-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add image field/override to initContainer
In order to support having DB migrations run via a separate container image. Running the added kuttl test: ``` kubectl kuttl test -v2 bundle/tests/scorecard/kuttl/ --test test-init-container-image ```
- Loading branch information
Showing
9 changed files
with
133 additions
and
1 deletion.
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
8 changes: 8 additions & 0 deletions
8
bundle/tests/scorecard/kuttl/test-init-container-image/00-install.yaml
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,8 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: test-init-container-image | ||
spec: | ||
finalizers: | ||
- kubernetes |
26 changes: 26 additions & 0 deletions
26
bundle/tests/scorecard/kuttl/test-init-container-image/01-assert.yaml
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,26 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: test-init-container-image-overridden | ||
namespace: test-init-container-image | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- image: k8s.gcr.io/pause:3.2 | ||
initContainers: | ||
- image: k8s.gcr.io/pause:3.1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: test-init-container-image-app | ||
namespace: test-init-container-image | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- image: k8s.gcr.io/pause:3.2 | ||
initContainers: | ||
- image: k8s.gcr.io/pause:3.2 |
50 changes: 50 additions & 0 deletions
50
bundle/tests/scorecard/kuttl/test-init-container-image/01-pod.yaml
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,50 @@ | ||
--- | ||
apiVersion: cloud.redhat.com/v1alpha1 | ||
kind: ClowdEnvironment | ||
metadata: | ||
name: test-init-container-image | ||
spec: | ||
targetNamespace: test-init-container-image | ||
providers: | ||
web: | ||
port: 8000 | ||
mode: none | ||
metrics: | ||
port: 9000 | ||
mode: none | ||
db: | ||
mode: none | ||
inMemoryDb: | ||
mode: none | ||
kafka: | ||
mode: none | ||
logging: | ||
mode: none | ||
objectStore: | ||
mode: none | ||
resourceDefaults: | ||
limits: | ||
cpu: 400m | ||
memory: 1024Mi | ||
requests: | ||
cpu: 30m | ||
memory: 512Mi | ||
--- | ||
apiVersion: cloud.redhat.com/v1alpha1 | ||
kind: ClowdApp | ||
metadata: | ||
name: test-init-container-image | ||
namespace: test-init-container-image | ||
spec: | ||
envName: test-init-container-image | ||
deployments: | ||
- name: overridden | ||
podSpec: | ||
image: k8s.gcr.io/pause:3.2 | ||
initContainers: | ||
- image: k8s.gcr.io/pause:3.1 | ||
- name: app | ||
podSpec: | ||
image: k8s.gcr.io/pause:3.2 | ||
initContainers: | ||
- {} |
10 changes: 10 additions & 0 deletions
10
bundle/tests/scorecard/kuttl/test-init-container-image/02-delete.yaml
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,10 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
delete: | ||
- apiVersion: cloud.redhat.com/v1alpha1 | ||
kind: ClowdEnvironment | ||
name: test-init-container-image | ||
- apiVersion: v1 | ||
kind: Namespace | ||
name: test-init-container-image |
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