GoogleCloudPlatform / k8s-config-connector

GCP Config Connector, a Kubernetes add-on for managing GCP resources
https://cloud.google.com/config-connector/docs/overview
Apache License 2.0
864 stars 202 forks source link

[Compositions] CRDs shouldn't have more than one composition #1484

Open zicongmei opened 3 months ago

zicongmei commented 3 months ago

Checklist

Bug Description

Currently, the composition has a reference to the CRD, in the spec.inputAPIGroup. We can define two different compositons with a same CRD. Which causes undetermined composition results.

I don't think the composition should have a referece to the CRDs. Instead, the CRD should have a reference to the composition. Because one composition can be reused by different CRDs to fit different needs.

Example, I can compose a composition to deploy a GKE cluster with some dependencies. And platform team can create CRD for team A that allow them to selete different region and create another CRD for team B with a fixed region. The composition is the same but CRD is different.

Additional Diagnostic Information

no

Kubernetes Cluster Version

N/A

Config Connector Version

N/a

Config Connector Mode

namespaced mode (default)

Log Output

No response

Steps to reproduce the issue

kubectl apply -f https://user.git.corp.google.com/zicong/kcc-alice/+/c95b39ce9864784218382883f9f79bbdef92e9ac/composition/01-composition.yaml

kubectl apply -f https://user.git.corp.google.com/zicong/kcc-alice/+/c95b39ce9864784218382883f9f79bbdef92e9ac/composition/011-composition-2.yaml

YAML snippets

No response

google-oss-prow[bot] commented 3 months ago

@barney-s: The label(s) /label enhancement cannot be applied. These labels are supported: tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

In response to [this](https://github.com/GoogleCloudPlatform/k8s-config-connector/issues/1484#issuecomment-2041248269): >/label enhancement Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
barney-s commented 3 months ago

@zicongmei - Please review the attached PR