Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the Dotnet Kubernetes Client #435

Closed
buehler opened this issue May 16, 2022 · 8 comments · Fixed by #507
Closed

Remove the Dotnet Kubernetes Client #435

buehler opened this issue May 16, 2022 · 8 comments · Fixed by #507
Labels
enhancement New feature or request

Comments

@buehler
Copy link
Owner

buehler commented May 16, 2022

Remove the custom implementation (with generics) and use the original client. They have generics now. Therefore the logic must not be implemented twice.

@buehler buehler added the enhancement New feature or request label May 16, 2022
@buehler
Copy link
Owner Author

buehler commented May 16, 2022

/cc @Silvenga :-)
This would be a good opportunity, right?

@Silvenga
Copy link
Contributor

How did I miss that? Yeah, this would be a good opportunity!

@buehler
Copy link
Owner Author

buehler commented May 16, 2022

No worries :-D just wrote the "issue" this morning.

@buehler
Copy link
Owner Author

buehler commented May 16, 2022

Would you mind to take upon this task?

@Silvenga
Copy link
Contributor

Would love to @buehler! Hopefully soon.

@Silvenga
Copy link
Contributor

Actually not sure if it'll be worth moving to the generic API - https://github.com/kubernetes-client/csharp/pull/744/files#diff-b6ffdded30c31747bbe5fd118533176288995b595670672553915eb7976fbaa2

The project would need to implement a similar abstraction to https://github.com/buehler/dotnet-kubernetes-client, since the generics API requires knowing the object types during the construction of the client, where dotnet-operator-sdk is naturally more lazy.

var genericPods = new GenericClient(client, "", "v1", "pods");
await genericPods.CreateNamespacedAsync(
    new V1Pod()
    {
        Metadata = new V1ObjectMeta { Name = podName, },
        Spec = new V1PodSpec
        {
            Containers = new[] { new V1Container() { Name = "k8scsharp-e2e", Image = "nginx", }, },
        },
    },
    namespaceParameter);
var pods = await genericPods.ListNamespacedAsync<V1PodList>(namespaceParameter)

@erin-allison
Copy link
Contributor

I'm interested in why they didn't put the type argument on the class... if they did that, we could handle this with a factory.

On a cursory inspection, I agree with @Silvenga in that it may not be worth the refactor.

@Silvenga
Copy link
Contributor

Yeah, I'm a little confused too, but to be honest, the new V8 API moved so much, it's hard to discover where things went. If there's another way they didn't document anywhere, I haven't found it.

Regardless, there's a lot of changes to move from JSON.NET to System.Text.Json e.g. JsonDiffer only supports JSON.NET. I'm going to focus on at least upgrading to the V7.2 API (since V8 was only released 4 days ago). Aka upgrading dotnet-kubernetes-client 2.1.12.

buehler pushed a commit that referenced this issue Jan 18, 2023
Big "Thank you" to @Silvenga for the initial work on this.

This closes #435.
This fixes #434.

BREAKING CHANGE: This moves to System.Text.Json from Newtonsoft.Json
to adhere to the changes in Kubernetes Client upstream.
Existing projects must migrate from using `JsonPropertyAttributes`
to `JsonPropertyNameAttributes`.
The YAML serializer is also shared with `kubernetes-client`
and is no longer overridable via injection.
`Microsoft.Rest.HttpOperationException` no longer exists, any place
this is used must move to `k8s.Autorest.HttpOperationException`.

Signed-off-by: Christoph Bühler <christoph@smartive.ch>
buehler pushed a commit that referenced this issue Jan 18, 2023
Big "Thank you" to @Silvenga for the initial work on this.

This closes #435.
This fixes #434.

BREAKING CHANGE: This moves to System.Text.Json from Newtonsoft.Json
to adhere to the changes in Kubernetes Client upstream.
Existing projects must migrate from using `JsonPropertyAttributes`
to `JsonPropertyNameAttributes`.
The YAML serializer is also shared with `kubernetes-client`
and is no longer overridable via injection.
`Microsoft.Rest.HttpOperationException` no longer exists, any place
this is used must move to `k8s.Autorest.HttpOperationException`.

Signed-off-by: Christoph Bühler <christoph@smartive.ch>
buehler added a commit that referenced this issue Jan 18, 2023
…Ops (#507)

Big "Thank you" to @Silvenga for the initial work on this.

This closes #435.
This fixes #434.

BREAKING CHANGE: This moves to System.Text.Json from Newtonsoft.Json
to adhere to the changes in Kubernetes Client upstream.
Existing projects must migrate from using `JsonPropertyAttributes`
to `JsonPropertyNameAttributes`.
The YAML serializer is also shared with `kubernetes-client`
and is no longer overridable via injection.
`Microsoft.Rest.HttpOperationException` no longer exists, any place
this is used must move to `k8s.Autorest.HttpOperationException`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants