mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-06 13:02:37 +00:00
k8s apply - fix list merge for array attribute with empty dict (#131)
Fix k8s apply
This commit is contained in:
@@ -836,6 +836,66 @@
|
||||
that:
|
||||
- k8s_secret is not changed
|
||||
|
||||
- name: Create network policy (egress array with empty dict)
|
||||
k8s:
|
||||
namespace: "{{ apply_namespace }}"
|
||||
apply: true
|
||||
definition:
|
||||
kind: NetworkPolicy
|
||||
apiVersion: networking.k8s.io/v1
|
||||
metadata:
|
||||
name: apply-netpolicy
|
||||
labels:
|
||||
app: apply-netpolicy
|
||||
annotations:
|
||||
{}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: apply-netpolicy
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
ingress:
|
||||
- ports:
|
||||
- port: 9093
|
||||
protocol: TCP
|
||||
egress:
|
||||
- {}
|
||||
|
||||
- name: Apply network policy
|
||||
k8s:
|
||||
namespace: "{{ apply_namespace }}"
|
||||
definition:
|
||||
kind: NetworkPolicy
|
||||
apiVersion: networking.k8s.io/v1
|
||||
metadata:
|
||||
name: apply-netpolicy
|
||||
labels:
|
||||
app: apply-netpolicy
|
||||
annotations:
|
||||
{}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: apply-netpolicy
|
||||
policyTypes:
|
||||
- Ingress
|
||||
- Egress
|
||||
ingress:
|
||||
- ports:
|
||||
- port: 9093
|
||||
protocol: TCP
|
||||
egress:
|
||||
- {}
|
||||
apply: true
|
||||
register: k8s_networkpolicy
|
||||
|
||||
- name: Check that nothing changed
|
||||
assert:
|
||||
that:
|
||||
- k8s_networkpolicy is not changed
|
||||
|
||||
always:
|
||||
- name: Remove namespace
|
||||
k8s:
|
||||
|
||||
Reference in New Issue
Block a user