From faff1e8acfc116b061a276d843bf61d5275be050 Mon Sep 17 00:00:00 2001 From: Surya Seetharaman Date: Thu, 28 Mar 2024 19:37:18 +0100 Subject: [PATCH] Bump network-policy-api to latest Brings in: 1) https://github.com/kubernetes-sigs/network-policy-api/pull/209 2) https://github.com/kubernetes-sigs/network-policy-api/pull/196 3) https://github.com/kubernetes-sigs/network-policy-api/pull/213 Signed-off-by: Surya Seetharaman --- go-controller/go.mod | 2 +- go-controller/go.sum | 4 +- go-controller/vendor/modules.txt | 3 +- .../apis/v1alpha1/adminnetworkpolicy_types.go | 9 +- .../baselineadminnetworkpolicy_types.go | 11 +- .../apis/v1alpha1/shared_types.go | 76 +----- .../apis/v1alpha1/zz_generated.deepcopy.go | 65 +----- .../apis/v1alpha1/adminnetworkpolicy.go | 218 ++++++++++++++++++ .../v1alpha1/adminnetworkpolicyegresspeer.go | 73 ++++++ .../v1alpha1/adminnetworkpolicyegressrule.go | 87 +++++++ .../v1alpha1/adminnetworkpolicyingresspeer.go | 52 +++++ .../v1alpha1/adminnetworkpolicyingressrule.go | 87 +++++++ .../apis/v1alpha1/adminnetworkpolicyport.go | 57 +++++ .../apis/v1alpha1/adminnetworkpolicyspec.go | 76 ++++++ .../apis/v1alpha1/adminnetworkpolicystatus.go | 45 ++++ .../v1alpha1/adminnetworkpolicysubject.go | 52 +++++ .../v1alpha1/baselineadminnetworkpolicy.go | 218 ++++++++++++++++++ .../baselineadminnetworkpolicyegressrule.go | 87 +++++++ .../baselineadminnetworkpolicyingressrule.go | 87 +++++++ .../baselineadminnetworkpolicyspec.go | 67 ++++++ .../baselineadminnetworkpolicystatus.go | 45 ++++ .../apis/v1alpha1/namespacedpeer.go | 65 ++++++ .../apis/v1alpha1/namespacedpod.go | 52 +++++ .../apis/v1alpha1/namespacedpodpeer.go | 52 +++++ .../apis/v1alpha1/namespacedpodsubject.go | 52 +++++ .../applyconfiguration/apis/v1alpha1/port.go | 52 +++++ .../apis/v1alpha1/portrange.go | 61 +++++ .../typed/apis/v1alpha1/adminnetworkpolicy.go | 59 +++++ .../v1alpha1/baselineadminnetworkpolicy.go | 59 +++++ .../v1alpha1/fake/fake_adminnetworkpolicy.go | 46 ++++ .../fake/fake_baselineadminnetworkpolicy.go | 46 ++++ 31 files changed, 1834 insertions(+), 131 deletions(-) create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicy.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegresspeer.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegressrule.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingresspeer.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingressrule.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyport.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyspec.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicystatus.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicysubject.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicy.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyegressrule.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyingressrule.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyspec.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicystatus.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpeer.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpod.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpodpeer.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpodsubject.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/port.go create mode 100644 go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/portrange.go diff --git a/go-controller/go.mod b/go-controller/go.mod index 22cc1bd32f..7fce433b21 100644 --- a/go-controller/go.mod +++ b/go-controller/go.mod @@ -58,7 +58,7 @@ require ( k8s.io/utils v0.0.0-20230726121419-3b25d923346b kubevirt.io/api v1.0.0-alpha.0 sigs.k8s.io/controller-runtime v0.17.0 - sigs.k8s.io/network-policy-api v0.1.3-0.20240311165859-d48faeeb0e02 + sigs.k8s.io/network-policy-api v0.1.3 sigs.k8s.io/structured-merge-diff/v4 v4.4.1 ) diff --git a/go-controller/go.sum b/go-controller/go.sum index 582e18ea73..59e23609f7 100644 --- a/go-controller/go.sum +++ b/go-controller/go.sum @@ -1382,8 +1382,8 @@ sigs.k8s.io/controller-runtime v0.17.0/go.mod h1:+MngTvIQQQhfXtwfdGw/UOQ/aIaqsYy sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/network-policy-api v0.1.3-0.20240311165859-d48faeeb0e02 h1:5ho9Gw0zfldiXQd/I38VJxpCNEWVaCvCH1rV+0GbV/c= -sigs.k8s.io/network-policy-api v0.1.3-0.20240311165859-d48faeeb0e02/go.mod h1:D7Nkr43VLNd7iYryemnj8qf0N/WjBzTZDxYA+g4u1/Y= +sigs.k8s.io/network-policy-api v0.1.3 h1:nHiAt6+9oyBIhSNwuVVdr6KOuYlE/gwSsQ4EiczGFR4= +sigs.k8s.io/network-policy-api v0.1.3/go.mod h1:D7Nkr43VLNd7iYryemnj8qf0N/WjBzTZDxYA+g4u1/Y= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= diff --git a/go-controller/vendor/modules.txt b/go-controller/vendor/modules.txt index 65424bae79..73ec932a98 100644 --- a/go-controller/vendor/modules.txt +++ b/go-controller/vendor/modules.txt @@ -1164,9 +1164,10 @@ sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics ## explicit; go 1.18 sigs.k8s.io/json sigs.k8s.io/json/internal/golang/encoding/json -# sigs.k8s.io/network-policy-api v0.1.3-0.20240311165859-d48faeeb0e02 +# sigs.k8s.io/network-policy-api v0.1.3 ## explicit; go 1.21 sigs.k8s.io/network-policy-api/apis/v1alpha1 +sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1 sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/fake sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/scheme diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/adminnetworkpolicy_types.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/adminnetworkpolicy_types.go index b55072061c..0919cfbad0 100644 --- a/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/adminnetworkpolicy_types.go +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/adminnetworkpolicy_types.go @@ -47,7 +47,11 @@ type AdminNetworkPolicy struct { // AdminNetworkPolicyStatus defines the observed state of AdminNetworkPolicy. type AdminNetworkPolicyStatus struct { - Conditions []metav1.Condition `json:"conditions"` + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions" patchStrategy:"merge" patchMergeKey:"type"` } // AdminNetworkPolicySpec defines the desired state of AdminNetworkPolicy. @@ -154,6 +158,8 @@ type AdminNetworkPolicyIngressRule struct { // AdminNetworkPolicyEgressRule describes an action to take on a particular // set of traffic originating from pods selected by a AdminNetworkPolicy's // Subject field. +// +// +kubebuilder:validation:XValidation:rule="!(self.to.exists(peer, has(peer.networks) || has(peer.nodes)) && has(self.ports) && self.ports.exists(port, has(port.namedPort)))",message="networks/nodes peer cannot be set with namedPorts since there are no namedPorts for networks/nodes" type AdminNetworkPolicyEgressRule struct { // Name is an identifier for this rule, that may be no more than 100 characters // in length. This field should be used by the implementation to help @@ -206,6 +212,7 @@ type AdminNetworkPolicyEgressRule struct { // Support: Core // // +enum +// +kubebuilder:validation:Enum={"Allow", "Deny", "Pass"} type AdminNetworkPolicyRuleAction string const ( diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/baselineadminnetworkpolicy_types.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/baselineadminnetworkpolicy_types.go index 91b032a2ea..61241fca55 100644 --- a/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/baselineadminnetworkpolicy_types.go +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/baselineadminnetworkpolicy_types.go @@ -44,7 +44,11 @@ type BaselineAdminNetworkPolicy struct { // BaselineAdminNetworkPolicyStatus defines the observed state of // BaselineAdminNetworkPolicy. type BaselineAdminNetworkPolicyStatus struct { - Conditions []metav1.Condition `json:"conditions"` + // +patchMergeKey=type + // +patchStrategy=merge + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions" patchStrategy:"merge" patchMergeKey:"type"` } // BaselineAdminNetworkPolicySpec defines the desired state of @@ -138,6 +142,8 @@ type BaselineAdminNetworkPolicyIngressRule struct { // BaselineAdminNetworkPolicyEgressRule describes an action to take on a particular // set of traffic originating from pods selected by a BaselineAdminNetworkPolicy's // Subject field. +// +// +kubebuilder:validation:XValidation:rule="!(self.to.exists(peer, has(peer.networks) || has(peer.nodes)) && has(self.ports) && self.ports.exists(port, has(port.namedPort)))",message="networks/nodes peer cannot be set with namedPorts since there are no namedPorts for networks/nodes" type BaselineAdminNetworkPolicyEgressRule struct { // Name is an identifier for this rule, that may be no more than 100 characters // in length. This field should be used by the implementation to help @@ -171,7 +177,7 @@ type BaselineAdminNetworkPolicyEgressRule struct { To []AdminNetworkPolicyEgressPeer `json:"to"` // Ports allows for matching traffic based on port and protocols. - // This field is a list of destination ports for the outging egress traffic. + // This field is a list of destination ports for the outgoing egress traffic. // If Ports is not set then the rule does not filter traffic via port. // +optional // +kubebuilder:validation:MaxItems=100 @@ -184,6 +190,7 @@ type BaselineAdminNetworkPolicyEgressRule struct { // Support: Core // // +enum +// +kubebuilder:validation:Enum={"Allow", "Deny"} type BaselineAdminNetworkPolicyRuleAction string const ( diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/shared_types.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/shared_types.go index 626f4aeede..ac8bf90563 100644 --- a/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/shared_types.go +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/shared_types.go @@ -30,12 +30,12 @@ type AdminNetworkPolicySubject struct { Namespaces *metav1.LabelSelector `json:"namespaces,omitempty"` // Pods is used to select pods via namespace AND pod selectors. // +optional - Pods *NamespacedPodSubject `json:"pods,omitempty"` + Pods *NamespacedPod `json:"pods,omitempty"` } -// NamespacedPodSubject allows the user to select a given set of pod(s) in +// NamespacedPod allows the user to select a given set of pod(s) in // selected namespace(s). -type NamespacedPodSubject struct { +type NamespacedPod struct { // NamespaceSelector follows standard label selector semantics; if empty, // it selects all Namespaces. NamespaceSelector metav1.LabelSelector `json:"namespaceSelector"` @@ -133,7 +133,7 @@ type AdminNetworkPolicyIngressPeer struct { // Support: Core // // +optional - Namespaces *NamespacedPeer `json:"namespaces,omitempty"` + Namespaces *metav1.LabelSelector `json:"namespaces,omitempty"` // Pods defines a way to select a set of pods in // a set of namespaces. Note that host-networked pods // are not included in this type of peer. @@ -141,7 +141,7 @@ type AdminNetworkPolicyIngressPeer struct { // Support: Core // // +optional - Pods *NamespacedPodPeer `json:"pods,omitempty"` + Pods *NamespacedPod `json:"pods,omitempty"` } // AdminNetworkPolicyEgressPeer defines a peer to allow traffic to. @@ -157,7 +157,7 @@ type AdminNetworkPolicyEgressPeer struct { // Support: Core // // +optional - Namespaces *NamespacedPeer `json:"namespaces,omitempty"` + Namespaces *metav1.LabelSelector `json:"namespaces,omitempty"` // Pods defines a way to select a set of pods in // a set of namespaces. Note that host-networked pods // are not included in this type of peer. @@ -165,7 +165,7 @@ type AdminNetworkPolicyEgressPeer struct { // Support: Core // // +optional - Pods *NamespacedPodPeer `json:"pods,omitempty"` + Pods *NamespacedPod `json:"pods,omitempty"` // Nodes defines a way to select a set of nodes in // the cluster. This field follows standard label selector // semantics; if present but empty, it selects all Nodes. @@ -192,72 +192,12 @@ type AdminNetworkPolicyEgressPeer struct { // // // +optional + // +listType=set // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:MaxItems=25 Networks []CIDR `json:"networks,omitempty"` } -// NamespacedPeer defines a flexible way to select Namespaces in a cluster. -// Exactly one of the selectors must be set. If a consumer observes none of -// its fields are set, they must assume an unknown option has been specified -// and fail closed. -// +kubebuilder:validation:MaxProperties=1 -// +kubebuilder:validation:MinProperties=1 -type NamespacedPeer struct { - // NamespaceSelector is a labelSelector used to select Namespaces, This field - // follows standard label selector semantics; if present but empty, it selects - // all Namespaces. - // - // Support: Core - // - // +optional - NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"` - - // SameLabels is used to select a set of Namespaces that share the same values - // for a set of labels. - // To be selected a Namespace must have all of the labels defined in SameLabels, - // AND they must all have the same value as the subject of this policy. - // If Samelabels is Empty then nothing is selected. - // - // Support: Extended - // - // - // +optional - // +kubebuilder:validation:MaxItems=100 - SameLabels []string `json:"sameLabels,omitempty"` - - // NotSameLabels is used to select a set of Namespaces that do not have certain - // values for a set of label(s). - // To be selected a Namespace must have all of the labels defined in NotSameLabels, - // AND at least one of them must have different values than the subject of this policy. - // If NotSameLabels is empty then nothing is selected. - // - // Support: Extended - // - // - // +optional - // +kubebuilder:validation:MaxItems=100 - NotSameLabels []string `json:"notSameLabels,omitempty"` -} - -// NamespacedPodPeer defines a flexible way to select Namespaces and pods in a -// cluster. The `Namespaces` and `PodSelector` fields are required. -type NamespacedPodPeer struct { - // Namespaces is used to select a set of Namespaces. - // - // Support: Core - // - Namespaces NamespacedPeer `json:"namespaces"` - - // PodSelector is a labelSelector used to select Pods, This field is NOT optional, - // follows standard label selector semantics and if present but empty, it selects - // all Pods. - // - // Support: Core - // - PodSelector metav1.LabelSelector `json:"podSelector"` -} - // CIDR is an IP address range in CIDR notation (for example, "10.0.0.0/8" or "fd00::/8"). // This string must be validated by implementations using net.ParseCIDR // TODO: Introduce CEL CIDR validation regex isCIDR() in Kube 1.31 when it is available. diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/zz_generated.deepcopy.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/zz_generated.deepcopy.go index 82b1b61d9e..d279c1fffe 100644 --- a/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/zz_generated.deepcopy.go +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/apis/v1alpha1/zz_generated.deepcopy.go @@ -57,12 +57,12 @@ func (in *AdminNetworkPolicyEgressPeer) DeepCopyInto(out *AdminNetworkPolicyEgre *out = *in if in.Namespaces != nil { in, out := &in.Namespaces, &out.Namespaces - *out = new(NamespacedPeer) + *out = new(v1.LabelSelector) (*in).DeepCopyInto(*out) } if in.Pods != nil { in, out := &in.Pods, &out.Pods - *out = new(NamespacedPodPeer) + *out = new(NamespacedPod) (*in).DeepCopyInto(*out) } if in.Nodes != nil { @@ -125,12 +125,12 @@ func (in *AdminNetworkPolicyIngressPeer) DeepCopyInto(out *AdminNetworkPolicyIng *out = *in if in.Namespaces != nil { in, out := &in.Namespaces, &out.Namespaces - *out = new(NamespacedPeer) + *out = new(v1.LabelSelector) (*in).DeepCopyInto(*out) } if in.Pods != nil { in, out := &in.Pods, &out.Pods - *out = new(NamespacedPodPeer) + *out = new(NamespacedPod) (*in).DeepCopyInto(*out) } } @@ -302,7 +302,7 @@ func (in *AdminNetworkPolicySubject) DeepCopyInto(out *AdminNetworkPolicySubject } if in.Pods != nil { in, out := &in.Pods, &out.Pods - *out = new(NamespacedPodSubject) + *out = new(NamespacedPod) (*in).DeepCopyInto(*out) } } @@ -495,65 +495,18 @@ func (in *BaselineAdminNetworkPolicyStatus) DeepCopy() *BaselineAdminNetworkPoli } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespacedPeer) DeepCopyInto(out *NamespacedPeer) { - *out = *in - if in.NamespaceSelector != nil { - in, out := &in.NamespaceSelector, &out.NamespaceSelector - *out = new(v1.LabelSelector) - (*in).DeepCopyInto(*out) - } - if in.SameLabels != nil { - in, out := &in.SameLabels, &out.SameLabels - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.NotSameLabels != nil { - in, out := &in.NotSameLabels, &out.NotSameLabels - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedPeer. -func (in *NamespacedPeer) DeepCopy() *NamespacedPeer { - if in == nil { - return nil - } - out := new(NamespacedPeer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespacedPodPeer) DeepCopyInto(out *NamespacedPodPeer) { - *out = *in - in.Namespaces.DeepCopyInto(&out.Namespaces) - in.PodSelector.DeepCopyInto(&out.PodSelector) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedPodPeer. -func (in *NamespacedPodPeer) DeepCopy() *NamespacedPodPeer { - if in == nil { - return nil - } - out := new(NamespacedPodPeer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespacedPodSubject) DeepCopyInto(out *NamespacedPodSubject) { +func (in *NamespacedPod) DeepCopyInto(out *NamespacedPod) { *out = *in in.NamespaceSelector.DeepCopyInto(&out.NamespaceSelector) in.PodSelector.DeepCopyInto(&out.PodSelector) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedPodSubject. -func (in *NamespacedPodSubject) DeepCopy() *NamespacedPodSubject { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedPod. +func (in *NamespacedPod) DeepCopy() *NamespacedPod { if in == nil { return nil } - out := new(NamespacedPodSubject) + out := new(NamespacedPod) in.DeepCopyInto(out) return out } diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicy.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicy.go new file mode 100644 index 0000000000..514a286e6a --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicy.go @@ -0,0 +1,218 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// AdminNetworkPolicyApplyConfiguration represents an declarative configuration of the AdminNetworkPolicy type for use +// with apply. +type AdminNetworkPolicyApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *AdminNetworkPolicySpecApplyConfiguration `json:"spec,omitempty"` + Status *AdminNetworkPolicyStatusApplyConfiguration `json:"status,omitempty"` +} + +// AdminNetworkPolicy constructs an declarative configuration of the AdminNetworkPolicy type for use with +// apply. +func AdminNetworkPolicy(name string) *AdminNetworkPolicyApplyConfiguration { + b := &AdminNetworkPolicyApplyConfiguration{} + b.WithName(name) + b.WithKind("AdminNetworkPolicy") + b.WithAPIVersion("policy.networking.k8s.io/v1alpha1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *AdminNetworkPolicyApplyConfiguration) WithKind(value string) *AdminNetworkPolicyApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *AdminNetworkPolicyApplyConfiguration) WithAPIVersion(value string) *AdminNetworkPolicyApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *AdminNetworkPolicyApplyConfiguration) WithName(value string) *AdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *AdminNetworkPolicyApplyConfiguration) WithGenerateName(value string) *AdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *AdminNetworkPolicyApplyConfiguration) WithNamespace(value string) *AdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *AdminNetworkPolicyApplyConfiguration) WithUID(value types.UID) *AdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *AdminNetworkPolicyApplyConfiguration) WithResourceVersion(value string) *AdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *AdminNetworkPolicyApplyConfiguration) WithGeneration(value int64) *AdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *AdminNetworkPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *AdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *AdminNetworkPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *AdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *AdminNetworkPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *AdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *AdminNetworkPolicyApplyConfiguration) WithLabels(entries map[string]string) *AdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *AdminNetworkPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *AdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *AdminNetworkPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *AdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *AdminNetworkPolicyApplyConfiguration) WithFinalizers(values ...string) *AdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *AdminNetworkPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *AdminNetworkPolicyApplyConfiguration) WithSpec(value *AdminNetworkPolicySpecApplyConfiguration) *AdminNetworkPolicyApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *AdminNetworkPolicyApplyConfiguration) WithStatus(value *AdminNetworkPolicyStatusApplyConfiguration) *AdminNetworkPolicyApplyConfiguration { + b.Status = value + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegresspeer.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegresspeer.go new file mode 100644 index 0000000000..ed4d5e146d --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegresspeer.go @@ -0,0 +1,73 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + apisv1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" +) + +// AdminNetworkPolicyEgressPeerApplyConfiguration represents an declarative configuration of the AdminNetworkPolicyEgressPeer type for use +// with apply. +type AdminNetworkPolicyEgressPeerApplyConfiguration struct { + Namespaces *v1.LabelSelector `json:"namespaces,omitempty"` + Pods *NamespacedPodApplyConfiguration `json:"pods,omitempty"` + Nodes *v1.LabelSelector `json:"nodes,omitempty"` + Networks []apisv1alpha1.CIDR `json:"networks,omitempty"` +} + +// AdminNetworkPolicyEgressPeerApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicyEgressPeer type for use with +// apply. +func AdminNetworkPolicyEgressPeer() *AdminNetworkPolicyEgressPeerApplyConfiguration { + return &AdminNetworkPolicyEgressPeerApplyConfiguration{} +} + +// WithNamespaces sets the Namespaces field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespaces field is set to the value of the last call. +func (b *AdminNetworkPolicyEgressPeerApplyConfiguration) WithNamespaces(value v1.LabelSelector) *AdminNetworkPolicyEgressPeerApplyConfiguration { + b.Namespaces = &value + return b +} + +// WithPods sets the Pods field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pods field is set to the value of the last call. +func (b *AdminNetworkPolicyEgressPeerApplyConfiguration) WithPods(value *NamespacedPodApplyConfiguration) *AdminNetworkPolicyEgressPeerApplyConfiguration { + b.Pods = value + return b +} + +// WithNodes sets the Nodes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Nodes field is set to the value of the last call. +func (b *AdminNetworkPolicyEgressPeerApplyConfiguration) WithNodes(value v1.LabelSelector) *AdminNetworkPolicyEgressPeerApplyConfiguration { + b.Nodes = &value + return b +} + +// WithNetworks adds the given value to the Networks field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Networks field. +func (b *AdminNetworkPolicyEgressPeerApplyConfiguration) WithNetworks(values ...apisv1alpha1.CIDR) *AdminNetworkPolicyEgressPeerApplyConfiguration { + for i := range values { + b.Networks = append(b.Networks, values[i]) + } + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegressrule.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegressrule.go new file mode 100644 index 0000000000..10806caf84 --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegressrule.go @@ -0,0 +1,87 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" +) + +// AdminNetworkPolicyEgressRuleApplyConfiguration represents an declarative configuration of the AdminNetworkPolicyEgressRule type for use +// with apply. +type AdminNetworkPolicyEgressRuleApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Action *v1alpha1.AdminNetworkPolicyRuleAction `json:"action,omitempty"` + To []AdminNetworkPolicyEgressPeerApplyConfiguration `json:"to,omitempty"` + Ports *[]AdminNetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` +} + +// AdminNetworkPolicyEgressRuleApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicyEgressRule type for use with +// apply. +func AdminNetworkPolicyEgressRule() *AdminNetworkPolicyEgressRuleApplyConfiguration { + return &AdminNetworkPolicyEgressRuleApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *AdminNetworkPolicyEgressRuleApplyConfiguration) WithName(value string) *AdminNetworkPolicyEgressRuleApplyConfiguration { + b.Name = &value + return b +} + +// WithAction sets the Action field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Action field is set to the value of the last call. +func (b *AdminNetworkPolicyEgressRuleApplyConfiguration) WithAction(value v1alpha1.AdminNetworkPolicyRuleAction) *AdminNetworkPolicyEgressRuleApplyConfiguration { + b.Action = &value + return b +} + +// WithTo adds the given value to the To field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the To field. +func (b *AdminNetworkPolicyEgressRuleApplyConfiguration) WithTo(values ...*AdminNetworkPolicyEgressPeerApplyConfiguration) *AdminNetworkPolicyEgressRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTo") + } + b.To = append(b.To, *values[i]) + } + return b +} + +func (b *AdminNetworkPolicyEgressRuleApplyConfiguration) ensureAdminNetworkPolicyPortApplyConfigurationExists() { + if b.Ports == nil { + b.Ports = &[]AdminNetworkPolicyPortApplyConfiguration{} + } +} + +// WithPorts adds the given value to the Ports field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ports field. +func (b *AdminNetworkPolicyEgressRuleApplyConfiguration) WithPorts(values ...*AdminNetworkPolicyPortApplyConfiguration) *AdminNetworkPolicyEgressRuleApplyConfiguration { + b.ensureAdminNetworkPolicyPortApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPorts") + } + *b.Ports = append(*b.Ports, *values[i]) + } + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingresspeer.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingresspeer.go new file mode 100644 index 0000000000..89bbb823de --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingresspeer.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AdminNetworkPolicyIngressPeerApplyConfiguration represents an declarative configuration of the AdminNetworkPolicyIngressPeer type for use +// with apply. +type AdminNetworkPolicyIngressPeerApplyConfiguration struct { + Namespaces *v1.LabelSelector `json:"namespaces,omitempty"` + Pods *NamespacedPodApplyConfiguration `json:"pods,omitempty"` +} + +// AdminNetworkPolicyIngressPeerApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicyIngressPeer type for use with +// apply. +func AdminNetworkPolicyIngressPeer() *AdminNetworkPolicyIngressPeerApplyConfiguration { + return &AdminNetworkPolicyIngressPeerApplyConfiguration{} +} + +// WithNamespaces sets the Namespaces field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespaces field is set to the value of the last call. +func (b *AdminNetworkPolicyIngressPeerApplyConfiguration) WithNamespaces(value v1.LabelSelector) *AdminNetworkPolicyIngressPeerApplyConfiguration { + b.Namespaces = &value + return b +} + +// WithPods sets the Pods field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pods field is set to the value of the last call. +func (b *AdminNetworkPolicyIngressPeerApplyConfiguration) WithPods(value *NamespacedPodApplyConfiguration) *AdminNetworkPolicyIngressPeerApplyConfiguration { + b.Pods = value + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingressrule.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingressrule.go new file mode 100644 index 0000000000..cc31fb1d7e --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingressrule.go @@ -0,0 +1,87 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" +) + +// AdminNetworkPolicyIngressRuleApplyConfiguration represents an declarative configuration of the AdminNetworkPolicyIngressRule type for use +// with apply. +type AdminNetworkPolicyIngressRuleApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Action *v1alpha1.AdminNetworkPolicyRuleAction `json:"action,omitempty"` + From []AdminNetworkPolicyIngressPeerApplyConfiguration `json:"from,omitempty"` + Ports *[]AdminNetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` +} + +// AdminNetworkPolicyIngressRuleApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicyIngressRule type for use with +// apply. +func AdminNetworkPolicyIngressRule() *AdminNetworkPolicyIngressRuleApplyConfiguration { + return &AdminNetworkPolicyIngressRuleApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *AdminNetworkPolicyIngressRuleApplyConfiguration) WithName(value string) *AdminNetworkPolicyIngressRuleApplyConfiguration { + b.Name = &value + return b +} + +// WithAction sets the Action field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Action field is set to the value of the last call. +func (b *AdminNetworkPolicyIngressRuleApplyConfiguration) WithAction(value v1alpha1.AdminNetworkPolicyRuleAction) *AdminNetworkPolicyIngressRuleApplyConfiguration { + b.Action = &value + return b +} + +// WithFrom adds the given value to the From field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the From field. +func (b *AdminNetworkPolicyIngressRuleApplyConfiguration) WithFrom(values ...*AdminNetworkPolicyIngressPeerApplyConfiguration) *AdminNetworkPolicyIngressRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFrom") + } + b.From = append(b.From, *values[i]) + } + return b +} + +func (b *AdminNetworkPolicyIngressRuleApplyConfiguration) ensureAdminNetworkPolicyPortApplyConfigurationExists() { + if b.Ports == nil { + b.Ports = &[]AdminNetworkPolicyPortApplyConfiguration{} + } +} + +// WithPorts adds the given value to the Ports field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ports field. +func (b *AdminNetworkPolicyIngressRuleApplyConfiguration) WithPorts(values ...*AdminNetworkPolicyPortApplyConfiguration) *AdminNetworkPolicyIngressRuleApplyConfiguration { + b.ensureAdminNetworkPolicyPortApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPorts") + } + *b.Ports = append(*b.Ports, *values[i]) + } + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyport.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyport.go new file mode 100644 index 0000000000..585b0fba4c --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyport.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// AdminNetworkPolicyPortApplyConfiguration represents an declarative configuration of the AdminNetworkPolicyPort type for use +// with apply. +type AdminNetworkPolicyPortApplyConfiguration struct { + PortNumber *PortApplyConfiguration `json:"portNumber,omitempty"` + NamedPort *string `json:"namedPort,omitempty"` + PortRange *PortRangeApplyConfiguration `json:"portRange,omitempty"` +} + +// AdminNetworkPolicyPortApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicyPort type for use with +// apply. +func AdminNetworkPolicyPort() *AdminNetworkPolicyPortApplyConfiguration { + return &AdminNetworkPolicyPortApplyConfiguration{} +} + +// WithPortNumber sets the PortNumber field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PortNumber field is set to the value of the last call. +func (b *AdminNetworkPolicyPortApplyConfiguration) WithPortNumber(value *PortApplyConfiguration) *AdminNetworkPolicyPortApplyConfiguration { + b.PortNumber = value + return b +} + +// WithNamedPort sets the NamedPort field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NamedPort field is set to the value of the last call. +func (b *AdminNetworkPolicyPortApplyConfiguration) WithNamedPort(value string) *AdminNetworkPolicyPortApplyConfiguration { + b.NamedPort = &value + return b +} + +// WithPortRange sets the PortRange field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PortRange field is set to the value of the last call. +func (b *AdminNetworkPolicyPortApplyConfiguration) WithPortRange(value *PortRangeApplyConfiguration) *AdminNetworkPolicyPortApplyConfiguration { + b.PortRange = value + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyspec.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyspec.go new file mode 100644 index 0000000000..314526ec64 --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyspec.go @@ -0,0 +1,76 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// AdminNetworkPolicySpecApplyConfiguration represents an declarative configuration of the AdminNetworkPolicySpec type for use +// with apply. +type AdminNetworkPolicySpecApplyConfiguration struct { + Priority *int32 `json:"priority,omitempty"` + Subject *AdminNetworkPolicySubjectApplyConfiguration `json:"subject,omitempty"` + Ingress []AdminNetworkPolicyIngressRuleApplyConfiguration `json:"ingress,omitempty"` + Egress []AdminNetworkPolicyEgressRuleApplyConfiguration `json:"egress,omitempty"` +} + +// AdminNetworkPolicySpecApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicySpec type for use with +// apply. +func AdminNetworkPolicySpec() *AdminNetworkPolicySpecApplyConfiguration { + return &AdminNetworkPolicySpecApplyConfiguration{} +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *AdminNetworkPolicySpecApplyConfiguration) WithPriority(value int32) *AdminNetworkPolicySpecApplyConfiguration { + b.Priority = &value + return b +} + +// WithSubject sets the Subject field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Subject field is set to the value of the last call. +func (b *AdminNetworkPolicySpecApplyConfiguration) WithSubject(value *AdminNetworkPolicySubjectApplyConfiguration) *AdminNetworkPolicySpecApplyConfiguration { + b.Subject = value + return b +} + +// WithIngress adds the given value to the Ingress field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ingress field. +func (b *AdminNetworkPolicySpecApplyConfiguration) WithIngress(values ...*AdminNetworkPolicyIngressRuleApplyConfiguration) *AdminNetworkPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithIngress") + } + b.Ingress = append(b.Ingress, *values[i]) + } + return b +} + +// WithEgress adds the given value to the Egress field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Egress field. +func (b *AdminNetworkPolicySpecApplyConfiguration) WithEgress(values ...*AdminNetworkPolicyEgressRuleApplyConfiguration) *AdminNetworkPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithEgress") + } + b.Egress = append(b.Egress, *values[i]) + } + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicystatus.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicystatus.go new file mode 100644 index 0000000000..35d87e5e0a --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicystatus.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AdminNetworkPolicyStatusApplyConfiguration represents an declarative configuration of the AdminNetworkPolicyStatus type for use +// with apply. +type AdminNetworkPolicyStatusApplyConfiguration struct { + Conditions []v1.Condition `json:"conditions,omitempty"` +} + +// AdminNetworkPolicyStatusApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicyStatus type for use with +// apply. +func AdminNetworkPolicyStatus() *AdminNetworkPolicyStatusApplyConfiguration { + return &AdminNetworkPolicyStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *AdminNetworkPolicyStatusApplyConfiguration) WithConditions(values ...v1.Condition) *AdminNetworkPolicyStatusApplyConfiguration { + for i := range values { + b.Conditions = append(b.Conditions, values[i]) + } + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicysubject.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicysubject.go new file mode 100644 index 0000000000..3bfe54d2fc --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicysubject.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AdminNetworkPolicySubjectApplyConfiguration represents an declarative configuration of the AdminNetworkPolicySubject type for use +// with apply. +type AdminNetworkPolicySubjectApplyConfiguration struct { + Namespaces *v1.LabelSelector `json:"namespaces,omitempty"` + Pods *NamespacedPodApplyConfiguration `json:"pods,omitempty"` +} + +// AdminNetworkPolicySubjectApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicySubject type for use with +// apply. +func AdminNetworkPolicySubject() *AdminNetworkPolicySubjectApplyConfiguration { + return &AdminNetworkPolicySubjectApplyConfiguration{} +} + +// WithNamespaces sets the Namespaces field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespaces field is set to the value of the last call. +func (b *AdminNetworkPolicySubjectApplyConfiguration) WithNamespaces(value v1.LabelSelector) *AdminNetworkPolicySubjectApplyConfiguration { + b.Namespaces = &value + return b +} + +// WithPods sets the Pods field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pods field is set to the value of the last call. +func (b *AdminNetworkPolicySubjectApplyConfiguration) WithPods(value *NamespacedPodApplyConfiguration) *AdminNetworkPolicySubjectApplyConfiguration { + b.Pods = value + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicy.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicy.go new file mode 100644 index 0000000000..c94d6b0861 --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicy.go @@ -0,0 +1,218 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// BaselineAdminNetworkPolicyApplyConfiguration represents an declarative configuration of the BaselineAdminNetworkPolicy type for use +// with apply. +type BaselineAdminNetworkPolicyApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *BaselineAdminNetworkPolicySpecApplyConfiguration `json:"spec,omitempty"` + Status *BaselineAdminNetworkPolicyStatusApplyConfiguration `json:"status,omitempty"` +} + +// BaselineAdminNetworkPolicy constructs an declarative configuration of the BaselineAdminNetworkPolicy type for use with +// apply. +func BaselineAdminNetworkPolicy(name string) *BaselineAdminNetworkPolicyApplyConfiguration { + b := &BaselineAdminNetworkPolicyApplyConfiguration{} + b.WithName(name) + b.WithKind("BaselineAdminNetworkPolicy") + b.WithAPIVersion("policy.networking.k8s.io/v1alpha1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithKind(value string) *BaselineAdminNetworkPolicyApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithAPIVersion(value string) *BaselineAdminNetworkPolicyApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithName(value string) *BaselineAdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithGenerateName(value string) *BaselineAdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithNamespace(value string) *BaselineAdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithUID(value types.UID) *BaselineAdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithResourceVersion(value string) *BaselineAdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithGeneration(value int64) *BaselineAdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *BaselineAdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *BaselineAdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *BaselineAdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithLabels(entries map[string]string) *BaselineAdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *BaselineAdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *BaselineAdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithFinalizers(values ...string) *BaselineAdminNetworkPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *BaselineAdminNetworkPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithSpec(value *BaselineAdminNetworkPolicySpecApplyConfiguration) *BaselineAdminNetworkPolicyApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithStatus(value *BaselineAdminNetworkPolicyStatusApplyConfiguration) *BaselineAdminNetworkPolicyApplyConfiguration { + b.Status = value + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyegressrule.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyegressrule.go new file mode 100644 index 0000000000..cb5d0d83e4 --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyegressrule.go @@ -0,0 +1,87 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" +) + +// BaselineAdminNetworkPolicyEgressRuleApplyConfiguration represents an declarative configuration of the BaselineAdminNetworkPolicyEgressRule type for use +// with apply. +type BaselineAdminNetworkPolicyEgressRuleApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Action *v1alpha1.BaselineAdminNetworkPolicyRuleAction `json:"action,omitempty"` + To []AdminNetworkPolicyEgressPeerApplyConfiguration `json:"to,omitempty"` + Ports *[]AdminNetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` +} + +// BaselineAdminNetworkPolicyEgressRuleApplyConfiguration constructs an declarative configuration of the BaselineAdminNetworkPolicyEgressRule type for use with +// apply. +func BaselineAdminNetworkPolicyEgressRule() *BaselineAdminNetworkPolicyEgressRuleApplyConfiguration { + return &BaselineAdminNetworkPolicyEgressRuleApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyEgressRuleApplyConfiguration) WithName(value string) *BaselineAdminNetworkPolicyEgressRuleApplyConfiguration { + b.Name = &value + return b +} + +// WithAction sets the Action field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Action field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyEgressRuleApplyConfiguration) WithAction(value v1alpha1.BaselineAdminNetworkPolicyRuleAction) *BaselineAdminNetworkPolicyEgressRuleApplyConfiguration { + b.Action = &value + return b +} + +// WithTo adds the given value to the To field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the To field. +func (b *BaselineAdminNetworkPolicyEgressRuleApplyConfiguration) WithTo(values ...*AdminNetworkPolicyEgressPeerApplyConfiguration) *BaselineAdminNetworkPolicyEgressRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTo") + } + b.To = append(b.To, *values[i]) + } + return b +} + +func (b *BaselineAdminNetworkPolicyEgressRuleApplyConfiguration) ensureAdminNetworkPolicyPortApplyConfigurationExists() { + if b.Ports == nil { + b.Ports = &[]AdminNetworkPolicyPortApplyConfiguration{} + } +} + +// WithPorts adds the given value to the Ports field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ports field. +func (b *BaselineAdminNetworkPolicyEgressRuleApplyConfiguration) WithPorts(values ...*AdminNetworkPolicyPortApplyConfiguration) *BaselineAdminNetworkPolicyEgressRuleApplyConfiguration { + b.ensureAdminNetworkPolicyPortApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPorts") + } + *b.Ports = append(*b.Ports, *values[i]) + } + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyingressrule.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyingressrule.go new file mode 100644 index 0000000000..c7d248d42e --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyingressrule.go @@ -0,0 +1,87 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" +) + +// BaselineAdminNetworkPolicyIngressRuleApplyConfiguration represents an declarative configuration of the BaselineAdminNetworkPolicyIngressRule type for use +// with apply. +type BaselineAdminNetworkPolicyIngressRuleApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Action *v1alpha1.BaselineAdminNetworkPolicyRuleAction `json:"action,omitempty"` + From []AdminNetworkPolicyIngressPeerApplyConfiguration `json:"from,omitempty"` + Ports *[]AdminNetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` +} + +// BaselineAdminNetworkPolicyIngressRuleApplyConfiguration constructs an declarative configuration of the BaselineAdminNetworkPolicyIngressRule type for use with +// apply. +func BaselineAdminNetworkPolicyIngressRule() *BaselineAdminNetworkPolicyIngressRuleApplyConfiguration { + return &BaselineAdminNetworkPolicyIngressRuleApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyIngressRuleApplyConfiguration) WithName(value string) *BaselineAdminNetworkPolicyIngressRuleApplyConfiguration { + b.Name = &value + return b +} + +// WithAction sets the Action field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Action field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicyIngressRuleApplyConfiguration) WithAction(value v1alpha1.BaselineAdminNetworkPolicyRuleAction) *BaselineAdminNetworkPolicyIngressRuleApplyConfiguration { + b.Action = &value + return b +} + +// WithFrom adds the given value to the From field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the From field. +func (b *BaselineAdminNetworkPolicyIngressRuleApplyConfiguration) WithFrom(values ...*AdminNetworkPolicyIngressPeerApplyConfiguration) *BaselineAdminNetworkPolicyIngressRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFrom") + } + b.From = append(b.From, *values[i]) + } + return b +} + +func (b *BaselineAdminNetworkPolicyIngressRuleApplyConfiguration) ensureAdminNetworkPolicyPortApplyConfigurationExists() { + if b.Ports == nil { + b.Ports = &[]AdminNetworkPolicyPortApplyConfiguration{} + } +} + +// WithPorts adds the given value to the Ports field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ports field. +func (b *BaselineAdminNetworkPolicyIngressRuleApplyConfiguration) WithPorts(values ...*AdminNetworkPolicyPortApplyConfiguration) *BaselineAdminNetworkPolicyIngressRuleApplyConfiguration { + b.ensureAdminNetworkPolicyPortApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPorts") + } + *b.Ports = append(*b.Ports, *values[i]) + } + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyspec.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyspec.go new file mode 100644 index 0000000000..e0eb379fcd --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyspec.go @@ -0,0 +1,67 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +// BaselineAdminNetworkPolicySpecApplyConfiguration represents an declarative configuration of the BaselineAdminNetworkPolicySpec type for use +// with apply. +type BaselineAdminNetworkPolicySpecApplyConfiguration struct { + Subject *AdminNetworkPolicySubjectApplyConfiguration `json:"subject,omitempty"` + Ingress []BaselineAdminNetworkPolicyIngressRuleApplyConfiguration `json:"ingress,omitempty"` + Egress []BaselineAdminNetworkPolicyEgressRuleApplyConfiguration `json:"egress,omitempty"` +} + +// BaselineAdminNetworkPolicySpecApplyConfiguration constructs an declarative configuration of the BaselineAdminNetworkPolicySpec type for use with +// apply. +func BaselineAdminNetworkPolicySpec() *BaselineAdminNetworkPolicySpecApplyConfiguration { + return &BaselineAdminNetworkPolicySpecApplyConfiguration{} +} + +// WithSubject sets the Subject field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Subject field is set to the value of the last call. +func (b *BaselineAdminNetworkPolicySpecApplyConfiguration) WithSubject(value *AdminNetworkPolicySubjectApplyConfiguration) *BaselineAdminNetworkPolicySpecApplyConfiguration { + b.Subject = value + return b +} + +// WithIngress adds the given value to the Ingress field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ingress field. +func (b *BaselineAdminNetworkPolicySpecApplyConfiguration) WithIngress(values ...*BaselineAdminNetworkPolicyIngressRuleApplyConfiguration) *BaselineAdminNetworkPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithIngress") + } + b.Ingress = append(b.Ingress, *values[i]) + } + return b +} + +// WithEgress adds the given value to the Egress field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Egress field. +func (b *BaselineAdminNetworkPolicySpecApplyConfiguration) WithEgress(values ...*BaselineAdminNetworkPolicyEgressRuleApplyConfiguration) *BaselineAdminNetworkPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithEgress") + } + b.Egress = append(b.Egress, *values[i]) + } + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicystatus.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicystatus.go new file mode 100644 index 0000000000..5136110140 --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicystatus.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// BaselineAdminNetworkPolicyStatusApplyConfiguration represents an declarative configuration of the BaselineAdminNetworkPolicyStatus type for use +// with apply. +type BaselineAdminNetworkPolicyStatusApplyConfiguration struct { + Conditions []v1.Condition `json:"conditions,omitempty"` +} + +// BaselineAdminNetworkPolicyStatusApplyConfiguration constructs an declarative configuration of the BaselineAdminNetworkPolicyStatus type for use with +// apply. +func BaselineAdminNetworkPolicyStatus() *BaselineAdminNetworkPolicyStatusApplyConfiguration { + return &BaselineAdminNetworkPolicyStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *BaselineAdminNetworkPolicyStatusApplyConfiguration) WithConditions(values ...v1.Condition) *BaselineAdminNetworkPolicyStatusApplyConfiguration { + for i := range values { + b.Conditions = append(b.Conditions, values[i]) + } + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpeer.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpeer.go new file mode 100644 index 0000000000..486d28d1a4 --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpeer.go @@ -0,0 +1,65 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// NamespacedPeerApplyConfiguration represents an declarative configuration of the NamespacedPeer type for use +// with apply. +type NamespacedPeerApplyConfiguration struct { + NamespaceSelector *v1.LabelSelector `json:"namespaceSelector,omitempty"` + SameLabels []string `json:"sameLabels,omitempty"` + NotSameLabels []string `json:"notSameLabels,omitempty"` +} + +// NamespacedPeerApplyConfiguration constructs an declarative configuration of the NamespacedPeer type for use with +// apply. +func NamespacedPeer() *NamespacedPeerApplyConfiguration { + return &NamespacedPeerApplyConfiguration{} +} + +// WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NamespaceSelector field is set to the value of the last call. +func (b *NamespacedPeerApplyConfiguration) WithNamespaceSelector(value v1.LabelSelector) *NamespacedPeerApplyConfiguration { + b.NamespaceSelector = &value + return b +} + +// WithSameLabels adds the given value to the SameLabels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SameLabels field. +func (b *NamespacedPeerApplyConfiguration) WithSameLabels(values ...string) *NamespacedPeerApplyConfiguration { + for i := range values { + b.SameLabels = append(b.SameLabels, values[i]) + } + return b +} + +// WithNotSameLabels adds the given value to the NotSameLabels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the NotSameLabels field. +func (b *NamespacedPeerApplyConfiguration) WithNotSameLabels(values ...string) *NamespacedPeerApplyConfiguration { + for i := range values { + b.NotSameLabels = append(b.NotSameLabels, values[i]) + } + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpod.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpod.go new file mode 100644 index 0000000000..209b33d02d --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpod.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// NamespacedPodApplyConfiguration represents an declarative configuration of the NamespacedPod type for use +// with apply. +type NamespacedPodApplyConfiguration struct { + NamespaceSelector *v1.LabelSelector `json:"namespaceSelector,omitempty"` + PodSelector *v1.LabelSelector `json:"podSelector,omitempty"` +} + +// NamespacedPodApplyConfiguration constructs an declarative configuration of the NamespacedPod type for use with +// apply. +func NamespacedPod() *NamespacedPodApplyConfiguration { + return &NamespacedPodApplyConfiguration{} +} + +// WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NamespaceSelector field is set to the value of the last call. +func (b *NamespacedPodApplyConfiguration) WithNamespaceSelector(value v1.LabelSelector) *NamespacedPodApplyConfiguration { + b.NamespaceSelector = &value + return b +} + +// WithPodSelector sets the PodSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodSelector field is set to the value of the last call. +func (b *NamespacedPodApplyConfiguration) WithPodSelector(value v1.LabelSelector) *NamespacedPodApplyConfiguration { + b.PodSelector = &value + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpodpeer.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpodpeer.go new file mode 100644 index 0000000000..a1c0892318 --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpodpeer.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// NamespacedPodPeerApplyConfiguration represents an declarative configuration of the NamespacedPodPeer type for use +// with apply. +type NamespacedPodPeerApplyConfiguration struct { + Namespaces *NamespacedPeerApplyConfiguration `json:"namespaces,omitempty"` + PodSelector *v1.LabelSelector `json:"podSelector,omitempty"` +} + +// NamespacedPodPeerApplyConfiguration constructs an declarative configuration of the NamespacedPodPeer type for use with +// apply. +func NamespacedPodPeer() *NamespacedPodPeerApplyConfiguration { + return &NamespacedPodPeerApplyConfiguration{} +} + +// WithNamespaces sets the Namespaces field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespaces field is set to the value of the last call. +func (b *NamespacedPodPeerApplyConfiguration) WithNamespaces(value *NamespacedPeerApplyConfiguration) *NamespacedPodPeerApplyConfiguration { + b.Namespaces = value + return b +} + +// WithPodSelector sets the PodSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodSelector field is set to the value of the last call. +func (b *NamespacedPodPeerApplyConfiguration) WithPodSelector(value v1.LabelSelector) *NamespacedPodPeerApplyConfiguration { + b.PodSelector = &value + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpodsubject.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpodsubject.go new file mode 100644 index 0000000000..db133e9c94 --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpodsubject.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// NamespacedPodSubjectApplyConfiguration represents an declarative configuration of the NamespacedPodSubject type for use +// with apply. +type NamespacedPodSubjectApplyConfiguration struct { + NamespaceSelector *v1.LabelSelector `json:"namespaceSelector,omitempty"` + PodSelector *v1.LabelSelector `json:"podSelector,omitempty"` +} + +// NamespacedPodSubjectApplyConfiguration constructs an declarative configuration of the NamespacedPodSubject type for use with +// apply. +func NamespacedPodSubject() *NamespacedPodSubjectApplyConfiguration { + return &NamespacedPodSubjectApplyConfiguration{} +} + +// WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NamespaceSelector field is set to the value of the last call. +func (b *NamespacedPodSubjectApplyConfiguration) WithNamespaceSelector(value v1.LabelSelector) *NamespacedPodSubjectApplyConfiguration { + b.NamespaceSelector = &value + return b +} + +// WithPodSelector sets the PodSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodSelector field is set to the value of the last call. +func (b *NamespacedPodSubjectApplyConfiguration) WithPodSelector(value v1.LabelSelector) *NamespacedPodSubjectApplyConfiguration { + b.PodSelector = &value + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/port.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/port.go new file mode 100644 index 0000000000..3a48da650c --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/port.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// PortApplyConfiguration represents an declarative configuration of the Port type for use +// with apply. +type PortApplyConfiguration struct { + Protocol *v1.Protocol `json:"protocol,omitempty"` + Port *int32 `json:"port,omitempty"` +} + +// PortApplyConfiguration constructs an declarative configuration of the Port type for use with +// apply. +func Port() *PortApplyConfiguration { + return &PortApplyConfiguration{} +} + +// WithProtocol sets the Protocol field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Protocol field is set to the value of the last call. +func (b *PortApplyConfiguration) WithProtocol(value v1.Protocol) *PortApplyConfiguration { + b.Protocol = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *PortApplyConfiguration) WithPort(value int32) *PortApplyConfiguration { + b.Port = &value + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/portrange.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/portrange.go new file mode 100644 index 0000000000..017e5b4615 --- /dev/null +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1/portrange.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// PortRangeApplyConfiguration represents an declarative configuration of the PortRange type for use +// with apply. +type PortRangeApplyConfiguration struct { + Protocol *v1.Protocol `json:"protocol,omitempty"` + Start *int32 `json:"start,omitempty"` + End *int32 `json:"end,omitempty"` +} + +// PortRangeApplyConfiguration constructs an declarative configuration of the PortRange type for use with +// apply. +func PortRange() *PortRangeApplyConfiguration { + return &PortRangeApplyConfiguration{} +} + +// WithProtocol sets the Protocol field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Protocol field is set to the value of the last call. +func (b *PortRangeApplyConfiguration) WithProtocol(value v1.Protocol) *PortRangeApplyConfiguration { + b.Protocol = &value + return b +} + +// WithStart sets the Start field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Start field is set to the value of the last call. +func (b *PortRangeApplyConfiguration) WithStart(value int32) *PortRangeApplyConfiguration { + b.Start = &value + return b +} + +// WithEnd sets the End field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the End field is set to the value of the last call. +func (b *PortRangeApplyConfiguration) WithEnd(value int32) *PortRangeApplyConfiguration { + b.End = &value + return b +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/adminnetworkpolicy.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/adminnetworkpolicy.go index f7d0b81762..9d351d53b1 100644 --- a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/adminnetworkpolicy.go +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/adminnetworkpolicy.go @@ -20,6 +20,8 @@ package v1alpha1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,6 +29,7 @@ import ( watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" v1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" + apisv1alpha1 "sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1" scheme "sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/scheme" ) @@ -47,6 +50,8 @@ type AdminNetworkPolicyInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.AdminNetworkPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AdminNetworkPolicy, err error) + Apply(ctx context.Context, adminNetworkPolicy *apisv1alpha1.AdminNetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.AdminNetworkPolicy, err error) + ApplyStatus(ctx context.Context, adminNetworkPolicy *apisv1alpha1.AdminNetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.AdminNetworkPolicy, err error) AdminNetworkPolicyExpansion } @@ -182,3 +187,57 @@ func (c *adminNetworkPolicies) Patch(ctx context.Context, name string, pt types. Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied adminNetworkPolicy. +func (c *adminNetworkPolicies) Apply(ctx context.Context, adminNetworkPolicy *apisv1alpha1.AdminNetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.AdminNetworkPolicy, err error) { + if adminNetworkPolicy == nil { + return nil, fmt.Errorf("adminNetworkPolicy provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(adminNetworkPolicy) + if err != nil { + return nil, err + } + name := adminNetworkPolicy.Name + if name == nil { + return nil, fmt.Errorf("adminNetworkPolicy.Name must be provided to Apply") + } + result = &v1alpha1.AdminNetworkPolicy{} + err = c.client.Patch(types.ApplyPatchType). + Resource("adminnetworkpolicies"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *adminNetworkPolicies) ApplyStatus(ctx context.Context, adminNetworkPolicy *apisv1alpha1.AdminNetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.AdminNetworkPolicy, err error) { + if adminNetworkPolicy == nil { + return nil, fmt.Errorf("adminNetworkPolicy provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(adminNetworkPolicy) + if err != nil { + return nil, err + } + + name := adminNetworkPolicy.Name + if name == nil { + return nil, fmt.Errorf("adminNetworkPolicy.Name must be provided to Apply") + } + + result = &v1alpha1.AdminNetworkPolicy{} + err = c.client.Patch(types.ApplyPatchType). + Resource("adminnetworkpolicies"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/baselineadminnetworkpolicy.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/baselineadminnetworkpolicy.go index 852f405855..000f498586 100644 --- a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/baselineadminnetworkpolicy.go +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/baselineadminnetworkpolicy.go @@ -20,6 +20,8 @@ package v1alpha1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,6 +29,7 @@ import ( watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" v1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" + apisv1alpha1 "sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1" scheme "sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/scheme" ) @@ -47,6 +50,8 @@ type BaselineAdminNetworkPolicyInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BaselineAdminNetworkPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) + Apply(ctx context.Context, baselineAdminNetworkPolicy *apisv1alpha1.BaselineAdminNetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) + ApplyStatus(ctx context.Context, baselineAdminNetworkPolicy *apisv1alpha1.BaselineAdminNetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) BaselineAdminNetworkPolicyExpansion } @@ -182,3 +187,57 @@ func (c *baselineAdminNetworkPolicies) Patch(ctx context.Context, name string, p Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied baselineAdminNetworkPolicy. +func (c *baselineAdminNetworkPolicies) Apply(ctx context.Context, baselineAdminNetworkPolicy *apisv1alpha1.BaselineAdminNetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) { + if baselineAdminNetworkPolicy == nil { + return nil, fmt.Errorf("baselineAdminNetworkPolicy provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(baselineAdminNetworkPolicy) + if err != nil { + return nil, err + } + name := baselineAdminNetworkPolicy.Name + if name == nil { + return nil, fmt.Errorf("baselineAdminNetworkPolicy.Name must be provided to Apply") + } + result = &v1alpha1.BaselineAdminNetworkPolicy{} + err = c.client.Patch(types.ApplyPatchType). + Resource("baselineadminnetworkpolicies"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *baselineAdminNetworkPolicies) ApplyStatus(ctx context.Context, baselineAdminNetworkPolicy *apisv1alpha1.BaselineAdminNetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) { + if baselineAdminNetworkPolicy == nil { + return nil, fmt.Errorf("baselineAdminNetworkPolicy provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(baselineAdminNetworkPolicy) + if err != nil { + return nil, err + } + + name := baselineAdminNetworkPolicy.Name + if name == nil { + return nil, fmt.Errorf("baselineAdminNetworkPolicy.Name must be provided to Apply") + } + + result = &v1alpha1.BaselineAdminNetworkPolicy{} + err = c.client.Patch(types.ApplyPatchType). + Resource("baselineadminnetworkpolicies"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_adminnetworkpolicy.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_adminnetworkpolicy.go index 279da0698b..fc829128a2 100644 --- a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_adminnetworkpolicy.go +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_adminnetworkpolicy.go @@ -20,6 +20,8 @@ package fake import ( "context" + json "encoding/json" + "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -27,6 +29,7 @@ import ( watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" v1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" + apisv1alpha1 "sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1" ) // FakeAdminNetworkPolicies implements AdminNetworkPolicyInterface @@ -130,3 +133,46 @@ func (c *FakeAdminNetworkPolicies) Patch(ctx context.Context, name string, pt ty } return obj.(*v1alpha1.AdminNetworkPolicy), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied adminNetworkPolicy. +func (c *FakeAdminNetworkPolicies) Apply(ctx context.Context, adminNetworkPolicy *apisv1alpha1.AdminNetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.AdminNetworkPolicy, err error) { + if adminNetworkPolicy == nil { + return nil, fmt.Errorf("adminNetworkPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(adminNetworkPolicy) + if err != nil { + return nil, err + } + name := adminNetworkPolicy.Name + if name == nil { + return nil, fmt.Errorf("adminNetworkPolicy.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(adminnetworkpoliciesResource, *name, types.ApplyPatchType, data), &v1alpha1.AdminNetworkPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.AdminNetworkPolicy), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeAdminNetworkPolicies) ApplyStatus(ctx context.Context, adminNetworkPolicy *apisv1alpha1.AdminNetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.AdminNetworkPolicy, err error) { + if adminNetworkPolicy == nil { + return nil, fmt.Errorf("adminNetworkPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(adminNetworkPolicy) + if err != nil { + return nil, err + } + name := adminNetworkPolicy.Name + if name == nil { + return nil, fmt.Errorf("adminNetworkPolicy.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(adminnetworkpoliciesResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.AdminNetworkPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.AdminNetworkPolicy), err +} diff --git a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_baselineadminnetworkpolicy.go b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_baselineadminnetworkpolicy.go index 9e94316053..a50e256574 100644 --- a/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_baselineadminnetworkpolicy.go +++ b/go-controller/vendor/sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_baselineadminnetworkpolicy.go @@ -20,6 +20,8 @@ package fake import ( "context" + json "encoding/json" + "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -27,6 +29,7 @@ import ( watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" v1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" + apisv1alpha1 "sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/apis/v1alpha1" ) // FakeBaselineAdminNetworkPolicies implements BaselineAdminNetworkPolicyInterface @@ -130,3 +133,46 @@ func (c *FakeBaselineAdminNetworkPolicies) Patch(ctx context.Context, name strin } return obj.(*v1alpha1.BaselineAdminNetworkPolicy), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied baselineAdminNetworkPolicy. +func (c *FakeBaselineAdminNetworkPolicies) Apply(ctx context.Context, baselineAdminNetworkPolicy *apisv1alpha1.BaselineAdminNetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) { + if baselineAdminNetworkPolicy == nil { + return nil, fmt.Errorf("baselineAdminNetworkPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(baselineAdminNetworkPolicy) + if err != nil { + return nil, err + } + name := baselineAdminNetworkPolicy.Name + if name == nil { + return nil, fmt.Errorf("baselineAdminNetworkPolicy.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(baselineadminnetworkpoliciesResource, *name, types.ApplyPatchType, data), &v1alpha1.BaselineAdminNetworkPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BaselineAdminNetworkPolicy), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeBaselineAdminNetworkPolicies) ApplyStatus(ctx context.Context, baselineAdminNetworkPolicy *apisv1alpha1.BaselineAdminNetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) { + if baselineAdminNetworkPolicy == nil { + return nil, fmt.Errorf("baselineAdminNetworkPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(baselineAdminNetworkPolicy) + if err != nil { + return nil, err + } + name := baselineAdminNetworkPolicy.Name + if name == nil { + return nil, fmt.Errorf("baselineAdminNetworkPolicy.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(baselineadminnetworkpoliciesResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.BaselineAdminNetworkPolicy{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BaselineAdminNetworkPolicy), err +}