SAP / component-operator

A Kubernetes operator to deploy components into Kubernetes clusters. Components can be described as Kustomizations or Helm charts.
Apache License 2.0
0 stars 0 forks source link

Deletion of components fails if referenced source ref does not exist #20

Closed cbarbian-sap closed 2 days ago

cbarbian-sap commented 2 days ago

Deletion of components is stuck state 'DeletionPending' if the referenced source object does not exist anymore (for example a flux GitRepository).

cbarbian-sap commented 2 days ago

This bug was introduced with https://github.com/SAP/component-operator/commit/8b0cdc71722eb53d4c427d084f0beb914a6aa36c#diff-0702ede917ee437555d00c32619d913b80dbf25db68f4c3c33df0212cf792d5bL225, when LoadSourceReferences() with SourceReference.Init(). Mistakenly the part that ensures that references are not loaded in the deletion case, was missed in the new implementation:

    if !component.GetDeletionTimestamp().IsZero() {
        return nil
    }