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
endpointSelector: selector,
ingress: ingress,
egress: egress
}
}.compact!
end
override :kind
......
......@@ -20,7 +20,7 @@ RSpec.describe Gitlab::Kubernetes::CiliumNetworkPolicy do
kind: partial_class_name,
apiVersion: "cilium.io/v2",
metadata: { name: name, namespace: namespace, resourceVersion: resource_version },
spec: { endpointSelector: endpoint_selector, ingress: ingress, egress: nil }
spec: { endpointSelector: endpoint_selector, ingress: ingress }
)
end
......@@ -61,7 +61,7 @@ RSpec.describe Gitlab::Kubernetes::CiliumNetworkPolicy do
)
end
let(:spec) { { endpointSelector: selector, ingress: ingress, egress: nil } }
let(:spec) { { endpointSelector: selector, ingress: ingress } }
let(:metadata) { { name: name, namespace: namespace, resourceVersion: resource_version } }
end
......@@ -180,7 +180,7 @@ RSpec.describe Gitlab::Kubernetes::CiliumNetworkPolicy do
kind: partial_class_name,
apiVersion: "cilium.io/v2",
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
......
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