Skip to content

Commit

Permalink
Add more props that force replacement of Pods
Browse files Browse the repository at this point in the history
  • Loading branch information
lblackstone committed Jun 25, 2019
1 parent 1853784 commit 7671c44
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 13 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
## 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)

### 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
72 changes: 60 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,34 @@ 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 + ".name",
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

0 comments on commit 7671c44

Please sign in to comment.