Commit 6238eb43 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'remove_nil_attributes_for_cilium_network_policy' into 'master'

Remove nil attributes for CiliumNetworkPolicy

See merge request gitlab-org/gitlab!41008
parents 12b5376a ef3e685a
...@@ -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