cdk8s-team / cdk8s-cli

Apache License 2.0
38 stars 23 forks source link

Enum property names changed between v2.177.0 and v2.178.0 #1802

Open njlaw opened 8 months ago

njlaw commented 8 months ago

Description of the bug:

Enum property names (at least in TypeScript) have been changed between v2.177.0 and v2.178.0. In particular, what was for example, MESH_INTERNAL has become MESH_UNDERSCORE_INTERNAL. This requires manual updates in relying code. Please note that this change may be intentional; however, as it requires changes in relying code and I couldn't find it documented anywhere, I'm opening this issue.

Reproduction Steps:

The only difference between the following steps is the cdk8s-cli version invoked. I have also tested this with the latest release and get the same results as v2.178.0.

v2.177.0 Steps

curl -sLo istio.tar.gz https://github.com/istio/istio/archive/refs/tags/1.19.1.tar.gz
pnpm dlx cdk8s-cli@2.177.0 import -l typescript istio-1.19.1/manifests/charts/base/crds/crd-all.gen.yaml
v2.177.0 Output
/**
 * @schema ServiceEntryV1Beta1SpecLocation
 */
export enum ServiceEntryV1Beta1SpecLocation {
  /** MESH_EXTERNAL */
  MESH_EXTERNAL = "MESH_EXTERNAL",
  /** MESH_INTERNAL */
  MESH_INTERNAL = "MESH_INTERNAL",
}

v2.178.0 Steps

curl -sLo istio.tar.gz https://github.com/istio/istio/archive/refs/tags/1.19.1.tar.gz
pnpm dlx cdk8s-cli@2.178.0 import -l typescript istio-1.19.1/manifests/charts/base/crds/crd-all.gen.yaml
v2.178.0 Output
**
 * @schema ServiceEntryV1Beta1SpecLocation
 */
export enum ServiceEntryV1Beta1SpecLocation {
  /** MESH_EXTERNAL */
  MESH_UNDERSCORE_EXTERNAL = "MESH_EXTERNAL",
  /** MESH_INTERNAL */
  MESH_UNDERSCORE_INTERNAL = "MESH_INTERNAL",
}

Error Log:

In the above output, v2.177.0 resulted in MESH_INTERNAL = "MESH_INTERNAL", but now v2.178.0+ results in MESH_UNDERSCORE_INTERNAL = "MESH_INTERNAL". The current version, v2.198.22, also produces the same results as v2.178.0.

Environment:

Other:

Because the only changes between v2.177.0 and v2.178.0 are dependencies, I assume that this behavior was changed upstream, but I'm not sure where to look or whether this change at the cdk8s import level was intentional.


This is :bug: Bug Report

rpelau commented 6 months ago

Hi, I am facing the same bug in version 2.198.54

iliapolo commented 3 days ago

This happened because we inadvertently pulled in breaking changes from json2jsii. Unfortunately reverting will now also cause a breaking change so we are reluctant to do so. Apologies for the disruption this caused.

We have sense prevented pulling in such changes going forward: https://github.com/cdk8s-team/cdk8s-cli/pull/2713