Commit ef3e685a authored by Zamir Martins Filho's avatar Zamir Martins Filho Committed by Heinrich Lee Yu

Remove nil attributes for CiliumNetworkPolicy

Nil attributes whether ingress or egress will
fail API for update
parent a5fd7947
...@@ -82,7 +82,7 @@ module Gitlab ...@@ -82,7 +82,7 @@ module Gitlab
endpointSelector: selector, endpointSelector: selector,
ingress: ingress, ingress: ingress,
egress: egress egress: egress
} }.compact!
end end
override :kind override :kind
......
...@@ -20,7 +20,7 @@ RSpec.describe Gitlab::Kubernetes::CiliumNetworkPolicy do ...@@ -20,7 +20,7 @@ RSpec.describe Gitlab::Kubernetes::CiliumNetworkPolicy do
kind: partial_class_name, kind: partial_class_name,
apiVersion: "cilium.io/v2", apiVersion: "cilium.io/v2",
metadata: { name: name, namespace: namespace, resourceVersion: resource_version }, metadata: { name: name, namespace: namespace, resourceVersion: resource_version },
spec: { endpointSelector: endpoint_selector, ingress: ingress, egress: nil } spec: { endpointSelector: endpoint_selector, ingress: ingress }
) )
end end
...@@ -61,7 +61,7 @@ RSpec.describe Gitlab::Kubernetes::CiliumNetworkPolicy do ...@@ -61,7 +61,7 @@ RSpec.describe Gitlab::Kubernetes::CiliumNetworkPolicy do
) )
end end
let(:spec) { { endpointSelector: selector, ingress: ingress, egress: nil } } let(:spec) { { endpointSelector: selector, ingress: ingress } }
let(:metadata) { { name: name, namespace: namespace, resourceVersion: resource_version } } let(:metadata) { { name: name, namespace: namespace, resourceVersion: resource_version } }
end end
...@@ -180,7 +180,7 @@ RSpec.describe Gitlab::Kubernetes::CiliumNetworkPolicy do ...@@ -180,7 +180,7 @@ RSpec.describe Gitlab::Kubernetes::CiliumNetworkPolicy do
kind: partial_class_name, kind: partial_class_name,
apiVersion: "cilium.io/v2", apiVersion: "cilium.io/v2",
metadata: { name: name, namespace: namespace, resourceVersion: resource_version, labels: { app: 'foo' } }, metadata: { name: name, namespace: namespace, resourceVersion: resource_version, labels: { app: 'foo' } },
spec: { endpointSelector: endpoint_selector, ingress: ingress, egress: nil } spec: { endpointSelector: endpoint_selector, ingress: ingress }
) )
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment