From d76b81149e743e7ef46a3bf618b1afb1dca8fde7 Mon Sep 17 00:00:00 2001 From: Surya Seetharaman Date: Tue, 22 Oct 2024 08:04:33 +0200 Subject: [PATCH] Bump to 1.31.1 kube Signed-off-by: Surya Seetharaman --- apis/v1alpha1/shared_types.go | 5 +- ...etworking.k8s.io_adminnetworkpolicies.yaml | 74 +------ ...g.k8s.io_baselineadminnetworkpolicies.yaml | 65 +----- ...etworking.k8s.io_adminnetworkpolicies.yaml | 49 +---- ...g.k8s.io_baselineadminnetworkpolicies.yaml | 47 +---- go.mod | 58 +++--- go.sum | 143 +++++++------ .../apis/v1alpha1/adminnetworkpolicy.go | 10 +- .../v1alpha1/adminnetworkpolicyegresspeer.go | 4 +- .../v1alpha1/adminnetworkpolicyegressrule.go | 4 +- .../v1alpha1/adminnetworkpolicyingresspeer.go | 4 +- .../v1alpha1/adminnetworkpolicyingressrule.go | 4 +- .../apis/v1alpha1/adminnetworkpolicyport.go | 4 +- .../apis/v1alpha1/adminnetworkpolicyspec.go | 4 +- .../apis/v1alpha1/adminnetworkpolicystatus.go | 4 +- .../v1alpha1/adminnetworkpolicysubject.go | 4 +- .../v1alpha1/baselineadminnetworkpolicy.go | 10 +- .../baselineadminnetworkpolicyegresspeer.go | 4 +- .../baselineadminnetworkpolicyegressrule.go | 4 +- .../baselineadminnetworkpolicyingressrule.go | 4 +- .../baselineadminnetworkpolicyspec.go | 4 +- .../baselineadminnetworkpolicystatus.go | 4 +- .../apis/v1alpha1/namespacedpod.go | 4 +- .../applyconfiguration/apis/v1alpha1/port.go | 4 +- .../apis/v1alpha1/portrange.go | 4 +- pkg/client/applyconfiguration/utils.go | 7 + .../versioned/fake/clientset_generated.go | 39 +++- .../typed/apis/v1alpha1/adminnetworkpolicy.go | 192 +----------------- .../v1alpha1/baselineadminnetworkpolicy.go | 192 +----------------- .../v1alpha1/fake/fake_adminnetworkpolicy.go | 46 +++-- .../fake/fake_baselineadminnetworkpolicy.go | 46 +++-- .../apis/v1alpha1/adminnetworkpolicy.go | 26 +-- .../v1alpha1/baselineadminnetworkpolicy.go | 26 +-- 33 files changed, 312 insertions(+), 787 deletions(-) diff --git a/apis/v1alpha1/shared_types.go b/apis/v1alpha1/shared_types.go index 9f231221..078a9fa2 100644 --- a/apis/v1alpha1/shared_types.go +++ b/apis/v1alpha1/shared_types.go @@ -77,6 +77,7 @@ type AdminNetworkPolicyPort struct { type Port struct { // Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must // match. If not specified, this field defaults to TCP. + // +kubebuilder:default=TCP // // Support: Core // @@ -96,6 +97,7 @@ type Port struct { type PortRange struct { // Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must // match. If not specified, this field defaults to TCP. + // +kubebuilder:default=TCP // // Support: Core // @@ -145,8 +147,7 @@ type AdminNetworkPolicyIngressPeer struct { } // 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. +// +kubebuilder:validation:XValidation:rule="isCIDR(self)",message="Invalid CIDR format provided" // +kubebuilder:validation:XValidation:rule="self.contains(':') != self.contains('.')",message="CIDR must be either an IPv4 or IPv6 address. IPv4 address embedded in IPv6 addresses are not supported" // +kubebuilder:validation:MaxLength=43 type CIDR string diff --git a/config/crd/experimental/policy.networking.k8s.io_adminnetworkpolicies.yaml b/config/crd/experimental/policy.networking.k8s.io_adminnetworkpolicies.yaml index 09e98b5c..edca3fb9 100644 --- a/config/crd/experimental/policy.networking.k8s.io_adminnetworkpolicies.yaml +++ b/config/crd/experimental/policy.networking.k8s.io_adminnetworkpolicies.yaml @@ -62,7 +62,6 @@ spec: would take the highest precedence. ANPs with no egress rules do not affect egress traffic. - Support: Core items: description: |- @@ -82,7 +81,6 @@ spec: If the pod is not selected by any NetworkPolicies then execution is passed to any BaselineAdminNetworkPolicies that select the pod. - Support: Core enum: - Allow @@ -96,7 +94,6 @@ spec: improve observability, readability and error-reporting for any applied AdminNetworkPolicies. - Support: Core maxLength: 100 type: string @@ -106,7 +103,6 @@ spec: 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. - Support: Core items: description: |- @@ -119,24 +115,20 @@ spec: description: |- NamedPort selects a port on a pod(s) based on name. - Support: Extended - type: string portNumber: description: |- Port selects a port on a pod(s) based on number. - Support: Core properties: port: description: |- Number defines a network port value. - Support: Core format: int32 maximum: 65535 @@ -148,7 +140,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string required: @@ -160,7 +151,6 @@ spec: PortRange selects a port range on a pod(s) based on provided start and end values. - Support: Core properties: end: @@ -168,7 +158,6 @@ spec: End defines a network port that is the end of a port range, the End value must be greater than Start. - Support: Core format: int32 maximum: 65535 @@ -180,7 +169,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string start: @@ -188,7 +176,6 @@ spec: Start defines a network port that is the start of a port range, the Start value must be less than End. - Support: Core format: int32 maximum: 65535 @@ -209,7 +196,6 @@ spec: traffic then the specified action is applied. This field must be defined and contain at least one item. - Support: Core items: description: |- @@ -224,33 +210,26 @@ spec: description: |- DomainNames provides a way to specify domain names as peers. - DomainNames is only supported for ALLOW rules. In order to control access, DomainNames ALLOW rules should be used with a lower priority egress deny -- this allows the admin to maintain an explicit "allowlist" of reachable domains. - DomainNames can have up to 25 domain names specified in one rule. - Support: Extended - items: description: |- DomainName describes one or more domain names to be used as a peer. - DomainName can be an exact match, or use the wildcard specifier '*' to match one or more labels. - '*', the wildcard specifier, matches one or more entire labels. It does not support partial matches. '*' may only be specified as a prefix. - Examples: - `kubernetes.io` matches only `kubernetes.io`. It does not match "www.kubernetes.io", "blog.kubernetes.io", @@ -272,7 +251,6 @@ spec: Namespaces defines a way to select all pods within a set of Namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: matchExpressions: @@ -328,26 +306,22 @@ spec: or deny all IPv4 pod-to-pod traffic as well. If you don't want that, add a rule that Passes all pod traffic before the Networks rule. - Each item in Networks should be provided in the CIDR format and should be IPv4 or IPv6, for example "10.0.0.0/8" or "fd00::/8". - Networks can have upto 25 CIDRs specified. - Support: Extended - items: - description: |- - 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. + description: CIDR is an IP address range in CIDR notation + (for example, "10.0.0.0/8" or "fd00::/8"). maxLength: 43 type: string x-kubernetes-validations: + - message: Invalid CIDR format provided + rule: isCIDR(self) - message: CIDR must be either an IPv4 or IPv6 address. IPv4 address embedded in IPv6 addresses are not supported @@ -362,10 +336,8 @@ spec: the cluster. This field follows standard label selector semantics; if present but empty, it selects all Nodes. - Support: Extended - properties: matchExpressions: @@ -417,7 +389,6 @@ spec: a set of namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: namespaceSelector: @@ -547,7 +518,6 @@ spec: would take the highest precedence. ANPs with no ingress rules do not affect ingress traffic. - Support: Core items: description: |- @@ -566,7 +536,6 @@ spec: If the pod is not selected by any NetworkPolicies then execution is passed to any BaselineAdminNetworkPolicies that select the pod. - Support: Core enum: - Allow @@ -580,7 +549,6 @@ spec: traffic then the specified action is applied. This field must be defined and contain at least one item. - Support: Core items: description: |- @@ -596,7 +564,6 @@ spec: Namespaces defines a way to select all pods within a set of Namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: matchExpressions: @@ -648,7 +615,6 @@ spec: a set of namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: namespaceSelector: @@ -764,7 +730,6 @@ spec: improve observability, readability and error-reporting for any applied AdminNetworkPolicies. - Support: Core maxLength: 100 type: string @@ -776,7 +741,6 @@ spec: So it matches on the destination port for the ingress traffic. If Ports is not set then the rule does not filter traffic via port. - Support: Core items: description: |- @@ -789,24 +753,20 @@ spec: description: |- NamedPort selects a port on a pod(s) based on name. - Support: Extended - type: string portNumber: description: |- Port selects a port on a pod(s) based on number. - Support: Core properties: port: description: |- Number defines a network port value. - Support: Core format: int32 maximum: 65535 @@ -818,7 +778,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string required: @@ -830,7 +789,6 @@ spec: PortRange selects a port range on a pod(s) based on provided start and end values. - Support: Core properties: end: @@ -838,7 +796,6 @@ spec: End defines a network port that is the end of a port range, the End value must be greater than Start. - Support: Core format: int32 maximum: 65535 @@ -850,7 +807,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string start: @@ -858,7 +814,6 @@ spec: Start defines a network port that is the start of a port range, the Start value must be less than End. - Support: Core format: int32 maximum: 65535 @@ -889,7 +844,6 @@ spec: implementation can apply any of the matching policies to the connection, and there is no way for the user to reliably determine which one it will choose. - Support: Core format: int32 maximum: 1000 @@ -900,7 +854,6 @@ spec: Subject defines the pods to which this AdminNetworkPolicy applies. Note that host-networked pods are not included in subject selection. - Support: Core maxProperties: 1 minProperties: 1 @@ -1065,16 +1018,8 @@ spec: properties: conditions: items: - description: "Condition contains details for one aspect of the current - state of this API Resource.\n---\nThis struct is intended for - direct use as an array at the field path .status.conditions. For - example,\n\n\n\ttype FooStatus struct{\n\t // Represents the - observations of a foo's current state.\n\t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t - \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" - patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: description: |- @@ -1115,12 +1060,7 @@ spec: - Unknown type: string type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: type of condition in CamelCase or in foo.example.com/CamelCase. maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string diff --git a/config/crd/experimental/policy.networking.k8s.io_baselineadminnetworkpolicies.yaml b/config/crd/experimental/policy.networking.k8s.io_baselineadminnetworkpolicies.yaml index ccff6946..9882b571 100644 --- a/config/crd/experimental/policy.networking.k8s.io_baselineadminnetworkpolicies.yaml +++ b/config/crd/experimental/policy.networking.k8s.io_baselineadminnetworkpolicies.yaml @@ -60,7 +60,6 @@ spec: would take the highest precedence. BANPs with no egress rules do not affect egress traffic. - Support: Core items: description: |- @@ -76,7 +75,6 @@ spec: Allow: allows the selected traffic Deny: denies the selected traffic - Support: Core enum: - Allow @@ -89,7 +87,6 @@ spec: improve observability, readability and error-reporting for any applied BaselineAdminNetworkPolicies. - Support: Core maxLength: 100 type: string @@ -109,24 +106,20 @@ spec: description: |- NamedPort selects a port on a pod(s) based on name. - Support: Extended - type: string portNumber: description: |- Port selects a port on a pod(s) based on number. - Support: Core properties: port: description: |- Number defines a network port value. - Support: Core format: int32 maximum: 65535 @@ -138,7 +131,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string required: @@ -150,7 +142,6 @@ spec: PortRange selects a port range on a pod(s) based on provided start and end values. - Support: Core properties: end: @@ -158,7 +149,6 @@ spec: End defines a network port that is the end of a port range, the End value must be greater than Start. - Support: Core format: int32 maximum: 65535 @@ -170,7 +160,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string start: @@ -178,7 +167,6 @@ spec: Start defines a network port that is the start of a port range, the Start value must be less than End. - Support: Core format: int32 maximum: 65535 @@ -199,7 +187,6 @@ spec: traffic then the specified action is applied. This field must be defined and contain at least one item. - Support: Core items: description: |- @@ -215,7 +202,6 @@ spec: Namespaces defines a way to select all pods within a set of Namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: matchExpressions: @@ -271,26 +257,22 @@ spec: or deny all IPv4 pod-to-pod traffic as well. If you don't want that, add a rule that Passes all pod traffic before the Networks rule. - Each item in Networks should be provided in the CIDR format and should be IPv4 or IPv6, for example "10.0.0.0/8" or "fd00::/8". - Networks can have upto 25 CIDRs specified. - Support: Extended - items: - description: |- - 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. + description: CIDR is an IP address range in CIDR notation + (for example, "10.0.0.0/8" or "fd00::/8"). maxLength: 43 type: string x-kubernetes-validations: + - message: Invalid CIDR format provided + rule: isCIDR(self) - message: CIDR must be either an IPv4 or IPv6 address. IPv4 address embedded in IPv6 addresses are not supported @@ -305,10 +287,8 @@ spec: the cluster. This field follows standard label selector semantics; if present but empty, it selects all Nodes. - Support: Extended - properties: matchExpressions: @@ -360,7 +340,6 @@ spec: a set of namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: namespaceSelector: @@ -491,7 +470,6 @@ spec: would take the highest precedence. BANPs with no ingress rules do not affect ingress traffic. - Support: Core items: description: |- @@ -506,7 +484,6 @@ spec: Allow: allows the selected traffic Deny: denies the selected traffic - Support: Core enum: - Allow @@ -519,7 +496,6 @@ spec: traffic then the specified action is applied. This field must be defined and contain at least one item. - Support: Core items: description: |- @@ -535,7 +511,6 @@ spec: Namespaces defines a way to select all pods within a set of Namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: matchExpressions: @@ -587,7 +562,6 @@ spec: a set of namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: namespaceSelector: @@ -703,7 +677,6 @@ spec: improve observability, readability and error-reporting for any applied BaselineAdminNetworkPolicies. - Support: Core maxLength: 100 type: string @@ -715,7 +688,6 @@ spec: So it matches on the destination port for the ingress traffic. If Ports is not set then the rule does not filter traffic via port. - Support: Core items: description: |- @@ -728,24 +700,20 @@ spec: description: |- NamedPort selects a port on a pod(s) based on name. - Support: Extended - type: string portNumber: description: |- Port selects a port on a pod(s) based on number. - Support: Core properties: port: description: |- Number defines a network port value. - Support: Core format: int32 maximum: 65535 @@ -757,7 +725,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string required: @@ -769,7 +736,6 @@ spec: PortRange selects a port range on a pod(s) based on provided start and end values. - Support: Core properties: end: @@ -777,7 +743,6 @@ spec: End defines a network port that is the end of a port range, the End value must be greater than Start. - Support: Core format: int32 maximum: 65535 @@ -789,7 +754,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string start: @@ -797,7 +761,6 @@ spec: Start defines a network port that is the start of a port range, the Start value must be less than End. - Support: Core format: int32 maximum: 65535 @@ -822,7 +785,6 @@ spec: Subject defines the pods to which this BaselineAdminNetworkPolicy applies. Note that host-networked pods are not included in subject selection. - Support: Core maxProperties: 1 minProperties: 1 @@ -986,16 +948,8 @@ spec: properties: conditions: items: - description: "Condition contains details for one aspect of the current - state of this API Resource.\n---\nThis struct is intended for - direct use as an array at the field path .status.conditions. For - example,\n\n\n\ttype FooStatus struct{\n\t // Represents the - observations of a foo's current state.\n\t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t - \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" - patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: description: |- @@ -1036,12 +990,7 @@ spec: - Unknown type: string type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: type of condition in CamelCase or in foo.example.com/CamelCase. maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string diff --git a/config/crd/standard/policy.networking.k8s.io_adminnetworkpolicies.yaml b/config/crd/standard/policy.networking.k8s.io_adminnetworkpolicies.yaml index f2b08247..aa7425b1 100644 --- a/config/crd/standard/policy.networking.k8s.io_adminnetworkpolicies.yaml +++ b/config/crd/standard/policy.networking.k8s.io_adminnetworkpolicies.yaml @@ -62,7 +62,6 @@ spec: would take the highest precedence. ANPs with no egress rules do not affect egress traffic. - Support: Core items: description: |- @@ -82,7 +81,6 @@ spec: If the pod is not selected by any NetworkPolicies then execution is passed to any BaselineAdminNetworkPolicies that select the pod. - Support: Core enum: - Allow @@ -96,7 +94,6 @@ spec: improve observability, readability and error-reporting for any applied AdminNetworkPolicies. - Support: Core maxLength: 100 type: string @@ -106,7 +103,6 @@ spec: 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. - Support: Core items: description: |- @@ -119,14 +115,12 @@ spec: description: |- Port selects a port on a pod(s) based on number. - Support: Core properties: port: description: |- Number defines a network port value. - Support: Core format: int32 maximum: 65535 @@ -138,7 +132,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string required: @@ -150,7 +143,6 @@ spec: PortRange selects a port range on a pod(s) based on provided start and end values. - Support: Core properties: end: @@ -158,7 +150,6 @@ spec: End defines a network port that is the end of a port range, the End value must be greater than Start. - Support: Core format: int32 maximum: 65535 @@ -170,7 +161,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string start: @@ -178,7 +168,6 @@ spec: Start defines a network port that is the start of a port range, the Start value must be less than End. - Support: Core format: int32 maximum: 65535 @@ -199,7 +188,6 @@ spec: traffic then the specified action is applied. This field must be defined and contain at least one item. - Support: Core items: description: |- @@ -215,7 +203,6 @@ spec: Namespaces defines a way to select all pods within a set of Namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: matchExpressions: @@ -267,7 +254,6 @@ spec: a set of namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: namespaceSelector: @@ -392,7 +378,6 @@ spec: would take the highest precedence. ANPs with no ingress rules do not affect ingress traffic. - Support: Core items: description: |- @@ -411,7 +396,6 @@ spec: If the pod is not selected by any NetworkPolicies then execution is passed to any BaselineAdminNetworkPolicies that select the pod. - Support: Core enum: - Allow @@ -425,7 +409,6 @@ spec: traffic then the specified action is applied. This field must be defined and contain at least one item. - Support: Core items: description: |- @@ -441,7 +424,6 @@ spec: Namespaces defines a way to select all pods within a set of Namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: matchExpressions: @@ -493,7 +475,6 @@ spec: a set of namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: namespaceSelector: @@ -609,7 +590,6 @@ spec: improve observability, readability and error-reporting for any applied AdminNetworkPolicies. - Support: Core maxLength: 100 type: string @@ -621,7 +601,6 @@ spec: So it matches on the destination port for the ingress traffic. If Ports is not set then the rule does not filter traffic via port. - Support: Core items: description: |- @@ -634,14 +613,12 @@ spec: description: |- Port selects a port on a pod(s) based on number. - Support: Core properties: port: description: |- Number defines a network port value. - Support: Core format: int32 maximum: 65535 @@ -653,7 +630,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string required: @@ -665,7 +641,6 @@ spec: PortRange selects a port range on a pod(s) based on provided start and end values. - Support: Core properties: end: @@ -673,7 +648,6 @@ spec: End defines a network port that is the end of a port range, the End value must be greater than Start. - Support: Core format: int32 maximum: 65535 @@ -685,7 +659,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string start: @@ -693,7 +666,6 @@ spec: Start defines a network port that is the start of a port range, the Start value must be less than End. - Support: Core format: int32 maximum: 65535 @@ -724,7 +696,6 @@ spec: implementation can apply any of the matching policies to the connection, and there is no way for the user to reliably determine which one it will choose. - Support: Core format: int32 maximum: 1000 @@ -735,7 +706,6 @@ spec: Subject defines the pods to which this AdminNetworkPolicy applies. Note that host-networked pods are not included in subject selection. - Support: Core maxProperties: 1 minProperties: 1 @@ -900,16 +870,8 @@ spec: properties: conditions: items: - description: "Condition contains details for one aspect of the current - state of this API Resource.\n---\nThis struct is intended for - direct use as an array at the field path .status.conditions. For - example,\n\n\n\ttype FooStatus struct{\n\t // Represents the - observations of a foo's current state.\n\t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t - \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" - patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: description: |- @@ -950,12 +912,7 @@ spec: - Unknown type: string type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: type of condition in CamelCase or in foo.example.com/CamelCase. maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string diff --git a/config/crd/standard/policy.networking.k8s.io_baselineadminnetworkpolicies.yaml b/config/crd/standard/policy.networking.k8s.io_baselineadminnetworkpolicies.yaml index fafbff4a..fd5ed29f 100644 --- a/config/crd/standard/policy.networking.k8s.io_baselineadminnetworkpolicies.yaml +++ b/config/crd/standard/policy.networking.k8s.io_baselineadminnetworkpolicies.yaml @@ -60,7 +60,6 @@ spec: would take the highest precedence. BANPs with no egress rules do not affect egress traffic. - Support: Core items: description: |- @@ -76,7 +75,6 @@ spec: Allow: allows the selected traffic Deny: denies the selected traffic - Support: Core enum: - Allow @@ -89,7 +87,6 @@ spec: improve observability, readability and error-reporting for any applied BaselineAdminNetworkPolicies. - Support: Core maxLength: 100 type: string @@ -109,14 +106,12 @@ spec: description: |- Port selects a port on a pod(s) based on number. - Support: Core properties: port: description: |- Number defines a network port value. - Support: Core format: int32 maximum: 65535 @@ -128,7 +123,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string required: @@ -140,7 +134,6 @@ spec: PortRange selects a port range on a pod(s) based on provided start and end values. - Support: Core properties: end: @@ -148,7 +141,6 @@ spec: End defines a network port that is the end of a port range, the End value must be greater than Start. - Support: Core format: int32 maximum: 65535 @@ -160,7 +152,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string start: @@ -168,7 +159,6 @@ spec: Start defines a network port that is the start of a port range, the Start value must be less than End. - Support: Core format: int32 maximum: 65535 @@ -189,7 +179,6 @@ spec: traffic then the specified action is applied. This field must be defined and contain at least one item. - Support: Core items: description: |- @@ -205,7 +194,6 @@ spec: Namespaces defines a way to select all pods within a set of Namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: matchExpressions: @@ -257,7 +245,6 @@ spec: a set of namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: namespaceSelector: @@ -383,7 +370,6 @@ spec: would take the highest precedence. BANPs with no ingress rules do not affect ingress traffic. - Support: Core items: description: |- @@ -398,7 +384,6 @@ spec: Allow: allows the selected traffic Deny: denies the selected traffic - Support: Core enum: - Allow @@ -411,7 +396,6 @@ spec: traffic then the specified action is applied. This field must be defined and contain at least one item. - Support: Core items: description: |- @@ -427,7 +411,6 @@ spec: Namespaces defines a way to select all pods within a set of Namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: matchExpressions: @@ -479,7 +462,6 @@ spec: a set of namespaces. Note that host-networked pods are not included in this type of peer. - Support: Core properties: namespaceSelector: @@ -595,7 +577,6 @@ spec: improve observability, readability and error-reporting for any applied BaselineAdminNetworkPolicies. - Support: Core maxLength: 100 type: string @@ -607,7 +588,6 @@ spec: So it matches on the destination port for the ingress traffic. If Ports is not set then the rule does not filter traffic via port. - Support: Core items: description: |- @@ -620,14 +600,12 @@ spec: description: |- Port selects a port on a pod(s) based on number. - Support: Core properties: port: description: |- Number defines a network port value. - Support: Core format: int32 maximum: 65535 @@ -639,7 +617,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string required: @@ -651,7 +628,6 @@ spec: PortRange selects a port range on a pod(s) based on provided start and end values. - Support: Core properties: end: @@ -659,7 +635,6 @@ spec: End defines a network port that is the end of a port range, the End value must be greater than Start. - Support: Core format: int32 maximum: 65535 @@ -671,7 +646,6 @@ spec: Protocol is the network protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. - Support: Core type: string start: @@ -679,7 +653,6 @@ spec: Start defines a network port that is the start of a port range, the Start value must be less than End. - Support: Core format: int32 maximum: 65535 @@ -704,7 +677,6 @@ spec: Subject defines the pods to which this BaselineAdminNetworkPolicy applies. Note that host-networked pods are not included in subject selection. - Support: Core maxProperties: 1 minProperties: 1 @@ -868,16 +840,8 @@ spec: properties: conditions: items: - description: "Condition contains details for one aspect of the current - state of this API Resource.\n---\nThis struct is intended for - direct use as an array at the field path .status.conditions. For - example,\n\n\n\ttype FooStatus struct{\n\t // Represents the - observations of a foo's current state.\n\t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t - \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" - patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: description: |- @@ -918,12 +882,7 @@ spec: - Unknown type: string type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: type of condition in CamelCase or in foo.example.com/CamelCase. maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string diff --git a/go.mod b/go.mod index 6fdda6b1..d471697f 100644 --- a/go.mod +++ b/go.mod @@ -4,36 +4,37 @@ go 1.22.0 require ( github.com/ahmetb/gen-crd-api-reference-docs v0.3.0 - github.com/stretchr/testify v1.8.4 - k8s.io/api v0.30.1 - k8s.io/apiextensions-apiserver v0.30.1 - k8s.io/apimachinery v0.30.1 - k8s.io/client-go v0.30.1 - k8s.io/code-generator v0.30.1 - k8s.io/utils v0.0.0-20230726121419-3b25d923346b + github.com/stretchr/testify v1.9.0 + k8s.io/api v0.31.1 + k8s.io/apiextensions-apiserver v0.31.1 + k8s.io/apimachinery v0.31.1 + k8s.io/client-go v0.31.1 + k8s.io/code-generator v0.31.1 + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 sigs.k8s.io/controller-runtime v0.18.4 - sigs.k8s.io/controller-tools v0.15.0 + sigs.k8s.io/controller-tools v0.16.4 sigs.k8s.io/structured-merge-diff/v4 v4.4.1 sigs.k8s.io/yaml v1.4.0 ) require ( - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect - github.com/fatih/color v1.16.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/fatih/color v1.17.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.22.3 // indirect - github.com/gobuffalo/flect v1.0.2 // indirect + github.com/go-openapi/swag v0.22.4 // indirect + github.com/gobuffalo/flect v1.0.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/imdario/mergo v0.3.6 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -42,34 +43,35 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/moby/spdystream v0.2.0 // indirect + github.com/moby/spdystream v0.4.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/spf13/cobra v1.8.0 // indirect + github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.24.0 // indirect - golang.org/x/oauth2 v0.12.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/term v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect + github.com/x448/float16 v0.8.4 // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.20.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.33.0 // indirect + golang.org/x/tools v0.26.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 // indirect k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect k8s.io/klog v0.2.0 // indirect - k8s.io/klog/v2 v2.120.1 // indirect + k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect ) diff --git a/go.sum b/go.sum index 118c3d87..e5c142b0 100644 --- a/go.sum +++ b/go.sum @@ -2,11 +2,12 @@ github.com/ahmetb/gen-crd-api-reference-docs v0.3.0 h1:+XfOU14S4bGuwyvCijJwhhBIj github.com/ahmetb/gen-crd-api-reference-docs v0.3.0/go.mod h1:TdjdkYhlOifCQWPs1UdTma97kQQMozf5h26hTuG70u8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= @@ -15,26 +16,33 @@ github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0 github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA= github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= +github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4= +github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= @@ -47,11 +55,10 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= @@ -79,8 +86,8 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8= +github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -94,23 +101,25 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= -github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= -github.com/onsi/gomega v1.33.0 h1:snPCflnZrpMsy94p4lXVEkHo12lmPnc3vY5XBbreexE= -github.com/onsi/gomega v1.33.0/go.mod h1:+925n5YtiFsLzzafLUHzVMBpvvRAzrydIBiSIxjX3wY= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= +github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -120,8 +129,10 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -131,40 +142,50 @@ go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA= -golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= +golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU= +golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= -golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= -golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -172,20 +193,22 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= -golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= @@ -196,16 +219,16 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.30.1 h1:kCm/6mADMdbAxmIh0LBjS54nQBE+U4KmbCfIkF5CpJY= -k8s.io/api v0.30.1/go.mod h1:ddbN2C0+0DIiPntan/bye3SW3PdwLa11/0yqwvuRrJM= -k8s.io/apiextensions-apiserver v0.30.1 h1:4fAJZ9985BmpJG6PkoxVRpXv9vmPUOVzl614xarePws= -k8s.io/apiextensions-apiserver v0.30.1/go.mod h1:R4GuSrlhgq43oRY9sF2IToFh7PVlF1JjfWdoG3pixk4= -k8s.io/apimachinery v0.30.1 h1:ZQStsEfo4n65yAdlGTfP/uSHMQSoYzU/oeEbkmF7P2U= -k8s.io/apimachinery v0.30.1/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/client-go v0.30.1 h1:uC/Ir6A3R46wdkgCV3vbLyNOYyCJ8oZnjtJGKfytl/Q= -k8s.io/client-go v0.30.1/go.mod h1:wrAqLNs2trwiCH/wxxmT/x3hKVH9PuV0GGW0oDoHVqc= -k8s.io/code-generator v0.30.1 h1:ZsG++q5Vt0ScmKCeLhynUuWgcwFGg1Hl1AGfatqPJBI= -k8s.io/code-generator v0.30.1/go.mod h1:hFgxRsvOUg79mbpbVKfjJvRhVz1qLoe40yZDJ/hwRH4= +k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU= +k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI= +k8s.io/apiextensions-apiserver v0.31.1 h1:L+hwULvXx+nvTYX/MKM3kKMZyei+UiSXQWciX/N6E40= +k8s.io/apiextensions-apiserver v0.31.1/go.mod h1:tWMPR3sgW+jsl2xm9v7lAyRF1rYEK71i9G5dRtkknoQ= +k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= +k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0= +k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg= +k8s.io/code-generator v0.31.1 h1:GvkRZEP2g2UnB2QKT2Dgc/kYxIkDxCHENv2Q1itioVs= +k8s.io/code-generator v0.31.1/go.mod h1:oL2ky46L48osNqqZAeOcWWy0S5BXj50vVdwOtTefqIs= k8s.io/gengo v0.0.0-20201203183100-97869a43a9d9/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks= k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= @@ -214,16 +237,18 @@ k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0 k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c= k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= -k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw= sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= sigs.k8s.io/controller-tools v0.15.0 h1:4dxdABXGDhIa68Fiwaif0vcu32xfwmgQ+w8p+5CxoAI= sigs.k8s.io/controller-tools v0.15.0/go.mod h1:8zUSS2T8Hx0APCNRhJWbS3CAQEbIxLa07khzh7pZmXM= +sigs.k8s.io/controller-tools v0.16.4 h1:VXmar78eDXbx1by/H09ikEq1hiq3bqInxuV3lMr3GmQ= +sigs.k8s.io/controller-tools v0.16.4/go.mod h1:kcsZyYMXiOFuBhofSPtkB90zTSxVRxVVyvtKQcx3q1A= 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/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicy.go b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicy.go index 514a286e..84dc33e1 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicy.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicy.go @@ -24,7 +24,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// AdminNetworkPolicyApplyConfiguration represents an declarative configuration of the AdminNetworkPolicy type for use +// AdminNetworkPolicyApplyConfiguration represents a declarative configuration of the AdminNetworkPolicy type for use // with apply. type AdminNetworkPolicyApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -33,7 +33,7 @@ type AdminNetworkPolicyApplyConfiguration struct { Status *AdminNetworkPolicyStatusApplyConfiguration `json:"status,omitempty"` } -// AdminNetworkPolicy constructs an declarative configuration of the AdminNetworkPolicy type for use with +// AdminNetworkPolicy constructs a declarative configuration of the AdminNetworkPolicy type for use with // apply. func AdminNetworkPolicy(name string) *AdminNetworkPolicyApplyConfiguration { b := &AdminNetworkPolicyApplyConfiguration{} @@ -216,3 +216,9 @@ func (b *AdminNetworkPolicyApplyConfiguration) WithStatus(value *AdminNetworkPol b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *AdminNetworkPolicyApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegresspeer.go b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegresspeer.go index 307a610c..ff3f353c 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegresspeer.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegresspeer.go @@ -23,7 +23,7 @@ import ( apisv1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" ) -// AdminNetworkPolicyEgressPeerApplyConfiguration represents an declarative configuration of the AdminNetworkPolicyEgressPeer type for use +// AdminNetworkPolicyEgressPeerApplyConfiguration represents a declarative configuration of the AdminNetworkPolicyEgressPeer type for use // with apply. type AdminNetworkPolicyEgressPeerApplyConfiguration struct { Namespaces *v1.LabelSelectorApplyConfiguration `json:"namespaces,omitempty"` @@ -33,7 +33,7 @@ type AdminNetworkPolicyEgressPeerApplyConfiguration struct { DomainNames []apisv1alpha1.DomainName `json:"domainNames,omitempty"` } -// AdminNetworkPolicyEgressPeerApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicyEgressPeer type for use with +// AdminNetworkPolicyEgressPeerApplyConfiguration constructs a declarative configuration of the AdminNetworkPolicyEgressPeer type for use with // apply. func AdminNetworkPolicyEgressPeer() *AdminNetworkPolicyEgressPeerApplyConfiguration { return &AdminNetworkPolicyEgressPeerApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegressrule.go b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegressrule.go index 10806caf..f4fefc51 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegressrule.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyegressrule.go @@ -22,7 +22,7 @@ import ( v1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" ) -// AdminNetworkPolicyEgressRuleApplyConfiguration represents an declarative configuration of the AdminNetworkPolicyEgressRule type for use +// AdminNetworkPolicyEgressRuleApplyConfiguration represents a declarative configuration of the AdminNetworkPolicyEgressRule type for use // with apply. type AdminNetworkPolicyEgressRuleApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -31,7 +31,7 @@ type AdminNetworkPolicyEgressRuleApplyConfiguration struct { Ports *[]AdminNetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` } -// AdminNetworkPolicyEgressRuleApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicyEgressRule type for use with +// AdminNetworkPolicyEgressRuleApplyConfiguration constructs a declarative configuration of the AdminNetworkPolicyEgressRule type for use with // apply. func AdminNetworkPolicyEgressRule() *AdminNetworkPolicyEgressRuleApplyConfiguration { return &AdminNetworkPolicyEgressRuleApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingresspeer.go b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingresspeer.go index 45fe8007..991c84d6 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingresspeer.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingresspeer.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// AdminNetworkPolicyIngressPeerApplyConfiguration represents an declarative configuration of the AdminNetworkPolicyIngressPeer type for use +// AdminNetworkPolicyIngressPeerApplyConfiguration represents a declarative configuration of the AdminNetworkPolicyIngressPeer type for use // with apply. type AdminNetworkPolicyIngressPeerApplyConfiguration struct { Namespaces *v1.LabelSelectorApplyConfiguration `json:"namespaces,omitempty"` Pods *NamespacedPodApplyConfiguration `json:"pods,omitempty"` } -// AdminNetworkPolicyIngressPeerApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicyIngressPeer type for use with +// AdminNetworkPolicyIngressPeerApplyConfiguration constructs a declarative configuration of the AdminNetworkPolicyIngressPeer type for use with // apply. func AdminNetworkPolicyIngressPeer() *AdminNetworkPolicyIngressPeerApplyConfiguration { return &AdminNetworkPolicyIngressPeerApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingressrule.go b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingressrule.go index cc31fb1d..e339007a 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingressrule.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyingressrule.go @@ -22,7 +22,7 @@ import ( v1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" ) -// AdminNetworkPolicyIngressRuleApplyConfiguration represents an declarative configuration of the AdminNetworkPolicyIngressRule type for use +// AdminNetworkPolicyIngressRuleApplyConfiguration represents a declarative configuration of the AdminNetworkPolicyIngressRule type for use // with apply. type AdminNetworkPolicyIngressRuleApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -31,7 +31,7 @@ type AdminNetworkPolicyIngressRuleApplyConfiguration struct { Ports *[]AdminNetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` } -// AdminNetworkPolicyIngressRuleApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicyIngressRule type for use with +// AdminNetworkPolicyIngressRuleApplyConfiguration constructs a declarative configuration of the AdminNetworkPolicyIngressRule type for use with // apply. func AdminNetworkPolicyIngressRule() *AdminNetworkPolicyIngressRuleApplyConfiguration { return &AdminNetworkPolicyIngressRuleApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyport.go b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyport.go index 585b0fba..ad555339 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyport.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyport.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 -// AdminNetworkPolicyPortApplyConfiguration represents an declarative configuration of the AdminNetworkPolicyPort type for use +// AdminNetworkPolicyPortApplyConfiguration represents a declarative configuration of the AdminNetworkPolicyPort type for use // with apply. type AdminNetworkPolicyPortApplyConfiguration struct { PortNumber *PortApplyConfiguration `json:"portNumber,omitempty"` @@ -26,7 +26,7 @@ type AdminNetworkPolicyPortApplyConfiguration struct { PortRange *PortRangeApplyConfiguration `json:"portRange,omitempty"` } -// AdminNetworkPolicyPortApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicyPort type for use with +// AdminNetworkPolicyPortApplyConfiguration constructs a declarative configuration of the AdminNetworkPolicyPort type for use with // apply. func AdminNetworkPolicyPort() *AdminNetworkPolicyPortApplyConfiguration { return &AdminNetworkPolicyPortApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyspec.go b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyspec.go index 314526ec..79579e2a 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyspec.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicyspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 -// AdminNetworkPolicySpecApplyConfiguration represents an declarative configuration of the AdminNetworkPolicySpec type for use +// AdminNetworkPolicySpecApplyConfiguration represents a declarative configuration of the AdminNetworkPolicySpec type for use // with apply. type AdminNetworkPolicySpecApplyConfiguration struct { Priority *int32 `json:"priority,omitempty"` @@ -27,7 +27,7 @@ type AdminNetworkPolicySpecApplyConfiguration struct { Egress []AdminNetworkPolicyEgressRuleApplyConfiguration `json:"egress,omitempty"` } -// AdminNetworkPolicySpecApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicySpec type for use with +// AdminNetworkPolicySpecApplyConfiguration constructs a declarative configuration of the AdminNetworkPolicySpec type for use with // apply. func AdminNetworkPolicySpec() *AdminNetworkPolicySpecApplyConfiguration { return &AdminNetworkPolicySpecApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicystatus.go b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicystatus.go index 0b6b6059..feb37702 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicystatus.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicystatus.go @@ -22,13 +22,13 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// AdminNetworkPolicyStatusApplyConfiguration represents an declarative configuration of the AdminNetworkPolicyStatus type for use +// AdminNetworkPolicyStatusApplyConfiguration represents a declarative configuration of the AdminNetworkPolicyStatus type for use // with apply. type AdminNetworkPolicyStatusApplyConfiguration struct { Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` } -// AdminNetworkPolicyStatusApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicyStatus type for use with +// AdminNetworkPolicyStatusApplyConfiguration constructs a declarative configuration of the AdminNetworkPolicyStatus type for use with // apply. func AdminNetworkPolicyStatus() *AdminNetworkPolicyStatusApplyConfiguration { return &AdminNetworkPolicyStatusApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicysubject.go b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicysubject.go index 52b5dbdd..8a2cda14 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicysubject.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicysubject.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// AdminNetworkPolicySubjectApplyConfiguration represents an declarative configuration of the AdminNetworkPolicySubject type for use +// AdminNetworkPolicySubjectApplyConfiguration represents a declarative configuration of the AdminNetworkPolicySubject type for use // with apply. type AdminNetworkPolicySubjectApplyConfiguration struct { Namespaces *v1.LabelSelectorApplyConfiguration `json:"namespaces,omitempty"` Pods *NamespacedPodApplyConfiguration `json:"pods,omitempty"` } -// AdminNetworkPolicySubjectApplyConfiguration constructs an declarative configuration of the AdminNetworkPolicySubject type for use with +// AdminNetworkPolicySubjectApplyConfiguration constructs a declarative configuration of the AdminNetworkPolicySubject type for use with // apply. func AdminNetworkPolicySubject() *AdminNetworkPolicySubjectApplyConfiguration { return &AdminNetworkPolicySubjectApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicy.go b/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicy.go index c94d6b08..81d1aa42 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicy.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicy.go @@ -24,7 +24,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// BaselineAdminNetworkPolicyApplyConfiguration represents an declarative configuration of the BaselineAdminNetworkPolicy type for use +// BaselineAdminNetworkPolicyApplyConfiguration represents a declarative configuration of the BaselineAdminNetworkPolicy type for use // with apply. type BaselineAdminNetworkPolicyApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -33,7 +33,7 @@ type BaselineAdminNetworkPolicyApplyConfiguration struct { Status *BaselineAdminNetworkPolicyStatusApplyConfiguration `json:"status,omitempty"` } -// BaselineAdminNetworkPolicy constructs an declarative configuration of the BaselineAdminNetworkPolicy type for use with +// BaselineAdminNetworkPolicy constructs a declarative configuration of the BaselineAdminNetworkPolicy type for use with // apply. func BaselineAdminNetworkPolicy(name string) *BaselineAdminNetworkPolicyApplyConfiguration { b := &BaselineAdminNetworkPolicyApplyConfiguration{} @@ -216,3 +216,9 @@ func (b *BaselineAdminNetworkPolicyApplyConfiguration) WithStatus(value *Baselin b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *BaselineAdminNetworkPolicyApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyegresspeer.go b/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyegresspeer.go index ea90c288..3db3286a 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyegresspeer.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyegresspeer.go @@ -23,7 +23,7 @@ import ( apisv1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" ) -// BaselineAdminNetworkPolicyEgressPeerApplyConfiguration represents an declarative configuration of the BaselineAdminNetworkPolicyEgressPeer type for use +// BaselineAdminNetworkPolicyEgressPeerApplyConfiguration represents a declarative configuration of the BaselineAdminNetworkPolicyEgressPeer type for use // with apply. type BaselineAdminNetworkPolicyEgressPeerApplyConfiguration struct { Namespaces *v1.LabelSelectorApplyConfiguration `json:"namespaces,omitempty"` @@ -32,7 +32,7 @@ type BaselineAdminNetworkPolicyEgressPeerApplyConfiguration struct { Networks []apisv1alpha1.CIDR `json:"networks,omitempty"` } -// BaselineAdminNetworkPolicyEgressPeerApplyConfiguration constructs an declarative configuration of the BaselineAdminNetworkPolicyEgressPeer type for use with +// BaselineAdminNetworkPolicyEgressPeerApplyConfiguration constructs a declarative configuration of the BaselineAdminNetworkPolicyEgressPeer type for use with // apply. func BaselineAdminNetworkPolicyEgressPeer() *BaselineAdminNetworkPolicyEgressPeerApplyConfiguration { return &BaselineAdminNetworkPolicyEgressPeerApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyegressrule.go b/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyegressrule.go index 137d56eb..f560917e 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyegressrule.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyegressrule.go @@ -22,7 +22,7 @@ import ( v1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" ) -// BaselineAdminNetworkPolicyEgressRuleApplyConfiguration represents an declarative configuration of the BaselineAdminNetworkPolicyEgressRule type for use +// BaselineAdminNetworkPolicyEgressRuleApplyConfiguration represents a declarative configuration of the BaselineAdminNetworkPolicyEgressRule type for use // with apply. type BaselineAdminNetworkPolicyEgressRuleApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -31,7 +31,7 @@ type BaselineAdminNetworkPolicyEgressRuleApplyConfiguration struct { Ports *[]AdminNetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` } -// BaselineAdminNetworkPolicyEgressRuleApplyConfiguration constructs an declarative configuration of the BaselineAdminNetworkPolicyEgressRule type for use with +// BaselineAdminNetworkPolicyEgressRuleApplyConfiguration constructs a declarative configuration of the BaselineAdminNetworkPolicyEgressRule type for use with // apply. func BaselineAdminNetworkPolicyEgressRule() *BaselineAdminNetworkPolicyEgressRuleApplyConfiguration { return &BaselineAdminNetworkPolicyEgressRuleApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyingressrule.go b/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyingressrule.go index c7d248d4..95824bca 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyingressrule.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyingressrule.go @@ -22,7 +22,7 @@ import ( v1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" ) -// BaselineAdminNetworkPolicyIngressRuleApplyConfiguration represents an declarative configuration of the BaselineAdminNetworkPolicyIngressRule type for use +// BaselineAdminNetworkPolicyIngressRuleApplyConfiguration represents a declarative configuration of the BaselineAdminNetworkPolicyIngressRule type for use // with apply. type BaselineAdminNetworkPolicyIngressRuleApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -31,7 +31,7 @@ type BaselineAdminNetworkPolicyIngressRuleApplyConfiguration struct { Ports *[]AdminNetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` } -// BaselineAdminNetworkPolicyIngressRuleApplyConfiguration constructs an declarative configuration of the BaselineAdminNetworkPolicyIngressRule type for use with +// BaselineAdminNetworkPolicyIngressRuleApplyConfiguration constructs a declarative configuration of the BaselineAdminNetworkPolicyIngressRule type for use with // apply. func BaselineAdminNetworkPolicyIngressRule() *BaselineAdminNetworkPolicyIngressRuleApplyConfiguration { return &BaselineAdminNetworkPolicyIngressRuleApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyspec.go b/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyspec.go index e0eb379f..93e40c6b 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyspec.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicyspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 -// BaselineAdminNetworkPolicySpecApplyConfiguration represents an declarative configuration of the BaselineAdminNetworkPolicySpec type for use +// BaselineAdminNetworkPolicySpecApplyConfiguration represents a declarative configuration of the BaselineAdminNetworkPolicySpec type for use // with apply. type BaselineAdminNetworkPolicySpecApplyConfiguration struct { Subject *AdminNetworkPolicySubjectApplyConfiguration `json:"subject,omitempty"` @@ -26,7 +26,7 @@ type BaselineAdminNetworkPolicySpecApplyConfiguration struct { Egress []BaselineAdminNetworkPolicyEgressRuleApplyConfiguration `json:"egress,omitempty"` } -// BaselineAdminNetworkPolicySpecApplyConfiguration constructs an declarative configuration of the BaselineAdminNetworkPolicySpec type for use with +// BaselineAdminNetworkPolicySpecApplyConfiguration constructs a declarative configuration of the BaselineAdminNetworkPolicySpec type for use with // apply. func BaselineAdminNetworkPolicySpec() *BaselineAdminNetworkPolicySpecApplyConfiguration { return &BaselineAdminNetworkPolicySpecApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicystatus.go b/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicystatus.go index c3ce53e5..f5dbe671 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicystatus.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/baselineadminnetworkpolicystatus.go @@ -22,13 +22,13 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// BaselineAdminNetworkPolicyStatusApplyConfiguration represents an declarative configuration of the BaselineAdminNetworkPolicyStatus type for use +// BaselineAdminNetworkPolicyStatusApplyConfiguration represents a declarative configuration of the BaselineAdminNetworkPolicyStatus type for use // with apply. type BaselineAdminNetworkPolicyStatusApplyConfiguration struct { Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` } -// BaselineAdminNetworkPolicyStatusApplyConfiguration constructs an declarative configuration of the BaselineAdminNetworkPolicyStatus type for use with +// BaselineAdminNetworkPolicyStatusApplyConfiguration constructs a declarative configuration of the BaselineAdminNetworkPolicyStatus type for use with // apply. func BaselineAdminNetworkPolicyStatus() *BaselineAdminNetworkPolicyStatusApplyConfiguration { return &BaselineAdminNetworkPolicyStatusApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpod.go b/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpod.go index d68ffccf..dbb188e9 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpod.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/namespacedpod.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// NamespacedPodApplyConfiguration represents an declarative configuration of the NamespacedPod type for use +// NamespacedPodApplyConfiguration represents a declarative configuration of the NamespacedPod type for use // with apply. type NamespacedPodApplyConfiguration struct { NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` PodSelector *v1.LabelSelectorApplyConfiguration `json:"podSelector,omitempty"` } -// NamespacedPodApplyConfiguration constructs an declarative configuration of the NamespacedPod type for use with +// NamespacedPodApplyConfiguration constructs a declarative configuration of the NamespacedPod type for use with // apply. func NamespacedPod() *NamespacedPodApplyConfiguration { return &NamespacedPodApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/port.go b/pkg/client/applyconfiguration/apis/v1alpha1/port.go index 3a48da65..c1b18285 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/port.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/port.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// PortApplyConfiguration represents an declarative configuration of the Port type for use +// PortApplyConfiguration represents a 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 +// PortApplyConfiguration constructs a declarative configuration of the Port type for use with // apply. func Port() *PortApplyConfiguration { return &PortApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/apis/v1alpha1/portrange.go b/pkg/client/applyconfiguration/apis/v1alpha1/portrange.go index 017e5b46..2acd24e9 100644 --- a/pkg/client/applyconfiguration/apis/v1alpha1/portrange.go +++ b/pkg/client/applyconfiguration/apis/v1alpha1/portrange.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// PortRangeApplyConfiguration represents an declarative configuration of the PortRange type for use +// PortRangeApplyConfiguration represents a declarative configuration of the PortRange type for use // with apply. type PortRangeApplyConfiguration struct { Protocol *v1.Protocol `json:"protocol,omitempty"` @@ -30,7 +30,7 @@ type PortRangeApplyConfiguration struct { End *int32 `json:"end,omitempty"` } -// PortRangeApplyConfiguration constructs an declarative configuration of the PortRange type for use with +// PortRangeApplyConfiguration constructs a declarative configuration of the PortRange type for use with // apply. func PortRange() *PortRangeApplyConfiguration { return &PortRangeApplyConfiguration{} diff --git a/pkg/client/applyconfiguration/utils.go b/pkg/client/applyconfiguration/utils.go index ca4e22e8..0152fb2f 100644 --- a/pkg/client/applyconfiguration/utils.go +++ b/pkg/client/applyconfiguration/utils.go @@ -19,9 +19,12 @@ limitations under the License. package applyconfiguration import ( + runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + 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" + internal "sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration/internal" ) // ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no @@ -69,3 +72,7 @@ func ForKind(kind schema.GroupVersionKind) interface{} { } return nil } + +func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter { + return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()} +} diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 88ad0f6a..0694ab5a 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -24,6 +24,7 @@ import ( "k8s.io/client-go/discovery" fakediscovery "k8s.io/client-go/discovery/fake" "k8s.io/client-go/testing" + applyconfiguration "sigs.k8s.io/network-policy-api/pkg/client/applyconfiguration" clientset "sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned" policyv1alpha1 "sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1" fakepolicyv1alpha1 "sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake" @@ -31,8 +32,12 @@ import ( // NewSimpleClientset returns a clientset that will respond with the provided objects. // It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement +// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement // for a real clientset and is mostly useful in simple unit tests. +// +// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves +// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. +// via --with-applyconfig). func NewSimpleClientset(objects ...runtime.Object) *Clientset { o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) for _, obj := range objects { @@ -74,6 +79,38 @@ func (c *Clientset) Tracker() testing.ObjectTracker { return c.tracker } +// NewClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewClientset(objects ...runtime.Object) *Clientset { + o := testing.NewFieldManagedObjectTracker( + scheme, + codecs.UniversalDecoder(), + applyconfiguration.NewTypeConverter(scheme), + ) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + var ( _ clientset.Interface = &Clientset{} _ testing.FakeClient = &Clientset{} diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha1/adminnetworkpolicy.go b/pkg/client/clientset/versioned/typed/apis/v1alpha1/adminnetworkpolicy.go index 9d351d53..df5ccf0d 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha1/adminnetworkpolicy.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha1/adminnetworkpolicy.go @@ -20,14 +20,11 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" 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" @@ -43,6 +40,7 @@ type AdminNetworkPoliciesGetter interface { type AdminNetworkPolicyInterface interface { Create(ctx context.Context, adminNetworkPolicy *v1alpha1.AdminNetworkPolicy, opts v1.CreateOptions) (*v1alpha1.AdminNetworkPolicy, error) Update(ctx context.Context, adminNetworkPolicy *v1alpha1.AdminNetworkPolicy, opts v1.UpdateOptions) (*v1alpha1.AdminNetworkPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, adminNetworkPolicy *v1alpha1.AdminNetworkPolicy, opts v1.UpdateOptions) (*v1alpha1.AdminNetworkPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,193 +49,25 @@ type AdminNetworkPolicyInterface interface { 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) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, adminNetworkPolicy *apisv1alpha1.AdminNetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.AdminNetworkPolicy, err error) AdminNetworkPolicyExpansion } // adminNetworkPolicies implements AdminNetworkPolicyInterface type adminNetworkPolicies struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.AdminNetworkPolicy, *v1alpha1.AdminNetworkPolicyList, *apisv1alpha1.AdminNetworkPolicyApplyConfiguration] } // newAdminNetworkPolicies returns a AdminNetworkPolicies func newAdminNetworkPolicies(c *PolicyV1alpha1Client) *adminNetworkPolicies { return &adminNetworkPolicies{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.AdminNetworkPolicy, *v1alpha1.AdminNetworkPolicyList, *apisv1alpha1.AdminNetworkPolicyApplyConfiguration]( + "adminnetworkpolicies", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.AdminNetworkPolicy { return &v1alpha1.AdminNetworkPolicy{} }, + func() *v1alpha1.AdminNetworkPolicyList { return &v1alpha1.AdminNetworkPolicyList{} }), } } - -// Get takes name of the adminNetworkPolicy, and returns the corresponding adminNetworkPolicy object, and an error if there is any. -func (c *adminNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AdminNetworkPolicy, err error) { - result = &v1alpha1.AdminNetworkPolicy{} - err = c.client.Get(). - Resource("adminnetworkpolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of AdminNetworkPolicies that match those selectors. -func (c *adminNetworkPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AdminNetworkPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.AdminNetworkPolicyList{} - err = c.client.Get(). - Resource("adminnetworkpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested adminNetworkPolicies. -func (c *adminNetworkPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("adminnetworkpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a adminNetworkPolicy and creates it. Returns the server's representation of the adminNetworkPolicy, and an error, if there is any. -func (c *adminNetworkPolicies) Create(ctx context.Context, adminNetworkPolicy *v1alpha1.AdminNetworkPolicy, opts v1.CreateOptions) (result *v1alpha1.AdminNetworkPolicy, err error) { - result = &v1alpha1.AdminNetworkPolicy{} - err = c.client.Post(). - Resource("adminnetworkpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(adminNetworkPolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a adminNetworkPolicy and updates it. Returns the server's representation of the adminNetworkPolicy, and an error, if there is any. -func (c *adminNetworkPolicies) Update(ctx context.Context, adminNetworkPolicy *v1alpha1.AdminNetworkPolicy, opts v1.UpdateOptions) (result *v1alpha1.AdminNetworkPolicy, err error) { - result = &v1alpha1.AdminNetworkPolicy{} - err = c.client.Put(). - Resource("adminnetworkpolicies"). - Name(adminNetworkPolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(adminNetworkPolicy). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *adminNetworkPolicies) UpdateStatus(ctx context.Context, adminNetworkPolicy *v1alpha1.AdminNetworkPolicy, opts v1.UpdateOptions) (result *v1alpha1.AdminNetworkPolicy, err error) { - result = &v1alpha1.AdminNetworkPolicy{} - err = c.client.Put(). - Resource("adminnetworkpolicies"). - Name(adminNetworkPolicy.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(adminNetworkPolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the adminNetworkPolicy and deletes it. Returns an error if one occurs. -func (c *adminNetworkPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("adminnetworkpolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *adminNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("adminnetworkpolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched adminNetworkPolicy. -func (c *adminNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AdminNetworkPolicy, err error) { - result = &v1alpha1.AdminNetworkPolicy{} - err = c.client.Patch(pt). - Resource("adminnetworkpolicies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - 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/pkg/client/clientset/versioned/typed/apis/v1alpha1/baselineadminnetworkpolicy.go b/pkg/client/clientset/versioned/typed/apis/v1alpha1/baselineadminnetworkpolicy.go index 000f4985..c364cb56 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha1/baselineadminnetworkpolicy.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha1/baselineadminnetworkpolicy.go @@ -20,14 +20,11 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" 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" @@ -43,6 +40,7 @@ type BaselineAdminNetworkPoliciesGetter interface { type BaselineAdminNetworkPolicyInterface interface { Create(ctx context.Context, baselineAdminNetworkPolicy *v1alpha1.BaselineAdminNetworkPolicy, opts v1.CreateOptions) (*v1alpha1.BaselineAdminNetworkPolicy, error) Update(ctx context.Context, baselineAdminNetworkPolicy *v1alpha1.BaselineAdminNetworkPolicy, opts v1.UpdateOptions) (*v1alpha1.BaselineAdminNetworkPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, baselineAdminNetworkPolicy *v1alpha1.BaselineAdminNetworkPolicy, opts v1.UpdateOptions) (*v1alpha1.BaselineAdminNetworkPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,193 +49,25 @@ type BaselineAdminNetworkPolicyInterface interface { 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) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, baselineAdminNetworkPolicy *apisv1alpha1.BaselineAdminNetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) BaselineAdminNetworkPolicyExpansion } // baselineAdminNetworkPolicies implements BaselineAdminNetworkPolicyInterface type baselineAdminNetworkPolicies struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.BaselineAdminNetworkPolicy, *v1alpha1.BaselineAdminNetworkPolicyList, *apisv1alpha1.BaselineAdminNetworkPolicyApplyConfiguration] } // newBaselineAdminNetworkPolicies returns a BaselineAdminNetworkPolicies func newBaselineAdminNetworkPolicies(c *PolicyV1alpha1Client) *baselineAdminNetworkPolicies { return &baselineAdminNetworkPolicies{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.BaselineAdminNetworkPolicy, *v1alpha1.BaselineAdminNetworkPolicyList, *apisv1alpha1.BaselineAdminNetworkPolicyApplyConfiguration]( + "baselineadminnetworkpolicies", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.BaselineAdminNetworkPolicy { return &v1alpha1.BaselineAdminNetworkPolicy{} }, + func() *v1alpha1.BaselineAdminNetworkPolicyList { return &v1alpha1.BaselineAdminNetworkPolicyList{} }), } } - -// Get takes name of the baselineAdminNetworkPolicy, and returns the corresponding baselineAdminNetworkPolicy object, and an error if there is any. -func (c *baselineAdminNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) { - result = &v1alpha1.BaselineAdminNetworkPolicy{} - err = c.client.Get(). - Resource("baselineadminnetworkpolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of BaselineAdminNetworkPolicies that match those selectors. -func (c *baselineAdminNetworkPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BaselineAdminNetworkPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.BaselineAdminNetworkPolicyList{} - err = c.client.Get(). - Resource("baselineadminnetworkpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested baselineAdminNetworkPolicies. -func (c *baselineAdminNetworkPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("baselineadminnetworkpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a baselineAdminNetworkPolicy and creates it. Returns the server's representation of the baselineAdminNetworkPolicy, and an error, if there is any. -func (c *baselineAdminNetworkPolicies) Create(ctx context.Context, baselineAdminNetworkPolicy *v1alpha1.BaselineAdminNetworkPolicy, opts v1.CreateOptions) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) { - result = &v1alpha1.BaselineAdminNetworkPolicy{} - err = c.client.Post(). - Resource("baselineadminnetworkpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(baselineAdminNetworkPolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a baselineAdminNetworkPolicy and updates it. Returns the server's representation of the baselineAdminNetworkPolicy, and an error, if there is any. -func (c *baselineAdminNetworkPolicies) Update(ctx context.Context, baselineAdminNetworkPolicy *v1alpha1.BaselineAdminNetworkPolicy, opts v1.UpdateOptions) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) { - result = &v1alpha1.BaselineAdminNetworkPolicy{} - err = c.client.Put(). - Resource("baselineadminnetworkpolicies"). - Name(baselineAdminNetworkPolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(baselineAdminNetworkPolicy). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *baselineAdminNetworkPolicies) UpdateStatus(ctx context.Context, baselineAdminNetworkPolicy *v1alpha1.BaselineAdminNetworkPolicy, opts v1.UpdateOptions) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) { - result = &v1alpha1.BaselineAdminNetworkPolicy{} - err = c.client.Put(). - Resource("baselineadminnetworkpolicies"). - Name(baselineAdminNetworkPolicy.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(baselineAdminNetworkPolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the baselineAdminNetworkPolicy and deletes it. Returns an error if one occurs. -func (c *baselineAdminNetworkPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("baselineadminnetworkpolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *baselineAdminNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("baselineadminnetworkpolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched baselineAdminNetworkPolicy. -func (c *baselineAdminNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) { - result = &v1alpha1.BaselineAdminNetworkPolicy{} - err = c.client.Patch(pt). - Resource("baselineadminnetworkpolicies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - 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/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_adminnetworkpolicy.go b/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_adminnetworkpolicy.go index fc829128..41ba5516 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_adminnetworkpolicy.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_adminnetworkpolicy.go @@ -43,20 +43,22 @@ var adminnetworkpoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("AdminNetwor // Get takes name of the adminNetworkPolicy, and returns the corresponding adminNetworkPolicy object, and an error if there is any. func (c *FakeAdminNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AdminNetworkPolicy, err error) { + emptyResult := &v1alpha1.AdminNetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(adminnetworkpoliciesResource, name), &v1alpha1.AdminNetworkPolicy{}) + Invokes(testing.NewRootGetActionWithOptions(adminnetworkpoliciesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.AdminNetworkPolicy), err } // List takes label and field selectors, and returns the list of AdminNetworkPolicies that match those selectors. func (c *FakeAdminNetworkPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AdminNetworkPolicyList, err error) { + emptyResult := &v1alpha1.AdminNetworkPolicyList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(adminnetworkpoliciesResource, adminnetworkpoliciesKind, opts), &v1alpha1.AdminNetworkPolicyList{}) + Invokes(testing.NewRootListActionWithOptions(adminnetworkpoliciesResource, adminnetworkpoliciesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -75,36 +77,39 @@ func (c *FakeAdminNetworkPolicies) List(ctx context.Context, opts v1.ListOptions // Watch returns a watch.Interface that watches the requested adminNetworkPolicies. func (c *FakeAdminNetworkPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(adminnetworkpoliciesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(adminnetworkpoliciesResource, opts)) } // Create takes the representation of a adminNetworkPolicy and creates it. Returns the server's representation of the adminNetworkPolicy, and an error, if there is any. func (c *FakeAdminNetworkPolicies) Create(ctx context.Context, adminNetworkPolicy *v1alpha1.AdminNetworkPolicy, opts v1.CreateOptions) (result *v1alpha1.AdminNetworkPolicy, err error) { + emptyResult := &v1alpha1.AdminNetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(adminnetworkpoliciesResource, adminNetworkPolicy), &v1alpha1.AdminNetworkPolicy{}) + Invokes(testing.NewRootCreateActionWithOptions(adminnetworkpoliciesResource, adminNetworkPolicy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.AdminNetworkPolicy), err } // Update takes the representation of a adminNetworkPolicy and updates it. Returns the server's representation of the adminNetworkPolicy, and an error, if there is any. func (c *FakeAdminNetworkPolicies) Update(ctx context.Context, adminNetworkPolicy *v1alpha1.AdminNetworkPolicy, opts v1.UpdateOptions) (result *v1alpha1.AdminNetworkPolicy, err error) { + emptyResult := &v1alpha1.AdminNetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(adminnetworkpoliciesResource, adminNetworkPolicy), &v1alpha1.AdminNetworkPolicy{}) + Invokes(testing.NewRootUpdateActionWithOptions(adminnetworkpoliciesResource, adminNetworkPolicy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.AdminNetworkPolicy), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeAdminNetworkPolicies) UpdateStatus(ctx context.Context, adminNetworkPolicy *v1alpha1.AdminNetworkPolicy, opts v1.UpdateOptions) (*v1alpha1.AdminNetworkPolicy, error) { +func (c *FakeAdminNetworkPolicies) UpdateStatus(ctx context.Context, adminNetworkPolicy *v1alpha1.AdminNetworkPolicy, opts v1.UpdateOptions) (result *v1alpha1.AdminNetworkPolicy, err error) { + emptyResult := &v1alpha1.AdminNetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(adminnetworkpoliciesResource, "status", adminNetworkPolicy), &v1alpha1.AdminNetworkPolicy{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(adminnetworkpoliciesResource, "status", adminNetworkPolicy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.AdminNetworkPolicy), err } @@ -118,7 +123,7 @@ func (c *FakeAdminNetworkPolicies) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeAdminNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(adminnetworkpoliciesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(adminnetworkpoliciesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.AdminNetworkPolicyList{}) return err @@ -126,10 +131,11 @@ func (c *FakeAdminNetworkPolicies) DeleteCollection(ctx context.Context, opts v1 // Patch applies the patch and returns the patched adminNetworkPolicy. func (c *FakeAdminNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AdminNetworkPolicy, err error) { + emptyResult := &v1alpha1.AdminNetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(adminnetworkpoliciesResource, name, pt, data, subresources...), &v1alpha1.AdminNetworkPolicy{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(adminnetworkpoliciesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.AdminNetworkPolicy), err } @@ -147,10 +153,11 @@ func (c *FakeAdminNetworkPolicies) Apply(ctx context.Context, adminNetworkPolicy if name == nil { return nil, fmt.Errorf("adminNetworkPolicy.Name must be provided to Apply") } + emptyResult := &v1alpha1.AdminNetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(adminnetworkpoliciesResource, *name, types.ApplyPatchType, data), &v1alpha1.AdminNetworkPolicy{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(adminnetworkpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.AdminNetworkPolicy), err } @@ -169,10 +176,11 @@ func (c *FakeAdminNetworkPolicies) ApplyStatus(ctx context.Context, adminNetwork if name == nil { return nil, fmt.Errorf("adminNetworkPolicy.Name must be provided to Apply") } + emptyResult := &v1alpha1.AdminNetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(adminnetworkpoliciesResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.AdminNetworkPolicy{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(adminnetworkpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.AdminNetworkPolicy), err } diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_baselineadminnetworkpolicy.go b/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_baselineadminnetworkpolicy.go index a50e2565..31c43eab 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_baselineadminnetworkpolicy.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_baselineadminnetworkpolicy.go @@ -43,20 +43,22 @@ var baselineadminnetworkpoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("Bas // Get takes name of the baselineAdminNetworkPolicy, and returns the corresponding baselineAdminNetworkPolicy object, and an error if there is any. func (c *FakeBaselineAdminNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) { + emptyResult := &v1alpha1.BaselineAdminNetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(baselineadminnetworkpoliciesResource, name), &v1alpha1.BaselineAdminNetworkPolicy{}) + Invokes(testing.NewRootGetActionWithOptions(baselineadminnetworkpoliciesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BaselineAdminNetworkPolicy), err } // List takes label and field selectors, and returns the list of BaselineAdminNetworkPolicies that match those selectors. func (c *FakeBaselineAdminNetworkPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BaselineAdminNetworkPolicyList, err error) { + emptyResult := &v1alpha1.BaselineAdminNetworkPolicyList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(baselineadminnetworkpoliciesResource, baselineadminnetworkpoliciesKind, opts), &v1alpha1.BaselineAdminNetworkPolicyList{}) + Invokes(testing.NewRootListActionWithOptions(baselineadminnetworkpoliciesResource, baselineadminnetworkpoliciesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -75,36 +77,39 @@ func (c *FakeBaselineAdminNetworkPolicies) List(ctx context.Context, opts v1.Lis // Watch returns a watch.Interface that watches the requested baselineAdminNetworkPolicies. func (c *FakeBaselineAdminNetworkPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(baselineadminnetworkpoliciesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(baselineadminnetworkpoliciesResource, opts)) } // Create takes the representation of a baselineAdminNetworkPolicy and creates it. Returns the server's representation of the baselineAdminNetworkPolicy, and an error, if there is any. func (c *FakeBaselineAdminNetworkPolicies) Create(ctx context.Context, baselineAdminNetworkPolicy *v1alpha1.BaselineAdminNetworkPolicy, opts v1.CreateOptions) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) { + emptyResult := &v1alpha1.BaselineAdminNetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(baselineadminnetworkpoliciesResource, baselineAdminNetworkPolicy), &v1alpha1.BaselineAdminNetworkPolicy{}) + Invokes(testing.NewRootCreateActionWithOptions(baselineadminnetworkpoliciesResource, baselineAdminNetworkPolicy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BaselineAdminNetworkPolicy), err } // Update takes the representation of a baselineAdminNetworkPolicy and updates it. Returns the server's representation of the baselineAdminNetworkPolicy, and an error, if there is any. func (c *FakeBaselineAdminNetworkPolicies) Update(ctx context.Context, baselineAdminNetworkPolicy *v1alpha1.BaselineAdminNetworkPolicy, opts v1.UpdateOptions) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) { + emptyResult := &v1alpha1.BaselineAdminNetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(baselineadminnetworkpoliciesResource, baselineAdminNetworkPolicy), &v1alpha1.BaselineAdminNetworkPolicy{}) + Invokes(testing.NewRootUpdateActionWithOptions(baselineadminnetworkpoliciesResource, baselineAdminNetworkPolicy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BaselineAdminNetworkPolicy), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeBaselineAdminNetworkPolicies) UpdateStatus(ctx context.Context, baselineAdminNetworkPolicy *v1alpha1.BaselineAdminNetworkPolicy, opts v1.UpdateOptions) (*v1alpha1.BaselineAdminNetworkPolicy, error) { +func (c *FakeBaselineAdminNetworkPolicies) UpdateStatus(ctx context.Context, baselineAdminNetworkPolicy *v1alpha1.BaselineAdminNetworkPolicy, opts v1.UpdateOptions) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) { + emptyResult := &v1alpha1.BaselineAdminNetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(baselineadminnetworkpoliciesResource, "status", baselineAdminNetworkPolicy), &v1alpha1.BaselineAdminNetworkPolicy{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(baselineadminnetworkpoliciesResource, "status", baselineAdminNetworkPolicy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BaselineAdminNetworkPolicy), err } @@ -118,7 +123,7 @@ func (c *FakeBaselineAdminNetworkPolicies) Delete(ctx context.Context, name stri // DeleteCollection deletes a collection of objects. func (c *FakeBaselineAdminNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(baselineadminnetworkpoliciesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(baselineadminnetworkpoliciesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.BaselineAdminNetworkPolicyList{}) return err @@ -126,10 +131,11 @@ func (c *FakeBaselineAdminNetworkPolicies) DeleteCollection(ctx context.Context, // Patch applies the patch and returns the patched baselineAdminNetworkPolicy. func (c *FakeBaselineAdminNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BaselineAdminNetworkPolicy, err error) { + emptyResult := &v1alpha1.BaselineAdminNetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(baselineadminnetworkpoliciesResource, name, pt, data, subresources...), &v1alpha1.BaselineAdminNetworkPolicy{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(baselineadminnetworkpoliciesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BaselineAdminNetworkPolicy), err } @@ -147,10 +153,11 @@ func (c *FakeBaselineAdminNetworkPolicies) Apply(ctx context.Context, baselineAd if name == nil { return nil, fmt.Errorf("baselineAdminNetworkPolicy.Name must be provided to Apply") } + emptyResult := &v1alpha1.BaselineAdminNetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(baselineadminnetworkpoliciesResource, *name, types.ApplyPatchType, data), &v1alpha1.BaselineAdminNetworkPolicy{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(baselineadminnetworkpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BaselineAdminNetworkPolicy), err } @@ -169,10 +176,11 @@ func (c *FakeBaselineAdminNetworkPolicies) ApplyStatus(ctx context.Context, base if name == nil { return nil, fmt.Errorf("baselineAdminNetworkPolicy.Name must be provided to Apply") } + emptyResult := &v1alpha1.BaselineAdminNetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(baselineadminnetworkpoliciesResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.BaselineAdminNetworkPolicy{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(baselineadminnetworkpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BaselineAdminNetworkPolicy), err } diff --git a/pkg/client/listers/apis/v1alpha1/adminnetworkpolicy.go b/pkg/client/listers/apis/v1alpha1/adminnetworkpolicy.go index e32fd55f..41f3a559 100644 --- a/pkg/client/listers/apis/v1alpha1/adminnetworkpolicy.go +++ b/pkg/client/listers/apis/v1alpha1/adminnetworkpolicy.go @@ -19,8 +19,8 @@ limitations under the License. package v1alpha1 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" ) @@ -39,30 +39,10 @@ type AdminNetworkPolicyLister interface { // adminNetworkPolicyLister implements the AdminNetworkPolicyLister interface. type adminNetworkPolicyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.AdminNetworkPolicy] } // NewAdminNetworkPolicyLister returns a new AdminNetworkPolicyLister. func NewAdminNetworkPolicyLister(indexer cache.Indexer) AdminNetworkPolicyLister { - return &adminNetworkPolicyLister{indexer: indexer} -} - -// List lists all AdminNetworkPolicies in the indexer. -func (s *adminNetworkPolicyLister) List(selector labels.Selector) (ret []*v1alpha1.AdminNetworkPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.AdminNetworkPolicy)) - }) - return ret, err -} - -// Get retrieves the AdminNetworkPolicy from the index for a given name. -func (s *adminNetworkPolicyLister) Get(name string) (*v1alpha1.AdminNetworkPolicy, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("adminnetworkpolicy"), name) - } - return obj.(*v1alpha1.AdminNetworkPolicy), nil + return &adminNetworkPolicyLister{listers.New[*v1alpha1.AdminNetworkPolicy](indexer, v1alpha1.Resource("adminnetworkpolicy"))} } diff --git a/pkg/client/listers/apis/v1alpha1/baselineadminnetworkpolicy.go b/pkg/client/listers/apis/v1alpha1/baselineadminnetworkpolicy.go index 3c501966..7220bdd2 100644 --- a/pkg/client/listers/apis/v1alpha1/baselineadminnetworkpolicy.go +++ b/pkg/client/listers/apis/v1alpha1/baselineadminnetworkpolicy.go @@ -19,8 +19,8 @@ limitations under the License. package v1alpha1 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1alpha1 "sigs.k8s.io/network-policy-api/apis/v1alpha1" ) @@ -39,30 +39,10 @@ type BaselineAdminNetworkPolicyLister interface { // baselineAdminNetworkPolicyLister implements the BaselineAdminNetworkPolicyLister interface. type baselineAdminNetworkPolicyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.BaselineAdminNetworkPolicy] } // NewBaselineAdminNetworkPolicyLister returns a new BaselineAdminNetworkPolicyLister. func NewBaselineAdminNetworkPolicyLister(indexer cache.Indexer) BaselineAdminNetworkPolicyLister { - return &baselineAdminNetworkPolicyLister{indexer: indexer} -} - -// List lists all BaselineAdminNetworkPolicies in the indexer. -func (s *baselineAdminNetworkPolicyLister) List(selector labels.Selector) (ret []*v1alpha1.BaselineAdminNetworkPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.BaselineAdminNetworkPolicy)) - }) - return ret, err -} - -// Get retrieves the BaselineAdminNetworkPolicy from the index for a given name. -func (s *baselineAdminNetworkPolicyLister) Get(name string) (*v1alpha1.BaselineAdminNetworkPolicy, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("baselineadminnetworkpolicy"), name) - } - return obj.(*v1alpha1.BaselineAdminNetworkPolicy), nil + return &baselineAdminNetworkPolicyLister{listers.New[*v1alpha1.BaselineAdminNetworkPolicy](indexer, v1alpha1.Resource("baselineadminnetworkpolicy"))} }