Open jrcichra opened 2 months ago
It looks like the schema is correct in _definitons.json
: https://github.com/cdk8s-team/cdk8s/blob/9fddebbca5a56199735bd4fcc375cc9e6cb001f5/kubernetes-schemas/v1.30.0/_definitions.json#L13070
The issue might be in the cdk8s import code when there are two Objects with the same name (Subject): https://github.com/cdk8s-team/cdk8s-cli/tree/2.x/src/import
v1beta3
seems to have the proper fields, using that as a workaround for now.
Thanks for reporting this. Yeah this is because there is a basename collision between io.k8s.api.rbac.v1.Subject
and io.k8s.api.flowcontrol.v1.Subject
. I think we need to start adding the ApiGroup to generated classes/interfaces names...but that would be a breaking change.
Marking as p1.
Another possibly non breaking solution is to provide an option to cdk8s import
. something like cdk8s import --include-api-group
Description of the bug:
When creating a FlowSchema in cdk8s with the 1.30 imports it does not have the correct parameters for the
Subject
object under.spec.rules.subjects
. It looks like it is reusing the RBAC Subjects field which does not have the same fields.There should be a
serviceAccount
anduser
field. Instead it hasname
andnamespace
at the top level, which is not inkubectl explain flowschema.spec.rules.subjects
. Usingname
andnamespace
as specified in the typescript schema does not apply to a 1.30.0 cluster.Reproduction Steps:
Start a new cdk8s project. Make a FlowSchema with at least one
.spec.rules.subjects
. Attempt to apply the result to a 1.30 cluster.Error Log:
Environment:
Other:
This is :bug: Bug Report