Skip to content

Commit

Permalink
changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
blampe committed Aug 21, 2024
1 parent 3ecf7a5 commit 278cc10
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
20 changes: 17 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,25 @@

### Added

- A new provider configuration option `enableSecretMutable` allows treating changes to `Secrets` as updates instead of replacements.
This is similar to the `enableConfigMapMutable` option.
The default replacement behavior can be preserved for a particular Secret by setting its `replaceOnChanges` resource option to `[".stringData", ".data"]`.
- The new `enableSecretMutable` provider configuration option treats changes to
`Secrets` as updates instead of replacements (similar to the
`enableConfigMapMutable` option).

The default replacement behavior can be preserved for a particular `Secret`
by setting its `immutable` field to `true`.
(https://github.com/pulumi/pulumi-kubernetes/issues/2291)

**Note:** These options (`enableSecretMutable` and `enableConfigMapMutable`)
may become the default behavior in a future v5 release of the provider.
Programs that depend on the replacement of `Secrets` and `ConfigMaps` (e.g.
to trigger updates for downstream dependencies like `Deployments`) are
recommended to explicitly specify `immutable: true`.

### Fixed

- The `immutable` field is now respected for `ConfigMaps` when the provider is configured with `enableConfigMapMutable`.
(https://github.com/pulumi/pulumi-kubernetes/issues/3181)

## 4.17.1 (August 16, 2024)

### Fixed
Expand Down
9 changes: 4 additions & 5 deletions provider/pkg/clients/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,22 +311,21 @@ func FindCRD(objs []unstructured.Unstructured, kind schema.GroupKind) *unstructu
return nil
}

// IsSecret returns true if the resource has a Secret GVK.
func IsSecret(obj *unstructured.Unstructured) bool {
gvk := obj.GroupVersionKind()
return (gvk.Group == corev1.GroupName || gvk.Group == "core") && gvk.Kind == string(kinds.Secret)
}

// IsConfigMap returns true if the resource has a ConfigMap GVK.
func IsConfigMap(obj *unstructured.Unstructured) bool {
gvk := obj.GroupVersionKind()
return (gvk.Group == corev1.GroupName || gvk.Group == "core") && gvk.Kind == string(kinds.ConfigMap)
}

// Checks whether the given ConfigMap or Secret is marked as immutable.
// IsMutable returns true if given ConfigMap or Secret is marked as immutable.
func IsImmutable(obj *unstructured.Unstructured) bool {
val, found, err := unstructured.NestedBool(obj.Object, "immutable")
if !found || err != nil {
val = false
}
val, _, _ := unstructured.NestedBool(obj.Object, "immutable")
return val
}

Expand Down

0 comments on commit 278cc10

Please sign in to comment.