Closed ksumit closed 2 years ago
If we wanted to do this, we should check in a "validate_crd.py" or somesuch script that can validate the CRD definition before we try to generate code for it.
We'd be happy to have a PR for that.
added a new constructor by which we can pass our custom loader/dumper options, but calling the native constructor should also work anyway. https://github.com/kubernetes-client/java/pull/1808
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/reopen
/remove-lifecycle rotten
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
@k8s-triage-robot: Closing this issue.
While working on a CRD, i had two enum patterns that didn't work out:
Example:
Technically these are not valid patterns for enum names in Java (atleast the second pattern wouldn't even compile) and crd-model-gen happily does the right thing by transforming these names to UPPERCASE and replacing special characters with "_" putting the values in the enum like below:
The problem however happens when loading a CR with such enum values using Yaml class that is provided with java implementation of kubernetes-client.
SnakeYaml started supporting a loader option to ignore case while loading enums starting version 1.28 and I have a corresponding change here to consume the same. However i am not able to justify that the second pattern should even be supported. And that brings to me to the thought, should crd-model-gen enforce that enum names are always UPPERCASE and don't container special characters other than "_".
Thoughts?