cdk8s-core icon indicating copy to clipboard operation
cdk8s-core copied to clipboard

Escape hatches seem to not be working as expected

Open srfrnk opened this issue 1 year ago • 9 comments

Description of the bug:

The following code:

    var test = new KubeNamespace(this, "test", {
      metadata: {
        name: "test"
      }
    })

    test.addJsonPatch(JsonPatch.add("/spec", { 'test': 1 }))

Generates this:

apiVersion: v1
kind: Namespace
metadata:
  name: test
spec: {}

While AFAIK it should generate:

apiVersion: v1
kind: Namespace
metadata:
  name: test
spec:
  test: 1

Reproduction Steps:

  • insert code section into a new Cdk8s TS project
  • run npm run synth

Environment:

  • Ubuntu 23
  • Node v18.20.0
  • Cdk8s 2.198.65

This is :bug: Bug Report

srfrnk avatar Mar 29 '24 11:03 srfrnk