aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.62k stars 3.91k forks source link

eks: addCdk8sChart does not allow overwrite flag #25881

Open gkaskonas opened 1 year ago

gkaskonas commented 1 year ago

Describe the bug

The function uses KubernetManifest under the hood so it should allow overwrite

Expected Behavior

  const chart = new Chart(k8sApp, "chart", {
    namespace: NAMESPACE,
  });

  cluster.addCdk8sChart("chart", chart, {
    overwrite: true,
  });

This should work

Current Behavior

Argument of type '{ overwrite: boolean; }' is not assignable to parameter of type 'KubernetesManifestOptions'.
  Object literal may only specify known properties, and 'overwrite' does not exist in type 'KubernetesManifestOptions'.ts(2345)

Reproduction Steps

export function create(app: DCApplication, k8sApp: App): void {
  const { stack, cluster } = createResources(app);

  const chart = new Chart(k8sApp, "chart", {
    namespace: NAMESPACE,
  });

  cluster.addCdk8sChart("chart", chart, {
    overwrite: true,
  });
}

const app = new DCApplication();
const k8sApp = new App();
create(app, k8sApp);

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

v2.80.0

Framework Version

No response

Node.js Version

16

OS

Mac OS

Language

Typescript

Language Version

4.9.5

Other information

No response

pahud commented 1 year ago

addCdk8sChart() comes with KubernetesManifestOptions. We need to add this new option for that before we are allowed to use it. I am making it a p2 feature request and we welcome any pull requests.