Skip to content

Conversation

@cben
Copy link
Collaborator

@cben cben commented May 31, 2018

Can we revert #58?

Seems kubernetes/kubernetes#6439 fixed - from which kubernetes version?
kubernetes/kubernetes#10200 landed in v1.1.0.

Works for me on OpenShift 3.10-ish:

[8] pry(main)> kclient.create_service(Kubeclient::Resource.new(metadata: {namespace: 'default', name: 'foo'}, spec: {ports: [{port: 80}]}))
RestClient.post "https://internal-api.bpaskinc.origin-gce.dev.openshift.com:8443/api/v1/namespaces/default/services", "{\"metadata\":{\"namespace\":\"default\",\"name\":\"foo\"},\"spec\":{\"ports\":[{\"port\":80}]}}", "Accept"=>"*/*", "Accept-Encoding"=>"gzip, deflate", "Content-Length"=>"80", "Content-Type"=>"application/json", "User-Agent"=>"rest-client/2.0.2 (linux-gnu x86_64) ruby/2.4.1p111"
=> #<Kubeclient::Resource kind="Service", apiVersion="v1", metadata={:name=>"foo", :namespace=>"default", :selfLink=>"/api/v1/namespaces/default/services/foo", :uid=>"b2b41793-64e1-11e8-9540-42010a8e0002", :resourceVersion=>"45722", :creationTimestamp=>"2018-05-31T14:48:36Z"}, spec={:ports=>[{:protocol=>"TCP", :port=>80, :targetPort=>80}], :clusterIP=>"172.30.186.136", :type=>"ClusterIP", :sessionAffinity=>"None"}, status={:loadBalancer=>{}}>

(note POST body didn't include kind nor apiVersion)

Motivation: if we don't need to know apiVersion, this may (?) open up #284, #318, and other issues to simpler interface.

  • I'm not sure yet if we should commit to "we don't need to know apiVersion"
  • OTOH, I suspect we could infer apiVersion from discovery anyway?

Can we revert ManageIQ#58?
Seems kubernetes/kubernetes#6439 fixed - from which kubernetes version?

kubernetes/kubernetes#10200 landed in v1.1.0.
@chasebolt
Copy link

i feel like k8s 1.1.0 is old enough that removing apiVersion and kind is sufficient. bump the gem version as a breaking change. can always re-eval inferring apiVersion from a discovery method later if needed.

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

Successfully merging this pull request may close these issues.

2 participants