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

Keep managed-by label in SSA mode if already present #2138

Merged
merged 1 commit into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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