kontena / mortar

The manifest shooter for Kubernetes
Apache License 2.0
145 stars 14 forks source link

yank fails with GKE 1.9.7 & 1.10.7-gke.6 #71

Closed matti closed 5 years ago

matti commented 5 years ago

https://github.com/kubernetes/kubernetes/issues/43329#issuecomment-363678598

aka GKE default version

matti commented 5 years ago
/lib/k8s/transport.rb:206:in `parse_response': DELETE /apis/apps/v1beta1/namespaces/default/deployments/nginx-deployment => HTTP 400 Bad Request: converting (url.Values).[]string.[]string to (v1.DeleteOptions).*v1.DeletionPropagation.v1.DeletionPropagation: couldn't copy '[]string' into 'v1.DeletionPropagation'; didn't understand types (K8s::Error::BadRequest)
matti commented 5 years ago

and in 1.10.7-gke.6:


transport.rb:206::in `parse_response': DELETE /apis/apps/v1beta1/namespaces/default/deployments/nginx-deployment => HTTP 400 Bad Request: converting (url.Values).[]string.[]string to (v1.DeleteOptions).*v1.DeletionPropagation.v1.DeletionPropagation: couldn't copy '[]string' into 'v1.DeletionPropagation'; didn't understand types (K8s::Error::BadRequest)
``
jnummelin commented 5 years ago

this is a nasty one, I don't think there's much currently we can do on Mortar side. Needs some way on k8s-client that would allow Mortar to override, maybe via some env or something, the propagationPolicy from query params to DELETE body. But having a body on DELETE is, well, somewhat borked. :)

jnummelin commented 5 years ago

@matti Would something like this work:

$ bundle exec mortar yank nginx
enter 'nginx' to confirm yank: nginx
/Users/jussi/code/k8s-client/lib/k8s/transport.rb:208:in `parse_response': DELETE /apis/apps/v1beta1/namespaces/default/deployments/myapp => HTTP 400 Bad Request: converting (url.Values).[]string.[]string to (v1.DeleteOptions).*v1.DeletionPropagation.v1.DeletionPropagation: couldn't copy '[]string' into 'v1.DeletionPropagation'; didn't understand types (K8s::Error::BadRequest)

$ KUBE_DELETE_OPTS_BODY=true bundle exec mortar yank nginx
enter 'nginx' to confirm yank: nginx
yanked nginx successfully!

Alternatively, or maybe complementary, that could be made as an flag for the commands.

WDYT?

matti commented 5 years ago

As a user I don't understand why it just doesn't work - eg. detect that it is GKE and enable that automatically

jnummelin commented 5 years ago

fixed in #87