cdk8s-team / cdk8s-cli

Apache License 2.0
38 stars 23 forks source link

warn when conflicting groupd ids are detected during CRD imports #696

Open TobbenTM opened 1 year ago

TobbenTM commented 1 year ago

Given the following cdk8s.yaml:

language: typescript
app: node main.js
imports:
  - k8s@1.23.0
  - https://raw.githubusercontent.com/cert-manager/cert-manager/master/deploy/crds/crd-certificates.yaml
  - https://raw.githubusercontent.com/cert-manager/cert-manager/master/deploy/crds/crd-clusterissuers.yaml

The CLI will create a cert-manager.io.ts file, but that'll only actually contain the cluster issuers, not the certificates.

I'm assuming this is because it's overriding the previous certificate import with the one that is imported last, but this cannot be the intended behavior right? Is there something I'm doing wrong, or is this an actual bug? Assigning them different names works, but also produces rather ugly file names.

iliapolo commented 1 year ago

@TobbenTM Have a look at https://github.com/cdk8s-team/cdk8s/issues/883. You need to use aliases because the CRD's share the same group id.

vinayak-kukreja commented 1 year ago

Hey @TobbenTM , does this resolve your issue?

TobbenTM commented 1 year ago

Hey @vinayak-kukreja , aliasing is indeed what we ended up using way back when, although I think the CLI tool really should warn before accepting conflicting group ids on multiple imports, not to mention that we have much less control over what the resulting (aliased) group ID ends up looking like.