Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Add test for openshift apply bug
Browse files Browse the repository at this point in the history
Fails using 0.11.0
  • Loading branch information
willthames committed May 14, 2020
1 parent 4de52c5 commit 8e3bc31
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 4 deletions.
53 changes: 53 additions & 0 deletions molecule/default/tasks/apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,59 @@
- k8s_service_3.result.spec.ports | length == 1
- k8s_service_3.result.spec.ports[0].port == 8081

- name: Add a deployment
k8s:
definition:
apiVersion: apps/v1
kind: Deployment
metadata:
name: apply-deploy
namespace: "{{ apply_namespace }}"
spec:
replicas: 1
selector:
matchLabels:
app: "{{ k8s_pod_name }}"
template: "{{ k8s_pod_template }}"
apply: yes
wait: yes
vars:
k8s_pod_name: apply-deploy
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:1
k8s_pod_resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 100m
memory: 100Mi

- name: Update a deployment
k8s:
definition:
apiVersion: apps/v1
kind: Deployment
metadata:
name: apply-deploy
namespace: "{{ apply_namespace }}"
spec:
replicas: 1
selector:
matchLabels:
app: "{{ k8s_pod_name }}"
template: "{{ k8s_pod_template }}"
apply: yes
wait: yes
vars:
k8s_pod_name: apply-deploy
k8s_pod_image: gcr.io/kuar-demo/kuard-amd64:2
k8s_pod_resources:
requests:
cpu: 50m
limits:
cpu: 50m
memory: 50Mi

always:
- name: Remove namespace
k8s:
Expand Down
10 changes: 6 additions & 4 deletions molecule/default/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ k8s_pod_spec:
exec:
command:
- /bin/true
resources:
limits:
cpu: "100m"
memory: "100Mi"
resources: "{{ k8s_pod_resources }}"
ports: "{{ k8s_pod_ports }}"

k8s_pod_resources:
limits:
cpu: "100m"
memory: "100Mi"

k8s_pod_command: []

k8s_pod_ports: []
Expand Down

0 comments on commit 8e3bc31

Please sign in to comment.