Skip to content

Commit

Permalink
Keep managed-by label in SSA mode if already present
Browse files Browse the repository at this point in the history
  • Loading branch information
lblackstone committed Aug 15, 2022
1 parent 5277945 commit c7779c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Fix Helm charts being ignored by policy packs. (https://github.com/pulumi/pulumi-kubernetes/pull/2133)
- Fixes to allow import of helm release (https://github.com/pulumi/pulumi-kubernetes/pull/2136)
- Keep managed-by label in SSA mode if already present (https://github.com/pulumi/pulumi-kubernetes/pull/2138)

## 3.20.3 (August 9, 2022)

Expand Down
5 changes: 3 additions & 2 deletions provider/pkg/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1308,8 +1308,9 @@ func (k *kubeProvider) Check(ctx context.Context, req *pulumirpc.CheckRequest) (
} else {
metadata.AssignNameIfAutonamable(newInputs, news, urn)

if !k.serverSideApplyMode {
// Set a "managed-by: pulumi" label on all created k8s resources.
// Set a "managed-by: pulumi" label on resources created with Client-Side Apply. To avoid churn on previously
// created resources, keep the label in SSA mode if it's already present on the resource.
if !k.serverSideApplyMode || metadata.HasManagedByLabel(oldInputs) {
_, err = metadata.TrySetManagedByLabel(newInputs)
if err != nil {
return nil, pkgerrors.Wrapf(err,
Expand Down

0 comments on commit c7779c9

Please sign in to comment.