k8s-ruby icon indicating copy to clipboard operation
k8s-ruby copied to clipboard

kubernetes 1.30 broken

Open matti opened this issue 1 year ago • 6 comments

old 0.11.0 version of this gem works with 1.29 but with 1.30 I get

[00] 	10: from /usr/local/bundle/gems/k8s-ruby-0.11.0/lib/k8s/stack.rb:120:in `apply'
[00] 	 9: from /usr/local/bundle/gems/k8s-ruby-0.11.0/lib/k8s/stack.rb:145:in `prune'
[00] 	 8: from /usr/local/bundle/gems/k8s-ruby-0.11.0/lib/k8s/client.rb:203:in `list_resources'
[00] 	 7: from /usr/local/bundle/gems/k8s-ruby-0.11.0/lib/k8s/resource_client.rb:52:in `list'
[00] 	 6: from /usr/local/bundle/gems/k8s-ruby-0.11.0/lib/k8s/transport.rb:384:in `gets'
[00] 	 5: from /usr/local/bundle/gems/k8s-ruby-0.11.0/lib/k8s/transport.rb:325:in `requests'
[00] 	 4: from /usr/local/bundle/gems/k8s-ruby-0.11.0/lib/k8s/transport.rb:325:in `map'
[00] 	 3: from /usr/local/bundle/gems/k8s-ruby-0.11.0/lib/k8s/transport.rb:329:in `block in requests'
[00] 	 2: from /usr/local/bundle/gems/k8s-ruby-0.11.0/lib/k8s/transport.rb:266:in `parse_response'
[00] 	 1: from /usr/local/bundle/gems/dry-struct-0.5.1/lib/dry/struct/class_interface.rb:201:in `new'
[00] /usr/local/bundle/gems/dry-struct-0.5.1/lib/dry/struct/class_interface.rb:208:in `rescue in new': [K8s::API::MetaV1::List.new] :items is missing in Hash input (Dry::Struct::Error)

matti avatar Jun 06 '24 08:06 matti

updated k8s-ruby to 0.16.0 and same error with 1.30

matti avatar Jun 06 '24 08:06 matti

      K8s::Stack.new(
        "mystack",
        [
          prefixed_priority_class(name: 'foo'),
          prefixed_priority_class(name: 'bar'),
        ],
        debug: false
      ).apply k8s_client

^-- this applies priorityclasses, they appear but the internal response parsing of k8s-ruby fails

matti avatar Jun 06 '24 08:06 matti

        15: from /usr/local/bundle/gems/k8s-ruby-0.16.0/lib/k8s/stack.rb:120:in `apply'
        14: from /usr/local/bundle/gems/k8s-ruby-0.16.0/lib/k8s/stack.rb:145:in `prune'
        13: from /usr/local/bundle/gems/k8s-ruby-0.16.0/lib/k8s/client.rb:203:in `list_resources'
        12: from /usr/local/bundle/gems/k8s-ruby-0.16.0/lib/k8s/resource_client.rb:52:in `list'
        11: from /usr/local/bundle/gems/k8s-ruby-0.16.0/lib/k8s/transport.rb:381:in `gets'
        10: from /usr/local/bundle/gems/k8s-ruby-0.16.0/lib/k8s/transport.rb:325:in `requests'
         9: from /usr/local/bundle/gems/k8s-ruby-0.16.0/lib/k8s/transport.rb:325:in `map'
         8: from /usr/local/bundle/gems/k8s-ruby-0.16.0/lib/k8s/transport.rb:329:in `block in requests'
         7: from /usr/local/bundle/gems/k8s-ruby-0.16.0/lib/k8s/transport.rb:266:in `parse_response'
         6: from /usr/local/bundle/gems/dry-struct-1.4.0/lib/dry/struct/class_interface.rb:265:in `new'
         5: from /usr/local/bundle/gems/dry-types-1.5.1/lib/dry/types/constructor.rb:87:in `call_unsafe'
         4: from /usr/local/bundle/gems/dry-types-1.5.1/lib/dry/types/schema.rb:62:in `call_unsafe'
         3: from /usr/local/bundle/gems/dry-types-1.5.1/lib/dry/types/schema.rb:339:in `resolve_unsafe'
         2: from /usr/local/bundle/gems/dry-types-1.5.1/lib/dry/types/schema.rb:375:in `resolve_missing_keys'
         1: from /usr/local/bundle/gems/dry-types-1.5.1/lib/dry/types/schema.rb:375:in `each'
/usr/local/bundle/gems/dry-types-1.5.1/lib/dry/types/schema.rb:384:in `block in resolve_missing_keys': [K8s::API::MetaV1::List.new] :items is missing in Hash input (Dry::Struct::Error)

here is the stack trace with 0.16.0

matti avatar Jun 06 '24 09:06 matti

@Vasu1105 ping

matti avatar Jun 06 '24 09:06 matti

@matti Thanks. It will be good if you know the fix raise the PR.

Vasu1105 avatar Jun 06 '24 09:06 Vasu1105

nope. the response parsing needs to be adapted for 1.30

matti avatar Jun 06 '24 10:06 matti

The issue title is misleading, please make it more precise, @matti.

I am using this library with k8s 1.30 without issues.

gdubicki avatar Nov 04 '24 16:11 gdubicki

I guess you are not listing same resources then

matti avatar Nov 04 '24 16:11 matti

no idea what happened, now atleast on gke 1.31 everything works.

matti avatar Mar 10 '25 22:03 matti