-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix DaemonSet name on diff The DaemonSet name was set with a lower case s (Daemonset), but the kind in the state is created with upper case (DaemonSet), and this was preventing changes on the .spec.selector to trigger a replace. This issue was also causing the Kubernetes API to fail as this field is immutable, but pulumi was trying to update it. * Add changelog * Add integration tests
- Loading branch information
Showing
8 changed files
with
115 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: replace-daemonset | ||
description: A program to test if the DaemonSet is replaced when the .spec.selector is updated | ||
runtime: nodejs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as k8s from "@pulumi/kubernetes"; | ||
|
||
const appLabels = { | ||
app: "nginx", | ||
}; | ||
|
||
const daemonset = new k8s.apps.v1.DaemonSet("test-replacement", { | ||
spec: { | ||
selector: { matchLabels: appLabels }, | ||
template: { | ||
metadata: { labels: appLabels }, | ||
spec: { containers: [{ name: "nginx", image: "nginx" }] }, | ||
}, | ||
}, | ||
}); | ||
|
||
export const name = daemonset.metadata.name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "daemonset-replacement", | ||
"version": "0.1.0", | ||
"dependencies": { | ||
"@pulumi/pulumi": "latest" | ||
}, | ||
"devDependencies": { | ||
}, | ||
"peerDependencies": { | ||
"@pulumi/kubernetes": "latest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"compilerOptions": { | ||
"outDir": "bin", | ||
"target": "es6", | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"declaration": true, | ||
"sourceMap": true, | ||
"stripInternal": true, | ||
"experimentalDecorators": true, | ||
"pretty": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitAny": true, | ||
"noImplicitReturns": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"strictNullChecks": true | ||
}, | ||
"files": [ | ||
"index.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as k8s from "@pulumi/kubernetes"; | ||
|
||
const appLabels = { | ||
app: "nginx", | ||
test: "new-value", | ||
}; | ||
|
||
const daemonset = new k8s.apps.v1.DaemonSet("test-replacement", { | ||
spec: { | ||
selector: { matchLabels: appLabels }, | ||
template: { | ||
metadata: { labels: appLabels }, | ||
spec: { containers: [{ name: "nginx", image: "nginx" }] }, | ||
}, | ||
}, | ||
}); | ||
|
||
export const name = daemonset.metadata.name; |