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

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

Open
rodrigosandrin opened this issue Aug 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rodrigosandrin
Copy link

rodrigosandrin commented Aug 5, 2024

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 Initial implementation #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

@rodrigosandrin rodrigosandrin added the bug Something isn't working label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant