cdk8s-team / cdk8s

Define Kubernetes native apps and abstractions using object-oriented programming
https://cdk8s.io
Apache License 2.0
4.38k stars 294 forks source link

Failed to import CRD #2233

Closed neopointer closed 2 weeks ago

neopointer commented 4 weeks ago

Description of the bug:

Failed to import CRD, seems to be similar to #892.

Reproduction Steps:

I could not pin point to the exact place, but it's failing while importing this CRD:

https://raw.githubusercontent.com/cilium/cilium/refs/tags/v1.16.3/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumloadbalancerippools.yaml

Error Log:

Error: Key 'of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info' contains non standard characters (Must match regex '/^(\w|\.|\/|-|#|,)*$/')
    at SafeReviver._sanitizeObj (/Users/user/Library/pnpm/global/5/.pnpm/cdk8s-cli@2.198.253/node_modules/cdk8s-cli/lib/reviver.js:40:23)
    at SafeReviver._sanitizeObj (/Users/user/Library/pnpm/global/5/.pnpm/cdk8s-cli@2.198.253/node_modules/cdk8s-cli/lib/reviver.js:47:22)
    at SafeReviver._sanitizeObj (/Users/user/Library/pnpm/global/5/.pnpm/cdk8s-cli@2.198.253/node_modules/cdk8s-cli/lib/reviver.js:47:22)
    at SafeReviver._sanitizeObj (/Users/user/Library/pnpm/global/5/.pnpm/cdk8s-cli@2.198.253/node_modules/cdk8s-cli/lib/reviver.js:47:22)
    at SafeReviver._sanitizeObj (/Users/user/Library/pnpm/global/5/.pnpm/cdk8s-cli@2.198.253/node_modules/cdk8s-cli/lib/reviver.js:47:22)
    at SafeReviver._sanitizeObj (/Users/user/Library/pnpm/global/5/.pnpm/cdk8s-cli@2.198.253/node_modules/cdk8s-cli/lib/reviver.js:47:22)
    at SafeReviver._sanitizeObj (/Users/user/Library/pnpm/global/5/.pnpm/cdk8s-cli@2.198.253/node_modules/cdk8s-cli/lib/reviver.js:47:22)
    at SafeReviver._sanitizeObj (/Users/user/Library/pnpm/global/5/.pnpm/cdk8s-cli@2.198.253/node_modules/cdk8s-cli/lib/reviver.js:47:22)
    at SafeReviver.sanitize (/Users/user/Library/pnpm/global/5/.pnpm/cdk8s-cli@2.198.253/node_modules/cdk8s-cli/lib/reviver.js:31:14)
    at safeParseYaml (/Users/user/Library/pnpm/global/5/.pnpm/cdk8s-cli@2.198.253/node_modules/cdk8s-cli/lib/util.js:160:17)

Environment:

Other:


This is :bug: Bug Report

maliciousbucket commented 2 weeks ago

Alright, which language are you using and which method are you using to import the CRDs?

By method I mean:

imports:
  - k8s
  - https://raw.githubusercontent.com/cilium/cilium/refs/tags/v1.16.3/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumloadbalancerippools.yaml

And then running cdk8s import

I am using Go, Ubuntu, and version 2.198.254 and I was able to install it just fine using the cdk8s import command (and yes I understand this setup uses a different OS and version of CDK8s) cdk8s-cillium-gen

cdk8s-cillium-import

neopointer commented 2 weeks ago

@maliciousbucket sorry I forgot to mention, but I'm using Java. Thanks for taking a look into it.

neopointer commented 2 weeks ago

@maliciousbucket I don't know what happened, but when I tried to import using the URL directly instead of the file in my filesystem then it worked. I would assume then most likely I introduced some change in the local file without noticing.

I'll close the issue.

Thanks!