Skip to content

BUG: KustomizeRefs resources are ignored by Drift Detection #1722

Description

@Frusoz

Problem Description

If I delete a resource deployed by a kustomizationRefs, the resource is not recreated automatically by Sveltos.

The only way to recreate it is to do a new commit in the GitRepository used as source by Flux.

The deployment is done both on the management cluster and on a managed cluster.

System Information

CLUSTERAPI VERSION: 0.26.0
SVELTOS VERSION: 1.8.0
KUBERNETES VERSION: v1.35.0

Logs

Example with a vsphereVirtualMachine object managed by Crossplane

cluster-profile.yaml

apiVersion: config.projectsveltos.io/v1beta1
kind: ClusterProfile
metadata:
  name: cluster-management-mgmt-profile
  namespace: projectsveltos
spec:
  clusterSelector:
    matchLabels:
      environment: mgmt
  syncMode: ContinuousWithDriftDetection
  stopMatchingBehavior: LeavePolicies
  dependsOn:
    - security-mgmt-profile
    - infrastructure-mgmt-profile 

....(various helm charts)...

 kustomizationRefs:
    - kind: GitRepository
      name: sveltos-gitops
      namespace: flux-system
      path: 'sveltos-manifests/cluster-addons/{{ index .Cluster.metadata.labels "environment" }}/cluster-management'

Kustomization.yaml entrypoint in the path specified above

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - capi-operator.yaml
  - crossplane.yaml
  - flux.yaml

crossplane.yaml

apiVersion: virtualmachine.crossplane.io/v1alpha1
kind: VSphereVirtualMachine
metadata:
  name: talos-v1-12-5-template
spec:
  deletionPolicy: Delete
  forProvider:
    (all spec...)
  providerConfigRef:
    name: vsphere-provider

resource summary output:

- group: virtualmachine.crossplane.io
    hash: be83d34658.....
    ignoreForConfigurationDrift: false
    kind: VSphereVirtualMachine
    name: talos-v1-12-5-template
    version: v1alpha1

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions