From 18bbe788483acda8c47e3c839706b5c4e780a6ed Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Tue, 23 Jan 2024 15:48:44 +0100 Subject: [PATCH] Prepare cwnp state --- api/v1/clusterwidenetworkpolicy_types.go | 11 +++++++++++ .../metal-stack.io_clusterwidenetworkpolicies.yaml | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/api/v1/clusterwidenetworkpolicy_types.go b/api/v1/clusterwidenetworkpolicy_types.go index 421855da..9c382e5f 100644 --- a/api/v1/clusterwidenetworkpolicy_types.go +++ b/api/v1/clusterwidenetworkpolicy_types.go @@ -67,12 +67,23 @@ type PolicySpec struct { type FQDNState map[string][]IPSet +type PolicyDeploymentState string + +const ( + PolicyDeploymentStateDeployed = PolicyDeploymentState("deployed") + PolicyDeploymentStateIgnored = PolicyDeploymentState("ignored") +) + // PolicyStatus defines the observed state for CWNP resource type PolicyStatus struct { // FQDNState stores mapping from FQDN rules to nftables sets used for a firewall rule. // Key is either MatchName or MatchPattern // +optional FQDNState FQDNState `json:"fqdn_state,omitempty"` + + State PolicyDeploymentState `json:"state"` + + Message string `json:"message,omitempty"` } // IngressRule describes a particular set of traffic that is allowed to the cluster. diff --git a/config/crd/bases/metal-stack.io_clusterwidenetworkpolicies.yaml b/config/crd/bases/metal-stack.io_clusterwidenetworkpolicies.yaml index 09a53e39..4660820e 100644 --- a/config/crd/bases/metal-stack.io_clusterwidenetworkpolicies.yaml +++ b/config/crd/bases/metal-stack.io_clusterwidenetworkpolicies.yaml @@ -251,6 +251,12 @@ spec: description: FQDNState stores mapping from FQDN rules to nftables sets used for a firewall rule. Key is either MatchName or MatchPattern type: object + message: + type: string + state: + type: string + required: + - state type: object type: object served: true