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

CSharp PUT wrappers #248

Closed
gaziqbal opened this issue Feb 27, 2019 · 4 comments
Closed

CSharp PUT wrappers #248

gaziqbal opened this issue Feb 27, 2019 · 4 comments

Comments

@gaziqbal
Copy link
Contributor

It appears that the API support PUT semantics (kubernetes/kubernetes#2114)
Are there plans to bring PUT wrappers to the CSharp client? I am not finding them right now.

@gaziqbal gaziqbal changed the title PUT wrappers CSharp PUT wrappers Feb 27, 2019
@itowlson
Copy link
Contributor

The ReplaceXxx methods have PUT semantics. Let us know if those don't suit your situation.

@gaziqbal
Copy link
Contributor Author

Thanks. I see that it's sending a PUT request, but for services at least, the following code fails with a 404 if there is no service of that name.

var service = await this.Client.ReplaceNamespacedServiceAsync(
                serviceRequest,
                serviceRequest.Metadata.Name,
                this.settings.Namespace).ConfigureAwait(false);

{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"services \"doc-svc-d16199e2-8166-49ad-a660-8fa57cc97a9c\" not found","reason":"NotFound","details":{"name":"doc-svc-d16199e2-8166-49ad-a660-8fa57cc97a9c","kind":"services"},"code":404}

kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.11", GitCommit:"637c7e288581ee40ab4ca210618a89a555b6e7e9", GitTreeState:"clean", BuildDate:"2018-11-26T14:38:32Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b1fed0", GitTreeState:"clean", BuildDate:"2019-02-01T20:00:57Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}

minikube version
minikube version: v0.34.1

@brendandburns
Copy link
Contributor

brendandburns commented Feb 28, 2019

edited to correct 'doesn't' to 'does'

404 indicates that the namespace/name object doesn't exist.

So either the name or the namespace in your call is wrong.

PUT requires that the object does exist. If you want to create a new object, use Create* instead.

--brendan

@gaziqbal
Copy link
Contributor Author

My expectation was that PUT would support create-or-replace. Is that not currently supported?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants