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

Add more props that force replacement of Pods #613

Merged
merged 1 commit into from
Jul 1, 2019
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
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
## 0.25.1 (Unreleased)

### Supported Kubernetes versions

- v1.15.x
- v1.14.x
- v1.13.x

### Improvements

- Unify diff behavior between `Diff` and `Update`. This should result in better detection of state drift as well as behavior that is more consistent with respect to `kubectl`.
- Unify diff behavior between `Diff` and `Update`. This should result in better detection of state drift as
well as behavior that is more consistent with respect to `kubectl`. (https://github.com/pulumi/pulumi-kubernetes/pull/604)
- The Kubernetes provider now supports the internal features necessary for the Pulumi engine to detect diffs between the actual and desired state of a resource after a `pulumi refresh` (https://github.com/pulumi/pulumi-kubernetes/pull/477).
- The Kubernetes provider now sets the `"kubectl.kubernetes.io/last-applied-configuration"` annotation to the last deployed configuration for a resource. This enables better interoperability with `kubectl`.
### Bug fixes

- Add more props that force replacement of Pods (https://github.com/pulumi/pulumi-kubernetes/pull/613)

## 0.25.0 (June 19, 2019)

Expand Down
71 changes: 59 additions & 12 deletions pkg/provider/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,39 @@ var core = versions{
".spec.volumeName",
},
labelSelectorForceNewProperties(".spec")...),
"Pod": containerForceNewProperties(".spec.containers[*]"),
"Pod": append(
properties{
".spec.affinity",
".spec.automountServiceAccountToken",
".spec.dnsConfig",
".spec.dnsPolicy",
".spec.enableServiceLinks",
".spec.hostAliases",
".spec.hostIPC",
".spec.hostNetwork",
".spec.hostPID",
".spec.hostname",
".spec.imagePullSecrets",
".spec.imagePullSecrets",
".spec.nodeName",
".spec.nodeSelector",
".spec.overhead",
".spec.preemptionPolicy",
".spec.priority",
".spec.priorityClassName",
".spec.readinessGates",
".spec.restartPolicy",
".spec.runtimeClassName",
".spec.schedulerName",
".spec.securityContext",
".spec.serviceAccount",
".spec.serviceAccountName",
".spec.shareProcessNamespace",
".spec.subdomain",
".spec.terminationGracePeriodSeconds",
".spec.volumes",
},
containerForceNewProperties(".spec.containers[*]", ".spec.initContainers[*]")...),
"ResourceQuota": properties{
".spec.scopes",
},
Expand Down Expand Up @@ -138,18 +170,33 @@ func metadataForceNewProperties(prefix string) properties {
}
}

func containerForceNewProperties(prefix string) properties {
return properties{
prefix + ".env",
prefix + ".env.value",
prefix + ".image",
prefix + ".lifecycle",
prefix + ".livenessProbe",
prefix + ".readinessProbe",
prefix + ".securityContext",
prefix + ".terminationMessagePath",
prefix + ".workingDir",
func containerForceNewProperties(prefixes ...string) properties {
var props properties
for _, prefix := range prefixes {
props = append(props, properties{
prefix + ".args",
prefix + ".command",
prefix + ".env",
prefix + ".env.value",
prefix + ".image",
prefix + ".imagePullPolicy",
prefix + ".lifecycle",
prefix + ".livenessProbe",
prefix + ".ports",
prefix + ".readinessProbe",
prefix + ".resources",
prefix + ".securityContext",
prefix + ".stdin",
prefix + ".stdinOnce",
prefix + ".terminationMessagePath",
prefix + ".terminationMessagePolicy",
prefix + ".tty",
prefix + ".volumeDevices",
prefix + ".volumeMounts",
prefix + ".workingDir",
}...)
}
return props
}

func labelSelectorForceNewProperties(prefix string) properties {
Expand Down