weaveworks / weave-gitops-enterprise

This repo provides the enterprise level features for the weave-gitops product, including CAPI cluster creation and team workspaces.
https://docs.gitops.weave.works/
Apache License 2.0
160 stars 29 forks source link

No match found for ClusterBootstrapConfig in templates.weave.works/v1alpha1 #2017

Open saeedfazal opened 1 year ago

saeedfazal commented 1 year ago

WGE Story/Feature:

Priority

Severity

Describe the bug Kind ClusterBootstrapConfig does not exist in templates.weave.works/v1alpha1.

To Reproduce Apply the following kustomization.

apiVersion: templates.weave.works/v1alpha1
kind: ClusterBootstrapConfig
metadata:
  name: "wge-leaf-kind"
  namespace: "test-system"
spec:
  clusterSelector:
    matchLabels:
      weave.works/flux: "bootstrap"
  jobTemplate:
    generateName: "run-gitops-{{ .ObjectMeta.Name }}"
    # requiredClusterReady: true
    spec:
      containers:
        - image: ghcr.io/fluxcd/flux-cli:v0.36.0
          imagePullPolicy: Always
          name: flux-bootstrap
          resources: {}
          volumeMounts:
            - name: kubeconfig
              mountPath: "/etc/gitops"
              readOnly: true
          args:
            [
              "bootstrap",
              "$(GIT_PROVIDER)",
              "--hostname=$(GIT_PROVIDER_HOSTNAME)",
              "--owner=$(GITOPS_REPO_OWNER)",
              "--repository=$(GITOPS_REPO_NAME)",
              "--path=./clusters/{{ .ObjectMeta.Namespace }}/{{ .ObjectMeta.Name }}",
            ]
          envFrom:
            - secretRef:
                name: "leaf-pat"
          env:
            - name: KUBECONFIG
              value: "/etc/gitops/value"
            # Templated by the test suite depending if its github/gitlab
            - name: GIT_PROVIDER
              value: "gitlab"
            - name: GIT_PROVIDER_HOSTNAME
              value: "gitlab.git.dev.weave.works"
            - name: GITOPS_REPO_OWNER
              value: "wge-test"
            - name: GITOPS_REPO_NAME
              value: "kind-management"
      restartPolicy: Never
      volumes:
        - name: kubeconfig
          secret:
            secretName: "{{ .ObjectMeta.Name }}-kubeconfig"

Actual behaviour capi.weave.works/v1alpha1 will be deprecated soon and therefore kind ClusterBootstrapConfig should find a match in templates.weave.works/v1alpha1 like GitOpsTemplates

Expected behaviour The ClusterBootstrapConfig failed to apply with the error: no matches for kind "ClusterBootstrapConfig" in version "templates.weave.works/v1alpha1"

Test Environment N/A

foot commented 1 year ago

@davidstauffer do we want to change the apiVersion in the CBC?

foot commented 1 year ago

It might be expensive.

foot commented 1 year ago

Could also be clusters.weave.works