Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support deduplication when using ClusterctlConfig #761

Open
salasberryfin opened this issue Oct 1, 2024 · 0 comments
Open

Support deduplication when using ClusterctlConfig #761

salasberryfin opened this issue Oct 1, 2024 · 0 comments

Comments

@salasberryfin
Copy link
Contributor

salasberryfin commented Oct 1, 2024

What would you like to be added (User Story)?

As a user, I would like to be able to override values in existing providers, e.g. changing the URL, via ClusterctlConfig.

Detailed Description

With the current implementation of ClusterctlConfig it is possible to add new providers to the list contained in the ConfigMap that represents clusterctl.yaml. This is great for providers like Metal3, which can be added with a given URL via the resource. If needing to override values of a provider that already exists in the ConfigMap, e.g. the URL for an air-gapped environment, the ClusterctlConfig is not able to deduplicate the data provided in the resource and will add the new configuration to the bottom of the list.

Anything else you would like to add?

This is a truncated version of the content of the ConfigMap:

apiVersion: v1
data:
  clusterctl.yaml: |
    images: {}
    providers:
    - name: cluster-api
      type: CoreProvider
      url: https://github.com/rancher-sandbox/cluster-api/releases/v1.7.3/core-components.yaml
    - name: aws
      type: InfrastructureProvider
      url: https://github.com/rancher-sandbox/cluster-api-provider-aws/releases/v2.6.1/infrastructure-components.yaml
    - name: azure
      type: InfrastructureProvider
      url: https://github.com/rancher-sandbox/cluster-api-provider-azure/releases/v1.16.1/infrastructure-components.yaml

Suppose we would like to modify CAPA's URL via:

apiVersion: turtles-capi.cattle.io/v1alpha1
kind: ClusterctlConfig
metadata:
  name: clusterctl-config
  namespace: rancher-turtles-system
spec:
  providers:
  - name: aws
    url: https://github.com/kubernetes-sigs/cluster-api/releases/v1.7.3/core-components.yaml
    type: InfrastructureProvider

The resulting ConfigMap will contain duplicated entries for AWS provider.

As a user, I would like this to be able to identify an existing entry and update its content.

Label(s) to be applied

/kind feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant