Commit 6059216f authored by Zamir Martins Filho's avatar Zamir Martins Filho Committed by charlie ablett

Add kind for both NetworkPolicy and

CiliumNetworkPolicy kubernetes resources
parent 82643f14
---
title: Add 'kind' to differentiate between NetworkPolicy and CiliumNetworkPolicy Kubernetes network manifests
merge_request: 40165
author:
type: changed
......@@ -84,6 +84,11 @@ module Gitlab
egress: egress
}
end
override :kind
def kind
KIND
end
end
end
end
......@@ -6,6 +6,8 @@ module Gitlab
include NetworkPolicyCommon
extend ::Gitlab::Utils::Override
KIND = 'NetworkPolicy'
def initialize(name:, namespace:, selector:, ingress:, labels: nil, creation_timestamp: nil, policy_types: ["Ingress"], egress: nil)
@name = name
@namespace = namespace
......@@ -80,6 +82,11 @@ module Gitlab
egress: egress
}
end
override :kind
def kind
KIND
end
end
end
end
......@@ -57,8 +57,12 @@ module Gitlab
raise NotImplementedError
end
def kind
raise NotImplementedError
end
def manifest
YAML.dump({ metadata: metadata, spec: spec }.deep_stringify_keys)
YAML.dump({ kind: kind, metadata: metadata, spec: spec }.deep_stringify_keys)
end
end
end
......
......@@ -13,6 +13,7 @@ RSpec.shared_examples 'network policy common specs' do
creation_timestamp: nil,
manifest: YAML.dump(
{
kind: described_class::KIND,
metadata: metadata,
spec: spec
}.deep_stringify_keys
......
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