crossplane-contrib/provider-kubernetes

Failed to apply Kustomization (fluxcd) when last applied is with a wrong dependency

Opened this issue · 0 comments

What happened?

Crossplan doesnt reconfigure Kustomization if the last applied config was with a wrong "dependsOn" field

How can we reproduce it?

Apply the yaml bellow, after applied, comment the lines:

        dependsOn:
          - name: cert-manager

The crossplane will not revert the kustomization config.

---
apiVersion: kubernetes.crossplane.io/v1alpha2
kind: Object
metadata:
  name: testnamespace
spec:
  forProvider:
    manifest:
      apiVersion: v1
      kind: Namespace
      metadata:
        name: object
  providerConfigRef:
    name: kubernetes-provider
---
apiVersion: kubernetes.crossplane.io/v1alpha2
kind: Object
metadata:
  name: podinfo-source2
spec:
  forProvider:
    manifest:
      apiVersion: source.toolkit.fluxcd.io/v1
      kind: GitRepository
      metadata:
        name: podinfo2
        namespace: object
      spec:
        interval: 1m0s
        ref:
          branch: master
        url: https://github.com/stefanprodan/podinfo
  providerConfigRef:
    name: kubernetes-provider
---
apiVersion: kubernetes.crossplane.io/v1alpha2
kind: Object
metadata:
  name: podinfo-kustomization
spec:
  forProvider:
    manifest:
      apiVersion: kustomize.toolkit.fluxcd.io/v1
      kind: Kustomization
      metadata:
        name: podinfo2
        namespace: object
      spec:
        dependsOn:
          - name: cert-manager
        interval: 30m0s
        path: ./kustomize
        prune: true
        retryInterval: 2m0s
        sourceRef:
          kind: GitRepository
          name: podinfo2
        targetNamespace: test
        timeout: 3m0s
        wait: true
  providerConfigRef:
    name: kubernetes-provider
---

What environment did it happen in?

Crossplane version:
v1.16.0

  • Kubernetes version:
    Client Version: v1.27.2
    Kustomize Version: v5.0.1
    Server Version: v1.27.16

  • OS:
    NAME="CentOS Linux"
    VERSION="7 (Core)"
    ID="centos"
    ID_LIKE="rhel fedora"
    VERSION_ID="7"
    PRETTY_NAME="CentOS Linux 7 (Core)"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:centos:centos:7"
    HOME_URL="https://www.centos.org/"
    BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

OBS: tested also in opensuse

  • Kernel : Linux Linux master01 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
    -->

Tested also with --enable-ssa-claims feature flag applied