From 8bbe7b0639d427ef45f48c04265751fa871c51ca Mon Sep 17 00:00:00 2001 From: hjiajing Date: Wed, 3 Jan 2024 17:14:59 +0800 Subject: [PATCH] Upgrade k8s libraries to v0.29.2 1. Upgrade k8s libraries to v0.29.2 2. Upgrade controller-runtime to v0.16.3 Signed-off-by: hjiajing --- build/images/codegen/Dockerfile | 4 +- build/images/codegen/README.md | 1 + cmd/antrea-agent-simulator/simulator.go | 4 +- cmd/antrea-agent/agent.go | 4 +- cmd/antrea-agent/options.go | 8 +- cmd/antrea-agent/options_test.go | 12 +- docs/prometheus-integration.md | 36 +- go.mod | 101 +- go.sum | 321 +++---- hack/update-codegen.sh | 2 +- .../v1alpha1/multiclusterconfig_types.go | 37 +- .../v1alpha1/zz_generated.deepcopy.go | 56 +- .../antrea-multicluster-leader-global.yml | 113 ++- .../antrea-multicluster-leader-namespaced.yml | 4 +- .../yamls/antrea-multicluster-leader.yml | 117 +-- .../yamls/antrea-multicluster-member.yml | 4 +- .../clusterset_webhook_test.go | 6 +- .../cmd/multicluster-controller/controller.go | 46 +- .../gateway_webhook_test.go | 6 +- .../cmd/multicluster-controller/leader.go | 2 +- .../multicluster-controller/leader_test.go | 10 +- .../memberclusterannounce_webhook_test.go | 6 +- .../cmd/multicluster-controller/options.go | 46 +- .../antrea-mc-config-with-empty-podcidrs.yml | 2 - ...-mc-config-with-invalid-endpointiptype.yml | 2 - ...antrea-mc-config-with-invalid-podcidrs.yml | 2 - .../antrea-mc-config-with-valid-podcidrs.yml | 2 - ...cluster.crd.antrea.io_resourceexports.yaml | 71 +- ...cluster.crd.antrea.io_resourceimports.yaml | 42 +- .../configmap/controller_manager_config.yaml | 2 - .../commonarea/remote_common_area.go | 14 +- .../leader/clusterset_controller_test.go | 2 +- .../leader/resourceexport_controller_test.go | 7 +- .../multicluster/leader/stale_controller.go | 2 +- .../leader/stale_controller_test.go | 4 +- .../member/clusterset_controller_test.go | 4 +- .../multicluster/member/gateway_controller.go | 6 +- .../member/gateway_controller_test.go | 16 +- .../member/labelidentity_controller.go | 10 +- .../member/labelidentity_controller_test.go | 9 +- .../multicluster/member/node_controller.go | 6 +- .../member/node_controller_test.go | 9 +- .../member/serviceexport_controller.go | 20 +- .../member/serviceexport_controller_test.go | 28 +- .../multicluster/member/stale_controller.go | 2 +- multicluster/hack/update-codegen.sh | 2 +- .../v1alpha1/fake/fake_clusterinfoimport.go | 7 +- .../v1alpha1/fake/fake_clusterset.go | 7 +- .../v1alpha1/fake/fake_gateway.go | 7 +- .../v1alpha1/fake/fake_labelidentity.go | 7 +- .../fake/fake_memberclusterannounce.go | 7 +- .../v1alpha1/fake/fake_resourceexport.go | 7 +- .../v1alpha1/fake/fake_resourceimport.go | 7 +- .../v1alpha2/fake/fake_clusterclaim.go | 7 +- .../v1alpha2/fake/fake_clusterset.go | 7 +- .../informers/externalversions/factory.go | 16 +- multicluster/test/integration/suite_test.go | 2 +- .../mocks/mock_controller_runtime_manager.go | 142 ++- pkg/agent/agent.go | 79 +- pkg/agent/agent_linux.go | 24 +- pkg/agent/agent_test.go | 2 +- pkg/agent/apiserver/apiserver.go | 6 + .../interface_configuration_windows.go | 42 +- pkg/agent/cniserver/ipam/antrea_ipam.go | 3 +- pkg/agent/cniserver/ipam/antrea_ipam_test.go | 24 +- pkg/agent/cniserver/server_windows_test.go | 15 +- .../egress/egress_controller_test.go | 40 +- .../l7_flow_export_controller_test.go | 7 +- .../networkpolicy/allocator_test.go | 10 +- .../networkpolicy/l7engine/reconciler.go | 3 +- .../networkpolicy/networkpolicy_controller.go | 4 +- .../networkpolicy/status_controller_test.go | 16 +- pkg/agent/controller/traceflow/packetin.go | 4 +- .../controller/traceflow/packetin_test.go | 4 +- .../traceflow/traceflow_controller_test.go | 4 +- .../controller/trafficcontrol/controller.go | 22 +- .../trafficcontrol/controller_test.go | 7 +- .../externalnode/external_node_controller.go | 7 +- pkg/agent/multicast/mcast_controller_test.go | 2 +- .../multicluster/pod_route_controller_test.go | 4 +- .../stretched_networkpolicy_controller.go | 2 +- ...stretched_networkpolicy_controller_test.go | 8 +- pkg/agent/nodeportlocal/npl_agent_test.go | 4 +- pkg/agent/proxy/proxier_test.go | 14 +- pkg/agent/proxy/topology.go | 2 +- .../podwatch/controller_test.go | 37 +- pkg/agent/util/iptables/lock.go | 14 +- pkg/agent/util/net_linux.go | 18 +- pkg/agent/util/net_windows.go | 9 +- pkg/antctl/raw/multicluster/common/common.go | 5 +- pkg/antctl/raw/multicluster/join.go | 5 +- pkg/antctl/raw/traceflow/command.go | 4 +- .../transform/networkpolicy/response_test.go | 14 +- pkg/apiserver/apiserver.go | 5 + pkg/apiserver/certificate/certificate.go | 22 +- pkg/apiserver/certificate/certificate_test.go | 2 +- pkg/apiserver/openapi/zz_generated.openapi.go | 862 ++++++++++++++---- .../registry/controlplane/egressgroup/rest.go | 15 +- .../controlplane/nodestatssummary/rest.go | 9 +- .../supportbundlecollection/rest.go | 15 +- .../networkpolicy/addressgroup/rest.go | 15 +- .../networkpolicy/appliedtogroup/rest.go | 15 +- .../networkpolicy/clustergroupmember/rest.go | 11 +- .../networkpolicy/groupassociation/rest.go | 11 +- .../networkpolicy/groupmember/rest.go | 11 +- .../networkpolicy/ipgroupassociation/rest.go | 11 +- .../networkpolicy/networkpolicy/rest.go | 15 +- .../networkpolicyevaluation/rest.go | 11 +- .../antreaclusternetworkpolicystats/rest.go | 13 +- .../stats/antreanetworkpolicystats/rest.go | 13 +- .../registry/stats/multicastgroup/rest.go | 13 +- .../registry/stats/networkpolicystats/rest.go | 13 +- .../registry/system/controllerinfo/rest.go | 11 +- .../registry/system/supportbundle/rest.go | 13 +- pkg/client/clientset/versioned/doc.go | 18 - .../v1beta2/fake/fake_addressgroup.go | 7 +- .../v1beta2/fake/fake_appliedtogroup.go | 7 +- .../v1beta2/fake/fake_clustergroupmembers.go | 7 +- .../v1beta2/fake/fake_egressgroup.go | 7 +- .../v1beta2/fake/fake_groupassociation.go | 7 +- .../v1beta2/fake/fake_groupmembers.go | 7 +- .../v1beta2/fake/fake_ipgroupassociation.go | 7 +- .../v1beta2/fake/fake_networkpolicy.go | 7 +- .../fake/fake_networkpolicyevaluation.go | 5 +- .../v1beta2/fake/fake_nodestatssummary.go | 7 +- .../fake/fake_supportbundlecollection.go | 7 +- .../fake/fake_clusternetworkpolicy.go | 7 +- .../crd/v1alpha1/fake/fake_externalnode.go | 7 +- .../crd/v1alpha1/fake/fake_networkpolicy.go | 7 +- .../fake/fake_supportbundlecollection.go | 7 +- .../typed/crd/v1alpha1/fake/fake_tier.go | 7 +- .../typed/crd/v1alpha1/fake/fake_traceflow.go | 7 +- .../typed/crd/v1alpha2/fake/fake_egress.go | 7 +- .../crd/v1alpha2/fake/fake_externalentity.go | 7 +- .../crd/v1alpha2/fake/fake_externalippool.go | 7 +- .../typed/crd/v1alpha2/fake/fake_ippool.go | 7 +- .../crd/v1alpha2/fake/fake_trafficcontrol.go | 7 +- .../crd/v1alpha3/fake/fake_clustergroup.go | 7 +- .../typed/crd/v1alpha3/fake/fake_group.go | 7 +- .../crd/v1beta1/fake/fake_antreaagentinfo.go | 7 +- .../v1beta1/fake/fake_antreacontrollerinfo.go | 7 +- .../crd/v1beta1/fake/fake_clustergroup.go | 7 +- .../v1beta1/fake/fake_clusternetworkpolicy.go | 7 +- .../typed/crd/v1beta1/fake/fake_egress.go | 7 +- .../crd/v1beta1/fake/fake_externalippool.go | 7 +- .../typed/crd/v1beta1/fake/fake_group.go | 7 +- .../crd/v1beta1/fake/fake_networkpolicy.go | 7 +- .../typed/crd/v1beta1/fake/fake_tier.go | 7 +- .../typed/crd/v1beta1/fake/fake_traceflow.go | 7 +- .../fake_antreaclusternetworkpolicystats.go | 7 +- .../fake/fake_antreanetworkpolicystats.go | 7 +- .../v1alpha1/fake/fake_multicastgroup.go | 7 +- .../v1alpha1/fake/fake_networkpolicystats.go | 7 +- .../system/v1beta1/fake/fake_supportbundle.go | 7 +- .../informers/externalversions/factory.go | 16 +- .../ipsec_csr_signing_controller_test.go | 23 +- pkg/controller/egress/controller_test.go | 15 +- .../externalippool/controller_test.go | 2 +- .../externalnode/controller_test.go | 8 +- pkg/controller/grouping/controller.go | 5 +- pkg/controller/grouping/controller_test.go | 7 +- .../ipam/antrea_ipam_controller_test.go | 38 +- pkg/controller/labelidentity/controller.go | 5 +- .../labelidentity/controller_test.go | 7 +- .../networkpolicy_controller_test.go | 16 +- pkg/controller/stats/aggregator_test.go | 6 +- .../controller_test.go | 4 +- pkg/controller/traceflow/controller_test.go | 4 +- .../clickhouseclient/clickhouseclient.go | 2 +- .../clickhouseclient/clickhouseclient_test.go | 13 +- pkg/flowaggregator/exporter/clickhouse.go | 3 +- pkg/flowaggregator/exporter/utils.go | 3 +- pkg/ipam/poolallocator/allocator_test.go | 10 +- pkg/monitor/controller.go | 4 +- pkg/ovs/ovsctl/ovsctl_others.go | 2 +- pkg/util/channel/channel_test.go | 9 +- test/e2e/antreaipam_test.go | 4 +- test/e2e/antreapolicy_test.go | 18 +- test/e2e/basic_test.go | 17 +- test/e2e/batch_test.go | 9 +- test/e2e/connectivity_test.go | 2 +- test/e2e/egress_test.go | 120 +-- test/e2e/flowaggregator_test.go | 8 +- test/e2e/framework.go | 52 +- test/e2e/ipsec_test.go | 9 +- test/e2e/k8s_util.go | 4 +- test/e2e/l7networkpolicy_test.go | 39 +- test/e2e/multicast_test.go | 6 +- test/e2e/networkpolicy_test.go | 4 +- test/e2e/nodeportlocal_test.go | 7 +- test/e2e/performance_test.go | 2 +- test/e2e/prometheus_test.go | 4 +- test/e2e/security_test.go | 6 +- test/e2e/service_externalip_test.go | 35 +- test/e2e/supportbundle_test.go | 4 +- test/e2e/traceflow_test.go | 6 +- test/e2e/vmagent_test.go | 18 +- test/integration/agent/route_test.go | 5 +- test/integration/ovs/ofctrl_test.go | 107 +-- test/integration/ovs/openflow_test_utils.go | 40 +- .../ipam/nodeipam/ipam/cidr_allocator.go | 27 +- third_party/proxy/service.go | 7 +- third_party/proxy/types.go | 2 +- 203 files changed, 2403 insertions(+), 1654 deletions(-) delete mode 100644 pkg/client/clientset/versioned/doc.go diff --git a/build/images/codegen/Dockerfile b/build/images/codegen/Dockerfile index a195c6b5306..4455efe4b3c 100644 --- a/build/images/codegen/Dockerfile +++ b/build/images/codegen/Dockerfile @@ -32,11 +32,11 @@ LABEL description="A Docker image based on the golang image, which includes code ENV GO111MODULE=on -ARG K8S_VERSION=1.26.4 +ARG K8S_VERSION=1.29.2 # The k8s.io/kube-openapi repo does not have tag, using a workable commit hash. # We use the version that is referenced in the Kubernetes go.mod (for the # correct K8s version). -ARG KUBEOPENAPI_VERSION=v0.0.0-20221012153701-172d655c2280 +ARG KUBEOPENAPI_VERSION=v0.0.0-20231010175941-2dd684a91f00 RUN go install k8s.io/code-generator/cmd/client-gen@kubernetes-$K8S_VERSION && \ go install k8s.io/code-generator/cmd/deepcopy-gen@kubernetes-$K8S_VERSION && \ diff --git a/build/images/codegen/README.md b/build/images/codegen/README.md index cfd31cefcd9..738873cfeeb 100644 --- a/build/images/codegen/README.md +++ b/build/images/codegen/README.md @@ -20,6 +20,7 @@ Here is the table of codegen images that have been uploaded: | Tag | Change | | :----------------------------- | ---------------------------------------------------- | +| kubernetes-1.29.2 | Upgraded K8s libraries to v1.29.2 | | kubernetes-1.26.4-build.1 | Replace github.com/golang/mock with go.uber.org/mock | | kubernetes-1.26.4-build.0 | Upgraded Go to v1.21 | | kubernetes-1.26.4 | Upgraded K8s libraries to v1.26.4 | diff --git a/cmd/antrea-agent-simulator/simulator.go b/cmd/antrea-agent-simulator/simulator.go index ec9ce22edf1..755642e6ac3 100644 --- a/cmd/antrea-agent-simulator/simulator.go +++ b/cmd/antrea-agent-simulator/simulator.go @@ -67,7 +67,7 @@ func run() error { // Add loop to check whether client is ready attempts := 0 - if err := wait.PollImmediateUntil(200*time.Millisecond, func() (bool, error) { + if err := wait.PollUntilContextCancel(wait.ContextForChannel(stopCh), 200*time.Millisecond, true, func(ctx context.Context) (bool, error) { if attempts%10 == 0 { klog.Info("Waiting for Antrea client to be ready") } @@ -76,7 +76,7 @@ func run() error { return false, nil } return true, nil - }, stopCh); err != nil { + }); err != nil { klog.Info("Stopped waiting for Antrea client") return err } diff --git a/cmd/antrea-agent/agent.go b/cmd/antrea-agent/agent.go index dbefa8530ba..7c663f57e89 100644 --- a/cmd/antrea-agent/agent.go +++ b/cmd/antrea-agent/agent.go @@ -778,10 +778,10 @@ func run(o *Options) error { // Service would fail. if o.config.AntreaProxy.ProxyAll { klog.InfoS("Waiting for AntreaProxy to be ready") - if err := wait.PollUntil(time.Second, func() (bool, error) { + if err := wait.PollUntilContextCancel(wait.ContextForChannel(stopCh), time.Second, false, func(ctx context.Context) (bool, error) { klog.V(2).InfoS("Checking if AntreaProxy is ready") return proxier.GetProxyProvider().SyncedOnce(), nil - }, stopCh); err != nil { + }); err != nil { return fmt.Errorf("error when waiting for AntreaProxy to be ready: %v", err) } klog.InfoS("AntreaProxy is ready") diff --git a/cmd/antrea-agent/options.go b/cmd/antrea-agent/options.go index faaa1934428..ec5dfaed79c 100644 --- a/cmd/antrea-agent/options.go +++ b/cmd/antrea-agent/options.go @@ -27,7 +27,7 @@ import ( cliflag "k8s.io/component-base/cli/flag" "k8s.io/component-base/featuregate" "k8s.io/klog/v2" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" "antrea.io/antrea/pkg/agent/config" "antrea.io/antrea/pkg/apis" @@ -411,10 +411,10 @@ func (o *Options) setK8sNodeDefaultOptions() { o.config.HostProcPathPrefix = defaultHostProcPathPrefix } if o.config.AntreaProxy.Enable == nil { - o.config.AntreaProxy.Enable = pointer.Bool(true) + o.config.AntreaProxy.Enable = ptr.To(true) } if o.config.AntreaProxy.ProxyLoadBalancerIPs == nil { - o.config.AntreaProxy.ProxyLoadBalancerIPs = pointer.Bool(true) + o.config.AntreaProxy.ProxyLoadBalancerIPs = ptr.To(true) } if o.config.ServiceCIDR == "" { //It's okay to set the default value of this field even when AntreaProxy is enabled and the field is not used. @@ -427,7 +427,7 @@ func (o *Options) setK8sNodeDefaultOptions() { o.config.ClusterMembershipPort = apis.AntreaAgentClusterMembershipPort } if o.config.EnablePrometheusMetrics == nil { - o.config.EnablePrometheusMetrics = pointer.Bool(true) + o.config.EnablePrometheusMetrics = ptr.To(true) } if o.config.WireGuard.Port == 0 { o.config.WireGuard.Port = apis.WireGuardListenPort diff --git a/cmd/antrea-agent/options_test.go b/cmd/antrea-agent/options_test.go index 4b62f775800..919d1af8a7f 100644 --- a/cmd/antrea-agent/options_test.go +++ b/cmd/antrea-agent/options_test.go @@ -21,7 +21,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" featuregatetesting "k8s.io/component-base/featuregate/testing" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" "antrea.io/antrea/pkg/agent/config" agentconfig "antrea.io/antrea/pkg/config/agent" @@ -93,7 +93,7 @@ func TestOptionsValidateAntreaProxyConfig(t *testing.T) { name: "default", trafficEncapMode: config.TrafficEncapModeEncap, antreaProxyConfig: agentconfig.AntreaProxyConfig{ - Enable: pointer.Bool(true), + Enable: ptr.To(true), DefaultLoadBalancerMode: config.LoadBalancerModeNAT.String(), }, expectedDefaultLoadBalancerMode: config.LoadBalancerModeNAT, @@ -103,7 +103,7 @@ func TestOptionsValidateAntreaProxyConfig(t *testing.T) { enabledDSR: true, trafficEncapMode: config.TrafficEncapModeEncap, antreaProxyConfig: agentconfig.AntreaProxyConfig{ - Enable: pointer.Bool(true), + Enable: ptr.To(true), DefaultLoadBalancerMode: config.LoadBalancerModeDSR.String(), }, expectedDefaultLoadBalancerMode: config.LoadBalancerModeDSR, @@ -111,7 +111,7 @@ func TestOptionsValidateAntreaProxyConfig(t *testing.T) { { name: "LoadBalancerModeDSR disabled", antreaProxyConfig: agentconfig.AntreaProxyConfig{ - Enable: pointer.Bool(true), + Enable: ptr.To(true), DefaultLoadBalancerMode: config.LoadBalancerModeDSR.String(), }, trafficEncapMode: config.TrafficEncapModeEncap, @@ -121,7 +121,7 @@ func TestOptionsValidateAntreaProxyConfig(t *testing.T) { name: "unsupported encap mode", enabledDSR: true, antreaProxyConfig: agentconfig.AntreaProxyConfig{ - Enable: pointer.Bool(true), + Enable: ptr.To(true), DefaultLoadBalancerMode: config.LoadBalancerModeDSR.String(), }, trafficEncapMode: config.TrafficEncapModeNoEncap, @@ -131,7 +131,7 @@ func TestOptionsValidateAntreaProxyConfig(t *testing.T) { name: "invalid LoadBalancerMode", trafficEncapMode: config.TrafficEncapModeEncap, antreaProxyConfig: agentconfig.AntreaProxyConfig{ - Enable: pointer.Bool(true), + Enable: ptr.To(true), DefaultLoadBalancerMode: "drs", }, expectedErr: "LoadBalancerMode drs is unknown", diff --git a/docs/prometheus-integration.md b/docs/prometheus-integration.md index 53a7480b304..dc9ab9345fa 100644 --- a/docs/prometheus-integration.md +++ b/docs/prometheus-integration.md @@ -219,6 +219,11 @@ updates received by AntreaProxy ### Common Metrics Provided by Infrastructure +#### Aggregator Metrics + +- **aggregator_discovery_aggregation_count_total:** Counter of number of +times discovery was aggregated + #### Apiserver Metrics - **apiserver_audit_event_total:** Counter of audit events generated and @@ -253,11 +258,13 @@ scope and component. - **apiserver_request_filter_duration_seconds:** Request filter latency distribution in seconds, for each filter type - **apiserver_request_sli_duration_seconds:** Response latency distribution -(not counting webhook duration) in seconds for each verb, group, version, -resource, subresource, scope and component. +(not counting webhook duration and priority & fairness queue wait times) +in seconds for each verb, group, version, resource, subresource, scope +and component. - **apiserver_request_slo_duration_seconds:** Response latency distribution -(not counting webhook duration) in seconds for each verb, group, version, -resource, subresource, scope and component. +(not counting webhook duration and priority & fairness queue wait times) +in seconds for each verb, group, version, resource, subresource, scope +and component. - **apiserver_request_total:** Counter of apiserver requests broken out for each verb, dry run value, group, version, resource, scope, component, and HTTP response code. @@ -297,15 +304,26 @@ broken out by result. - **authentication_token_cache_request_duration_seconds:** - **authentication_token_cache_request_total:** +#### Authorization Metrics + +- **authorization_attempts_total:** Counter of authorization attempts broken +down by result. It can be either 'allowed', 'denied', 'no-opinion' or 'error'. +- **authorization_duration_seconds:** Authorization duration in seconds +broken out by result. + +#### Cardinality Metrics + +- **cardinality_enforcement_unexpected_categorizations_total:** The count +of unexpected categorizations during cardinality enforcement. + #### Disabled Metrics -- **disabled_metric_total:** The count of disabled metrics. +- **disabled_metrics_total:** The count of disabled metrics. #### Field Metrics - **field_validation_request_duration_seconds:** Response latency distribution -in seconds for each field validation value and whether field validation is -enabled or not +in seconds for each field validation value #### Go Metrics @@ -576,7 +594,7 @@ contention data. #### Hidden Metrics -- **hidden_metric_total:** The count of hidden metrics. +- **hidden_metrics_total:** The count of hidden metrics. #### Process Metrics @@ -593,7 +611,7 @@ available in bytes. #### Registered Metrics -- **registered_metric_total:** The count of registered metrics broken by +- **registered_metrics_total:** The count of registered metrics broken by stability level and deprecation version. #### Workqueue Metrics diff --git a/go.mod b/go.mod index 7ffdb4059e7..8fbee827a54 100644 --- a/go.mod +++ b/go.mod @@ -67,19 +67,19 @@ require ( gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.26.4 - k8s.io/apiextensions-apiserver v0.26.4 - k8s.io/apimachinery v0.26.4 - k8s.io/apiserver v0.26.4 - k8s.io/client-go v0.26.4 - k8s.io/component-base v0.26.4 - k8s.io/klog/v2 v2.100.1 - k8s.io/kube-aggregator v0.26.4 - k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 - k8s.io/kubectl v0.26.4 - k8s.io/kubelet v0.26.4 - k8s.io/utils v0.0.0-20230209194617-a36077c30491 - sigs.k8s.io/controller-runtime v0.14.6 + k8s.io/api v0.29.2 + k8s.io/apiextensions-apiserver v0.29.2 + k8s.io/apimachinery v0.29.2 + k8s.io/apiserver v0.29.2 + k8s.io/client-go v0.29.2 + k8s.io/component-base v0.29.2 + k8s.io/klog/v2 v2.110.1 + k8s.io/kube-aggregator v0.29.2 + k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 + k8s.io/kubectl v0.29.2 + k8s.io/kubelet v0.29.2 + k8s.io/utils v0.0.0-20230726121419-3b25d923346b + sigs.k8s.io/controller-runtime v0.16.3 sigs.k8s.io/mcs-api v0.1.0 sigs.k8s.io/network-policy-api v0.1.1 sigs.k8s.io/yaml v1.3.0 @@ -93,8 +93,9 @@ require ( github.com/VividCortex/ewma v1.2.0 // indirect github.com/alexflint/go-filemutex v1.2.0 // indirect github.com/andybalholm/brotli v1.0.4 // indirect - github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect + github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da // indirect + github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.4 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.12.12 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.11 // indirect @@ -120,31 +121,31 @@ require ( github.com/containerd/cgroups v1.1.0 // indirect github.com/containerd/containerd v1.6.26 // indirect github.com/contiv/libovsdb v0.0.0-20170227191248-d0061a53e358 // indirect - github.com/coreos/go-semver v0.3.0 // indirect - github.com/coreos/go-systemd/v22 v22.3.2 // indirect - github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1 // indirect - github.com/emicklei/go-restful/v3 v3.10.1 // indirect - github.com/evanphx/json-patch v4.12.0+incompatible // indirect + github.com/coreos/go-semver v0.3.1 // indirect + github.com/coreos/go-systemd/v22 v22.5.0 // 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.6.0 // indirect github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect github.com/fatih/color v1.15.0 // indirect - github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fvbommel/sortorder v1.0.1 // indirect - github.com/go-errors/errors v1.0.1 // indirect + github.com/felixge/httpsnoop v1.0.3 // indirect + github.com/fvbommel/sortorder v1.1.0 // indirect + github.com/go-errors/errors v1.4.2 // indirect github.com/go-faster/city v1.0.1 // indirect github.com/go-faster/errors v0.6.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect - github.com/go-openapi/jsonreference v0.20.1 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/google/cel-go v0.12.6 // indirect - github.com/google/gnostic v0.5.7-v3refs // indirect + github.com/google/cel-go v0.17.7 // 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/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect + github.com/gorilla/websocket v1.5.0 // indirect github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect @@ -170,9 +171,9 @@ require ( github.com/mdlayher/genetlink v1.0.0 // indirect github.com/mdlayher/netlink v1.7.2 // indirect github.com/mdlayher/socket v0.4.1 // indirect - github.com/mitchellh/go-wordwrap v1.0.0 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/moby/spdystream v0.2.0 // indirect - github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect + github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect @@ -198,40 +199,40 @@ require ( github.com/stoewer/go-strcase v1.2.0 // indirect github.com/ti-mo/netfilter v0.5.0 // indirect github.com/vishvananda/netns v0.0.4 // indirect - github.com/xlab/treeprint v1.1.0 // indirect + github.com/xlab/treeprint v1.2.0 // indirect gitlab.com/golang-commonmark/puny v0.0.0-20191124015043-9f83538fa04f // indirect - go.etcd.io/etcd/api/v3 v3.5.5 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect - go.etcd.io/etcd/client/v3 v3.5.5 // indirect + go.etcd.io/etcd/api/v3 v3.5.10 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect + go.etcd.io/etcd/client/v3 v3.5.10 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0 // indirect - go.opentelemetry.io/otel v1.20.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 // indirect - go.opentelemetry.io/otel/metric v1.20.0 // indirect - go.opentelemetry.io/otel/sdk v1.20.0 // indirect - go.opentelemetry.io/otel/trace v1.20.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 // indirect + go.opentelemetry.io/otel v1.19.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 // indirect + go.opentelemetry.io/otel/metric v1.19.0 // indirect + go.opentelemetry.io/otel/sdk v1.19.0 // indirect + go.opentelemetry.io/otel/trace v1.19.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect - go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.9.0 // indirect - go.uber.org/zap v1.24.0 // indirect + go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.25.0 // indirect + golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect golang.org/x/oauth2 v0.16.0 // indirect golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.zx2c4.com/wireguard v0.0.0-20210427022245-097af6e1351b // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - k8s.io/cli-runtime v0.26.4 // indirect - k8s.io/kms v0.26.4 // indirect - sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.36 // indirect + k8s.io/cli-runtime v0.29.2 // indirect + k8s.io/kms v0.29.2 // indirect + sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/kustomize/api v0.12.1 // indirect - sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect + sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect + sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) diff --git a/go.sum b/go.sum index 9f226ee4710..e40a041ac6f 100644 --- a/go.sum +++ b/go.sum @@ -50,25 +50,22 @@ github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1o github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alessio/shellescape v1.2.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/alexflint/go-filemutex v1.2.0 h1:1v0TJPDtlhgpW4nJ+GvxCLSlUDC3+gW0CQQvlmfDR/s= github.com/alexflint/go-filemutex v1.2.0/go.mod h1:mYyQSWvw9Tx2/H2n9qXPb52tTYfE0pZAWcBq5mK025c= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 h1:yL7+Jz0jTC6yykIK/Wh74gnTJnrGr5AyrNMXuA0gves= -github.com/antlr/antlr4/runtime/Go/antlr v1.4.10/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= +github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= +github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= 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/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go-v2 v1.16.10 h1:+yDD0tcuHRQZgqONkpDwzepqmElQaSlFPymHRHR9mrc= github.com/aws/aws-sdk-go-v2 v1.16.10/go.mod h1:WTACcleLz6VZTp7fak4EO5b9Q4foxbn+8PIz3PmyKlo= @@ -107,8 +104,8 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.16.12 h1:YU9UHPukkCCnETHEExOptF/BxPv github.com/aws/aws-sdk-go-v2/service/sts v1.16.12/go.mod h1:b53qpmhHk7mTL2J/tfG6f38neZiyBQSiNXGCuNKq4+4= github.com/aws/smithy-go v1.12.1 h1:yQRC55aXN/y1W10HgwHle01DRuV9Dpf31iGkotjt3Ag= github.com/aws/smithy-go v1.12.1/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= +github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -129,7 +126,6 @@ github.com/cenkalti/rpc2 v0.0.0-20180727162946-9642ea02d0aa h1:t+iWhuJE2aropY4ux github.com/cenkalti/rpc2 v0.0.0-20180727162946-9642ea02d0aa/go.mod h1:v2npkhrXyk5BCnkNIiPdRI23Uq6uWPUQGL2hnRcRr/M= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= @@ -141,8 +137,6 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= @@ -165,12 +159,13 @@ github.com/coreos/go-iptables v0.7.0 h1:XWM3V+MPRr5/q51NuWSgU0fqMad64Zyxs8ZUoMsa github.com/coreos/go-iptables v0.7.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= +github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= @@ -179,8 +174,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= 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= @@ -196,27 +191,20 @@ github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25Kn github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1 h1:yY9rWGoXv1U5pl4gxqlULARMQD7x0QG85lqEXTWysik= -github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= -github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful/v3 v3.10.1 h1:rc42Y5YTp7Am7CS630D7JmhRjq4UlEUuEKfrDac4bSQ= -github.com/emicklei/go-restful/v3 v3.10.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +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/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= -github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= -github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= +github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.0.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= @@ -225,44 +213,39 @@ github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZM github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= -github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= 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/fvbommel/sortorder v1.0.1 h1:dSnXLt4mJYH25uDDGa3biZNQsozaUWDSWeKJ0qqFfzE= -github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= +github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw= +github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/gammazero/deque v0.1.2 h1:WvbDJ3YaT4ELf9+Cq9lv4Ef0aPRyZeEpIoVkjOw9kes= github.com/gammazero/deque v0.1.2/go.mod h1:KQw7vFau1hHuM8xmI9RbgKFbAsQFWmBpqQ2KenFLk6M= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-faster/city v1.0.1 h1:4WAxSZ3V2Ws4QRDrscLEDcibJY8uf41H6AhXDrNDcGw= github.com/go-faster/city v1.0.1/go.mod h1:jKcUJId49qdW3L1qKHH/3wPeUstCVpVSXTM6vO3VcTw= github.com/go-faster/errors v0.6.1 h1:nNIPOBkprlKzkThvS/0YaX8Zs9KewLCOSFQS5BU06FI= github.com/go-faster/errors v0.6.1/go.mod h1:5MGV2/2T9yvlrbhe9pD9LO5Z/2zCSq2T8j+Jpi2LAyY= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= 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/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= -github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= +github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= +github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= @@ -283,8 +266,8 @@ github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3Hfo github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= -github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +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/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= @@ -323,6 +306,8 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= @@ -337,7 +322,6 @@ github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -354,16 +338,17 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/cel-go v0.12.6 h1:kjeKudqV0OygrAqA9fX6J55S8gj+Jre2tckIm5RoG4M= -github.com/google/cel-go v0.12.6/go.mod h1:Jk7ljRzLBhkmiAwBoUxB1sZSCVBAzkqPF25olK/iRDw= -github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= -github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= +github.com/google/cel-go v0.17.7 h1:6ebJFzu1xO2n7TLtN+UBqShGBhlD85bhvglh5DpcfqQ= +github.com/google/cel-go v0.17.7/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -371,6 +356,7 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -396,8 +382,9 @@ github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1a github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +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/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -457,7 +444,6 @@ github.com/josharian/native v0.0.0-20200817173448-b6b71def0850/go.mod h1:7X/rasw github.com/josharian/native v1.0.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA= github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jsimonetti/rtnetlink v0.0.0-20190606172950-9527aa82566a/go.mod h1:Oz+70psSo5OFh8DBl0Zv2ACw7Esh6pPUphlvZG9x7uw= github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4/go.mod h1:WGuG/smIU4J/54PblvSbh+xvCZmpJnFgr3ds6Z55XMQ= github.com/jsimonetti/rtnetlink v0.0.0-20201009170750-9c6f07d100c1/go.mod h1:hqoO/u39cqLeBLebZ8fWdE96O7FxrAsRYhnVOdgHxok= @@ -469,12 +455,10 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.3.0 h1:MjRRgZyTGo90G+UrwlDQjU+uG4Z7By65qvQxGoILT/8= github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.3.0/go.mod h1:nqCI7aelBJU61wiBeeZWJ6oi4bJy5nrjkM6lWIMA4j0= github.com/k8snetworkplumbingwg/sriov-cni v2.1.0+incompatible h1:5comk9qUB9j99Oc+rvnm92RWWe9urdJ1TP3cXM3fmmc= @@ -489,12 +473,10 @@ github.com/kisielk/sqlstruct v0.0.0-20201105191214-5f3e10d3ab46/go.mod h1:yyMNCy github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -562,13 +544,13 @@ github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPk github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721 h1:RlZweED6sbSArvlE924+mUcZuXKLBHA35U7LN621Bws= github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721/go.mod h1:Ickgr2WtCLZ2MDGd4Gr0geeCH5HybhRJbonOgQpvSxc= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 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/term v0.0.0-20220808134915-39b0c02b01ae h1:O4SWKdcHVCvYqyDV+9CJA1fcDN2L11Bule0iFy3YlAI= -github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= +github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA= +github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= 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= @@ -582,7 +564,6 @@ github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8m github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -644,8 +625,6 @@ github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prY github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -657,24 +636,18 @@ github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= 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/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= @@ -695,7 +668,6 @@ github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -748,8 +720,8 @@ github.com/ti-mo/netfilter v0.5.0/go.mod h1:nt+8B9hx/QpqHr7Hazq+2qMCCA8u2OTkyc/7 github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE= +github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= @@ -764,79 +736,72 @@ github.com/vmware/go-ipfix v0.9.0 h1:4/N5eFliqULEaCUQV0lafOpN/1bItPE9OTAPGhrIXus github.com/vmware/go-ipfix v0.9.0/go.mod h1:MYEdL6Uel2ufOZyVCKvIAaw9hwnewK8aPr7rnwRbxMY= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk= -github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= +github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= +github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= gitlab.com/golang-commonmark/puny v0.0.0-20191124015043-9f83538fa04f h1:Wku8eEdeJqIOFHtrfkYUByc4bCaTeA6fL0UJgfEiFMI= gitlab.com/golang-commonmark/puny v0.0.0-20191124015043-9f83538fa04f/go.mod h1:Tiuhl+njh/JIg0uS/sOJVYi0x2HEa5rc1OAaVsb5tAs= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= -go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= +go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738 h1:VcrIfasaLFkyjk6KNlXQSzO+B0fZcnECiDrKJsfxka0= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd/api/v3 v3.5.5 h1:BX4JIbQ7hl7+jL+g+2j5UAr0o1bctCm6/Ct+ArBGkf0= -go.etcd.io/etcd/api/v3 v3.5.5/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8= -go.etcd.io/etcd/client/pkg/v3 v3.5.5 h1:9S0JUVvmrVl7wCF39iTQthdaaNIiAaQbmK75ogO6GU8= -go.etcd.io/etcd/client/pkg/v3 v3.5.5/go.mod h1:ggrwbk069qxpKPq8/FKkQ3Xq9y39kbFR4LnKszpRXeQ= -go.etcd.io/etcd/client/v2 v2.305.5 h1:DktRP60//JJpnPC0VBymAN/7V71GHMdjDCBt4ZPXDjI= -go.etcd.io/etcd/client/v2 v2.305.5/go.mod h1:zQjKllfqfBVyVStbt4FaosoX2iYd8fV/GRy/PbowgP4= -go.etcd.io/etcd/client/v3 v3.5.5 h1:q++2WTJbUgpQu4B6hCuT7VkdwaTP7Qz6Daak3WzbrlI= -go.etcd.io/etcd/client/v3 v3.5.5/go.mod h1:aApjR4WGlSumpnJ2kloS75h6aHUmAyaPLjHMxpc7E7c= -go.etcd.io/etcd/pkg/v3 v3.5.5 h1:Ablg7T7OkR+AeeeU32kdVhw/AGDsitkKPl7aW73ssjU= -go.etcd.io/etcd/pkg/v3 v3.5.5/go.mod h1:6ksYFxttiUGzC2uxyqiyOEvhAiD0tuIqSZkX3TyPdaE= -go.etcd.io/etcd/raft/v3 v3.5.5 h1:Ibz6XyZ60OYyRopu73lLM/P+qco3YtlZMOhnXNS051I= -go.etcd.io/etcd/raft/v3 v3.5.5/go.mod h1:76TA48q03g1y1VpTue92jZLr9lIHKUNcYdZOOGyx8rI= -go.etcd.io/etcd/server/v3 v3.5.5 h1:jNjYm/9s+f9A9r6+SC4RvNaz6AqixpOvhrFdT0PvIj0= -go.etcd.io/etcd/server/v3 v3.5.5/go.mod h1:rZ95vDw/jrvsbj9XpTqPrTAB9/kzchVdhRirySPkUBc= +go.etcd.io/etcd/api/v3 v3.5.10 h1:szRajuUUbLyppkhs9K6BRtjY37l66XQQmw7oZRANE4k= +go.etcd.io/etcd/api/v3 v3.5.10/go.mod h1:TidfmT4Uycad3NM/o25fG3J07odo4GBB9hoxaodFCtI= +go.etcd.io/etcd/client/pkg/v3 v3.5.10 h1:kfYIdQftBnbAq8pUWFXfpuuxFSKzlmM5cSn76JByiT0= +go.etcd.io/etcd/client/pkg/v3 v3.5.10/go.mod h1:DYivfIviIuQ8+/lCq4vcxuseg2P2XbHygkKwFo9fc8U= +go.etcd.io/etcd/client/v2 v2.305.10 h1:MrmRktzv/XF8CvtQt+P6wLUlURaNpSDJHFZhe//2QE4= +go.etcd.io/etcd/client/v2 v2.305.10/go.mod h1:m3CKZi69HzilhVqtPDcjhSGp+kA1OmbNn0qamH80xjA= +go.etcd.io/etcd/client/v3 v3.5.10 h1:W9TXNZ+oB3MCd/8UjxHTWK5J9Nquw9fQBLJd5ne5/Ao= +go.etcd.io/etcd/client/v3 v3.5.10/go.mod h1:RVeBnDz2PUEZqTpgqwAtUd8nAPf5kjyFyND7P1VkOKc= +go.etcd.io/etcd/pkg/v3 v3.5.10 h1:WPR8K0e9kWl1gAhB5A7gEa5ZBTNkT9NdNWrR8Qpo1CM= +go.etcd.io/etcd/pkg/v3 v3.5.10/go.mod h1:TKTuCKKcF1zxmfKWDkfz5qqYaE3JncKKZPFf8c1nFUs= +go.etcd.io/etcd/raft/v3 v3.5.10 h1:cgNAYe7xrsrn/5kXMSaH8kM/Ky8mAdMqGOxyYwpP0LA= +go.etcd.io/etcd/raft/v3 v3.5.10/go.mod h1:odD6kr8XQXTy9oQnyMPBOr0TVe+gT0neQhElQ6jbGRc= +go.etcd.io/etcd/server/v3 v3.5.10 h1:4NOGyOwD5sUZ22PiWYKmfxqoeh72z6EhYjNosKGLmZg= +go.etcd.io/etcd/server/v3 v3.5.10/go.mod h1:gBplPHfs6YI0L+RpGkTQO7buDbHv5HJGG/Bst0/zIPo= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0 h1:1eHu3/pUSWaOgltNK3WJFaywKsTIr/PwvHyDmi0lQA0= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0/go.mod h1:HyABWq60Uy1kjJSa2BVOxUVao8Cdick5AWSKPutqy6U= -go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc= -go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 h1:DeFD0VgTZ+Cj6hxravYYZE2W4GlneVH81iAOPjZkzk8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0/go.mod h1:GijYcYmNpX1KazD5JmWGsi4P7dDTTTnfv1UbGn84MnU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 h1:gvmNvqrPYovvyRmCSygkUDyL8lC5Tl845MLEwqpxhEU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0/go.mod h1:vNUq47TGFioo+ffTSnKNdob241vePmtNZnAODKapKd0= -go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9GyKR4wzA= -go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM= -go.opentelemetry.io/otel/sdk v1.20.0 h1:5Jf6imeFZlZtKv9Qbo6qt2ZkmWtdWx/wzcCbNUlAWGM= -go.opentelemetry.io/otel/sdk v1.20.0/go.mod h1:rmkSx1cZCm/tn16iWDn1GQbLtsW/LvsdEEFzCSRM6V0= -go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= -go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0 h1:ZOLJc06r4CB42laIXg/7udr0pbZyuAihN10A/XuiQRY= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0/go.mod h1:5z+/ZWJQKXa9YT34fQNx5K8Hd1EoIhvtUygUQPqEOgQ= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 h1:KfYpVmrjI7JuToy5k8XV3nkapjWx48k4E4JOtVstzQI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0/go.mod h1:SeQhzAEccGVZVEy7aH87Nh0km+utSpo1pTv6eMMop48= +go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= +go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 h1:3d+S281UTjM+AbF31XSOYn1qXn3BgIdWl8HNEpx08Jk= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0/go.mod h1:0+KuTDyKL4gjKCF75pHOX4wuzYDUZYfAQdSu43o+Z2I= +go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= +go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= +go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= +go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= +go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= -go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc= -go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= +go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY= +go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= +go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -857,15 +822,14 @@ golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +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/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= @@ -895,8 +859,6 @@ golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -904,7 +866,6 @@ golang.org/x/net v0.0.0-20201216054612-986b41b23924/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210504132125-bbd867fde50d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -915,7 +876,6 @@ golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -926,7 +886,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/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.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= @@ -951,7 +910,6 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -965,8 +923,6 @@ golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200602100848-8d3cce7afc34/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -979,12 +935,8 @@ golang.org/x/sys v0.0.0-20210123111255-9b0068b26619/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210216163648-f7da38b97c65/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309040221-94ec62e08169/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1003,6 +955,7 @@ golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= @@ -1012,7 +965,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/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.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= @@ -1037,15 +989,12 @@ golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= @@ -1058,8 +1007,8 @@ golang.zx2c4.com/wireguard v0.0.0-20210427022245-097af6e1351b/go.mod h1:a057zjmo golang.zx2c4.com/wireguard/wgctrl v0.0.0-20210506160403-92e472f520a5 h1:LpEwXnbN4q2EIPkqbG9KHBUrducJYDOOdL+eMcJAlFo= golang.zx2c4.com/wireguard/wgctrl v0.0.0-20210506160403-92e472f520a5/go.mod h1:+1XihzyZUBJcSc5WO9SwNA7v26puQwOEDwanaxfNXPQ= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= -gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= -gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= +gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= +gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1070,10 +1019,7 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU= @@ -1087,11 +1033,7 @@ google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -1102,7 +1044,6 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= @@ -1129,9 +1070,7 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1140,92 +1079,86 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/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= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= -gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= k8s.io/api v0.18.4/go.mod h1:lOIQAKYgai1+vz9J7YcDZwC26Z0zQewYOGWdyIPUUQ4= -k8s.io/api v0.26.4 h1:qSG2PmtcD23BkYiWfoYAcak870eF/hE7NNYBYavTT94= -k8s.io/api v0.26.4/go.mod h1:WwKEXU3R1rgCZ77AYa7DFksd9/BAIKyOmRlbVxgvjCk= +k8s.io/api v0.29.2 h1:hBC7B9+MU+ptchxEqTNW2DkUosJpp1P+Wn6YncZ474A= +k8s.io/api v0.29.2/go.mod h1:sdIaaKuU7P44aoyyLlikSLayT6Vb7bvJNCX105xZXY0= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.18.4/go.mod h1:NYeyeYq4SIpFlPxSAB6jHPIdvu3hL0pc36wuRChybio= -k8s.io/apiextensions-apiserver v0.26.4 h1:9D2RTxYGxrG5uYg6D7QZRcykXvavBvcA59j5kTaedQI= -k8s.io/apiextensions-apiserver v0.26.4/go.mod h1:cd4uGFGIgzEqUghWpRsr9KE8j2KNTjY8Ji8pnMMazyw= +k8s.io/apiextensions-apiserver v0.29.2 h1:UK3xB5lOWSnhaCk0RFZ0LUacPZz9RY4wi/yt2Iu+btg= +k8s.io/apiextensions-apiserver v0.29.2/go.mod h1:aLfYjpA5p3OwtqNXQFkhJ56TB+spV8Gc4wfMhUA3/b8= k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= k8s.io/apimachinery v0.18.4/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= -k8s.io/apimachinery v0.26.4 h1:rZccKdBLg9vP6J09JD+z8Yr99Ce8gk3Lbi9TCx05Jzs= -k8s.io/apimachinery v0.26.4/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I= +k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8= +k8s.io/apimachinery v0.29.2/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.18.4/go.mod h1:q+zoFct5ABNnYkGIaGQ3bcbUNdmPyOCoEBcg51LChY8= -k8s.io/apiserver v0.26.4 h1:3Oq4mnJv0mzVX7BR/Nod+8KjlELf/3Ljvu9ZWDyLUoA= -k8s.io/apiserver v0.26.4/go.mod h1:yAY3O1vBM4/0OIGAGeWcdfzQvgdwJ188VirLcuSAVnw= -k8s.io/cli-runtime v0.26.4 h1:MgSU871KDzBDX7V9GtuqS6Ai9lhQCHgRzkurnXOWtZ0= -k8s.io/cli-runtime v0.26.4/go.mod h1:MjJ2DXMChw2zcG0/agzm17xwKpfVxOfuoCdfY9iOCOE= +k8s.io/apiserver v0.29.2 h1:+Z9S0dSNr+CjnVXQePG8TcBWHr3Q7BmAr7NraHvsMiQ= +k8s.io/apiserver v0.29.2/go.mod h1:B0LieKVoyU7ykQvPFm7XSdIHaCHSzCzQWPFa5bqbeMQ= +k8s.io/cli-runtime v0.29.2 h1:smfsOcT4QujeghsNjECKN3lwyX9AwcFU0nvJ7sFN3ro= +k8s.io/cli-runtime v0.29.2/go.mod h1:KLisYYfoqeNfO+MkTWvpqIyb1wpJmmFJhioA0xd4MW8= k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= k8s.io/client-go v0.18.4/go.mod h1:f5sXwL4yAZRkAtzOxRWUhA/N8XzGCb+nPZI8PfobZ9g= -k8s.io/client-go v0.26.4 h1:/7P/IbGBuT73A+G97trf44NTPSNqvuBREpOfdLbHvD4= -k8s.io/client-go v0.26.4/go.mod h1:6qOItWm3EwxJdl/8p5t7FWtWUOwyMdA8N9ekbW4idpI= +k8s.io/client-go v0.29.2 h1:FEg85el1TeZp+/vYJM7hkDlSTFZ+c5nnK44DJ4FyoRg= +k8s.io/client-go v0.29.2/go.mod h1:knlvFZE58VpqbQpJNbCbctTVXcd35mMyAAwBdpt4jrA= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.4/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= k8s.io/component-base v0.18.4/go.mod h1:7jr/Ef5PGmKwQhyAz/pjByxJbC58mhKAhiaDu0vXfPk= -k8s.io/component-base v0.26.4 h1:Bg2xzyXNKL3eAuiTEu3XE198d6z22ENgFgGQv2GGOUk= -k8s.io/component-base v0.26.4/go.mod h1:lTuWL1Xz/a4e80gmIC3YZG2JCO4xNwtKWHJWeJmsq20= +k8s.io/component-base v0.29.2 h1:lpiLyuvPA9yV1aQwGLENYyK7n/8t6l3nn3zAtFTJYe8= +k8s.io/component-base v0.29.2/go.mod h1:BfB3SLrefbZXiBfbM+2H1dlat21Uewg/5qtKOl8degM= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kms v0.26.4 h1:mQ+DeOvgAHC6+heZcozPkEd3rWtP4DVVjo1hLSih9w4= -k8s.io/kms v0.26.4/go.mod h1:69qGnf1NsFOQP07fBYqNLZklqEHSJF024JqYCaeVxHg= -k8s.io/kube-aggregator v0.26.4 h1:iGljhq5exQkbuc3bnkwUx95RPCBDExg7DkX9XaYhg6w= -k8s.io/kube-aggregator v0.26.4/go.mod h1:eWfg4tU0+l57ebWiS5THOANIJUrKRxudSVDJ+63bqvQ= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/kms v0.29.2 h1:MDsbp98gSlEQs7K7dqLKNNTwKFQRYYvO4UOlBOjNy6Y= +k8s.io/kms v0.29.2/go.mod h1:s/9RC4sYRZ/6Tn6yhNjbfJuZdb8LzlXhdlBnKizeFDo= +k8s.io/kube-aggregator v0.29.2 h1:z9qJn5wlGmGaX6EfM7OEhr6fq6SBjDKR6tPRZ/qgxeY= +k8s.io/kube-aggregator v0.29.2/go.mod h1:QEuwzmMJJsg0eg1Gv+u4cWcYeJG2+8vN8/nTXBzopUo= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= -k8s.io/kubectl v0.26.4 h1:A0Oa0u/po4KxXnXsNCOwLojAe9cQR3TJNJabEIf7U1w= -k8s.io/kubectl v0.26.4/go.mod h1:cWtp/+I4p+h5En3s2zO1zCry9v3/6h37EQ2tF3jNRnM= -k8s.io/kubelet v0.26.4 h1:SEQPfjN4lu4uL9O8NdeN7Aum3liQ4kOnp/yC3jMRMUo= -k8s.io/kubelet v0.26.4/go.mod h1:ZMPGTCnrQ5UOlC7igXhbW9cgna1LtTRWLaHub4dA2FU= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/kubectl v0.29.2 h1:uaDYaBhumvkwz0S2XHt36fK0v5IdNgL7HyUniwb2IUo= +k8s.io/kubectl v0.29.2/go.mod h1:BhizuYBGcKaHWyq+G7txGw2fXg576QbPrrnQdQDZgqI= +k8s.io/kubelet v0.29.2 h1:bQ2StqkUqPCFNLtGLsb3v3O2LKQHXNMju537zOGboRg= +k8s.io/kubelet v0.29.2/go.mod h1:i5orNPqW/fAMrqptbCXFW/vLBBP12TZZc41IrrvF7SY= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= -k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.36 h1:PUuX1qIFv309AT8hF/CdPKDmsG/hn/L8zRX7VvISM3A= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.36/go.mod h1:WxjusMwXlKzfAs4p9km6XJRndVt2FROgMVCE4cdohFo= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 h1:TgtAeesdhpm2SGwkQasmbeqDo8th5wOBA5h/AjTKA4I= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0/go.mod h1:VHVDI/KrK4fjnV61bE2g3sA7tiETLn8sooImelsCx3Y= sigs.k8s.io/controller-runtime v0.6.1/go.mod h1:XRYBPdbf5XJu9kpS84VJiZ7h/u1hF3gEORz0efEja7A= -sigs.k8s.io/controller-runtime v0.14.6 h1:oxstGVvXGNnMvY7TAESYk+lzr6S3V5VFxQ6d92KcwQA= -sigs.k8s.io/controller-runtime v0.14.6/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0= +sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4= +sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0= sigs.k8s.io/controller-tools v0.3.0/go.mod h1:enhtKGfxZD1GFEoMgP8Fdbu+uKQ/cq1/WGJhdVChfvI= 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/kind v0.8.1/go.mod h1:oNKTxUVPYkV9lWzY6CVMNluVq8cBsyq+UgPJdvA3uu4= -sigs.k8s.io/kustomize/api v0.12.1 h1:7YM7gW3kYBwtKvoY216ZzY+8hM+lV53LUayghNRJ0vM= -sigs.k8s.io/kustomize/api v0.12.1/go.mod h1:y3JUhimkZkR6sbLNwfJHxvo1TCLwuwm14sCYnkH6S1s= -sigs.k8s.io/kustomize/kyaml v0.13.9 h1:Qz53EAaFFANyNgyOEJbT/yoIHygK40/ZcvU3rgry2Tk= -sigs.k8s.io/kustomize/kyaml v0.13.9/go.mod h1:QsRbD0/KcU+wdk0/L0fIp2KLnohkVzs6fQ85/nOXac4= +sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 h1:XX3Ajgzov2RKUdc5jW3t5jwY7Bo7dcRm+tFxT+NfgY0= +sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3/go.mod h1:9n16EZKMhXBNSiUC5kSdFQJkdH3zbxS/JoO619G1VAY= +sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3 h1:W6cLQc5pnqM7vh3b7HvGNfXrJ/xL6BDMS0v1V/HHg5U= +sigs.k8s.io/kustomize/kyaml v0.14.3-0.20230601165947-6ce0bf390ce3/go.mod h1:JWP1Fj0VWGHyw3YUPjXSQnRnrwezrZSrApfX5S0nIag= sigs.k8s.io/mcs-api v0.1.0 h1:edDbg0oRGfXw8TmZjKYep06LcJLv/qcYLidejnUp0PM= sigs.k8s.io/mcs-api v0.1.0/go.mod h1:gGiAryeFNB4GBsq2LBmVqSgKoobLxt+p7ii/WG5QYYw= sigs.k8s.io/network-policy-api v0.1.1 h1:KDW+AkvCCQI3h8yH8j0hurhvPLNtLeVvmZoqtMaG9ew= sigs.k8s.io/network-policy-api v0.1.1/go.mod h1:F7S5fsb7QEzlLjuMgTGfUT4LRHylRbx2xDDpHfJKKEs= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 719d6b549c4..d5d66efb1f8 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -18,7 +18,7 @@ set -o errexit set -o pipefail ANTREA_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )" -IMAGE_NAME="antrea/codegen:kubernetes-1.26.4-build.1" +IMAGE_NAME="antrea/codegen:kubernetes-1.29.2" # Recent versions of Git will not access .git directories which are owned by # another user (as a security measure), unless the directories are explicitly diff --git a/multicluster/apis/multicluster/v1alpha1/multiclusterconfig_types.go b/multicluster/apis/multicluster/v1alpha1/multiclusterconfig_types.go index af0ed8c8c3c..b66ce52639a 100644 --- a/multicluster/apis/multicluster/v1alpha1/multiclusterconfig_types.go +++ b/multicluster/apis/multicluster/v1alpha1/multiclusterconfig_types.go @@ -18,7 +18,6 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - config "sigs.k8s.io/controller-runtime/pkg/config/v1alpha1" ) // Precedence defines the precedence of Node IP type. @@ -37,8 +36,12 @@ const ( // +kubebuilder:printcolumn:name="Service CIDR",type=string,JSONPath=`.serviceCIDR`,description="Manually specified Service CIDR" type MultiClusterConfig struct { metav1.TypeMeta `json:",inline"` - // ControllerManagerConfigurationSpec defines the contfigurations for controllers. - config.ControllerManagerConfigurationSpec `json:",inline"` + // Metrics contains the controller metrics configuration + Metrics ControllerMetrics `json:"metrics,omitempty"` + // Health contains the controller health configuration + Health ControllerHealth `json:"health,omitempty"` + // Webhook contains the controllers webhook configuration + Webhook ControllerWebhook `json:"webhook,omitempty"` // ServiceCIDR allows user to set the ClusterIP range of the cluster manually. ServiceCIDR string `json:"serviceCIDR,omitempty"` // PodCIDRs is the Pod IP address CIDRs. @@ -59,6 +62,34 @@ type MultiClusterConfig struct { EnableStretchedNetworkPolicy bool `json:"enableStretchedNetworkPolicy,omitempty"` } +type ControllerMetrics struct { + // BindAddress is the TCP address that the controller should bind to + // for serving prometheus metrics. + // It can be set to "0" to disable the metrics serving. + BindAddress string `json:"bindAddress,omitempty"` +} + +type ControllerWebhook struct { + // Port is the port that the webhook server serves at. + // It is used to set webhook.Server.Port. + Port *int `json:"port,omitempty"` + // Host is the hostname that the webhook server binds to. + // It is used to set webhook.Server.Host. + Host string `json:"host,omitempty"` + // CertDir is the directory that contains the server key and certificate. + // if not set, webhook server would look up the server key and certificate in + // {TempDir}/k8s-webhook-server/serving-certs. The server key and certificate + // must be named tls.key and tls.crt, respectively. + CertDir string `json:"certDir,omitempty"` +} + +type ControllerHealth struct { + // HealthProbeBindAddress is the TCP address that the controller should bind to + // for serving health probes + // It can be set to "0" or "" to disable serving the health probe. + HealthProbeBindAddress string `json:"healthProbeBindAddress,omitempty"` +} + func init() { SchemeBuilder.Register(&MultiClusterConfig{}) } diff --git a/multicluster/apis/multicluster/v1alpha1/zz_generated.deepcopy.go b/multicluster/apis/multicluster/v1alpha1/zz_generated.deepcopy.go index ebebbdea7eb..60a07c018b7 100644 --- a/multicluster/apis/multicluster/v1alpha1/zz_generated.deepcopy.go +++ b/multicluster/apis/multicluster/v1alpha1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated // +build !ignore_autogenerated -// Copyright 2023 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -305,6 +305,56 @@ func (in *ClusterStatus) DeepCopy() *ClusterStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControllerHealth) DeepCopyInto(out *ControllerHealth) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerHealth. +func (in *ControllerHealth) DeepCopy() *ControllerHealth { + if in == nil { + return nil + } + out := new(ControllerHealth) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControllerMetrics) DeepCopyInto(out *ControllerMetrics) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerMetrics. +func (in *ControllerMetrics) DeepCopy() *ControllerMetrics { + if in == nil { + return nil + } + out := new(ControllerMetrics) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControllerWebhook) DeepCopyInto(out *ControllerWebhook) { + *out = *in + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerWebhook. +func (in *ControllerWebhook) DeepCopy() *ControllerWebhook { + if in == nil { + return nil + } + out := new(ControllerWebhook) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *EndpointsExport) DeepCopyInto(out *EndpointsExport) { *out = *in @@ -626,7 +676,9 @@ func (in *MemberClusterAnnounceList) DeepCopyObject() runtime.Object { func (in *MultiClusterConfig) DeepCopyInto(out *MultiClusterConfig) { *out = *in out.TypeMeta = in.TypeMeta - in.ControllerManagerConfigurationSpec.DeepCopyInto(&out.ControllerManagerConfigurationSpec) + out.Metrics = in.Metrics + out.Health = in.Health + in.Webhook.DeepCopyInto(&out.Webhook) if in.PodCIDRs != nil { in, out := &in.PodCIDRs, &out.PodCIDRs *out = make([]string, len(*in)) diff --git a/multicluster/build/yamls/antrea-multicluster-leader-global.yml b/multicluster/build/yamls/antrea-multicluster-leader-global.yml index ca5fcd07e5b..d282ae78aab 100644 --- a/multicluster/build/yamls/antrea-multicluster-leader-global.yml +++ b/multicluster/build/yamls/antrea-multicluster-leader-global.yml @@ -2703,13 +2703,10 @@ spec: description: The Hostname of this endpoint type: string ip: - description: 'The IP of this endpoint. May not be - loopback (127.0.0.0/8), link-local (169.254.0.0/16), - or link-local multicast ((224.0.0.0/24). IPv6 is - also accepted but not fully supported on all platforms. - Also, certain kubernetes components, like kube-proxy, - are not IPv6 ready. TODO: This should allow hostname - or IP, See #4447.' + description: The IP of this endpoint. May not be loopback + (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 + or fe80::/10), or link-local multicast (224.0.0.0/24 + or ff02::/16). type: string nodeName: description: 'Optional: Node hosting this endpoint. @@ -2777,13 +2774,10 @@ spec: description: The Hostname of this endpoint type: string ip: - description: 'The IP of this endpoint. May not be - loopback (127.0.0.0/8), link-local (169.254.0.0/16), - or link-local multicast ((224.0.0.0/24). IPv6 is - also accepted but not fully supported on all platforms. - Also, certain kubernetes components, like kube-proxy, - are not IPv6 ready. TODO: This should allow hostname - or IP, See #4447.' + description: The IP of this endpoint. May not be loopback + (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 + or fe80::/10), or link-local multicast (224.0.0.0/24 + or ff02::/16). type: string nodeName: description: 'Optional: Node hosting this endpoint. @@ -2845,12 +2839,22 @@ spec: single port. properties: appProtocol: - description: The application protocol for this port. + description: "The application protocol for this port. + This is used as a hint for implementations to offer + richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. - Un-prefixed names are reserved for IANA standard - service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). - Non-standard protocols should use prefixed names - such as mycompany.com/my-custom-protocol. + Valid values are either: \n * Un-prefixed protocol + names - reserved for IANA standard service names + (as per RFC-6335 and https://www.iana.org/assignments/service-names). + \n * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' + - HTTP/2 prior knowledge over cleartext as described + in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- + * 'kubernetes.io/ws' - WebSocket over cleartext + as described in https://www.rfc-editor.org/rfc/rfc6455 + * 'kubernetes.io/wss' - WebSocket over TLS as described + in https://www.rfc-editor.org/rfc/rfc6455 \n * Other + protocols should use implementation-defined prefixed + names such as mycompany.com/my-custom-protocol." type: string name: description: The name of this port. This must match @@ -3136,11 +3140,10 @@ spec: supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature. Deprecated: This field was - under-specified and its meaning varies across implementations, - and it cannot support dual-stack. As of Kubernetes v1.24, - users are encouraged to use implementation-specific annotations - when available. This field may be removed in a future API - version.' + under-specified and its meaning varies across implementations. + Using it is non-portable and it may not support dual-stack. + Users are encouraged to use implementation-specific annotations + when available.' type: string loadBalancerSourceRanges: description: 'If specified and supported by the platform, @@ -3159,12 +3162,22 @@ spec: port. properties: appProtocol: - description: The application protocol for this port. + description: "The application protocol for this port. + This is used as a hint for implementations to offer + richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. - Un-prefixed names are reserved for IANA standard service - names (as per RFC-6335 and https://www.iana.org/assignments/service-names). - Non-standard protocols should use prefixed names such - as mycompany.com/my-custom-protocol. + Valid values are either: \n * Un-prefixed protocol + names - reserved for IANA standard service names (as + per RFC-6335 and https://www.iana.org/assignments/service-names). + \n * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' + - HTTP/2 prior knowledge over cleartext as described + in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- + * 'kubernetes.io/ws' - WebSocket over cleartext as + described in https://www.rfc-editor.org/rfc/rfc6455 + * 'kubernetes.io/wss' - WebSocket over TLS as described + in https://www.rfc-editor.org/rfc/rfc6455 \n * Other + protocols should use implementation-defined prefixed + names such as mycompany.com/my-custom-protocol." type: string name: description: The name of this port within the service. @@ -5614,13 +5627,10 @@ spec: description: The Hostname of this endpoint type: string ip: - description: 'The IP of this endpoint. May not be - loopback (127.0.0.0/8), link-local (169.254.0.0/16), - or link-local multicast ((224.0.0.0/24). IPv6 is - also accepted but not fully supported on all platforms. - Also, certain kubernetes components, like kube-proxy, - are not IPv6 ready. TODO: This should allow hostname - or IP, See #4447.' + description: The IP of this endpoint. May not be loopback + (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 + or fe80::/10), or link-local multicast (224.0.0.0/24 + or ff02::/16). type: string nodeName: description: 'Optional: Node hosting this endpoint. @@ -5688,13 +5698,10 @@ spec: description: The Hostname of this endpoint type: string ip: - description: 'The IP of this endpoint. May not be - loopback (127.0.0.0/8), link-local (169.254.0.0/16), - or link-local multicast ((224.0.0.0/24). IPv6 is - also accepted but not fully supported on all platforms. - Also, certain kubernetes components, like kube-proxy, - are not IPv6 ready. TODO: This should allow hostname - or IP, See #4447.' + description: The IP of this endpoint. May not be loopback + (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 + or fe80::/10), or link-local multicast (224.0.0.0/24 + or ff02::/16). type: string nodeName: description: 'Optional: Node hosting this endpoint. @@ -5756,12 +5763,22 @@ spec: single port. properties: appProtocol: - description: The application protocol for this port. + description: "The application protocol for this port. + This is used as a hint for implementations to offer + richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. - Un-prefixed names are reserved for IANA standard - service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). - Non-standard protocols should use prefixed names - such as mycompany.com/my-custom-protocol. + Valid values are either: \n * Un-prefixed protocol + names - reserved for IANA standard service names + (as per RFC-6335 and https://www.iana.org/assignments/service-names). + \n * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' + - HTTP/2 prior knowledge over cleartext as described + in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- + * 'kubernetes.io/ws' - WebSocket over cleartext + as described in https://www.rfc-editor.org/rfc/rfc6455 + * 'kubernetes.io/wss' - WebSocket over TLS as described + in https://www.rfc-editor.org/rfc/rfc6455 \n * Other + protocols should use implementation-defined prefixed + names such as mycompany.com/my-custom-protocol." type: string name: description: The name of this port. This must match diff --git a/multicluster/build/yamls/antrea-multicluster-leader-namespaced.yml b/multicluster/build/yamls/antrea-multicluster-leader-namespaced.yml index c1c8bb56785..b9f7e243bd8 100644 --- a/multicluster/build/yamls/antrea-multicluster-leader-namespaced.yml +++ b/multicluster/build/yamls/antrea-multicluster-leader-namespaced.yml @@ -298,8 +298,6 @@ data: bindAddress: "0" webhook: port: 9443 - leaderElection: - leaderElect: false serviceCIDR: "" podCIDRs: - "" @@ -356,7 +354,7 @@ spec: template: metadata: annotations: - checksum/config: 7eb0f1e65f7eb3e35b0739d6064b92b7621af0f4e41813c35bfdee71ceaefbe2 + checksum/config: 81ec1a33aace39ae40ac2f5d909b5d1d0208bbe6a1e8d1d9ada232bcc583b76a labels: app: antrea component: antrea-mc-controller diff --git a/multicluster/build/yamls/antrea-multicluster-leader.yml b/multicluster/build/yamls/antrea-multicluster-leader.yml index 8c8a4c10ad8..2e7e449c5f5 100644 --- a/multicluster/build/yamls/antrea-multicluster-leader.yml +++ b/multicluster/build/yamls/antrea-multicluster-leader.yml @@ -2703,13 +2703,10 @@ spec: description: The Hostname of this endpoint type: string ip: - description: 'The IP of this endpoint. May not be - loopback (127.0.0.0/8), link-local (169.254.0.0/16), - or link-local multicast ((224.0.0.0/24). IPv6 is - also accepted but not fully supported on all platforms. - Also, certain kubernetes components, like kube-proxy, - are not IPv6 ready. TODO: This should allow hostname - or IP, See #4447.' + description: The IP of this endpoint. May not be loopback + (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 + or fe80::/10), or link-local multicast (224.0.0.0/24 + or ff02::/16). type: string nodeName: description: 'Optional: Node hosting this endpoint. @@ -2777,13 +2774,10 @@ spec: description: The Hostname of this endpoint type: string ip: - description: 'The IP of this endpoint. May not be - loopback (127.0.0.0/8), link-local (169.254.0.0/16), - or link-local multicast ((224.0.0.0/24). IPv6 is - also accepted but not fully supported on all platforms. - Also, certain kubernetes components, like kube-proxy, - are not IPv6 ready. TODO: This should allow hostname - or IP, See #4447.' + description: The IP of this endpoint. May not be loopback + (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 + or fe80::/10), or link-local multicast (224.0.0.0/24 + or ff02::/16). type: string nodeName: description: 'Optional: Node hosting this endpoint. @@ -2845,12 +2839,22 @@ spec: single port. properties: appProtocol: - description: The application protocol for this port. + description: "The application protocol for this port. + This is used as a hint for implementations to offer + richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. - Un-prefixed names are reserved for IANA standard - service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). - Non-standard protocols should use prefixed names - such as mycompany.com/my-custom-protocol. + Valid values are either: \n * Un-prefixed protocol + names - reserved for IANA standard service names + (as per RFC-6335 and https://www.iana.org/assignments/service-names). + \n * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' + - HTTP/2 prior knowledge over cleartext as described + in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- + * 'kubernetes.io/ws' - WebSocket over cleartext + as described in https://www.rfc-editor.org/rfc/rfc6455 + * 'kubernetes.io/wss' - WebSocket over TLS as described + in https://www.rfc-editor.org/rfc/rfc6455 \n * Other + protocols should use implementation-defined prefixed + names such as mycompany.com/my-custom-protocol." type: string name: description: The name of this port. This must match @@ -3136,11 +3140,10 @@ spec: supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature. Deprecated: This field was - under-specified and its meaning varies across implementations, - and it cannot support dual-stack. As of Kubernetes v1.24, - users are encouraged to use implementation-specific annotations - when available. This field may be removed in a future API - version.' + under-specified and its meaning varies across implementations. + Using it is non-portable and it may not support dual-stack. + Users are encouraged to use implementation-specific annotations + when available.' type: string loadBalancerSourceRanges: description: 'If specified and supported by the platform, @@ -3159,12 +3162,22 @@ spec: port. properties: appProtocol: - description: The application protocol for this port. + description: "The application protocol for this port. + This is used as a hint for implementations to offer + richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. - Un-prefixed names are reserved for IANA standard service - names (as per RFC-6335 and https://www.iana.org/assignments/service-names). - Non-standard protocols should use prefixed names such - as mycompany.com/my-custom-protocol. + Valid values are either: \n * Un-prefixed protocol + names - reserved for IANA standard service names (as + per RFC-6335 and https://www.iana.org/assignments/service-names). + \n * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' + - HTTP/2 prior knowledge over cleartext as described + in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- + * 'kubernetes.io/ws' - WebSocket over cleartext as + described in https://www.rfc-editor.org/rfc/rfc6455 + * 'kubernetes.io/wss' - WebSocket over TLS as described + in https://www.rfc-editor.org/rfc/rfc6455 \n * Other + protocols should use implementation-defined prefixed + names such as mycompany.com/my-custom-protocol." type: string name: description: The name of this port within the service. @@ -5614,13 +5627,10 @@ spec: description: The Hostname of this endpoint type: string ip: - description: 'The IP of this endpoint. May not be - loopback (127.0.0.0/8), link-local (169.254.0.0/16), - or link-local multicast ((224.0.0.0/24). IPv6 is - also accepted but not fully supported on all platforms. - Also, certain kubernetes components, like kube-proxy, - are not IPv6 ready. TODO: This should allow hostname - or IP, See #4447.' + description: The IP of this endpoint. May not be loopback + (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 + or fe80::/10), or link-local multicast (224.0.0.0/24 + or ff02::/16). type: string nodeName: description: 'Optional: Node hosting this endpoint. @@ -5688,13 +5698,10 @@ spec: description: The Hostname of this endpoint type: string ip: - description: 'The IP of this endpoint. May not be - loopback (127.0.0.0/8), link-local (169.254.0.0/16), - or link-local multicast ((224.0.0.0/24). IPv6 is - also accepted but not fully supported on all platforms. - Also, certain kubernetes components, like kube-proxy, - are not IPv6 ready. TODO: This should allow hostname - or IP, See #4447.' + description: The IP of this endpoint. May not be loopback + (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 + or fe80::/10), or link-local multicast (224.0.0.0/24 + or ff02::/16). type: string nodeName: description: 'Optional: Node hosting this endpoint. @@ -5756,12 +5763,22 @@ spec: single port. properties: appProtocol: - description: The application protocol for this port. + description: "The application protocol for this port. + This is used as a hint for implementations to offer + richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. - Un-prefixed names are reserved for IANA standard - service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). - Non-standard protocols should use prefixed names - such as mycompany.com/my-custom-protocol. + Valid values are either: \n * Un-prefixed protocol + names - reserved for IANA standard service names + (as per RFC-6335 and https://www.iana.org/assignments/service-names). + \n * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' + - HTTP/2 prior knowledge over cleartext as described + in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- + * 'kubernetes.io/ws' - WebSocket over cleartext + as described in https://www.rfc-editor.org/rfc/rfc6455 + * 'kubernetes.io/wss' - WebSocket over TLS as described + in https://www.rfc-editor.org/rfc/rfc6455 \n * Other + protocols should use implementation-defined prefixed + names such as mycompany.com/my-custom-protocol." type: string name: description: The name of this port. This must match @@ -6334,8 +6351,6 @@ data: bindAddress: "0" webhook: port: 9443 - leaderElection: - leaderElect: false serviceCIDR: "" podCIDRs: - "" @@ -6392,7 +6407,7 @@ spec: template: metadata: annotations: - checksum/config: 7eb0f1e65f7eb3e35b0739d6064b92b7621af0f4e41813c35bfdee71ceaefbe2 + checksum/config: 81ec1a33aace39ae40ac2f5d909b5d1d0208bbe6a1e8d1d9ada232bcc583b76a labels: app: antrea component: antrea-mc-controller diff --git a/multicluster/build/yamls/antrea-multicluster-member.yml b/multicluster/build/yamls/antrea-multicluster-member.yml index 47f0adfc8c7..5642c80ac57 100644 --- a/multicluster/build/yamls/antrea-multicluster-member.yml +++ b/multicluster/build/yamls/antrea-multicluster-member.yml @@ -1152,8 +1152,6 @@ data: bindAddress: "0" webhook: port: 9443 - leaderElection: - leaderElect: false serviceCIDR: "" podCIDRs: - "" @@ -1199,7 +1197,7 @@ spec: template: metadata: annotations: - checksum/config: 7eb0f1e65f7eb3e35b0739d6064b92b7621af0f4e41813c35bfdee71ceaefbe2 + checksum/config: 81ec1a33aace39ae40ac2f5d909b5d1d0208bbe6a1e8d1d9ada232bcc583b76a labels: app: antrea component: antrea-mc-controller diff --git a/multicluster/cmd/multicluster-controller/clusterset_webhook_test.go b/multicluster/cmd/multicluster-controller/clusterset_webhook_test.go index e8de60a93f6..8e23f008544 100644 --- a/multicluster/cmd/multicluster-controller/clusterset_webhook_test.go +++ b/multicluster/cmd/multicluster-controller/clusterset_webhook_test.go @@ -25,7 +25,6 @@ import ( v1 "k8s.io/api/admission/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/klog/v2" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" @@ -181,10 +180,7 @@ func TestWebhookClusterSetEvents(t *testing.T) { }, } - decoder, err := admission.NewDecoder(common.TestScheme) - if err != nil { - klog.ErrorS(err, "Error constructing a decoder") - } + decoder := admission.NewDecoder(common.TestScheme) for _, tt := range tests { objects := []client.Object{} diff --git a/multicluster/cmd/multicluster-controller/controller.go b/multicluster/cmd/multicluster-controller/controller.go index bf86deb45be..00c39a4145b 100644 --- a/multicluster/cmd/multicluster-controller/controller.go +++ b/multicluster/cmd/multicluster-controller/controller.go @@ -35,8 +35,10 @@ import ( aggregatorclientset "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" + controllerruntimeclient "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/manager" + "sigs.k8s.io/controller-runtime/pkg/webhook" k8smcsv1alpha1 "sigs.k8s.io/mcs-api/pkg/apis/v1alpha1" mcv1alpha1 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha1" @@ -148,7 +150,7 @@ func setupManagerAndCertController(isLeader bool, o *Options) (manager.Manager, secureServing := genericoptions.NewSecureServingOptions().WithLoopback() caCertController, err := certificate.ApplyServerCert(o.SelfSignedCert, client, aggregatorClient, apiExtensionClient, - secureServing, getCaConfig(isLeader, o.options.Namespace)) + secureServing, getCaConfig(isLeader, o.Namespace)) if err != nil { return nil, fmt.Errorf("error applying server cert: %v", err) } @@ -157,25 +159,31 @@ func setupManagerAndCertController(isLeader bool, o *Options) (manager.Manager, } if o.SelfSignedCert { - o.options.CertDir = selfSignedCertDir + o.options.Metrics.CertDir = selfSignedCertDir + o.WebhookConfig.CertDir = selfSignedCertDir } else { - o.options.CertDir = certDir + o.options.Metrics.CertDir = certDir + o.WebhookConfig.CertDir = certDir } + o.options.WebhookServer = webhook.NewServer(webhook.Options{ + Port: *o.WebhookConfig.Port, + Host: o.WebhookConfig.Host, + CertDir: o.WebhookConfig.CertDir, + }) namespaceFieldSelector := fields.SelectorFromSet(fields.Set{"metadata.namespace": env.GetPodNamespace()}) - o.options.NewCache = cache.BuilderWithOptions(cache.Options{ - SelectorsByObject: cache.SelectorsByObject{ - &mcv1alpha1.Gateway{}: { - Field: namespaceFieldSelector, - }, - &mcv1alpha2.ClusterSet{}: { - Field: namespaceFieldSelector, - }, - &mcv1alpha1.MemberClusterAnnounce{}: { - Field: namespaceFieldSelector, - }, + o.options.Cache.DefaultFieldSelector = namespaceFieldSelector + o.options.Cache.ByObject = map[controllerruntimeclient.Object]cache.ByObject{ + &mcv1alpha1.Gateway{}: { + Field: namespaceFieldSelector, }, - }) + &mcv1alpha2.ClusterSet{}: { + Field: namespaceFieldSelector, + }, + &mcv1alpha1.MemberClusterAnnounce{}: { + Field: namespaceFieldSelector, + }, + } // EndpointSlice is enabled in AntreaProxy by default since v1.11, so Antrea MC // will use EndpointSlice API by default to keep consistent with AntreaProxy. @@ -198,9 +206,13 @@ func setupManagerAndCertController(isLeader bool, o *Options) (manager.Manager, } o.ClusterCalimCRDAvailable = clusterClaimCRDAvailable - mgr, err := ctrl.NewManager(k8sConfig, o.options) + mgr, err := ctrl.NewManager(k8sConfig, manager.Options{ + Scheme: o.options.Scheme, + Metrics: o.options.Metrics, + HealthProbeBindAddress: o.options.HealthProbeBindAddress, + }) if err != nil { - return nil, fmt.Errorf("error starting manager: %v", err) + return nil, fmt.Errorf("error creating manager: %v", err) } //+kubebuilder:scaffold:builder diff --git a/multicluster/cmd/multicluster-controller/gateway_webhook_test.go b/multicluster/cmd/multicluster-controller/gateway_webhook_test.go index 210eb67e71f..b2bec75ca66 100644 --- a/multicluster/cmd/multicluster-controller/gateway_webhook_test.go +++ b/multicluster/cmd/multicluster-controller/gateway_webhook_test.go @@ -26,7 +26,6 @@ import ( authenticationv1 "k8s.io/api/authentication/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/klog/v2" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" @@ -173,10 +172,7 @@ func TestWebhookGatewayEvents(t *testing.T) { }, } - decoder, err := admission.NewDecoder(common.TestScheme) - if err != nil { - klog.ErrorS(err, "Error constructing a decoder") - } + decoder := admission.NewDecoder(common.TestScheme) for _, tt := range tests { fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects().Build() if tt.existingGateway != nil { diff --git a/multicluster/cmd/multicluster-controller/leader.go b/multicluster/cmd/multicluster-controller/leader.go index 2fee6958c43..a9ad3a01cf4 100644 --- a/multicluster/cmd/multicluster-controller/leader.go +++ b/multicluster/cmd/multicluster-controller/leader.go @@ -52,7 +52,7 @@ func newLeaderCommand() *cobra.Command { func runLeader(o *Options) error { // on the leader we want the reconciler to run for a given Namespace instead of cluster scope podNamespace := env.GetPodNamespace() - o.options.Namespace = podNamespace + o.Namespace = podNamespace stopCh := signals.RegisterSignalHandlers() mgr, err := setupManagerAndCertControllerFunc(true, o) diff --git a/multicluster/cmd/multicluster-controller/leader_test.go b/multicluster/cmd/multicluster-controller/leader_test.go index 26660b139f6..bdf73b033dc 100644 --- a/multicluster/cmd/multicluster-controller/leader_test.go +++ b/multicluster/cmd/multicluster-controller/leader_test.go @@ -29,7 +29,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache/informertest" "sigs.k8s.io/controller-runtime/pkg/client/fake" - "sigs.k8s.io/controller-runtime/pkg/config/v1alpha1" + "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/webhook" "antrea.io/antrea/multicluster/controllers/multicluster/common" @@ -39,13 +39,13 @@ import ( func initMockManager(mockManager *mocks.MockManager) { fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithObjects().Build() - mockManager.EXPECT().GetWebhookServer().Return(&webhook.Server{}).AnyTimes() - mockManager.EXPECT().GetWebhookServer().Return(&webhook.Server{}).AnyTimes() + mockManager.EXPECT().GetWebhookServer().Return(&webhook.DefaultServer{}).AnyTimes() + mockManager.EXPECT().GetWebhookServer().Return(&webhook.DefaultServer{}).AnyTimes() mockManager.EXPECT().GetClient().Return(fakeClient).AnyTimes() mockManager.EXPECT().GetScheme().Return(common.TestScheme).AnyTimes() - mockManager.EXPECT().GetControllerOptions().Return(v1alpha1.ControllerConfigurationSpec{}).AnyTimes() + mockManager.EXPECT().GetControllerOptions().Return(config.Controller{}).AnyTimes() + mockManager.EXPECT().GetCache().Return(&informertest.FakeInformers{}).AnyTimes() mockManager.EXPECT().GetLogger().Return(klog.NewKlogr()).AnyTimes() - mockManager.EXPECT().SetFields(gomock.Any()).Return(nil).AnyTimes() mockManager.EXPECT().Add(gomock.Any()).Return(nil).AnyTimes() mockManager.EXPECT().Start(gomock.Any()).Return(nil).AnyTimes() mockManager.EXPECT().GetConfig().Return(&rest.Config{}).AnyTimes() diff --git a/multicluster/cmd/multicluster-controller/memberclusterannounce_webhook_test.go b/multicluster/cmd/multicluster-controller/memberclusterannounce_webhook_test.go index 3d5bb19f7df..640e8e0b129 100644 --- a/multicluster/cmd/multicluster-controller/memberclusterannounce_webhook_test.go +++ b/multicluster/cmd/multicluster-controller/memberclusterannounce_webhook_test.go @@ -27,7 +27,6 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/klog/v2" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" @@ -252,10 +251,7 @@ func TestMemberClusterAnnounceWebhook(t *testing.T) { }, } - decoder, err := admission.NewDecoder(common.TestScheme) - if err != nil { - klog.ErrorS(err, "Error constructing a decoder") - } + decoder := admission.NewDecoder(common.TestScheme) for _, tt := range tests { fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects().WithLists(existingServiceAccounts).Build() if tt.existingClusterSet != nil { diff --git a/multicluster/cmd/multicluster-controller/options.go b/multicluster/cmd/multicluster-controller/options.go index f5b8358a489..f28e6439e52 100644 --- a/multicluster/cmd/multicluster-controller/options.go +++ b/multicluster/cmd/multicluster-controller/options.go @@ -17,10 +17,15 @@ package main import ( "fmt" "net" + "os" "github.com/spf13/pflag" + "gopkg.in/yaml.v2" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/klog/v2" ctrl "sigs.k8s.io/controller-runtime" + metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" mcsv1alpha1 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha1" "antrea.io/antrea/multicluster/controllers/multicluster/common" @@ -31,6 +36,7 @@ type Options struct { configFile string SelfSignedCert bool options ctrl.Options + Namespace string // The Service ClusterIP range used in the member cluster. ServiceCIDR string // PodCIDRs is the Pod IP address CIDRs of the member cluster. @@ -49,6 +55,8 @@ type Options struct { // ClusterCalimCRDAvailable indicates if the ClusterClaim CRD is available or not // in the cluster. ClusterCalimCRDAvailable bool + // WebhookConfig contains the controllers webhook configuration + WebhookConfig mcsv1alpha1.ControllerWebhook } func newOptions() *Options { @@ -64,10 +72,8 @@ func (o *Options) complete(args []string) error { ctrlConfig := &mcsv1alpha1.MultiClusterConfig{} if len(o.configFile) > 0 { klog.InfoS("Loading config", "file", o.configFile) - options, err = options.AndFrom(ctrl.ConfigFile().AtPath(o.configFile).OfKind(ctrlConfig)) - if err != nil { - klog.ErrorS(err, "Failed to load options") - return fmt.Errorf("failed to load options from configuration file %s", o.configFile) + if err = o.loadConfigFromFile(ctrlConfig); err != nil { + return err } o.options = options if ctrlConfig.ServiceCIDR != "" { @@ -87,6 +93,7 @@ func (o *Options) complete(args []string) error { o.ServiceCIDR = ctrlConfig.ServiceCIDR o.PodCIDRs = cidrs o.GatewayIPPrecedence = ctrlConfig.GatewayIPPrecedence + o.WebhookConfig = ctrlConfig.Webhook if ctrlConfig.EndpointIPType == "" { o.EndpointIPType = common.EndpointIPTypeClusterIP } else { @@ -110,10 +117,33 @@ func (o *Options) addFlags(fs *pflag.FlagSet) { func (o *Options) setDefaults() { o.options = ctrl.Options{ - Scheme: scheme, - MetricsBindAddress: "0", - Port: 9443, + Scheme: scheme, + Metrics: metricsserver.Options{ + BindAddress: "0", + }, HealthProbeBindAddress: ":8080", - LeaderElection: false, } } + +func (o *Options) loadConfigFromFile(multiclusterConfig *mcsv1alpha1.MultiClusterConfig) error { + data, err := os.ReadFile(o.configFile) + if err != nil { + return err + } + codecs := serializer.NewCodecFactory(scheme) + if err := yaml.Unmarshal(data, multiclusterConfig); err != nil { + return err + } + if err = runtime.DecodeInto(codecs.UniversalDecoder(), data, multiclusterConfig); err != nil { + return err + } + + if multiclusterConfig.Metrics.BindAddress != "" { + o.options.Metrics.BindAddress = multiclusterConfig.Metrics.BindAddress + } + if multiclusterConfig.Health.HealthProbeBindAddress != "" { + o.options.HealthProbeBindAddress = multiclusterConfig.Health.HealthProbeBindAddress + } + + return nil +} diff --git a/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-empty-podcidrs.yml b/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-empty-podcidrs.yml index decbb468ccb..a3fe15cadf3 100644 --- a/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-empty-podcidrs.yml +++ b/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-empty-podcidrs.yml @@ -6,8 +6,6 @@ metrics: bindAddress: "0" webhook: port: 9443 -leaderElection: - leaderElect: false serviceCIDR: "" podCIDRs: - "" diff --git a/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-invalid-endpointiptype.yml b/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-invalid-endpointiptype.yml index ccaeb9a2c25..de97c067924 100644 --- a/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-invalid-endpointiptype.yml +++ b/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-invalid-endpointiptype.yml @@ -6,8 +6,6 @@ metrics: bindAddress: "0" webhook: port: 9443 -leaderElection: - leaderElect: false serviceCIDR: "" podCIDRs: - "10.10.0.0/16" diff --git a/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-invalid-podcidrs.yml b/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-invalid-podcidrs.yml index 5a84017356e..18d827dcac4 100644 --- a/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-invalid-podcidrs.yml +++ b/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-invalid-podcidrs.yml @@ -6,8 +6,6 @@ metrics: bindAddress: "0" webhook: port: 9443 -leaderElection: - leaderElect: false serviceCIDR: "10.100.0.0/16" podCIDRs: - "10.10a.0.0/16" diff --git a/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-valid-podcidrs.yml b/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-valid-podcidrs.yml index 0638f8f284f..539ece2c0a7 100644 --- a/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-valid-podcidrs.yml +++ b/multicluster/cmd/multicluster-controller/testdata/antrea-mc-config-with-valid-podcidrs.yml @@ -6,8 +6,6 @@ metrics: bindAddress: "0" webhook: port: 9443 -leaderElection: - leaderElect: false serviceCIDR: "" podCIDRs: - "10.10.0.0/16" diff --git a/multicluster/config/crd/bases/multicluster.crd.antrea.io_resourceexports.yaml b/multicluster/config/crd/bases/multicluster.crd.antrea.io_resourceexports.yaml index 9140f80d34f..00aaf827a9b 100644 --- a/multicluster/config/crd/bases/multicluster.crd.antrea.io_resourceexports.yaml +++ b/multicluster/config/crd/bases/multicluster.crd.antrea.io_resourceexports.yaml @@ -2293,13 +2293,10 @@ spec: description: The Hostname of this endpoint type: string ip: - description: 'The IP of this endpoint. May not be - loopback (127.0.0.0/8), link-local (169.254.0.0/16), - or link-local multicast ((224.0.0.0/24). IPv6 is - also accepted but not fully supported on all platforms. - Also, certain kubernetes components, like kube-proxy, - are not IPv6 ready. TODO: This should allow hostname - or IP, See #4447.' + description: The IP of this endpoint. May not be loopback + (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 + or fe80::/10), or link-local multicast (224.0.0.0/24 + or ff02::/16). type: string nodeName: description: 'Optional: Node hosting this endpoint. @@ -2367,13 +2364,10 @@ spec: description: The Hostname of this endpoint type: string ip: - description: 'The IP of this endpoint. May not be - loopback (127.0.0.0/8), link-local (169.254.0.0/16), - or link-local multicast ((224.0.0.0/24). IPv6 is - also accepted but not fully supported on all platforms. - Also, certain kubernetes components, like kube-proxy, - are not IPv6 ready. TODO: This should allow hostname - or IP, See #4447.' + description: The IP of this endpoint. May not be loopback + (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 + or fe80::/10), or link-local multicast (224.0.0.0/24 + or ff02::/16). type: string nodeName: description: 'Optional: Node hosting this endpoint. @@ -2435,12 +2429,22 @@ spec: single port. properties: appProtocol: - description: The application protocol for this port. + description: "The application protocol for this port. + This is used as a hint for implementations to offer + richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. - Un-prefixed names are reserved for IANA standard - service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). - Non-standard protocols should use prefixed names - such as mycompany.com/my-custom-protocol. + Valid values are either: \n * Un-prefixed protocol + names - reserved for IANA standard service names + (as per RFC-6335 and https://www.iana.org/assignments/service-names). + \n * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' + - HTTP/2 prior knowledge over cleartext as described + in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- + * 'kubernetes.io/ws' - WebSocket over cleartext + as described in https://www.rfc-editor.org/rfc/rfc6455 + * 'kubernetes.io/wss' - WebSocket over TLS as described + in https://www.rfc-editor.org/rfc/rfc6455 \n * Other + protocols should use implementation-defined prefixed + names such as mycompany.com/my-custom-protocol." type: string name: description: The name of this port. This must match @@ -2726,11 +2730,10 @@ spec: supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature. Deprecated: This field was - under-specified and its meaning varies across implementations, - and it cannot support dual-stack. As of Kubernetes v1.24, - users are encouraged to use implementation-specific annotations - when available. This field may be removed in a future API - version.' + under-specified and its meaning varies across implementations. + Using it is non-portable and it may not support dual-stack. + Users are encouraged to use implementation-specific annotations + when available.' type: string loadBalancerSourceRanges: description: 'If specified and supported by the platform, @@ -2749,12 +2752,22 @@ spec: port. properties: appProtocol: - description: The application protocol for this port. + description: "The application protocol for this port. + This is used as a hint for implementations to offer + richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. - Un-prefixed names are reserved for IANA standard service - names (as per RFC-6335 and https://www.iana.org/assignments/service-names). - Non-standard protocols should use prefixed names such - as mycompany.com/my-custom-protocol. + Valid values are either: \n * Un-prefixed protocol + names - reserved for IANA standard service names (as + per RFC-6335 and https://www.iana.org/assignments/service-names). + \n * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' + - HTTP/2 prior knowledge over cleartext as described + in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- + * 'kubernetes.io/ws' - WebSocket over cleartext as + described in https://www.rfc-editor.org/rfc/rfc6455 + * 'kubernetes.io/wss' - WebSocket over TLS as described + in https://www.rfc-editor.org/rfc/rfc6455 \n * Other + protocols should use implementation-defined prefixed + names such as mycompany.com/my-custom-protocol." type: string name: description: The name of this port within the service. diff --git a/multicluster/config/crd/bases/multicluster.crd.antrea.io_resourceimports.yaml b/multicluster/config/crd/bases/multicluster.crd.antrea.io_resourceimports.yaml index fafe9bec89f..34a5b22ab0a 100644 --- a/multicluster/config/crd/bases/multicluster.crd.antrea.io_resourceimports.yaml +++ b/multicluster/config/crd/bases/multicluster.crd.antrea.io_resourceimports.yaml @@ -2291,13 +2291,10 @@ spec: description: The Hostname of this endpoint type: string ip: - description: 'The IP of this endpoint. May not be - loopback (127.0.0.0/8), link-local (169.254.0.0/16), - or link-local multicast ((224.0.0.0/24). IPv6 is - also accepted but not fully supported on all platforms. - Also, certain kubernetes components, like kube-proxy, - are not IPv6 ready. TODO: This should allow hostname - or IP, See #4447.' + description: The IP of this endpoint. May not be loopback + (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 + or fe80::/10), or link-local multicast (224.0.0.0/24 + or ff02::/16). type: string nodeName: description: 'Optional: Node hosting this endpoint. @@ -2365,13 +2362,10 @@ spec: description: The Hostname of this endpoint type: string ip: - description: 'The IP of this endpoint. May not be - loopback (127.0.0.0/8), link-local (169.254.0.0/16), - or link-local multicast ((224.0.0.0/24). IPv6 is - also accepted but not fully supported on all platforms. - Also, certain kubernetes components, like kube-proxy, - are not IPv6 ready. TODO: This should allow hostname - or IP, See #4447.' + description: The IP of this endpoint. May not be loopback + (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 + or fe80::/10), or link-local multicast (224.0.0.0/24 + or ff02::/16). type: string nodeName: description: 'Optional: Node hosting this endpoint. @@ -2433,12 +2427,22 @@ spec: single port. properties: appProtocol: - description: The application protocol for this port. + description: "The application protocol for this port. + This is used as a hint for implementations to offer + richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. - Un-prefixed names are reserved for IANA standard - service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). - Non-standard protocols should use prefixed names - such as mycompany.com/my-custom-protocol. + Valid values are either: \n * Un-prefixed protocol + names - reserved for IANA standard service names + (as per RFC-6335 and https://www.iana.org/assignments/service-names). + \n * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' + - HTTP/2 prior knowledge over cleartext as described + in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- + * 'kubernetes.io/ws' - WebSocket over cleartext + as described in https://www.rfc-editor.org/rfc/rfc6455 + * 'kubernetes.io/wss' - WebSocket over TLS as described + in https://www.rfc-editor.org/rfc/rfc6455 \n * Other + protocols should use implementation-defined prefixed + names such as mycompany.com/my-custom-protocol." type: string name: description: The name of this port. This must match diff --git a/multicluster/config/default/configmap/controller_manager_config.yaml b/multicluster/config/default/configmap/controller_manager_config.yaml index 853e3d117a2..f811380d396 100644 --- a/multicluster/config/default/configmap/controller_manager_config.yaml +++ b/multicluster/config/default/configmap/controller_manager_config.yaml @@ -6,8 +6,6 @@ metrics: bindAddress: "0" webhook: port: 9443 -leaderElection: - leaderElect: false serviceCIDR: "" podCIDRs: - "" diff --git a/multicluster/controllers/multicluster/commonarea/remote_common_area.go b/multicluster/controllers/multicluster/commonarea/remote_common_area.go index 82d7e88df28..3f6384035d8 100644 --- a/multicluster/controllers/multicluster/commonarea/remote_common_area.go +++ b/multicluster/controllers/multicluster/commonarea/remote_common_area.go @@ -31,8 +31,10 @@ import ( "k8s.io/client-go/tools/clientcmd" "k8s.io/klog/v2" ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" + metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" mcv1alpha1 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha1" mcv1alpha2 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha2" @@ -153,9 +155,15 @@ func GetRemoteConfigAndClient(secretObj *v1.Secret, url string, clusterID common config.QPS = common.ResourceExchangeQPS config.Burst = common.ResourceExchangeBurst remoteCommonAreaMgr, err := ctrl.NewManager(config, ctrl.Options{ - Scheme: scheme, - MetricsBindAddress: "0", - Namespace: clusterSet.Spec.Namespace, + Scheme: scheme, + Metrics: metricsserver.Options{ + BindAddress: "0", + }, + Cache: cache.Options{ + DefaultNamespaces: map[string]cache.Config{ + clusterSet.Spec.Namespace: {}, + }, + }, }) if err != nil { klog.ErrorS(err, "Error creating manager for RemoteCommonArea", "cluster", clusterID) diff --git a/multicluster/controllers/multicluster/leader/clusterset_controller_test.go b/multicluster/controllers/multicluster/leader/clusterset_controller_test.go index 0c6a0045264..c2d79465cff 100644 --- a/multicluster/controllers/multicluster/leader/clusterset_controller_test.go +++ b/multicluster/controllers/multicluster/leader/clusterset_controller_test.go @@ -81,7 +81,7 @@ var ( func createMockClients(t *testing.T, objects ...client.Object) (client.Client, *MockMemberClusterStatusManager) { fakeRemoteClient := fake.NewClientBuilder().WithScheme(common.TestScheme). - WithObjects(objects...).Build() + WithObjects(objects...).WithStatusSubresource(objects...).Build() mockCtrl := gomock.NewController(t) mockStatusManager := NewMockMemberClusterStatusManager(mockCtrl) diff --git a/multicluster/controllers/multicluster/leader/resourceexport_controller_test.go b/multicluster/controllers/multicluster/leader/resourceexport_controller_test.go index bc720ccf35b..c678eb270b2 100644 --- a/multicluster/controllers/multicluster/leader/resourceexport_controller_test.go +++ b/multicluster/controllers/multicluster/leader/resourceexport_controller_test.go @@ -167,7 +167,8 @@ func TestResourceExportReconciler_handleEndpointsExportDeleteEvent(t *testing.T) } expectedSubsets := common.EPNginxSubset2 namespacedName := types.NamespacedName{Namespace: "default", Name: "default-nginx-endpoints"} - fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(existingResExport1, existingResExport2, existResImport).Build() + fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(existingResExport1, existingResExport2, existResImport). + WithStatusSubresource(existingResExport1, existingResExport2, existResImport).Build() r := NewResourceExportReconciler(fakeClient, common.TestScheme) if _, err := r.Reconcile(common.TestCtx, epResReq); err != nil { t.Errorf("ResourceExport Reconciler should handle Endpoints ResourceExport delete event successfully but got error = %v", err) @@ -383,7 +384,7 @@ func TestResourceExportReconciler_handleSingleServiceUpdateEvent(t *testing.T) { } namespacedName := types.NamespacedName{Namespace: "default", Name: "default-nginx-service"} fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme). - WithObjects(newResExport, existResImport).Build() + WithObjects(newResExport, existResImport).WithStatusSubresource(newResExport, existResImport).Build() r := NewResourceExportReconciler(fakeClient, common.TestScheme) if _, err := r.Reconcile(common.TestCtx, svcResReq); err != nil { t.Errorf("ResourceExport Reconciler should handle Service ResourceExport update event successfully but got error = %v", err) @@ -419,7 +420,7 @@ func TestResourceExportReconciler_handleServiceUpdateEvent(t *testing.T) { } fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme). - WithObjects(newResExport, existingResExport2, existResImport).Build() + WithObjects(newResExport, existingResExport2, existResImport).WithStatusSubresource(newResExport, existingResExport2, existResImport).Build() r := NewResourceExportReconciler(fakeClient, common.TestScheme) if _, err := r.Reconcile(common.TestCtx, svcResReq); err != nil { if !assert.Contains(t, err.Error(), "don't match existing") { diff --git a/multicluster/controllers/multicluster/leader/stale_controller.go b/multicluster/controllers/multicluster/leader/stale_controller.go index 6b4fd9892a7..cf4ef7bee3c 100644 --- a/multicluster/controllers/multicluster/leader/stale_controller.go +++ b/multicluster/controllers/multicluster/leader/stale_controller.go @@ -97,7 +97,7 @@ func (c *StaleResCleanupController) Run(stopCh <-chan struct{}) { klog.InfoS("Starting StaleResCleanupController") defer klog.InfoS("Shutting down StaleResCleanupController") - ctx, _ := wait.ContextForChannel(stopCh) + ctx := wait.ContextForChannel(stopCh) go wait.UntilWithContext(ctx, c.cleanUpExpiredMemberClusterAnnounces, memberClusterAnnounceStaleTime/2) <-stopCh } diff --git a/multicluster/controllers/multicluster/leader/stale_controller_test.go b/multicluster/controllers/multicluster/leader/stale_controller_test.go index a16a66aaefc..8b54dc17879 100644 --- a/multicluster/controllers/multicluster/leader/stale_controller_test.go +++ b/multicluster/controllers/multicluster/leader/stale_controller_test.go @@ -76,6 +76,7 @@ func TestReconcile(t *testing.T) { Name: "member-announce-from-cluster-1", Namespace: "default", DeletionTimestamp: &now, + Finalizers: []string{"test-membercluster-announce-finalizer"}, }, ClusterID: "cluster-1", } @@ -120,7 +121,8 @@ func TestReconcile(t *testing.T) { defer func() { getResourceExportsByClusterIDFunc = getResourceExportsByClusterID }() - fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithLists(tt.existingResExports).WithObjects(tt.existingMemberAnnounce).Build() + fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithLists(tt.existingResExports). + WithObjects(tt.existingMemberAnnounce).WithStatusSubresource(tt.existingMemberAnnounce).Build() c := NewStaleResCleanupController(fakeClient, common.TestScheme) ctx := context.Background() _, err := c.Reconcile(ctx, ctrl.Request{ diff --git a/multicluster/controllers/multicluster/member/clusterset_controller_test.go b/multicluster/controllers/multicluster/member/clusterset_controller_test.go index f4abea90432..e4440ee8818 100644 --- a/multicluster/controllers/multicluster/member/clusterset_controller_test.go +++ b/multicluster/controllers/multicluster/member/clusterset_controller_test.go @@ -114,8 +114,8 @@ func TestMemberClusterStatus(t *testing.T) { ObservedGeneration: 1, }, } - fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(existingClusterSet).Build() - fakeRemoteClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(existingClusterSet).Build() + fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(existingClusterSet).WithStatusSubresource(existingClusterSet).Build() + fakeRemoteClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(existingClusterSet).WithStatusSubresource(existingClusterSet).Build() conditions := []mcv1alpha2.ClusterCondition{ { Message: "Member Connected", diff --git a/multicluster/controllers/multicluster/member/gateway_controller.go b/multicluster/controllers/multicluster/member/gateway_controller.go index a2e561f20f3..7c2ed5f5ef7 100644 --- a/multicluster/controllers/multicluster/member/gateway_controller.go +++ b/multicluster/controllers/multicluster/member/gateway_controller.go @@ -31,7 +31,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" "antrea.io/antrea/multicluster/apis/multicluster/constants" mcv1alpha1 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha1" @@ -186,7 +185,7 @@ func (r *GatewayReconciler) createResourceExport(ctx context.Context, req ctrl.R func (r *GatewayReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). For(&mcv1alpha1.Gateway{}). - Watches(&source.Kind{Type: &mcv1alpha2.ClusterSet{}}, handler.EnqueueRequestsFromMapFunc(r.clusterSetMapFunc), + Watches(&mcv1alpha2.ClusterSet{}, handler.EnqueueRequestsFromMapFunc(r.clusterSetMapFunc), builder.WithPredicates(statusReadyPredicate)). WithOptions(controller.Options{ // TODO: add a lock for r.serviceCIDR and r.localClusterID if @@ -196,13 +195,12 @@ func (r *GatewayReconciler) SetupWithManager(mgr ctrl.Manager) error { Complete(r) } -func (r *GatewayReconciler) clusterSetMapFunc(a client.Object) []reconcile.Request { +func (r *GatewayReconciler) clusterSetMapFunc(ctx context.Context, a client.Object) []reconcile.Request { clusterSet := &mcv1alpha2.ClusterSet{} requests := []reconcile.Request{} if a.GetNamespace() != r.namespace { return requests } - ctx := context.TODO() err := r.Client.Get(ctx, types.NamespacedName{Namespace: a.GetNamespace(), Name: a.GetName()}, clusterSet) if err == nil { if len(clusterSet.Status.Conditions) > 0 && clusterSet.Status.Conditions[0].Status == v1.ConditionTrue { diff --git a/multicluster/controllers/multicluster/member/gateway_controller_test.go b/multicluster/controllers/multicluster/member/gateway_controller_test.go index d8b11f28b35..95361c0a328 100644 --- a/multicluster/controllers/multicluster/member/gateway_controller_test.go +++ b/multicluster/controllers/multicluster/member/gateway_controller_test.go @@ -17,6 +17,7 @@ limitations under the License. package member import ( + "context" "reflect" "testing" "time" @@ -81,6 +82,7 @@ func TestGatewayReconciler(t *testing.T) { gwNode1New.GatewayIP = "10.10.10.12" staleExistingResExport := existingResExport.DeepCopy() staleExistingResExport.DeletionTimestamp = &metav1.Time{Time: time.Now()} + staleExistingResExport.Finalizers = append(staleExistingResExport.Finalizers, constants.ResourceExportFinalizer) tests := []struct { name string namespacedName types.NamespacedName @@ -148,10 +150,10 @@ func TestGatewayReconciler(t *testing.T) { node := n obj = append(obj, &node) } - fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(obj...).Build() - fakeRemoteClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects().Build() + fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(obj...).WithStatusSubresource(obj...).Build() + fakeRemoteClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects().WithStatusSubresource().Build() if tt.resExport != nil { - fakeRemoteClient = fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(tt.resExport).Build() + fakeRemoteClient = fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(tt.resExport).WithStatusSubresource(tt.resExport).Build() } commonArea := commonarea.NewFakeRemoteCommonArea(fakeRemoteClient, "leader-cluster", common.LocalClusterID, common.LeaderNamespace, nil) mcReconciler := NewMemberClusterSetReconciler(fakeClient, common.TestScheme, "default", false, false, make(chan struct{})) @@ -254,15 +256,17 @@ func TestClusterSetMapFunc_Gateway(t *testing.T) { }, }, } + ctx := context.Background() + fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(clusterSet, gw1).Build() r := NewGatewayReconciler(fakeClient, common.TestScheme, "default", []string{"10.200.1.1/16"}, nil) - requests := r.clusterSetMapFunc(clusterSet) + requests := r.clusterSetMapFunc(ctx, clusterSet) assert.Equal(t, expectedReqs, requests) - requests = r.clusterSetMapFunc(deletedClusterSet) + requests = r.clusterSetMapFunc(ctx, deletedClusterSet) assert.Equal(t, []reconcile.Request{}, requests) r = NewGatewayReconciler(fakeClient, common.TestScheme, "mismatch_ns", []string{"10.200.1.1/16"}, nil) - requests = r.clusterSetMapFunc(clusterSet) + requests = r.clusterSetMapFunc(ctx, clusterSet) assert.Equal(t, []reconcile.Request{}, requests) } diff --git a/multicluster/controllers/multicluster/member/labelidentity_controller.go b/multicluster/controllers/multicluster/member/labelidentity_controller.go index 6d333e25021..254287d5af3 100644 --- a/multicluster/controllers/multicluster/member/labelidentity_controller.go +++ b/multicluster/controllers/multicluster/member/labelidentity_controller.go @@ -38,7 +38,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" "antrea.io/antrea/multicluster/apis/multicluster/constants" mcv1alpha1 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha1" @@ -135,10 +134,10 @@ func (r *LabelIdentityReconciler) checkRemoteCommonArea() bool { func (r *LabelIdentityReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). For(&v1.Pod{}, builder.WithPredicates(predicate.LabelChangedPredicate{})). - Watches(&source.Kind{Type: &v1.Namespace{}}, + Watches(&v1.Namespace{}, handler.EnqueueRequestsFromMapFunc(r.namespaceMapFunc), builder.WithPredicates(predicate.LabelChangedPredicate{})). - Watches(&source.Kind{Type: &mcv1alpha2.ClusterSet{}}, + Watches(&mcv1alpha2.ClusterSet{}, handler.EnqueueRequestsFromMapFunc(r.clusterSetMapFunc), builder.WithPredicates(statusReadyPredicate)). WithOptions(controller.Options{ @@ -147,13 +146,12 @@ func (r *LabelIdentityReconciler) SetupWithManager(mgr ctrl.Manager) error { Complete(r) } -func (r *LabelIdentityReconciler) clusterSetMapFunc(a client.Object) []reconcile.Request { +func (r *LabelIdentityReconciler) clusterSetMapFunc(ctx context.Context, a client.Object) []reconcile.Request { clusterSet := &mcv1alpha2.ClusterSet{} requests := []reconcile.Request{} if a.GetNamespace() != r.namespace { return requests } - ctx := context.TODO() err := r.Client.Get(ctx, types.NamespacedName{Namespace: a.GetNamespace(), Name: a.GetName()}, clusterSet) if err == nil { if len(clusterSet.Status.Conditions) > 0 && clusterSet.Status.Conditions[0].Status == v1.ConditionTrue { @@ -181,7 +179,7 @@ func (r *LabelIdentityReconciler) clusterSetMapFunc(a client.Object) []reconcile // namespaceMapFunc handles Namespace update events (Namespace label change) by enqueuing // all Pods in the Namespace into the reconciler processing queue. -func (r *LabelIdentityReconciler) namespaceMapFunc(ns client.Object) []reconcile.Request { +func (r *LabelIdentityReconciler) namespaceMapFunc(ctx context.Context, ns client.Object) []reconcile.Request { podList := &v1.PodList{} r.Client.List(context.TODO(), podList, client.InNamespace(ns.GetName())) requests := make([]reconcile.Request, len(podList.Items)) diff --git a/multicluster/controllers/multicluster/member/labelidentity_controller_test.go b/multicluster/controllers/multicluster/member/labelidentity_controller_test.go index 98b63ec22e2..f1169a59af5 100644 --- a/multicluster/controllers/multicluster/member/labelidentity_controller_test.go +++ b/multicluster/controllers/multicluster/member/labelidentity_controller_test.go @@ -17,6 +17,7 @@ limitations under the License. package member import ( + "context" "reflect" "testing" "time" @@ -246,7 +247,7 @@ func TestNamespaceMapFunc(t *testing.T) { mcReconciler.SetRemoteCommonArea(commonArea) r := NewLabelIdentityReconciler(fakeClient, common.TestScheme, mcReconciler, "default") - actualReq := r.namespaceMapFunc(ns) + actualReq := r.namespaceMapFunc(context.Background(), ns) assert.ElementsMatch(t, expReq, actualReq) } @@ -342,18 +343,18 @@ func TestClusterSetMapFunc_LabelIdentity(t *testing.T) { } fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(clusterSet).WithLists(pods).Build() r := NewLabelIdentityReconciler(fakeClient, common.TestScheme, nil, clusterSet.Namespace) - requests := r.clusterSetMapFunc(clusterSet) + requests := r.clusterSetMapFunc(context.Background(), clusterSet) assert.Equal(t, expectedReqs, requests) r = NewLabelIdentityReconciler(fakeClient, common.TestScheme, nil, "mismatch_ns") - requests = r.clusterSetMapFunc(clusterSet) + requests = r.clusterSetMapFunc(context.Background(), clusterSet) assert.Equal(t, []reconcile.Request{}, requests) // non-existing ClusterSet r = NewLabelIdentityReconciler(fakeClient, common.TestScheme, nil, "default") r.labelToPodsCache["label"] = sets.New[string]("default/nginx") r.podLabelCache["default/nginx"] = "label" - requests = r.clusterSetMapFunc(clusterSet2) + requests = r.clusterSetMapFunc(context.Background(), clusterSet2) assert.Equal(t, []reconcile.Request{}, requests) assert.Equal(t, 0, len(r.labelToPodsCache)) assert.Equal(t, 0, len(r.labelToPodsCache)) diff --git a/multicluster/controllers/multicluster/member/node_controller.go b/multicluster/controllers/multicluster/member/node_controller.go index 52a1eb14884..2a883943b67 100644 --- a/multicluster/controllers/multicluster/member/node_controller.go +++ b/multicluster/controllers/multicluster/member/node_controller.go @@ -36,7 +36,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" mcv1alpha1 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha1" mcv1alpha2 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha2" @@ -373,7 +372,7 @@ func (r *NodeReconciler) SetupWithManager(mgr ctrl.Manager) error { } return ctrl.NewControllerManagedBy(mgr). For(&corev1.Node{}). - Watches(&source.Kind{Type: &mcv1alpha2.ClusterSet{}}, + Watches(&mcv1alpha2.ClusterSet{}, handler.EnqueueRequestsFromMapFunc(r.clusterSetMapFunc), builder.WithPredicates(statusReadyPredicate)). WithOptions(controller.Options{ @@ -382,13 +381,12 @@ func (r *NodeReconciler) SetupWithManager(mgr ctrl.Manager) error { Complete(r) } -func (r *NodeReconciler) clusterSetMapFunc(a client.Object) []reconcile.Request { +func (r *NodeReconciler) clusterSetMapFunc(ctx context.Context, a client.Object) []reconcile.Request { clusterSet := &mcv1alpha2.ClusterSet{} requests := []reconcile.Request{} if a.GetNamespace() != r.namespace { return requests } - ctx := context.TODO() err := r.Client.Get(ctx, types.NamespacedName{Namespace: a.GetNamespace(), Name: a.GetName()}, clusterSet) if err == nil { if len(clusterSet.Status.Conditions) > 0 && clusterSet.Status.Conditions[0].Status == corev1.ConditionTrue { diff --git a/multicluster/controllers/multicluster/member/node_controller_test.go b/multicluster/controllers/multicluster/member/node_controller_test.go index 0484498960d..e8ac2c3a68f 100644 --- a/multicluster/controllers/multicluster/member/node_controller_test.go +++ b/multicluster/controllers/multicluster/member/node_controller_test.go @@ -17,6 +17,7 @@ limitations under the License. package member import ( + "context" "testing" "github.com/stretchr/testify/assert" @@ -373,16 +374,18 @@ func TestClusterSetMapFunc(t *testing.T) { }, }, } + ctx := context.Background() + fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(clusterSet, node1).Build() r := NewNodeReconciler(fakeClient, common.TestScheme, "default", "10.200.1.1/16", "", nil) - requests := r.clusterSetMapFunc(clusterSet) + requests := r.clusterSetMapFunc(ctx, clusterSet) assert.Equal(t, expectedReqs, requests) - requests = r.clusterSetMapFunc(deletedClusterSet) + requests = r.clusterSetMapFunc(ctx, deletedClusterSet) assert.Equal(t, []reconcile.Request{}, requests) r = NewNodeReconciler(fakeClient, common.TestScheme, "mismatch_ns", "10.200.1.1/16", "", nil) - requests = r.clusterSetMapFunc(clusterSet) + requests = r.clusterSetMapFunc(ctx, clusterSet) assert.Equal(t, []reconcile.Request{}, requests) } diff --git a/multicluster/controllers/multicluster/member/serviceexport_controller.go b/multicluster/controllers/multicluster/member/serviceexport_controller.go index 3f8635008a8..557ad9faeb7 100644 --- a/multicluster/controllers/multicluster/member/serviceexport_controller.go +++ b/multicluster/controllers/multicluster/member/serviceexport_controller.go @@ -39,7 +39,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" k8smcsv1alpha1 "sigs.k8s.io/mcs-api/pkg/apis/v1alpha1" "antrea.io/antrea/multicluster/apis/multicluster/constants" @@ -506,9 +505,9 @@ func (r *ServiceExportReconciler) SetupWithManager(mgr ctrl.Manager) error { if r.endpointSliceEnabled { return ctrl.NewControllerManagedBy(mgr). For(&k8smcsv1alpha1.ServiceExport{}, versionChangePredicates). - Watches(&source.Kind{Type: &corev1.Service{}}, handler.EnqueueRequestsFromMapFunc(objectMapFunc), versionChangePredicates). - Watches(&source.Kind{Type: &discovery.EndpointSlice{}}, handler.EnqueueRequestsFromMapFunc(endpointSliceMapFunc), versionChangePredicates). - Watches(&source.Kind{Type: &mcv1alpha2.ClusterSet{}}, handler.EnqueueRequestsFromMapFunc(r.clusterSetMapFunc), + Watches(&corev1.Service{}, handler.EnqueueRequestsFromMapFunc(objectMapFunc), versionChangePredicates). + Watches(&discovery.EndpointSlice{}, handler.EnqueueRequestsFromMapFunc(endpointSliceMapFunc), versionChangePredicates). + Watches(&mcv1alpha2.ClusterSet{}, handler.EnqueueRequestsFromMapFunc(r.clusterSetMapFunc), builder.WithPredicates(statusReadyPredicate)). WithOptions(controller.Options{ MaxConcurrentReconciles: common.DefaultWorkerCount, @@ -517,9 +516,9 @@ func (r *ServiceExportReconciler) SetupWithManager(mgr ctrl.Manager) error { } return ctrl.NewControllerManagedBy(mgr). For(&k8smcsv1alpha1.ServiceExport{}, versionChangePredicates). - Watches(&source.Kind{Type: &corev1.Service{}}, handler.EnqueueRequestsFromMapFunc(objectMapFunc), versionChangePredicates). - Watches(&source.Kind{Type: &corev1.Endpoints{}}, handler.EnqueueRequestsFromMapFunc(objectMapFunc), versionChangePredicates). - Watches(&source.Kind{Type: &mcv1alpha2.ClusterSet{}}, handler.EnqueueRequestsFromMapFunc(r.clusterSetMapFunc), + Watches(&corev1.Service{}, handler.EnqueueRequestsFromMapFunc(objectMapFunc), versionChangePredicates). + Watches(&corev1.Endpoints{}, handler.EnqueueRequestsFromMapFunc(objectMapFunc), versionChangePredicates). + Watches(&mcv1alpha2.ClusterSet{}, handler.EnqueueRequestsFromMapFunc(r.clusterSetMapFunc), builder.WithPredicates(statusReadyPredicate)). WithOptions(controller.Options{ MaxConcurrentReconciles: common.DefaultWorkerCount, @@ -529,14 +528,13 @@ func (r *ServiceExportReconciler) SetupWithManager(mgr ctrl.Manager) error { // clusterSetMapFunc handles ClusterSet events by enqueuing all ServiceExports // into the reconciler processing queue. -func (r *ServiceExportReconciler) clusterSetMapFunc(a client.Object) []reconcile.Request { +func (r *ServiceExportReconciler) clusterSetMapFunc(ctx context.Context, a client.Object) []reconcile.Request { clusterSet := &mcv1alpha2.ClusterSet{} requests := []reconcile.Request{} if a.GetNamespace() != r.namespace { return requests } - ctx := context.TODO() err := r.Client.Get(ctx, types.NamespacedName{Namespace: a.GetNamespace(), Name: a.GetName()}, clusterSet) if err == nil { if len(clusterSet.Status.Conditions) > 0 && clusterSet.Status.Conditions[0].Status == corev1.ConditionTrue { @@ -566,7 +564,7 @@ func (r *ServiceExportReconciler) clusterSetMapFunc(a client.Object) []reconcile // When there are any Service or Endpoints changes, it might be reflected in ResourceExport // in leader cluster as well, so ServiceExportReconciler also needs to watch // Service and Endpoints events. -func objectMapFunc(a client.Object) []reconcile.Request { +func objectMapFunc(ctx context.Context, a client.Object) []reconcile.Request { return []reconcile.Request{ { NamespacedName: types.NamespacedName{ @@ -577,7 +575,7 @@ func objectMapFunc(a client.Object) []reconcile.Request { } } -func endpointSliceMapFunc(a client.Object) []reconcile.Request { +func endpointSliceMapFunc(ctx context.Context, a client.Object) []reconcile.Request { labels := a.GetLabels() svcName := labels[discovery.LabelServiceName] mappedObject := types.NamespacedName{} diff --git a/multicluster/controllers/multicluster/member/serviceexport_controller_test.go b/multicluster/controllers/multicluster/member/serviceexport_controller_test.go index 9ec9a6c2a8f..91e2027c8ea 100644 --- a/multicluster/controllers/multicluster/member/serviceexport_controller_test.go +++ b/multicluster/controllers/multicluster/member/serviceexport_controller_test.go @@ -17,6 +17,7 @@ limitations under the License. package member import ( + "context" "reflect" "testing" @@ -271,7 +272,9 @@ func TestServiceExportReconciler_CheckExportStatus(t *testing.T) { } fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(mcsSvc, nginx0Svc, nginx1Svc, nginx3Svc, svcNoClusterIP, nginx1EP, svcNoClusterIPEP, - nginx2Svc, existSvcExport, nginx0SvcExport, nginx1SvcExportWithStatus, nginx2SvcExportWithStatus, nginx3SvcExport, mcsSvcExport, svcExpNoClusterIP).Build() + nginx2Svc, existSvcExport, nginx0SvcExport, nginx1SvcExportWithStatus, nginx2SvcExportWithStatus, nginx3SvcExport, mcsSvcExport, svcExpNoClusterIP). + WithStatusSubresource(mcsSvc, nginx0Svc, nginx1Svc, nginx3Svc, svcNoClusterIP, nginx1EP, svcNoClusterIPEP, nginx0SvcExport, nginx1SvcExportWithStatus, nginx2SvcExportWithStatus, nginx3SvcExport, mcsSvcExport, svcExpNoClusterIP). + Build() fakeRemoteClient := fake.NewClientBuilder().WithScheme(common.TestScheme).Build() commonArea := commonarea.NewFakeRemoteCommonArea(fakeRemoteClient, "leader-cluster", common.LocalClusterID, "default", nil) @@ -335,13 +338,15 @@ func TestServiceExportReconciler_handleServiceExportCreateEvent(t *testing.T) { fakeClient client.WithWatch }{ { - name: "with Endpoint API", - fakeClient: fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(common.SvcNginx, common.EPNginx, existSvcExport).Build(), + name: "with Endpoint API", + fakeClient: fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(common.SvcNginx, common.EPNginx, existSvcExport). + WithStatusSubresource(common.SvcNginx, common.EPNginx, existSvcExport).Build(), endpointIPType: "ClusterIP", }, { - name: "with EndpointSlice API", - fakeClient: fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(common.SvcNginx, epsNginx, existSvcExport).Build(), + name: "with EndpointSlice API", + fakeClient: fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(common.SvcNginx, epsNginx, existSvcExport). + WithStatusSubresource(common.SvcNginx, epsNginx, existSvcExport).Build(), endpointIPType: "PodIP", endpointSliceEnabled: true, }, @@ -568,6 +573,7 @@ func TestServiceExportReconciler_handleUpdateEvent(t *testing.T) { } func Test_objectMapFunc(t *testing.T) { + ctx := context.Background() tests := []struct { name string obj client.Object @@ -593,7 +599,7 @@ func Test_objectMapFunc(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := objectMapFunc(tt.obj); !reflect.DeepEqual(got, tt.want) { + if got := objectMapFunc(ctx, tt.obj); !reflect.DeepEqual(got, tt.want) { t.Errorf("Test_objectMapFunc() = %v, want %v", got, tt.want) } }) @@ -601,6 +607,7 @@ func Test_objectMapFunc(t *testing.T) { } func Test_endpointSliceMapFunc(t *testing.T) { + ctx := context.Background() tests := []struct { name string obj client.Object @@ -637,7 +644,7 @@ func Test_endpointSliceMapFunc(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := endpointSliceMapFunc(tt.obj); !reflect.DeepEqual(got, tt.want) { + if got := endpointSliceMapFunc(ctx, tt.obj); !reflect.DeepEqual(got, tt.want) { t.Errorf("Test_endpointSliceMapFunc() = %v, want %v", got, tt.want) } }) @@ -696,20 +703,21 @@ func TestClusterSetMapFunc_ServiceExport(t *testing.T) { }, }, } + ctx := context.Background() fakeClient := fake.NewClientBuilder().WithScheme(common.TestScheme).WithObjects(clusterSet).WithLists(serviceExports).Build() r := NewServiceExportReconciler(fakeClient, common.TestScheme, nil, "PodIP", true, clusterSet.Namespace) - requests := r.clusterSetMapFunc(clusterSet) + requests := r.clusterSetMapFunc(ctx, clusterSet) assert.Equal(t, expectedReqs, requests) r = NewServiceExportReconciler(fakeClient, common.TestScheme, nil, "PodIP", true, "mismatch_ns") - requests = r.clusterSetMapFunc(clusterSet) + requests = r.clusterSetMapFunc(ctx, clusterSet) assert.Equal(t, []reconcile.Request{}, requests) // non-existing ClusterSet r = NewServiceExportReconciler(fakeClient, common.TestScheme, nil, "PodIP", true, "default") r.installedSvcs.Add(&svcInfo{name: "nginx-stale", namespace: "default"}) r.installedEps.Add(&epInfo{name: "nginx-stale", namespace: "default"}) - requests = r.clusterSetMapFunc(clusterSet2) + requests = r.clusterSetMapFunc(ctx, clusterSet2) assert.Equal(t, []reconcile.Request{}, requests) assert.Equal(t, 0, len(r.installedSvcs.List())) assert.Equal(t, 0, len(r.installedEps.List())) diff --git a/multicluster/controllers/multicluster/member/stale_controller.go b/multicluster/controllers/multicluster/member/stale_controller.go index cc1a62444c8..fcd4d0482df 100644 --- a/multicluster/controllers/multicluster/member/stale_controller.go +++ b/multicluster/controllers/multicluster/member/stale_controller.go @@ -371,7 +371,7 @@ func (c *StaleResCleanupController) Run(stopCh <-chan struct{}) { klog.InfoS("Starting StaleResCleanupController") defer klog.InfoS("Shutting down StaleResCleanupController") - ctx, _ := wait.ContextForChannel(stopCh) + ctx := wait.ContextForChannel(stopCh) go func() { retry.OnError(common.CleanUpRetry, func(err error) bool { return true }, diff --git a/multicluster/hack/update-codegen.sh b/multicluster/hack/update-codegen.sh index 2aff4bdbe22..35a9c3ff230 100755 --- a/multicluster/hack/update-codegen.sh +++ b/multicluster/hack/update-codegen.sh @@ -18,7 +18,7 @@ set -o errexit set -o pipefail ANTREA_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../" && pwd )" -IMAGE_NAME="antrea/codegen:kubernetes-1.26.4-build.1" +IMAGE_NAME="antrea/codegen:kubernetes-1.29.2" # Recent versions of Git will not access .git directories which are owned by # another user (as a security measure), unless the directories are explicitly diff --git a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_clusterinfoimport.go b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_clusterinfoimport.go index f45b880a86f..0be5abde9ef 100644 --- a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_clusterinfoimport.go +++ b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_clusterinfoimport.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -34,9 +33,9 @@ type FakeClusterInfoImports struct { ns string } -var clusterinfoimportsResource = schema.GroupVersionResource{Group: "multicluster.crd.antrea.io", Version: "v1alpha1", Resource: "clusterinfoimports"} +var clusterinfoimportsResource = v1alpha1.SchemeGroupVersion.WithResource("clusterinfoimports") -var clusterinfoimportsKind = schema.GroupVersionKind{Group: "multicluster.crd.antrea.io", Version: "v1alpha1", Kind: "ClusterInfoImport"} +var clusterinfoimportsKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterInfoImport") // Get takes name of the clusterInfoImport, and returns the corresponding clusterInfoImport object, and an error if there is any. func (c *FakeClusterInfoImports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterInfoImport, err error) { diff --git a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_clusterset.go b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_clusterset.go index 39b5b83317a..d1a57eee98e 100644 --- a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_clusterset.go +++ b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_clusterset.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -34,9 +33,9 @@ type FakeClusterSets struct { ns string } -var clustersetsResource = schema.GroupVersionResource{Group: "multicluster.crd.antrea.io", Version: "v1alpha1", Resource: "clustersets"} +var clustersetsResource = v1alpha1.SchemeGroupVersion.WithResource("clustersets") -var clustersetsKind = schema.GroupVersionKind{Group: "multicluster.crd.antrea.io", Version: "v1alpha1", Kind: "ClusterSet"} +var clustersetsKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterSet") // Get takes name of the clusterSet, and returns the corresponding clusterSet object, and an error if there is any. func (c *FakeClusterSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterSet, err error) { diff --git a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_gateway.go b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_gateway.go index e0d409c984c..d3e26888ad6 100644 --- a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_gateway.go +++ b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_gateway.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -34,9 +33,9 @@ type FakeGateways struct { ns string } -var gatewaysResource = schema.GroupVersionResource{Group: "multicluster.crd.antrea.io", Version: "v1alpha1", Resource: "gateways"} +var gatewaysResource = v1alpha1.SchemeGroupVersion.WithResource("gateways") -var gatewaysKind = schema.GroupVersionKind{Group: "multicluster.crd.antrea.io", Version: "v1alpha1", Kind: "Gateway"} +var gatewaysKind = v1alpha1.SchemeGroupVersion.WithKind("Gateway") // Get takes name of the gateway, and returns the corresponding gateway object, and an error if there is any. func (c *FakeGateways) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Gateway, err error) { diff --git a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_labelidentity.go b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_labelidentity.go index 571d5d8847c..6849c9c60e3 100644 --- a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_labelidentity.go +++ b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_labelidentity.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeLabelIdentities struct { Fake *FakeMulticlusterV1alpha1 } -var labelidentitiesResource = schema.GroupVersionResource{Group: "multicluster.crd.antrea.io", Version: "v1alpha1", Resource: "labelidentities"} +var labelidentitiesResource = v1alpha1.SchemeGroupVersion.WithResource("labelidentities") -var labelidentitiesKind = schema.GroupVersionKind{Group: "multicluster.crd.antrea.io", Version: "v1alpha1", Kind: "LabelIdentity"} +var labelidentitiesKind = v1alpha1.SchemeGroupVersion.WithKind("LabelIdentity") // Get takes name of the labelIdentity, and returns the corresponding labelIdentity object, and an error if there is any. func (c *FakeLabelIdentities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LabelIdentity, err error) { diff --git a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_memberclusterannounce.go b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_memberclusterannounce.go index 1f44f731eb5..e63629048cc 100644 --- a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_memberclusterannounce.go +++ b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_memberclusterannounce.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -34,9 +33,9 @@ type FakeMemberClusterAnnounces struct { ns string } -var memberclusterannouncesResource = schema.GroupVersionResource{Group: "multicluster.crd.antrea.io", Version: "v1alpha1", Resource: "memberclusterannounces"} +var memberclusterannouncesResource = v1alpha1.SchemeGroupVersion.WithResource("memberclusterannounces") -var memberclusterannouncesKind = schema.GroupVersionKind{Group: "multicluster.crd.antrea.io", Version: "v1alpha1", Kind: "MemberClusterAnnounce"} +var memberclusterannouncesKind = v1alpha1.SchemeGroupVersion.WithKind("MemberClusterAnnounce") // Get takes name of the memberClusterAnnounce, and returns the corresponding memberClusterAnnounce object, and an error if there is any. func (c *FakeMemberClusterAnnounces) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MemberClusterAnnounce, err error) { diff --git a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_resourceexport.go b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_resourceexport.go index b0853da39ad..e54aa17f715 100644 --- a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_resourceexport.go +++ b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_resourceexport.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -34,9 +33,9 @@ type FakeResourceExports struct { ns string } -var resourceexportsResource = schema.GroupVersionResource{Group: "multicluster.crd.antrea.io", Version: "v1alpha1", Resource: "resourceexports"} +var resourceexportsResource = v1alpha1.SchemeGroupVersion.WithResource("resourceexports") -var resourceexportsKind = schema.GroupVersionKind{Group: "multicluster.crd.antrea.io", Version: "v1alpha1", Kind: "ResourceExport"} +var resourceexportsKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceExport") // Get takes name of the resourceExport, and returns the corresponding resourceExport object, and an error if there is any. func (c *FakeResourceExports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceExport, err error) { diff --git a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_resourceimport.go b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_resourceimport.go index cf98358d37a..d60bd0a1c66 100644 --- a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_resourceimport.go +++ b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_resourceimport.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -34,9 +33,9 @@ type FakeResourceImports struct { ns string } -var resourceimportsResource = schema.GroupVersionResource{Group: "multicluster.crd.antrea.io", Version: "v1alpha1", Resource: "resourceimports"} +var resourceimportsResource = v1alpha1.SchemeGroupVersion.WithResource("resourceimports") -var resourceimportsKind = schema.GroupVersionKind{Group: "multicluster.crd.antrea.io", Version: "v1alpha1", Kind: "ResourceImport"} +var resourceimportsKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceImport") // Get takes name of the resourceImport, and returns the corresponding resourceImport object, and an error if there is any. func (c *FakeResourceImports) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceImport, err error) { diff --git a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha2/fake/fake_clusterclaim.go b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha2/fake/fake_clusterclaim.go index 7b2f7f5c7a6..8d1a2969c92 100644 --- a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha2/fake/fake_clusterclaim.go +++ b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha2/fake/fake_clusterclaim.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha2 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -34,9 +33,9 @@ type FakeClusterClaims struct { ns string } -var clusterclaimsResource = schema.GroupVersionResource{Group: "multicluster.crd.antrea.io", Version: "v1alpha2", Resource: "clusterclaims"} +var clusterclaimsResource = v1alpha2.SchemeGroupVersion.WithResource("clusterclaims") -var clusterclaimsKind = schema.GroupVersionKind{Group: "multicluster.crd.antrea.io", Version: "v1alpha2", Kind: "ClusterClaim"} +var clusterclaimsKind = v1alpha2.SchemeGroupVersion.WithKind("ClusterClaim") // Get takes name of the clusterClaim, and returns the corresponding clusterClaim object, and an error if there is any. func (c *FakeClusterClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ClusterClaim, err error) { diff --git a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha2/fake/fake_clusterset.go b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha2/fake/fake_clusterset.go index fbdba69bb5e..1bd409d02f8 100644 --- a/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha2/fake/fake_clusterset.go +++ b/multicluster/pkg/client/clientset/versioned/typed/multicluster/v1alpha2/fake/fake_clusterset.go @@ -1,4 +1,4 @@ -// Copyright 2023 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha2 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -34,9 +33,9 @@ type FakeClusterSets struct { ns string } -var clustersetsResource = schema.GroupVersionResource{Group: "multicluster.crd.antrea.io", Version: "v1alpha2", Resource: "clustersets"} +var clustersetsResource = v1alpha2.SchemeGroupVersion.WithResource("clustersets") -var clustersetsKind = schema.GroupVersionKind{Group: "multicluster.crd.antrea.io", Version: "v1alpha2", Kind: "ClusterSet"} +var clustersetsKind = v1alpha2.SchemeGroupVersion.WithKind("ClusterSet") // Get takes name of the clusterSet, and returns the corresponding clusterSet object, and an error if there is any. func (c *FakeClusterSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ClusterSet, err error) { diff --git a/multicluster/pkg/client/informers/externalversions/factory.go b/multicluster/pkg/client/informers/externalversions/factory.go index aeec2a2bd59..5aed620f6de 100644 --- a/multicluster/pkg/client/informers/externalversions/factory.go +++ b/multicluster/pkg/client/informers/externalversions/factory.go @@ -1,4 +1,4 @@ -// Copyright 2023 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,6 +40,7 @@ type sharedInformerFactory struct { lock sync.Mutex defaultResync time.Duration customResync map[reflect.Type]time.Duration + transform cache.TransformFunc informers map[reflect.Type]cache.SharedIndexInformer // startedInformers is used for tracking which informers have been started. @@ -78,6 +79,14 @@ func WithNamespace(namespace string) SharedInformerOption { } } +// WithTransform sets a transform on all informers. +func WithTransform(transform cache.TransformFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.transform = transform + return factory + } +} + // NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync) @@ -164,7 +173,7 @@ func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[ref return res } -// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// InformerFor returns the SharedIndexInformer for obj using an internal // client. func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { f.lock.Lock() @@ -182,6 +191,7 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal } informer = newFunc(f.client, resyncPeriod) + informer.SetTransform(f.transform) f.informers[informerType] = informer return informer @@ -237,7 +247,7 @@ type SharedInformerFactory interface { // ForResource gives generic access to a shared informer of the matching type. ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // InformerFor returns the SharedIndexInformer for obj using an internal // client. InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer diff --git a/multicluster/test/integration/suite_test.go b/multicluster/test/integration/suite_test.go index fa795fc0802..a36fc8ff71e 100644 --- a/multicluster/test/integration/suite_test.go +++ b/multicluster/test/integration/suite_test.go @@ -134,7 +134,7 @@ var _ = BeforeSuite(func() { k8sServerURL = testEnv.Config.Host stopCh := signals.RegisterSignalHandlers() - ctx, _ := wait.ContextForChannel(stopCh) + ctx := wait.ContextForChannel(stopCh) By("Creating MemberClusterSetReconciler") k8sClient.Create(ctx, leaderNS) diff --git a/multicluster/test/mocks/mock_controller_runtime_manager.go b/multicluster/test/mocks/mock_controller_runtime_manager.go index 193198fea01..b1af80f9eec 100644 --- a/multicluster/test/mocks/mock_controller_runtime_manager.go +++ b/multicluster/test/mocks/mock_controller_runtime_manager.go @@ -32,7 +32,7 @@ import ( record "k8s.io/client-go/tools/record" cache "sigs.k8s.io/controller-runtime/pkg/cache" client "sigs.k8s.io/controller-runtime/pkg/client" - v1alpha1 "sigs.k8s.io/controller-runtime/pkg/config/v1alpha1" + config "sigs.k8s.io/controller-runtime/pkg/config" healthz "sigs.k8s.io/controller-runtime/pkg/healthz" manager "sigs.k8s.io/controller-runtime/pkg/manager" webhook "sigs.k8s.io/controller-runtime/pkg/webhook" @@ -70,51 +70,37 @@ func (m *MockManager) Add(arg0 manager.Runnable) error { } // Add indicates an expected call of Add. -func (mr *MockManagerMockRecorder) Add(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) Add(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockManager)(nil).Add), arg0) } // AddHealthzCheck mocks base method. -func (m *MockManager) AddHealthzCheck(arg0 string, arg1 healthz.Checker) error { +func (m *MockManager) AddHealthzCheck(name string, check healthz.Checker) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "AddHealthzCheck", arg0, arg1) + ret := m.ctrl.Call(m, "AddHealthzCheck", name, check) ret0, _ := ret[0].(error) return ret0 } // AddHealthzCheck indicates an expected call of AddHealthzCheck. -func (mr *MockManagerMockRecorder) AddHealthzCheck(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) AddHealthzCheck(name, check any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddHealthzCheck", reflect.TypeOf((*MockManager)(nil).AddHealthzCheck), arg0, arg1) -} - -// AddMetricsExtraHandler mocks base method. -func (m *MockManager) AddMetricsExtraHandler(arg0 string, arg1 http.Handler) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "AddMetricsExtraHandler", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// AddMetricsExtraHandler indicates an expected call of AddMetricsExtraHandler. -func (mr *MockManagerMockRecorder) AddMetricsExtraHandler(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMetricsExtraHandler", reflect.TypeOf((*MockManager)(nil).AddMetricsExtraHandler), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddHealthzCheck", reflect.TypeOf((*MockManager)(nil).AddHealthzCheck), name, check) } // AddReadyzCheck mocks base method. -func (m *MockManager) AddReadyzCheck(arg0 string, arg1 healthz.Checker) error { +func (m *MockManager) AddReadyzCheck(name string, check healthz.Checker) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "AddReadyzCheck", arg0, arg1) + ret := m.ctrl.Call(m, "AddReadyzCheck", name, check) ret0, _ := ret[0].(error) return ret0 } // AddReadyzCheck indicates an expected call of AddReadyzCheck. -func (mr *MockManagerMockRecorder) AddReadyzCheck(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) AddReadyzCheck(name, check any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddReadyzCheck", reflect.TypeOf((*MockManager)(nil).AddReadyzCheck), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddReadyzCheck", reflect.TypeOf((*MockManager)(nil).AddReadyzCheck), name, check) } // Elected mocks base method. @@ -188,10 +174,10 @@ func (mr *MockManagerMockRecorder) GetConfig() *gomock.Call { } // GetControllerOptions mocks base method. -func (m *MockManager) GetControllerOptions() v1alpha1.ControllerConfigurationSpec { +func (m *MockManager) GetControllerOptions() config.Controller { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetControllerOptions") - ret0, _ := ret[0].(v1alpha1.ControllerConfigurationSpec) + ret0, _ := ret[0].(config.Controller) return ret0 } @@ -202,17 +188,17 @@ func (mr *MockManagerMockRecorder) GetControllerOptions() *gomock.Call { } // GetEventRecorderFor mocks base method. -func (m *MockManager) GetEventRecorderFor(arg0 string) record.EventRecorder { +func (m *MockManager) GetEventRecorderFor(name string) record.EventRecorder { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetEventRecorderFor", arg0) + ret := m.ctrl.Call(m, "GetEventRecorderFor", name) ret0, _ := ret[0].(record.EventRecorder) return ret0 } // GetEventRecorderFor indicates an expected call of GetEventRecorderFor. -func (mr *MockManagerMockRecorder) GetEventRecorderFor(arg0 interface{}) *gomock.Call { +func (mr *MockManagerMockRecorder) GetEventRecorderFor(name any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEventRecorderFor", reflect.TypeOf((*MockManager)(nil).GetEventRecorderFor), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEventRecorderFor", reflect.TypeOf((*MockManager)(nil).GetEventRecorderFor), name) } // GetFieldIndexer mocks base method. @@ -229,6 +215,20 @@ func (mr *MockManagerMockRecorder) GetFieldIndexer() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFieldIndexer", reflect.TypeOf((*MockManager)(nil).GetFieldIndexer)) } +// GetHTTPClient mocks base method. +func (m *MockManager) GetHTTPClient() *http.Client { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetHTTPClient") + ret0, _ := ret[0].(*http.Client) + return ret0 +} + +// GetHTTPClient indicates an expected call of GetHTTPClient. +func (mr *MockManagerMockRecorder) GetHTTPClient() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHTTPClient", reflect.TypeOf((*MockManager)(nil).GetHTTPClient)) +} + // GetLogger mocks base method. func (m *MockManager) GetLogger() logr.Logger { m.ctrl.T.Helper() @@ -272,10 +272,10 @@ func (mr *MockManagerMockRecorder) GetScheme() *gomock.Call { } // GetWebhookServer mocks base method. -func (m *MockManager) GetWebhookServer() *webhook.Server { +func (m *MockManager) GetWebhookServer() webhook.Server { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetWebhookServer") - ret0, _ := ret[0].(*webhook.Server) + ret0, _ := ret[0].(webhook.Server) return ret0 } @@ -285,22 +285,45 @@ func (mr *MockManagerMockRecorder) GetWebhookServer() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWebhookServer", reflect.TypeOf((*MockManager)(nil).GetWebhookServer)) } -// SetFields mocks base method. -func (m *MockManager) SetFields(arg0 interface{}) error { +// Start mocks base method. +func (m *MockManager) Start(ctx context.Context) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SetFields", arg0) + ret := m.ctrl.Call(m, "Start", ctx) ret0, _ := ret[0].(error) return ret0 } -// SetFields indicates an expected call of SetFields. -func (mr *MockManagerMockRecorder) SetFields(arg0 interface{}) *gomock.Call { +// Start indicates an expected call of Start. +func (mr *MockManagerMockRecorder) Start(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetFields", reflect.TypeOf((*MockManager)(nil).SetFields), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockManager)(nil).Start), ctx) +} + +// MockRunnable is a mock of Runnable interface. +type MockRunnable struct { + ctrl *gomock.Controller + recorder *MockRunnableMockRecorder +} + +// MockRunnableMockRecorder is the mock recorder for MockRunnable. +type MockRunnableMockRecorder struct { + mock *MockRunnable +} + +// NewMockRunnable creates a new mock instance. +func NewMockRunnable(ctrl *gomock.Controller) *MockRunnable { + mock := &MockRunnable{ctrl: ctrl} + mock.recorder = &MockRunnableMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRunnable) EXPECT() *MockRunnableMockRecorder { + return m.recorder } // Start mocks base method. -func (m *MockManager) Start(arg0 context.Context) error { +func (m *MockRunnable) Start(arg0 context.Context) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Start", arg0) ret0, _ := ret[0].(error) @@ -308,7 +331,44 @@ func (m *MockManager) Start(arg0 context.Context) error { } // Start indicates an expected call of Start. -func (mr *MockManagerMockRecorder) Start(arg0 interface{}) *gomock.Call { +func (mr *MockRunnableMockRecorder) Start(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockManager)(nil).Start), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockRunnable)(nil).Start), arg0) +} + +// MockLeaderElectionRunnable is a mock of LeaderElectionRunnable interface. +type MockLeaderElectionRunnable struct { + ctrl *gomock.Controller + recorder *MockLeaderElectionRunnableMockRecorder +} + +// MockLeaderElectionRunnableMockRecorder is the mock recorder for MockLeaderElectionRunnable. +type MockLeaderElectionRunnableMockRecorder struct { + mock *MockLeaderElectionRunnable } + +// NewMockLeaderElectionRunnable creates a new mock instance. +func NewMockLeaderElectionRunnable(ctrl *gomock.Controller) *MockLeaderElectionRunnable { + mock := &MockLeaderElectionRunnable{ctrl: ctrl} + mock.recorder = &MockLeaderElectionRunnableMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockLeaderElectionRunnable) EXPECT() *MockLeaderElectionRunnableMockRecorder { + return m.recorder +} + +// NeedLeaderElection mocks base method. +func (m *MockLeaderElectionRunnable) NeedLeaderElection() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NeedLeaderElection") + ret0, _ := ret[0].(bool) + return ret0 +} + +// NeedLeaderElection indicates an expected call of NeedLeaderElection. +func (mr *MockLeaderElectionRunnableMockRecorder) NeedLeaderElection() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NeedLeaderElection", reflect.TypeOf((*MockLeaderElectionRunnable)(nil).NeedLeaderElection)) +} \ No newline at end of file diff --git a/pkg/agent/agent.go b/pkg/agent/agent.go index 350770574bc..57db78cae5c 100644 --- a/pkg/agent/agent.go +++ b/pkg/agent/agent.go @@ -606,12 +606,13 @@ func (i *Initializer) initOpenFlowPipeline() error { // happen that ovsBridgeClient's connection is not ready when ofClient completes flow replay. We retry it // with a timeout that is longer time than ovsBridgeClient's maximum connecting retry interval (8 seconds) // to ensure the flag can be removed successfully. - err = wait.PollImmediate(200*time.Millisecond, 10*time.Second, func() (done bool, err error) { - if err := i.FlowRestoreComplete(); err != nil { - return false, nil - } - return true, nil - }) + err = wait.PollUntilContextTimeout(context.TODO(), 200*time.Millisecond, 10*time.Second, true, + func(ctx context.Context) (done bool, err error) { + if err := i.FlowRestoreComplete(); err != nil { + return false, nil + } + return true, nil + }) // This shouldn't happen unless OVS is disconnected again after replaying flows. If it happens, we will try // to clean up the config again so an error log should be fine. if err != nil { @@ -639,21 +640,22 @@ func (i *Initializer) FlowRestoreComplete() error { } // "flow-restore-wait" is supposed to be true here. - err := wait.PollImmediate(200*time.Millisecond, 2*time.Second, func() (done bool, err error) { - flowRestoreWait, err := getFlowRestoreWait() - if err != nil { - return false, err - } - if !flowRestoreWait { - // If the log is seen and the config becomes true later, we should look at why "ovs-vsctl set --no-wait" - // doesn't take effect on ovsdb immediately. - klog.Warning("flow-restore-wait was not true before the delete call was made, will retry") - return false, nil - } - return true, nil - }) + err := wait.PollUntilContextTimeout(context.TODO(), 200*time.Millisecond, 2*time.Second, true, + func(ctx context.Context) (done bool, err error) { + flowRestoreWait, err := getFlowRestoreWait() + if err != nil { + return false, err + } + if !flowRestoreWait { + // If the log is seen and the config becomes true later, we should look at why "ovs-vsctl set --no-wait" + // doesn't take effect on ovsdb immediately. + klog.Warning("flow-restore-wait was not true before the delete call was made, will retry") + return false, nil + } + return true, nil + }) if err != nil { - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { // This could happen if the method is triggered by OVS disconnection event, in which OVS doesn't restart. klog.Info("flow-restore-wait was not true, skip cleaning it up") return nil @@ -913,24 +915,25 @@ func (i *Initializer) setTunnelCsum(tunnelPortName string, enable bool) error { // host gateway interface. func (i *Initializer) initK8sNodeLocalConfig(nodeName string) error { var node *v1.Node - if err := wait.PollImmediate(5*time.Second, getNodeTimeout, func() (bool, error) { - var err error - node, err = i.client.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{}) - if err != nil { - return false, fmt.Errorf("failed to get Node with name %s from K8s: %w", nodeName, err) - } + if err := wait.PollUntilContextTimeout(context.TODO(), 5*time.Second, getNodeTimeout, true, + func(ctx context.Context) (bool, error) { + var err error + node, err = i.client.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{}) + if err != nil { + return false, fmt.Errorf("failed to get Node with name %s from K8s: %w", nodeName, err) + } - // Except in networkPolicyOnly mode, we need a PodCIDR for the Node. - if !i.networkConfig.TrafficEncapMode.IsNetworkPolicyOnly() { - // Validate that PodCIDR has been configured. - if node.Spec.PodCIDRs == nil && node.Spec.PodCIDR == "" { - klog.InfoS("Waiting for Node PodCIDR configuration to complete", "nodeName", nodeName) - return false, nil + // Except in networkPolicyOnly mode, we need a PodCIDR for the Node. + if !i.networkConfig.TrafficEncapMode.IsNetworkPolicyOnly() { + // Validate that PodCIDR has been configured. + if node.Spec.PodCIDRs == nil && node.Spec.PodCIDR == "" { + klog.InfoS("Waiting for Node PodCIDR configuration to complete", "nodeName", nodeName) + return false, nil + } } - } - return true, nil - }); err != nil { - if err == wait.ErrWaitTimeout { + return true, nil + }); err != nil { + if wait.Interrupted(err) { klog.ErrorS(err, "Spec.PodCIDR is empty for Node. Please make sure --allocate-node-cidrs is enabled "+ "for kube-controller-manager and --cluster-cidr specifies a sufficient CIDR range, or nodeIPAM is "+ "enabled for antrea-controller", "nodeName", nodeName) @@ -1313,13 +1316,13 @@ func (i *Initializer) initNodeLocalConfig() error { func (i *Initializer) initVMLocalConfig(nodeName string) error { var en *v1alpha1.ExternalNode klog.InfoS("Initializing VM config", "ExternalNode", nodeName) - if err := wait.PollImmediateUntil(10*time.Second, func() (done bool, err error) { + if err := wait.PollUntilContextCancel(wait.ContextForChannel(i.stopCh), 10*time.Second, true, func(ctx context.Context) (done bool, err error) { en, err = i.crdClient.CrdV1alpha1().ExternalNodes(i.externalNodeNamespace).Get(context.TODO(), nodeName, metav1.GetOptions{}) if err != nil { return false, nil } return true, nil - }, i.stopCh); err != nil { + }); err != nil { klog.Info("Stopped waiting for ExternalNode") return err } diff --git a/pkg/agent/agent_linux.go b/pkg/agent/agent_linux.go index cc150fa5f24..bc0b4fbeca9 100644 --- a/pkg/agent/agent_linux.go +++ b/pkg/agent/agent_linux.go @@ -18,6 +18,7 @@ package agent import ( + "context" "fmt" "net" "time" @@ -236,16 +237,17 @@ func (i *Initializer) ConnectUplinkToOVSBridge() error { // Move network configuration of uplink interface to OVS bridge local interface. // The net configuration of uplink will be restored by RestoreOVSBridge when shutting down. - wait.PollImmediate(100*time.Millisecond, 10000*time.Millisecond, func() (bool, error) { - // Wait a few seconds for OVS bridge local port. - link, err := netlink.LinkByName(uplinkName) - if err != nil { - klog.V(4).InfoS("OVS bridge local port is not ready", "port", uplinkName, "err", err) - return false, nil - } - klog.InfoS("OVS bridge local port is ready", "type", link.Type(), "attrs", link.Attrs()) - return true, nil - }) + wait.PollUntilContextTimeout(context.TODO(), 100*time.Millisecond, 10000*time.Millisecond, true, + func(ctx context.Context) (bool, error) { + // Wait a few seconds for OVS bridge local port. + link, err := netlink.LinkByName(uplinkName) + if err != nil { + klog.V(4).InfoS("OVS bridge local port is not ready", "port", uplinkName, "err", err) + return false, nil + } + klog.InfoS("OVS bridge local port is ready", "type", link.Type(), "attrs", link.Attrs()) + return true, nil + }) localLink, err := netlink.LinkByName(uplinkName) if err != nil { return err @@ -359,7 +361,7 @@ func (i *Initializer) prepareL7EngineInterfaces() error { if err != nil { return err } - if pollErr := wait.PollImmediate(time.Second, 5*time.Second, func() (bool, error) { + if pollErr := wait.PollUntilContextTimeout(context.TODO(), time.Second, 5*time.Second, true, func(ctx context.Context) (bool, error) { _, _, err := util.SetLinkUp(portName) if err == nil { return true, nil diff --git a/pkg/agent/agent_test.go b/pkg/agent/agent_test.go index 27968c1f0da..9495c77593b 100644 --- a/pkg/agent/agent_test.go +++ b/pkg/agent/agent_test.go @@ -951,7 +951,7 @@ func TestInitVMLocalConfig(t *testing.T) { name: "provided external Node unavailable", nodeName: "testNode", crdClient: fakeversioned.NewSimpleClientset(), - expectedErr: "timed out waiting for the condition", + expectedErr: "context canceled", }, } diff --git a/pkg/agent/apiserver/apiserver.go b/pkg/agent/apiserver/apiserver.go index d07cb43823a..ab16057f9cb 100644 --- a/pkg/agent/apiserver/apiserver.go +++ b/pkg/agent/apiserver/apiserver.go @@ -26,6 +26,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" k8sversion "k8s.io/apimachinery/pkg/version" + genericopenapi "k8s.io/apiserver/pkg/endpoints/openapi" "k8s.io/apiserver/pkg/registry/rest" genericapiserver "k8s.io/apiserver/pkg/server" "k8s.io/apiserver/pkg/server/healthz" @@ -45,7 +46,9 @@ import ( agentquerier "antrea.io/antrea/pkg/agent/querier" systeminstall "antrea.io/antrea/pkg/apis/system/install" systemv1beta1 "antrea.io/antrea/pkg/apis/system/v1beta1" + "antrea.io/antrea/pkg/apiserver" "antrea.io/antrea/pkg/apiserver/handlers/loglevel" + "antrea.io/antrea/pkg/apiserver/openapi" "antrea.io/antrea/pkg/apiserver/registry/system/supportbundle" "antrea.io/antrea/pkg/ovs/ovsctl" "antrea.io/antrea/pkg/querier" @@ -199,6 +202,9 @@ func newConfig(aq agentquerier.AgentQuerier, return fmt.Errorf("disconnected from OFSwitch") }) serverConfig.LivezChecks = append(serverConfig.LivezChecks, ovsConnCheck) + serverConfig.OpenAPIV3Config = genericapiserver.DefaultOpenAPIV3Config( + openapi.GetOpenAPIDefinitions, + genericopenapi.NewDefinitionNamer(apiserver.Scheme)) completedServerCfg := serverConfig.Complete(nil) return &completedServerCfg, nil diff --git a/pkg/agent/cniserver/interface_configuration_windows.go b/pkg/agent/cniserver/interface_configuration_windows.go index a083354369d..1c83c6a4032 100644 --- a/pkg/agent/cniserver/interface_configuration_windows.go +++ b/pkg/agent/cniserver/interface_configuration_windows.go @@ -18,6 +18,7 @@ package cniserver import ( + "context" "errors" "fmt" "net" @@ -505,27 +506,28 @@ func (ic *ifConfigurator) addPostInterfaceCreateHook(containerID, endpointName s go func() { ifaceName := fmt.Sprintf("vEthernet (%s)", endpointName) var err error - pollErr := wait.PollImmediate(100*time.Millisecond, 60*time.Second, func() (bool, error) { - containerAccess.lockContainer(containerID) - defer containerAccess.unlockContainer(containerID) - currentEP, ok := ic.getEndpoint(endpointName) - if !ok { - klog.InfoS("HNSEndpoint doesn't exist in cache, exit current goroutine", "HNSEndpoint", endpointName) + pollErr := wait.PollUntilContextTimeout(context.TODO(), 100*time.Millisecond, 60*time.Second, true, + func(ctx context.Context) (bool, error) { + containerAccess.lockContainer(containerID) + defer containerAccess.unlockContainer(containerID) + currentEP, ok := ic.getEndpoint(endpointName) + if !ok { + klog.InfoS("HNSEndpoint doesn't exist in cache, exit current goroutine", "HNSEndpoint", endpointName) + return true, nil + } + if currentEP.Id != expectedEP.Id { + klog.InfoS("Detected HNSEndpoint change, exit current goroutine", "HNSEndpoint", endpointName) + return true, nil + } + if !hostInterfaceExistsFunc(ifaceName) { + klog.V(2).InfoS("Waiting for interface to be created", "interface", ifaceName) + return false, nil + } + if err = hook(); err != nil { + return false, err + } return true, nil - } - if currentEP.Id != expectedEP.Id { - klog.InfoS("Detected HNSEndpoint change, exit current goroutine", "HNSEndpoint", endpointName) - return true, nil - } - if !hostInterfaceExistsFunc(ifaceName) { - klog.V(2).InfoS("Waiting for interface to be created", "interface", ifaceName) - return false, nil - } - if err = hook(); err != nil { - return false, err - } - return true, nil - }) + }) if pollErr != nil { if err != nil { diff --git a/pkg/agent/cniserver/ipam/antrea_ipam.go b/pkg/agent/cniserver/ipam/antrea_ipam.go index 3aa3cfc1298..7172df15aab 100644 --- a/pkg/agent/cniserver/ipam/antrea_ipam.go +++ b/pkg/agent/cniserver/ipam/antrea_ipam.go @@ -15,6 +15,7 @@ package ipam import ( + "context" "fmt" "net" "sync" @@ -353,7 +354,7 @@ func (d *AntreaIPAM) owns(k8sArgs *types.K8sArgs) (mineType, *poolallocator.IPPo } func (d *AntreaIPAM) waitForControllerReady() error { - err := wait.PollImmediate(500*time.Millisecond, 5*time.Second, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.TODO(), 500*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) { d.controllerMutex.RLock() defer d.controllerMutex.RUnlock() if d.controller == nil { diff --git a/pkg/agent/cniserver/ipam/antrea_ipam_test.go b/pkg/agent/cniserver/ipam/antrea_ipam_test.go index df517bce395..042a6dd0cf0 100644 --- a/pkg/agent/cniserver/ipam/antrea_ipam_test.go +++ b/pkg/agent/cniserver/ipam/antrea_ipam_test.go @@ -15,6 +15,7 @@ package ipam import ( + "context" "fmt" "regexp" "sync" @@ -376,7 +377,7 @@ func TestAntreaIPAMDriver(t *testing.T) { podNamespace := string(k8sArgsMap[test].K8S_POD_NAMESPACE) podName := string(k8sArgsMap[test].K8S_POD_NAME) - err = wait.Poll(time.Millisecond*200, time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Millisecond*200, time.Second, false, func(ctx context.Context) (bool, error) { ipPool, _ := antreaIPAMController.ipPoolLister.Get(podNamespace) found := false for _, ipAddress := range ipPool.Status.IPAddresses { @@ -410,7 +411,7 @@ func TestAntreaIPAMDriver(t *testing.T) { podNamespace := string(k8sArgsMap[test].K8S_POD_NAMESPACE) podName := string(k8sArgsMap[test].K8S_POD_NAME) - err = wait.Poll(time.Millisecond*200, time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Millisecond*200, time.Second, false, func(ctx context.Context) (bool, error) { ipPool, _ := antreaIPAMController.ipPoolLister.Get(podNamespace) found := false for _, ipAddress := range ipPool.Status.IPAddresses { @@ -492,14 +493,15 @@ func TestAntreaIPAMDriver(t *testing.T) { testDel("pear10", false) // Verify last update was propagated to informer - err = wait.PollImmediate(100*time.Millisecond, 1*time.Second, func() (bool, error) { - owns, err := testDriver.Check(cniArgsMap["orange2"], k8sArgsMap["orange2"], networkConfig) - if err != nil { - // container already relelased - return true, nil - } - return !owns, nil - }) + err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 1*time.Second, true, + func(ctx context.Context) (bool, error) { + owns, err := testDriver.Check(cniArgsMap["orange2"], k8sArgsMap["orange2"], networkConfig) + if err != nil { + // container already relelased + return true, nil + } + return !owns, nil + }) require.NoError(t, err, "orange2 pod was not released") @@ -575,7 +577,7 @@ func TestSecondaryNetworkAdd(t *testing.T) { }, }, }, - expectedRes: fmt.Errorf("Antrea IPAM driver not ready: timed out waiting for the condition"), + expectedRes: fmt.Errorf("Antrea IPAM driver not ready: context deadline exceeded"), }, { name: "Add secondary network successfully", diff --git a/pkg/agent/cniserver/server_windows_test.go b/pkg/agent/cniserver/server_windows_test.go index ba562bae762..0a3ffbf7c33 100644 --- a/pkg/agent/cniserver/server_windows_test.go +++ b/pkg/agent/cniserver/server_windows_test.go @@ -540,13 +540,14 @@ func TestCmdAdd(t *testing.T) { waiter.wait() // Wait for the completion of async function "setInterfaceMTUFunc", otherwise it may lead to the // race condition failure. - wait.PollImmediate(time.Millisecond*10, time.Second, func() (done bool, err error) { - mtuSet, exist := hostIfaces.Load(ovsPortName) - if !exist { - return false, nil - } - return mtuSet.(bool), nil - }) + wait.PollUntilContextTimeout(context.Background(), time.Millisecond*10, time.Second, true, + func(ctx context.Context) (done bool, err error) { + mtuSet, exist := hostIfaces.Load(ovsPortName) + if !exist { + return false, nil + } + return mtuSet.(bool), nil + }) } waiter.close() }) diff --git a/pkg/agent/controller/egress/egress_controller_test.go b/pkg/agent/controller/egress/egress_controller_test.go index 8c66a0f2a1b..7e91d2e53ca 100644 --- a/pkg/agent/controller/egress/egress_controller_test.go +++ b/pkg/agent/controller/egress/egress_controller_test.go @@ -30,7 +30,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes/fake" k8stesting "k8s.io/client-go/testing" @@ -1118,16 +1117,17 @@ func TestSyncEgress(t *testing.T) { if tt.newLocalIPs != nil { c.localIPDetector = &fakeLocalIPDetector{localIPs: tt.newLocalIPs} } - assert.NoError(t, wait.Poll(time.Millisecond*100, time.Second, func() (done bool, err error) { + assert.Eventually(t, func() bool { if tt.newExternalIPPool != nil { pool, _ := c.externalIPPoolLister.Get(tt.newExternalIPPool.Name) if !reflect.DeepEqual(pool, tt.newExternalIPPool) { - return false, nil + return false } } egress, _ := c.egressLister.Get(tt.newEgress.Name) - return reflect.DeepEqual(egress, tt.newEgress), nil - })) + return reflect.DeepEqual(egress, tt.newEgress) + }, time.Second, 100*time.Millisecond) + c.egressIPScheduler.schedule() err = c.syncEgress(tt.newEgress.Name) assert.NoError(t, err) @@ -1184,9 +1184,9 @@ func TestPodUpdateShouldSyncEgress(t *testing.T) { PodNamespace: "ns1", } c.podUpdateChannel.Notify(ev) - require.NoError(t, wait.PollImmediate(10*time.Millisecond, time.Second, func() (done bool, err error) { - return c.queue.Len() == 1, nil - })) + require.Eventually(t, func() bool { + return c.queue.Len() == 1 + }, time.Second, 10*time.Millisecond) item, _ = c.queue.Get() require.Equal(t, egress.Name, item) require.NoError(t, c.syncEgress(item.(string))) @@ -1216,9 +1216,9 @@ func TestExternalIPPoolUpdateShouldSyncEgress(t *testing.T) { c.informerFactory.WaitForCacheSync(stopCh) assertItemsInQueue := func(items ...string) { - require.NoError(t, wait.Poll(10*time.Millisecond, time.Second, func() (done bool, err error) { - return c.queue.Len() == len(items), nil - })) + require.Eventually(t, func() bool { + return c.queue.Len() == len(items) + }, time.Second, 10*time.Millisecond) expectedItems := sets.New[string](items...) for i := 0; i < len(items); i++ { item, _ := c.queue.Get() @@ -1325,10 +1325,10 @@ func TestSyncOverlappingEgress(t *testing.T) { c.mockOFClient.EXPECT().UninstallPodSNATFlows(uint32(1)) c.mockOFClient.EXPECT().UninstallPodSNATFlows(uint32(2)) c.crdClient.CrdV1beta1().Egresses().Delete(context.TODO(), egress1.Name, metav1.DeleteOptions{}) - assert.NoError(t, wait.Poll(time.Millisecond*100, time.Second, func() (bool, error) { + assert.Eventually(t, func() bool { _, err := c.egressLister.Get(egress1.Name) - return err != nil, nil - })) + return err != nil + }, time.Second, time.Millisecond*100) checkQueueItemExistence(t, c.queue, egress1.Name) c.mockIPAssigner.EXPECT().UnassignIP(fakeLocalEgressIP1) err = c.syncEgress(egress1.Name) @@ -1352,10 +1352,10 @@ func TestSyncOverlappingEgress(t *testing.T) { c.mockOFClient.EXPECT().UninstallPodSNATFlows(uint32(3)) c.crdClient.CrdV1beta1().Egresses().Delete(context.TODO(), egress2.Name, metav1.DeleteOptions{}) c.mockIPAssigner.EXPECT().UnassignIP(fakeRemoteEgressIP1) - assert.NoError(t, wait.Poll(time.Millisecond*100, time.Second, func() (bool, error) { + assert.Eventually(t, func() bool { _, err := c.egressLister.Get(egress2.Name) - return err != nil, nil - })) + return err != nil + }, time.Second, time.Millisecond*100) checkQueueItemExistence(t, c.queue, egress2.Name) err = c.syncEgress(egress2.Name) assert.NoError(t, err) @@ -1368,10 +1368,10 @@ func TestSyncOverlappingEgress(t *testing.T) { c.mockOFClient.EXPECT().UninstallPodSNATFlows(uint32(4)) c.crdClient.CrdV1beta1().Egresses().Delete(context.TODO(), egress3.Name, metav1.DeleteOptions{}) c.mockIPAssigner.EXPECT().UnassignIP(fakeLocalEgressIP1) - assert.NoError(t, wait.Poll(time.Millisecond*100, time.Second, func() (bool, error) { + assert.Eventually(t, func() bool { _, err := c.egressLister.Get(egress3.Name) - return err != nil, nil - })) + return err != nil + }, time.Second, time.Millisecond*100) checkQueueItemExistence(t, c.queue, egress3.Name) err = c.syncEgress(egress3.Name) assert.NoError(t, err) diff --git a/pkg/agent/controller/l7flowexporter/l7_flow_export_controller_test.go b/pkg/agent/controller/l7flowexporter/l7_flow_export_controller_test.go index 27429df4a0a..5f400e7b1a2 100644 --- a/pkg/agent/controller/l7flowexporter/l7_flow_export_controller_test.go +++ b/pkg/agent/controller/l7flowexporter/l7_flow_export_controller_test.go @@ -28,7 +28,6 @@ import ( "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/informers" coreinformers "k8s.io/client-go/informers/core/v1" "k8s.io/client-go/kubernetes/fake" @@ -159,9 +158,9 @@ func newPodInterface(podName, podNamespace string, ofPort int32) *interfacestore } func waitEvents(t *testing.T, expectedEvents int, c *fakeController) { - require.NoError(t, wait.Poll(10*time.Millisecond, 5*time.Second, func() (done bool, err error) { - return c.queue.Len() == expectedEvents, nil - })) + require.Eventually(t, func() bool { + return c.queue.Len() == expectedEvents + }, 5*time.Second, 10*time.Millisecond) } func TestPodAdd(t *testing.T) { diff --git a/pkg/agent/controller/networkpolicy/allocator_test.go b/pkg/agent/controller/networkpolicy/allocator_test.go index 15b12033718..8bed6634ca0 100644 --- a/pkg/agent/controller/networkpolicy/allocator_test.go +++ b/pkg/agent/controller/networkpolicy/allocator_test.go @@ -15,6 +15,7 @@ package networkpolicy import ( + "context" "fmt" "testing" "time" @@ -234,7 +235,7 @@ func TestIdAllocatorWorker(t *testing.T) { fakeClock.SetTime(expectedDeleteTime.Add(-10 * time.Millisecond)) // We wait for a small duration and ensure that the rule is not deleted. - err := wait.PollImmediate(10*time.Millisecond, 100*time.Millisecond, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), 10*time.Millisecond, 100*time.Millisecond, true, func(ctx context.Context) (bool, error) { return ruleHasBeenDeleted(), nil }) require.Error(t, err, "Rule ID was unexpectedly released") @@ -244,9 +245,10 @@ func TestIdAllocatorWorker(t *testing.T) { fakeClock.SetTime(expectedDeleteTime.Add(10 * time.Millisecond)) - err = wait.PollImmediate(10*time.Millisecond, 1*time.Second, func() (bool, error) { - return ruleHasBeenDeleted(), nil - }) + err = wait.PollUntilContextTimeout(context.Background(), 10*time.Millisecond, 1*time.Second, true, + func(ctx context.Context) (bool, error) { + return ruleHasBeenDeleted(), nil + }) require.NoError(t, err, "Rule ID was not released") _, exists, err = a.getRuleFromAsyncCache(tt.expectedID) require.NoError(t, err) diff --git a/pkg/agent/controller/networkpolicy/l7engine/reconciler.go b/pkg/agent/controller/networkpolicy/l7engine/reconciler.go index 1eb6b132f03..4d489199fdd 100644 --- a/pkg/agent/controller/networkpolicy/l7engine/reconciler.go +++ b/pkg/agent/controller/networkpolicy/l7engine/reconciler.go @@ -16,6 +16,7 @@ package l7engine import ( "bytes" + "context" "encoding/json" "fmt" "os" @@ -494,7 +495,7 @@ func (r *Reconciler) startSuricata() { r.startSuricataFn() // Wait Suricata command socket file to be ready. - err = wait.PollImmediate(100*time.Millisecond, 5*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.TODO(), 100*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) { if _, err = defaultFS.Stat(suricataCommandSocket); err != nil { return false, nil } diff --git a/pkg/agent/controller/networkpolicy/networkpolicy_controller.go b/pkg/agent/controller/networkpolicy/networkpolicy_controller.go index 5565dad1f2a..c4f22e5d8a7 100644 --- a/pkg/agent/controller/networkpolicy/networkpolicy_controller.go +++ b/pkg/agent/controller/networkpolicy/networkpolicy_controller.go @@ -594,7 +594,7 @@ func (c *Controller) SetDenyConnStore(denyConnStore *connections.DenyConnectionS // Run will not return until stopCh is closed. func (c *Controller) Run(stopCh <-chan struct{}) { attempts := 0 - if err := wait.PollImmediateUntil(200*time.Millisecond, func() (bool, error) { + if err := wait.PollUntilContextCancel(wait.ContextForChannel(stopCh), 200*time.Millisecond, true, func(ctx context.Context) (bool, error) { if attempts%10 == 0 { klog.Info("Waiting for Antrea client to be ready") } @@ -603,7 +603,7 @@ func (c *Controller) Run(stopCh <-chan struct{}) { return false, nil } return true, nil - }, stopCh); err != nil { + }); err != nil { klog.Info("Stopped waiting for Antrea client") return } diff --git a/pkg/agent/controller/networkpolicy/status_controller_test.go b/pkg/agent/controller/networkpolicy/status_controller_test.go index 2aa778edd7f..6e06d915549 100644 --- a/pkg/agent/controller/networkpolicy/status_controller_test.go +++ b/pkg/agent/controller/networkpolicy/status_controller_test.go @@ -15,6 +15,7 @@ package networkpolicy import ( + "context" "fmt" "sync" "testing" @@ -138,13 +139,14 @@ func TestSyncStatusUpForUpdatedPolicy(t *testing.T) { statusController.SetRuleRealization(rule1.ID, policy.UID) matchGeneration := func(generation int64) error { - return wait.PollImmediate(100*time.Millisecond, 1*time.Second, func() (done bool, err error) { - status := statusControl.getNetworkPolicyStatus() - if status == nil { - return false, nil - } - return status.Nodes[0].Generation == generation, nil - }) + return wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 1*time.Second, true, + func(ctx context.Context) (done bool, err error) { + status := statusControl.getNetworkPolicyStatus() + if status == nil { + return false, nil + } + return status.Nodes[0].Generation == generation, nil + }) } assert.NoError(t, matchGeneration(policy.Generation), "The generation should be updated to %v but was not updated", policy.Generation) diff --git a/pkg/agent/controller/traceflow/packetin.go b/pkg/agent/controller/traceflow/packetin.go index c60ec7b639b..f67b8fdac3d 100644 --- a/pkg/agent/controller/traceflow/packetin.go +++ b/pkg/agent/controller/traceflow/packetin.go @@ -28,7 +28,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/util/retry" "k8s.io/klog/v2" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" "antrea.io/antrea/pkg/agent/openflow" crdv1beta1 "antrea.io/antrea/pkg/apis/crd/v1beta1" @@ -477,7 +477,7 @@ func parseCapturedPacket(pktIn *ofctrl.PacketIn) *crdv1beta1.Packet { capturedPacket.IPHeader = &crdv1beta1.IPHeader{Protocol: int32(pkt.IPProto), TTL: int32(pkt.TTL), Flags: int32(pkt.IPFlags)} } if pkt.IPProto == protocol.Type_TCP { - capturedPacket.TransportHeader.TCP = &crdv1beta1.TCPHeader{SrcPort: int32(pkt.SourcePort), DstPort: int32(pkt.DestinationPort), Flags: pointer.Int32(int32(pkt.TCPFlags))} + capturedPacket.TransportHeader.TCP = &crdv1beta1.TCPHeader{SrcPort: int32(pkt.SourcePort), DstPort: int32(pkt.DestinationPort), Flags: ptr.To(int32(pkt.TCPFlags))} } else if pkt.IPProto == protocol.Type_UDP { capturedPacket.TransportHeader.UDP = &crdv1beta1.UDPHeader{SrcPort: int32(pkt.SourcePort), DstPort: int32(pkt.DestinationPort)} } else if pkt.IPProto == protocol.Type_ICMP || pkt.IPProto == protocol.Type_IPv6ICMP { diff --git a/pkg/agent/controller/traceflow/packetin_test.go b/pkg/agent/controller/traceflow/packetin_test.go index 9cf6748da13..bd6e97d30dc 100644 --- a/pkg/agent/controller/traceflow/packetin_test.go +++ b/pkg/agent/controller/traceflow/packetin_test.go @@ -28,7 +28,7 @@ import ( "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" "antrea.io/antrea/pkg/agent/config" "antrea.io/antrea/pkg/agent/openflow" @@ -145,7 +145,7 @@ func TestParseCapturedPacket(t *testing.T) { SrcIP: tcpPktIn.NWSrc.String(), DstIP: tcpPktIn.NWDst.String(), Length: int32(tcpPktIn.Length), IPHeader: &crdv1beta1.IPHeader{Protocol: int32(tcpPktIn.Protocol), TTL: int32(tcpPktIn.TTL), Flags: int32(tcpPktIn.Flags)}, TransportHeader: crdv1beta1.TransportHeader{ - TCP: &crdv1beta1.TCPHeader{SrcPort: int32(tcp.PortSrc), DstPort: int32(tcp.PortDst), Flags: pointer.Int32(int32(tcp.Code))}, + TCP: &crdv1beta1.TCPHeader{SrcPort: int32(tcp.PortSrc), DstPort: int32(tcp.PortDst), Flags: ptr.To(int32(tcp.Code))}, }, } diff --git a/pkg/agent/controller/traceflow/traceflow_controller_test.go b/pkg/agent/controller/traceflow/traceflow_controller_test.go index f82afe0132e..7e9dd211736 100644 --- a/pkg/agent/controller/traceflow/traceflow_controller_test.go +++ b/pkg/agent/controller/traceflow/traceflow_controller_test.go @@ -31,7 +31,7 @@ import ( "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/util/workqueue" "k8s.io/klog/v2" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" "antrea.io/antrea/pkg/agent/config" "antrea.io/antrea/pkg/agent/interfacestore" @@ -227,7 +227,7 @@ func TestPreparePacket(t *testing.T) { TCP: &crdv1beta1.TCPHeader{ SrcPort: 80, DstPort: 81, - Flags: pointer.Int32(11), + Flags: ptr.To[int32](11), }, }, }, diff --git a/pkg/agent/controller/trafficcontrol/controller.go b/pkg/agent/controller/trafficcontrol/controller.go index e084b0e162f..745c173be4e 100644 --- a/pkg/agent/controller/trafficcontrol/controller.go +++ b/pkg/agent/controller/trafficcontrol/controller.go @@ -15,6 +15,7 @@ package trafficcontrol import ( + "context" "crypto/sha1" // #nosec G505: not used for security purposes "encoding/binary" "encoding/hex" @@ -589,16 +590,17 @@ func (c *Controller) createOVSInternalPort(portName string) (string, error) { if err != nil { return "", err } - if pollErr := wait.PollImmediate(time.Second, 5*time.Second, func() (bool, error) { - _, _, err := util.SetLinkUp(portName) - if err == nil { - return true, nil - } - if _, ok := err.(util.LinkNotFound); ok { - return false, nil - } - return false, err - }); pollErr != nil { + if pollErr := wait.PollUntilContextTimeout(context.TODO(), time.Second, 5*time.Second, true, + func(ctx context.Context) (bool, error) { + _, _, err := util.SetLinkUp(portName) + if err == nil { + return true, nil + } + if _, ok := err.(util.LinkNotFound); ok { + return false, nil + } + return false, err + }); pollErr != nil { return "", pollErr } return portUUID, nil diff --git a/pkg/agent/controller/trafficcontrol/controller_test.go b/pkg/agent/controller/trafficcontrol/controller_test.go index 0c5e67bbe1a..84c77b7ddb6 100644 --- a/pkg/agent/controller/trafficcontrol/controller_test.go +++ b/pkg/agent/controller/trafficcontrol/controller_test.go @@ -28,7 +28,6 @@ import ( "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/informers" coreinformers "k8s.io/client-go/informers/core/v1" "k8s.io/client-go/kubernetes/fake" @@ -288,9 +287,9 @@ func generateTrafficControlState(direction v1alpha2.Direction, } func waitEvents(t *testing.T, expectedEvents int, c *fakeController) { - require.NoError(t, wait.Poll(10*time.Millisecond, 5*time.Second, func() (done bool, err error) { - return c.queue.Len() == expectedEvents, nil - })) + require.Eventually(t, func() bool { + return c.queue.Len() == expectedEvents + }, 5*time.Second, 10*time.Millisecond) } func TestTrafficControlAdd(t *testing.T) { diff --git a/pkg/agent/externalnode/external_node_controller.go b/pkg/agent/externalnode/external_node_controller.go index ae28d103c84..559e9bbfcd6 100644 --- a/pkg/agent/externalnode/external_node_controller.go +++ b/pkg/agent/externalnode/external_node_controller.go @@ -15,6 +15,7 @@ package externalnode import ( + "context" "fmt" "net" "reflect" @@ -126,13 +127,13 @@ func (c *ExternalNodeController) Run(stopCh <-chan struct{}) { klog.InfoS("Starting controller", "name", controllerName) defer klog.InfoS("Shutting down controller", "name", controllerName) - if err := wait.PollImmediateUntil(5*time.Second, func() (done bool, err error) { + if err := wait.PollUntilContextCancel(wait.ContextForChannel(stopCh), 5*time.Second, true, func(ctx context.Context) (done bool, err error) { if err = c.reconcile(); err != nil { klog.ErrorS(err, "ExternalNodeController failed during reconciliation") return false, nil } return true, nil - }, stopCh); err != nil { + }); err != nil { klog.Info("Stopped ExternalNodeController reconciliation") return } @@ -600,7 +601,7 @@ func (c *ExternalNodeController) removeOVSPortsAndFlows(interfaceConfig *interfa }() // Wait until the host interface created by OVS is removed. - if err = wait.PollImmediate(50*time.Millisecond, 2*time.Second, func() (bool, error) { + if err = wait.PollUntilContextTimeout(context.TODO(), 50*time.Millisecond, 2*time.Second, true, func(ctx context.Context) (bool, error) { return !hostInterfaceExists(hostIFName), nil }); err != nil { return fmt.Errorf("failed to wait for host interface %s deletion in 2s, err %v", hostIFName, err) diff --git a/pkg/agent/multicast/mcast_controller_test.go b/pkg/agent/multicast/mcast_controller_test.go index a322a657a58..2956e6d1ea7 100644 --- a/pkg/agent/multicast/mcast_controller_test.go +++ b/pkg/agent/multicast/mcast_controller_test.go @@ -831,7 +831,7 @@ func TestEncapLocalReportAndNotifyRemote(t *testing.T) { mockController.addOrUpdateGroupEvent(tc.e) if tc.groupChanged { - err := wait.PollImmediate(time.Millisecond*100, time.Second*3, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Millisecond*100, time.Second*3, true, func(ctx context.Context) (done bool, err error) { if tc.e.eType == groupJoin { return mockController.localGroupHasInstalled(groupKey) && mockController.groupHasInstalled(groupKey), nil } else { diff --git a/pkg/agent/multicluster/pod_route_controller_test.go b/pkg/agent/multicluster/pod_route_controller_test.go index ca76f6209ea..41dcf74dfed 100644 --- a/pkg/agent/multicluster/pod_route_controller_test.go +++ b/pkg/agent/multicluster/pod_route_controller_test.go @@ -319,7 +319,7 @@ func TestPodEvent(t *testing.T) { } func waitForGatewayRealized(gwLister mclisters.GatewayLister, gateway *mcv1alpha1.Gateway) error { - return wait.Poll(interval, timeout, func() (bool, error) { + return wait.PollUntilContextTimeout(context.Background(), interval, timeout, false, func(ctx context.Context) (bool, error) { _, err := gwLister.Gateways(gateway.Namespace).Get(gateway.Name) if err != nil { return false, nil @@ -329,7 +329,7 @@ func waitForGatewayRealized(gwLister mclisters.GatewayLister, gateway *mcv1alpha } func waitForPodIPUpdate(podLister v1.PodLister, pod *corev1.Pod) error { - return wait.Poll(interval, timeout, func() (bool, error) { + return wait.PollUntilContextTimeout(context.Background(), interval, timeout, false, func(ctx context.Context) (bool, error) { getPod, err := podLister.Pods(pod.Namespace).Get(pod.Name) if err != nil || pod.Status.PodIP != getPod.Status.PodIP || pod.Status.HostIP != getPod.Status.HostIP { return false, nil diff --git a/pkg/agent/multicluster/stretched_networkpolicy_controller.go b/pkg/agent/multicluster/stretched_networkpolicy_controller.go index 560ece18a61..8b455d64389 100644 --- a/pkg/agent/multicluster/stretched_networkpolicy_controller.go +++ b/pkg/agent/multicluster/stretched_networkpolicy_controller.go @@ -184,7 +184,7 @@ func (s *StretchedNetworkPolicyController) processNextWorkItem() bool { if podRef, ok := obj.(types.NamespacedName); !ok { s.queue.Forget(obj) - klog.Errorf("Expected type 'NamespacedName' in work queue but got object", "object", obj) + klog.ErrorS(nil, "Expected type 'NamespacedName' in work queue but got object", "object", obj) } else if err := s.syncPodClassifierFlow(podRef); err == nil { s.queue.Forget(podRef) } else { diff --git a/pkg/agent/multicluster/stretched_networkpolicy_controller_test.go b/pkg/agent/multicluster/stretched_networkpolicy_controller_test.go index f00d4a0beac..6d6fb65824b 100644 --- a/pkg/agent/multicluster/stretched_networkpolicy_controller_test.go +++ b/pkg/agent/multicluster/stretched_networkpolicy_controller_test.go @@ -558,7 +558,7 @@ func toPodAddEvent(pod *corev1.Pod) antreatypes.PodUpdate { } func waitForPodRealized(podLister v1.PodLister, pod *corev1.Pod) error { - return wait.Poll(interval, timeout, func() (bool, error) { + return wait.PollUntilContextTimeout(context.Background(), interval, timeout, false, func(ctx context.Context) (bool, error) { _, err := podLister.Pods(pod.Namespace).Get(pod.Name) if err != nil { return false, nil @@ -568,7 +568,7 @@ func waitForPodRealized(podLister v1.PodLister, pod *corev1.Pod) error { } func waitForPodLabelUpdate(podLister v1.PodLister, pod *corev1.Pod) error { - return wait.Poll(interval, timeout, func() (bool, error) { + return wait.PollUntilContextTimeout(context.Background(), interval, timeout, false, func(ctx context.Context) (bool, error) { getPod, err := podLister.Pods(pod.Namespace).Get(pod.Name) if err != nil || !reflect.DeepEqual(pod.Labels, getPod.Labels) { return false, nil @@ -578,7 +578,7 @@ func waitForPodLabelUpdate(podLister v1.PodLister, pod *corev1.Pod) error { } func waitForNSRealized(c *fakeStretchedNetworkPolicyController, ns *corev1.Namespace) error { - return wait.Poll(interval, timeout, func() (bool, error) { + return wait.PollUntilContextTimeout(context.Background(), interval, timeout, false, func(ctx context.Context) (bool, error) { _, err := c.namespaceLister.Get(ns.Name) if err != nil { return false, nil @@ -588,7 +588,7 @@ func waitForNSRealized(c *fakeStretchedNetworkPolicyController, ns *corev1.Names } func waitForLabelIdentityRealized(c *fakeStretchedNetworkPolicyController, labelIdentity *v1alpha1.LabelIdentity) error { - return wait.Poll(interval, timeout, func() (bool, error) { + return wait.PollUntilContextTimeout(context.Background(), interval, timeout, false, func(ctx context.Context) (bool, error) { _, err := c.labelIdentityLister.Get(labelIdentity.Name) if err != nil { return false, nil diff --git a/pkg/agent/nodeportlocal/npl_agent_test.go b/pkg/agent/nodeportlocal/npl_agent_test.go index 6d9e91ab946..a3bcdb43b86 100644 --- a/pkg/agent/nodeportlocal/npl_agent_test.go +++ b/pkg/agent/nodeportlocal/npl_agent_test.go @@ -310,7 +310,7 @@ func (t *testData) pollForPodAnnotation(podName string, found bool) ([]types.NPL var exists bool // do not use PollImmediate: 1 second is reserved for the controller to do his job and // update Pod NPL annotations as needed. - err := wait.Poll(time.Second, 20*time.Second, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second, 20*time.Second, false, func(ctx context.Context) (bool, error) { updatedPod, err := t.k8sClient.CoreV1().Pods(defaultNS).Get(context.TODO(), podName, metav1.GetOptions{}) require.NoError(t, err, "Failed to get Pod") annotation := updatedPod.GetAnnotations() @@ -489,7 +489,7 @@ func TestPodDelete(t *testing.T) { require.NoError(t, err, "Pod deletion failed") t.Logf("Successfully deleted Pod: %s", testPod.Name) - err = wait.Poll(time.Second, 20*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second, 20*time.Second, false, func(ctx context.Context) (bool, error) { return !testData.portTable.RuleExists(defaultPodIP, defaultPort, protocolTCP), nil }) assert.NoError(t, err, "Error when polling for port table update") diff --git a/pkg/agent/proxy/proxier_test.go b/pkg/agent/proxy/proxier_test.go index 81065124f87..4ee213d00a5 100644 --- a/pkg/agent/proxy/proxier_test.go +++ b/pkg/agent/proxy/proxier_test.go @@ -36,7 +36,7 @@ import ( featuregatetesting "k8s.io/component-base/featuregate/testing" "k8s.io/component-base/metrics/legacyregistry" "k8s.io/component-base/metrics/testutil" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" mccommon "antrea.io/antrea/multicluster/controllers/multicluster/common" agentconfig "antrea.io/antrea/pkg/agent/config" @@ -1080,9 +1080,9 @@ func TestLoadBalancerServiceWithMultiplePorts(t *testing.T) { endpoint1Address, }, Conditions: discovery.EndpointConditions{ - Ready: pointer.Bool(true), - Serving: pointer.Bool(true), - Terminating: pointer.Bool(false), + Ready: ptr.To(true), + Serving: ptr.To(true), + Terminating: ptr.To(false), }, NodeName: &endpoint1NodeName, }, @@ -1091,9 +1091,9 @@ func TestLoadBalancerServiceWithMultiplePorts(t *testing.T) { endpoint2Address, }, Conditions: discovery.EndpointConditions{ - Ready: pointer.Bool(true), - Serving: pointer.Bool(true), - Terminating: pointer.Bool(false), + Ready: ptr.To(true), + Serving: ptr.To(true), + Terminating: ptr.To(false), }, NodeName: &endpoint2NodeName, }, diff --git a/pkg/agent/proxy/topology.go b/pkg/agent/proxy/topology.go index 4589c1d727f..7460082c201 100644 --- a/pkg/agent/proxy/topology.go +++ b/pkg/agent/proxy/topology.go @@ -127,7 +127,7 @@ func (p *proxier) canUseTopology(endpoints map[string]k8sproxy.Endpoint, svcInfo hintsAnnotation := svcInfo.HintsAnnotation() if hintsAnnotation != "Auto" && hintsAnnotation != "auto" { if hintsAnnotation != "" && hintsAnnotation != "Disabled" && hintsAnnotation != "disabled" { - klog.InfoS("Skipping topology aware Endpoint filtering since Service has unexpected value", "annotationTopologyAwareHints", v1.AnnotationTopologyAwareHints, "hints", hintsAnnotation) + klog.InfoS("Skipping topology aware Endpoint filtering since Service has unexpected value", "annotationTopologyAwareHints", v1.DeprecatedAnnotationTopologyAwareHints, "hints", hintsAnnotation) } return false } diff --git a/pkg/agent/secondarynetwork/podwatch/controller_test.go b/pkg/agent/secondarynetwork/podwatch/controller_test.go index feb1b61154a..41e14eef512 100644 --- a/pkg/agent/secondarynetwork/podwatch/controller_test.go +++ b/pkg/agent/secondarynetwork/podwatch/controller_test.go @@ -39,7 +39,6 @@ import ( "go.uber.org/mock/gomock" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/util/workqueue" @@ -280,9 +279,9 @@ func TestPodControllerRun(t *testing.T) { require.NoError(t, err, "error when creating test Pod") // Wait for ConfigureSriovSecondaryInterface is called. - assert.NoError(t, wait.Poll(10*time.Millisecond, 1*time.Second, func() (bool, error) { - return atomic.LoadInt32(&interfaceConfigured) == 1, nil - })) + assert.Eventually(t, func() bool { + return atomic.LoadInt32(&interfaceConfigured) == 1 + }, 1*time.Second, 10*time.Millisecond) _, exists := podController.vfDeviceIDUsageMap.Load(podKey) assert.True(t, exists) @@ -306,9 +305,9 @@ func TestPodControllerRun(t *testing.T) { // Since interface is not saved to the interface store, interface creation should be // triggered again. podController.processCNIUpdate(event) - assert.NoError(t, wait.Poll(10*time.Millisecond, 1*time.Second, func() (bool, error) { - return atomic.LoadInt32(&interfaceConfigured) == 2, nil - })) + assert.Eventually(t, func() bool { + return atomic.LoadInt32(&interfaceConfigured) == 2 + }, 1*time.Second, 10*time.Millisecond) interfaceConfigurator.EXPECT().DeleteSriovSecondaryInterface(containerConfig). Do(func(*interfacestore.InterfaceConfig) { @@ -318,9 +317,9 @@ func TestPodControllerRun(t *testing.T) { require.NoError(t, client.CoreV1().Pods(testNamespace).Delete(context.Background(), podName, metav1.DeleteOptions{}), "error when deleting test Pod") - assert.NoError(t, wait.Poll(10*time.Millisecond, 1*time.Second, func() (bool, error) { - return atomic.LoadInt32(&interfaceConfigured) == 1, nil - })) + assert.Eventually(t, func() bool { + return atomic.LoadInt32(&interfaceConfigured) == 1 + }, 1*time.Second, 10*time.Millisecond) _, exists = podController.vfDeviceIDUsageMap.Load(podKey) assert.False(t, exists) @@ -336,9 +335,9 @@ func TestPodControllerRun(t *testing.T) { podController.processCNIUpdate(event) _, exists = cniCache.Load(podKey) assert.False(t, exists) - assert.NoError(t, wait.Poll(10*time.Millisecond, 1*time.Second, func() (bool, error) { - return atomic.LoadInt32(&interfaceConfigured) == 0, nil - })) + assert.Eventually(t, func() bool { + return atomic.LoadInt32(&interfaceConfigured) == 0 + }, 1*time.Second, 10*time.Millisecond) interfaceStore.DeleteInterface(containerConfig) podController.processCNIUpdate(event) @@ -593,18 +592,18 @@ func TestPodControllerAddPod(t *testing.T) { _, err := pc.kubeClient.CoreV1().Pods(testNamespace).Create(context.Background(), pod, metav1.CreateOptions{}) require.NoError(t, err, "error when creating test Pod") - assert.NoError(t, wait.Poll(10*time.Millisecond, 1*time.Second, func() (bool, error) { + assert.Eventually(t, func() bool { _, ok, err := pc.podInformer.GetIndexer().GetByKey(podKey) - return ok, err - })) + return ok == true && err == nil + }, 1*time.Second, 10*time.Millisecond) } deletePodFn := func(pc *podController, podName string) { require.NoError(t, pc.kubeClient.CoreV1().Pods(testNamespace).Delete(context.Background(), podName, metav1.DeleteOptions{}), "error when deleting test Pod") - assert.NoError(t, wait.Poll(10*time.Millisecond, 1*time.Second, func() (bool, error) { + assert.Eventually(t, func() bool { _, ok, err := pc.podInformer.GetIndexer().GetByKey(podKey) - return !ok, err - })) + return !ok && err == nil + }, 1*time.Second, 10*time.Millisecond) } t.Run("multiple network interfaces", func(t *testing.T) { diff --git a/pkg/agent/util/iptables/lock.go b/pkg/agent/util/iptables/lock.go index 3b17e5bef66..1b8e890ca93 100644 --- a/pkg/agent/util/iptables/lock.go +++ b/pkg/agent/util/iptables/lock.go @@ -18,6 +18,7 @@ package iptables import ( + "context" "fmt" "os" "time" @@ -40,12 +41,13 @@ func Lock(lockFilePath string, timeout time.Duration) (func() error, error) { } // Check whether the lock is available every 200ms. - if err := wait.PollImmediate(waitIntervalMicroSeconds*time.Microsecond, timeout, func() (bool, error) { - if err := unix.Flock(int(lockFile.Fd()), unix.LOCK_EX|unix.LOCK_NB); err != nil { - return false, nil - } - return true, nil - }); err != nil { + if err := wait.PollUntilContextTimeout(context.TODO(), waitIntervalMicroSeconds*time.Microsecond, timeout, true, + func(ctx context.Context) (bool, error) { + if err := unix.Flock(int(lockFile.Fd()), unix.LOCK_EX|unix.LOCK_NB); err != nil { + return false, nil + } + return true, nil + }); err != nil { lockFile.Close() return nil, fmt.Errorf("error acquiring xtables lock: %v", err) } diff --git a/pkg/agent/util/net_linux.go b/pkg/agent/util/net_linux.go index db1c5d8de8a..301691fb717 100644 --- a/pkg/agent/util/net_linux.go +++ b/pkg/agent/util/net_linux.go @@ -18,6 +18,7 @@ package util import ( + "context" "fmt" "net" "os" @@ -276,14 +277,15 @@ func GetInterfaceConfig(ifName string) (*net.Interface, []*net.IPNet, []interfac func RenameInterface(from, to string) error { klog.InfoS("Renaming interface", "oldName", from, "newName", to) var renameErr error - pollErr := wait.Poll(time.Millisecond*100, time.Second, func() (done bool, err error) { - renameErr = renameHostInterface(from, to) - if renameErr != nil { - klog.InfoS("Unable to rename host interface name with error, retrying", "oldName", from, "newName", to, "err", renameErr) - return false, nil - } - return true, nil - }) + pollErr := wait.PollUntilContextTimeout(context.TODO(), time.Millisecond*100, time.Second, false, + func(ctx context.Context) (done bool, err error) { + renameErr = renameHostInterface(from, to) + if renameErr != nil { + klog.InfoS("Unable to rename host interface name with error, retrying", "oldName", from, "newName", to, "err", renameErr) + return false, nil + } + return true, nil + }) if pollErr != nil { return fmt.Errorf("failed to rename host interface name %s to %s", from, to) } diff --git a/pkg/agent/util/net_windows.go b/pkg/agent/util/net_windows.go index 1848c2e9ac4..dc57c0a2dbf 100644 --- a/pkg/agent/util/net_windows.go +++ b/pkg/agent/util/net_windows.go @@ -20,6 +20,7 @@ package util import ( "bufio" "bytes" + "context" "encoding/json" "errors" "fmt" @@ -180,7 +181,7 @@ func EnableHostInterface(ifaceName string) error { // Enable-NetAdapter is not a blocking operation based on our testing. // It returns immediately no matter whether the interface has been enabled or not. // So we need to check the interface status to ensure it is up before returning. - if err := wait.PollImmediate(commandRetryInterval, commandRetryTimeout, func() (done bool, err error) { + if err := wait.PollUntilContextTimeout(context.TODO(), commandRetryInterval, commandRetryTimeout, true, func(ctx context.Context) (done bool, err error) { if _, err := runCommand(cmd); err != nil { klog.Errorf("Failed to run command %s: %v", cmd, err) return false, nil @@ -468,7 +469,7 @@ func PrepareHNSNetwork(subnetCIDR *net.IPNet, nodeIPNet *net.IPNet, uplinkAdapte var ipFound bool // On the current Windows testbed, it takes a maximum of 1.8 seconds to obtain a valid IP. // Therefore, we set the timeout limit to triple of that value, allowing a maximum wait of 6 seconds here. - err = wait.PollImmediate(1*time.Second, 6*time.Second, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.TODO(), 1*time.Second, 6*time.Second, true, func(ctx context.Context) (bool, error) { var checkErr error adapter, ipFound, checkErr = adapterIPExists(nodeIPNet.IP, uplinkAdapter.HardwareAddr, ContainerVNICPrefix) if checkErr != nil { @@ -477,7 +478,7 @@ func PrepareHNSNetwork(subnetCIDR *net.IPNet, nodeIPNet *net.IPNet, uplinkAdapte return ipFound, nil }) if err != nil { - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { dhcpStatus, err := InterfaceIPv4DhcpEnabled(uplinkAdapter.Name) if err != nil { klog.ErrorS(err, "Failed to get IPv4 DHCP status on the network adapter", "adapter", uplinkAdapter.Name) @@ -1015,7 +1016,7 @@ func GetInterfaceConfig(ifName string) (*net.Interface, []*net.IPNet, []interfac func RenameInterface(from, to string) error { var renameErr error - pollErr := wait.Poll(time.Millisecond*100, time.Second, func() (done bool, err error) { + pollErr := wait.PollUntilContextTimeout(context.TODO(), time.Millisecond*100, time.Second, false, func(ctx context.Context) (done bool, err error) { renameErr = renameHostInterface(from, to) if renameErr != nil { klog.ErrorS(renameErr, "Failed to rename adapter, retrying") diff --git a/pkg/antctl/raw/multicluster/common/common.go b/pkg/antctl/raw/multicluster/common/common.go index 90ad241b770..b3be75559e3 100644 --- a/pkg/antctl/raw/multicluster/common/common.go +++ b/pkg/antctl/raw/multicluster/common/common.go @@ -328,10 +328,11 @@ func DeleteMemberToken(cmd *cobra.Command, k8sClient client.Client, name string, } func waitForSecretReady(client client.Client, secretName string, namespace string) error { - return wait.PollImmediate( + return wait.PollUntilContextTimeout(context.TODO(), 1*time.Second, 5*time.Second, - func() (bool, error) { + true, + func(ctx context.Context) (bool, error) { secret := &corev1.Secret{} if err := client.Get(context.TODO(), types.NamespacedName{Name: secretName, Namespace: namespace}, secret); err != nil { if apierrors.IsNotFound(err) { diff --git a/pkg/antctl/raw/multicluster/join.go b/pkg/antctl/raw/multicluster/join.go index cc1dfb90f47..bff278a97fe 100644 --- a/pkg/antctl/raw/multicluster/join.go +++ b/pkg/antctl/raw/multicluster/join.go @@ -276,10 +276,11 @@ func waitForMemberClusterReady(cmd *cobra.Command, k8sClient client.Client) erro } func waitForClusterSetReady(client client.Client, name string, namespace string, clusterID string) error { - return wait.PollImmediate( + return wait.PollUntilContextTimeout(context.TODO(), 1*time.Second, 1*time.Minute, - func() (bool, error) { + true, + func(ctx context.Context) (bool, error) { clusterSet := &mcv1alpha2.ClusterSet{} if err := client.Get(context.TODO(), types.NamespacedName{Name: name, Namespace: namespace}, clusterSet); err != nil { if apierrors.IsNotFound(err) { diff --git a/pkg/antctl/raw/traceflow/command.go b/pkg/antctl/raw/traceflow/command.go index 1893835e00f..3dcc6c93497 100644 --- a/pkg/antctl/raw/traceflow/command.go +++ b/pkg/antctl/raw/traceflow/command.go @@ -184,7 +184,7 @@ func runE(cmd *cobra.Command, _ []string) error { } var res *v1beta1.Traceflow - err = wait.Poll(1*time.Second, option.timeout, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.TODO(), 1*time.Second, option.timeout, false, func(ctx context.Context) (bool, error) { res, err = client.CrdV1beta1().Traceflows().Get(context.TODO(), tf.Name, metav1.GetOptions{}) if err != nil { return false, err @@ -194,7 +194,7 @@ func runE(cmd *cobra.Command, _ []string) error { } return true, nil }) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { err = errors.New("timeout waiting for Traceflow done") // Still output the Traceflow results if any. if res == nil { diff --git a/pkg/antctl/transform/networkpolicy/response_test.go b/pkg/antctl/transform/networkpolicy/response_test.go index 728185000da..3720f366c55 100644 --- a/pkg/antctl/transform/networkpolicy/response_test.go +++ b/pkg/antctl/transform/networkpolicy/response_test.go @@ -20,7 +20,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" cpv1beta "antrea.io/antrea/pkg/apis/controlplane/v1beta2" ) @@ -35,8 +35,8 @@ func TestListTransform(t *testing.T) { SourceRef: &cpv1beta.NetworkPolicyReference{ Name: "a", }, - TierPriority: pointer.Int32(260), - Priority: pointer.Float64(5.7), + TierPriority: ptr.To[int32](260), + Priority: ptr.To(5.7), } var npB = cpv1beta.NetworkPolicy{ ObjectMeta: metav1.ObjectMeta{ @@ -47,8 +47,8 @@ func TestListTransform(t *testing.T) { SourceRef: &cpv1beta.NetworkPolicyReference{ Name: "b", }, - TierPriority: pointer.Int32(260), - Priority: pointer.Float64(7.8), + TierPriority: ptr.To[int32](260), + Priority: ptr.To(7.8), } var npC = cpv1beta.NetworkPolicy{ ObjectMeta: metav1.ObjectMeta{ @@ -59,8 +59,8 @@ func TestListTransform(t *testing.T) { SourceRef: &cpv1beta.NetworkPolicyReference{ Name: "c", }, - TierPriority: pointer.Int32(200), - Priority: pointer.Float64(8), + TierPriority: ptr.To[int32](200), + Priority: ptr.To[float64](8), } var npD = cpv1beta.NetworkPolicy{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index b87cd9d524c..a29b75b5df1 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -23,6 +23,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" + genericopenapi "k8s.io/apiserver/pkg/endpoints/openapi" "k8s.io/apiserver/pkg/registry/rest" genericapiserver "k8s.io/apiserver/pkg/server" "k8s.io/client-go/informers" @@ -42,6 +43,7 @@ import ( "antrea.io/antrea/pkg/apiserver/handlers/featuregates" "antrea.io/antrea/pkg/apiserver/handlers/loglevel" "antrea.io/antrea/pkg/apiserver/handlers/webhook" + "antrea.io/antrea/pkg/apiserver/openapi" "antrea.io/antrea/pkg/apiserver/registry/controlplane/egressgroup" "antrea.io/antrea/pkg/apiserver/registry/controlplane/nodestatssummary" "antrea.io/antrea/pkg/apiserver/registry/controlplane/supportbundlecollection" @@ -193,6 +195,9 @@ func NewConfig( } func (c *Config) Complete(informers informers.SharedInformerFactory) completedConfig { + c.genericConfig.OpenAPIV3Config = genericapiserver.DefaultOpenAPIV3Config( + openapi.GetOpenAPIDefinitions, + genericopenapi.NewDefinitionNamer(Scheme)) return completedConfig{c.genericConfig.Complete(informers), &c.extraConfig} } diff --git a/pkg/apiserver/certificate/certificate.go b/pkg/apiserver/certificate/certificate.go index 517547bf547..130b9ec2be6 100644 --- a/pkg/apiserver/certificate/certificate.go +++ b/pkg/apiserver/certificate/certificate.go @@ -15,6 +15,7 @@ package certificate import ( + "context" "fmt" "os" "path/filepath" @@ -67,17 +68,18 @@ func ApplyServerCert(selfSignedCert bool, tlsKeyPath := filepath.Join(caConfig.CertDir, TLSKeyFile) // The secret may be created after the Pod is created, for example, when cert-manager is used the secret // is created asynchronously. It waits for a while before it's considered to be failed. - if err = wait.PollImmediate(2*time.Second, caConfig.CertReadyTimeout, func() (bool, error) { - for _, path := range []string{caCertPath, tlsCertPath, tlsKeyPath} { - f, err := os.Open(path) - if err != nil { - klog.Warningf("Couldn't read %s when applying server certificate, retrying", path) - return false, nil + if err = wait.PollUntilContextTimeout(context.TODO(), 2*time.Second, caConfig.CertReadyTimeout, true, + func(ctx context.Context) (bool, error) { + for _, path := range []string{caCertPath, tlsCertPath, tlsKeyPath} { + f, err := os.Open(path) + if err != nil { + klog.Warningf("Couldn't read %s when applying server certificate, retrying", path) + return false, nil + } + f.Close() } - f.Close() - } - return true, nil - }); err != nil { + return true, nil + }); err != nil { return nil, fmt.Errorf("error reading TLS certificate and/or key. Please make sure the TLS CA (%s), cert (%s), and key (%s) files are present in \"%s\", when selfSignedCert is set to false", CACertFile, TLSCertFile, TLSKeyFile, caConfig.CertDir) } // Since 1.17.0 (https://github.com/kubernetes/kubernetes/commit/3f5fbfbfac281f40c11de2f57d58cc332affc37b), diff --git a/pkg/apiserver/certificate/certificate_test.go b/pkg/apiserver/certificate/certificate_test.go index 26d6c3b707d..988f230e595 100644 --- a/pkg/apiserver/certificate/certificate_test.go +++ b/pkg/apiserver/certificate/certificate_test.go @@ -203,7 +203,7 @@ func TestApplyServerCert(t *testing.T) { if tt.selfSignedCert && tt.testRotate { oldCertKeyContent := got.getCertificate() go got.Run(ctx, 1) - err := wait.Poll(time.Second, 8*time.Second, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second, 8*time.Second, false, func(ctx context.Context) (bool, error) { newCertKeyContent := got.getCertificate() equal := bytes.Equal(oldCertKeyContent, newCertKeyContent) return !equal, nil diff --git a/pkg/apiserver/openapi/zz_generated.openapi.go b/pkg/apiserver/openapi/zz_generated.openapi.go index 22779c68457..f574cb9cc1d 100644 --- a/pkg/apiserver/openapi/zz_generated.openapi.go +++ b/pkg/apiserver/openapi/zz_generated.openapi.go @@ -176,6 +176,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.CinderVolumeSource": schema_k8sio_api_core_v1_CinderVolumeSource(ref), "k8s.io/api/core/v1.ClaimSource": schema_k8sio_api_core_v1_ClaimSource(ref), "k8s.io/api/core/v1.ClientIPConfig": schema_k8sio_api_core_v1_ClientIPConfig(ref), + "k8s.io/api/core/v1.ClusterTrustBundleProjection": schema_k8sio_api_core_v1_ClusterTrustBundleProjection(ref), "k8s.io/api/core/v1.ComponentCondition": schema_k8sio_api_core_v1_ComponentCondition(ref), "k8s.io/api/core/v1.ComponentStatus": schema_k8sio_api_core_v1_ComponentStatus(ref), "k8s.io/api/core/v1.ComponentStatusList": schema_k8sio_api_core_v1_ComponentStatusList(ref), @@ -189,6 +190,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.Container": schema_k8sio_api_core_v1_Container(ref), "k8s.io/api/core/v1.ContainerImage": schema_k8sio_api_core_v1_ContainerImage(ref), "k8s.io/api/core/v1.ContainerPort": schema_k8sio_api_core_v1_ContainerPort(ref), + "k8s.io/api/core/v1.ContainerResizePolicy": schema_k8sio_api_core_v1_ContainerResizePolicy(ref), "k8s.io/api/core/v1.ContainerState": schema_k8sio_api_core_v1_ContainerState(ref), "k8s.io/api/core/v1.ContainerStateRunning": schema_k8sio_api_core_v1_ContainerStateRunning(ref), "k8s.io/api/core/v1.ContainerStateTerminated": schema_k8sio_api_core_v1_ContainerStateTerminated(ref), @@ -227,6 +229,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.HTTPGetAction": schema_k8sio_api_core_v1_HTTPGetAction(ref), "k8s.io/api/core/v1.HTTPHeader": schema_k8sio_api_core_v1_HTTPHeader(ref), "k8s.io/api/core/v1.HostAlias": schema_k8sio_api_core_v1_HostAlias(ref), + "k8s.io/api/core/v1.HostIP": schema_k8sio_api_core_v1_HostIP(ref), "k8s.io/api/core/v1.HostPathVolumeSource": schema_k8sio_api_core_v1_HostPathVolumeSource(ref), "k8s.io/api/core/v1.ISCSIPersistentVolumeSource": schema_k8sio_api_core_v1_ISCSIPersistentVolumeSource(ref), "k8s.io/api/core/v1.ISCSIVolumeSource": schema_k8sio_api_core_v1_ISCSIVolumeSource(ref), @@ -242,6 +245,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.LoadBalancerStatus": schema_k8sio_api_core_v1_LoadBalancerStatus(ref), "k8s.io/api/core/v1.LocalObjectReference": schema_k8sio_api_core_v1_LocalObjectReference(ref), "k8s.io/api/core/v1.LocalVolumeSource": schema_k8sio_api_core_v1_LocalVolumeSource(ref), + "k8s.io/api/core/v1.ModifyVolumeStatus": schema_k8sio_api_core_v1_ModifyVolumeStatus(ref), "k8s.io/api/core/v1.NFSVolumeSource": schema_k8sio_api_core_v1_NFSVolumeSource(ref), "k8s.io/api/core/v1.Namespace": schema_k8sio_api_core_v1_Namespace(ref), "k8s.io/api/core/v1.NamespaceCondition": schema_k8sio_api_core_v1_NamespaceCondition(ref), @@ -296,6 +300,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.PodProxyOptions": schema_k8sio_api_core_v1_PodProxyOptions(ref), "k8s.io/api/core/v1.PodReadinessGate": schema_k8sio_api_core_v1_PodReadinessGate(ref), "k8s.io/api/core/v1.PodResourceClaim": schema_k8sio_api_core_v1_PodResourceClaim(ref), + "k8s.io/api/core/v1.PodResourceClaimStatus": schema_k8sio_api_core_v1_PodResourceClaimStatus(ref), "k8s.io/api/core/v1.PodSchedulingGate": schema_k8sio_api_core_v1_PodSchedulingGate(ref), "k8s.io/api/core/v1.PodSecurityContext": schema_k8sio_api_core_v1_PodSecurityContext(ref), "k8s.io/api/core/v1.PodSignature": schema_k8sio_api_core_v1_PodSignature(ref), @@ -353,6 +358,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.ServiceSpec": schema_k8sio_api_core_v1_ServiceSpec(ref), "k8s.io/api/core/v1.ServiceStatus": schema_k8sio_api_core_v1_ServiceStatus(ref), "k8s.io/api/core/v1.SessionAffinityConfig": schema_k8sio_api_core_v1_SessionAffinityConfig(ref), + "k8s.io/api/core/v1.SleepAction": schema_k8sio_api_core_v1_SleepAction(ref), "k8s.io/api/core/v1.StorageOSPersistentVolumeSource": schema_k8sio_api_core_v1_StorageOSPersistentVolumeSource(ref), "k8s.io/api/core/v1.StorageOSVolumeSource": schema_k8sio_api_core_v1_StorageOSVolumeSource(ref), "k8s.io/api/core/v1.Sysctl": schema_k8sio_api_core_v1_Sysctl(ref), @@ -369,6 +375,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.VolumeMount": schema_k8sio_api_core_v1_VolumeMount(ref), "k8s.io/api/core/v1.VolumeNodeAffinity": schema_k8sio_api_core_v1_VolumeNodeAffinity(ref), "k8s.io/api/core/v1.VolumeProjection": schema_k8sio_api_core_v1_VolumeProjection(ref), + "k8s.io/api/core/v1.VolumeResourceRequirements": schema_k8sio_api_core_v1_VolumeResourceRequirements(ref), "k8s.io/api/core/v1.VolumeSource": schema_k8sio_api_core_v1_VolumeSource(ref), "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource": schema_k8sio_api_core_v1_VsphereVirtualDiskVolumeSource(ref), "k8s.io/api/core/v1.WeightedPodAffinityTerm": schema_k8sio_api_core_v1_WeightedPodAffinityTerm(ref), @@ -2530,8 +2537,7 @@ func schema_pkg_apis_controlplane_v1beta2_SupportBundleCollection(ref common.Ref }, "expiredAt": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, "sinceTime": { @@ -2750,7 +2756,6 @@ func schema_pkg_apis_crd_v1beta1_AgentCondition(ref common.ReferenceCallback) co "lastHeartbeatTime": { SchemaProps: spec.SchemaProps{ Description: "The timestamp when AntreaAgentInfo is created/updated, ideally heartbeat interval is 60s", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -3476,7 +3481,6 @@ func schema_pkg_apis_crd_v1beta1_ControllerCondition(ref common.ReferenceCallbac "lastHeartbeatTime": { SchemaProps: spec.SchemaProps{ Description: "The timestamp when AntreaControllerInfo is created/updated, ideally heartbeat interval is 60s", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -3615,8 +3619,7 @@ func schema_pkg_apis_crd_v1beta1_EgressCondition(ref common.ReferenceCallback) c }, "lastTransitionTime": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, "reason": { @@ -4039,8 +4042,7 @@ func schema_pkg_apis_crd_v1beta1_GroupCondition(ref common.ReferenceCallback) co }, "lastTransitionTime": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, }, @@ -4576,7 +4578,6 @@ func schema_pkg_apis_crd_v1beta1_NetworkPolicyCondition(ref common.ReferenceCall "lastTransitionTime": { SchemaProps: spec.SchemaProps{ Description: "Last time the condition transitioned from one status to another.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -4768,9 +4769,10 @@ func schema_pkg_apis_crd_v1beta1_NetworkPolicyPort(ref common.ReferenceCallback) Properties: map[string]spec.Schema{ "protocol": { SchemaProps: spec.SchemaProps{ - Description: "The protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP.", + Description: "The protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP.\n\nPossible enum values:\n - `\"SCTP\"` is the SCTP protocol.\n - `\"TCP\"` is the TCP protocol.\n - `\"UDP\"` is the UDP protocol.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"SCTP", "TCP", "UDP"}, }, }, "port": { @@ -6638,9 +6640,10 @@ func schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref common.ReferenceCallback }, "cachingMode": { SchemaProps: spec.SchemaProps{ - Description: "cachingMode is the Host Caching mode: None, Read Only, Read Write.", + Description: "cachingMode is the Host Caching mode: None, Read Only, Read Write.\n\nPossible enum values:\n - `\"None\"`\n - `\"ReadOnly\"`\n - `\"ReadWrite\"`", Type: []string{"string"}, Format: "", + Enum: []interface{}{"None", "ReadOnly", "ReadWrite"}, }, }, "fsType": { @@ -6659,9 +6662,10 @@ func schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref common.ReferenceCallback }, "kind": { SchemaProps: spec.SchemaProps{ - Description: "kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared", + Description: "kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared\n\nPossible enum values:\n - `\"Dedicated\"`\n - `\"Managed\"`\n - `\"Shared\"`", Type: []string{"string"}, Format: "", + Enum: []interface{}{"Dedicated", "Managed", "Shared"}, }, }, }, @@ -6869,13 +6873,13 @@ func schema_k8sio_api_core_v1_CSIPersistentVolumeSource(ref common.ReferenceCall }, "controllerExpandSecretRef": { SchemaProps: spec.SchemaProps{ - Description: "controllerExpandSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerExpandVolume call. This is an beta field and requires enabling ExpandCSIVolumes feature gate. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", + Description: "controllerExpandSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerExpandVolume call. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", Ref: ref("k8s.io/api/core/v1.SecretReference"), }, }, "nodeExpandSecretRef": { SchemaProps: spec.SchemaProps{ - Description: "nodeExpandSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeExpandVolume call. This is an alpha field and requires enabling CSINodeExpandSecret feature gate. This field is optional, may be omitted if no secret is required. If the secret object contains more than one secret, all secrets are passed.", + Description: "nodeExpandSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeExpandVolume call. This field is optional, may be omitted if no secret is required. If the secret object contains more than one secret, all secrets are passed.", Ref: ref("k8s.io/api/core/v1.SecretReference"), }, }, @@ -7225,7 +7229,7 @@ func schema_k8sio_api_core_v1_ClaimSource(ref common.ReferenceCallback) common.O }, "resourceClaimTemplateName": { SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The name of the ResourceClaim will be -, where is the PodResourceClaim.Name. Pod validation will reject the pod if the concatenated name is not valid for a ResourceClaim (e.g. too long).\n\nAn existing ResourceClaim with that name that is not owned by the pod will not be used for the pod to avoid using an unrelated resource by mistake. Scheduling and pod startup are then blocked until the unrelated ResourceClaim is removed.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.", + Description: "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.", Type: []string{"string"}, Format: "", }, @@ -7256,6 +7260,57 @@ func schema_k8sio_api_core_v1_ClientIPConfig(ref common.ReferenceCallback) commo } } +func schema_k8sio_api_core_v1_ClusterTrustBundleProjection(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterTrustBundleProjection describes how to select a set of ClusterTrustBundle objects and project their contents into the pod filesystem.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Select a single ClusterTrustBundle by object name. Mutually-exclusive with signerName and labelSelector.", + Type: []string{"string"}, + Format: "", + }, + }, + "signerName": { + SchemaProps: spec.SchemaProps{ + Description: "Select all ClusterTrustBundles that match this signer name. Mutually-exclusive with name. The contents of all selected ClusterTrustBundles will be unified and deduplicated.", + Type: []string{"string"}, + Format: "", + }, + }, + "labelSelector": { + SchemaProps: spec.SchemaProps{ + Description: "Select all ClusterTrustBundles that match this label selector. Only has effect if signerName is set. Mutually-exclusive with name. If unset, interpreted as \"match nothing\". If set but empty, interpreted as \"match everything\".", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), + }, + }, + "optional": { + SchemaProps: spec.SchemaProps{ + Description: "If true, don't block pod startup if the referenced ClusterTrustBundle(s) aren't available. If using name, then the named ClusterTrustBundle is allowed not to exist. If using signerName, then the combination of signerName and labelSelector is allowed to match zero ClusterTrustBundles.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "path": { + SchemaProps: spec.SchemaProps{ + Description: "Relative path from the volume root to write the bundle.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"path"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, + } +} + func schema_k8sio_api_core_v1_ComponentCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -7870,6 +7925,32 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), }, }, + "resizePolicy": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Resources resize policy for the container.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ContainerResizePolicy"), + }, + }, + }, + }, + }, + "restartPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "RestartPolicy defines the restart behavior of individual containers in a pod. This field may only be set for init containers, and the only allowed value is \"Always\". For non-init containers or when this field is not specified, the restart behavior is defined by the Pod's restart policy and the container type. Setting the RestartPolicy as \"Always\" for the init container will have the following effect: this init container will be continually restarted on exit until all regular containers have terminated. Once all regular containers have completed, all init containers with restartPolicy \"Always\" will be shut down. This lifecycle differs from normal init containers and is often referred to as a \"sidecar\" container. Although this init container still starts in the init container sequence, it does not wait for the container to complete before proceeding to the next init container. Instead, the next init container starts immediately after this init container is started, or after any startupProbe has successfully completed.", + Type: []string{"string"}, + Format: "", + }, + }, "volumeMounts": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -7946,14 +8027,16 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Description: "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n\nPossible enum values:\n - `\"FallbackToLogsOnError\"` will read the most recent contents of the container logs for the container status message when the container exits with an error and the terminationMessagePath has no contents.\n - `\"File\"` is the default behavior and will set the container status message to the contents of the container's terminationMessagePath when the container exits.", Type: []string{"string"}, Format: "", - Enum: []interface{}{"FallbackToLogsOnError", "File"}}, + Enum: []interface{}{"FallbackToLogsOnError", "File"}, + }, }, "imagePullPolicy": { SchemaProps: spec.SchemaProps{ Description: "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\nPossible enum values:\n - `\"Always\"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.\n - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.\n - `\"Never\"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Always", "IfNotPresent", "Never"}}, + Enum: []interface{}{"Always", "IfNotPresent", "Never"}, + }, }, "securityContext": { SchemaProps: spec.SchemaProps{ @@ -7987,7 +8070,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, + "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.ContainerResizePolicy", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, } } @@ -8061,7 +8144,8 @@ func schema_k8sio_api_core_v1_ContainerPort(ref common.ReferenceCallback) common Default: "TCP", Type: []string{"string"}, Format: "", - Enum: []interface{}{"SCTP", "TCP", "UDP"}}, + Enum: []interface{}{"SCTP", "TCP", "UDP"}, + }, }, "hostIP": { SchemaProps: spec.SchemaProps{ @@ -8077,6 +8161,36 @@ func schema_k8sio_api_core_v1_ContainerPort(ref common.ReferenceCallback) common } } +func schema_k8sio_api_core_v1_ContainerResizePolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ContainerResizePolicy represents resource resize policy for the container.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "resourceName": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the resource to which this resource resize policy applies. Supported values: cpu, memory.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "restartPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "Restart policy to apply when specified resource is resized. If not specified, it defaults to NotRequired.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"resourceName", "restartPolicy"}, + }, + }, + } +} + func schema_k8sio_api_core_v1_ContainerState(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -8120,7 +8234,6 @@ func schema_k8sio_api_core_v1_ContainerStateRunning(ref common.ReferenceCallback "startedAt": { SchemaProps: spec.SchemaProps{ Description: "Time at which the container was last (re-)started", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -8171,14 +8284,12 @@ func schema_k8sio_api_core_v1_ContainerStateTerminated(ref common.ReferenceCallb "startedAt": { SchemaProps: spec.SchemaProps{ Description: "Time at which previous execution of the container started", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, "finishedAt": { SchemaProps: spec.SchemaProps{ Description: "Time at which the container last terminated", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -8234,7 +8345,7 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm Properties: map[string]spec.Schema{ "name": { SchemaProps: spec.SchemaProps{ - Description: "This must be a DNS_LABEL. Each container in a pod must have a unique name. Cannot be updated.", + Description: "Name is a DNS_LABEL representing the unique name of the container. Each container in a pod must have a unique name across all container types. Cannot be updated.", Default: "", Type: []string{"string"}, Format: "", @@ -8242,21 +8353,21 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm }, "state": { SchemaProps: spec.SchemaProps{ - Description: "Details about the container's current condition.", + Description: "State holds details about the container's current condition.", Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ContainerState"), }, }, "lastState": { SchemaProps: spec.SchemaProps{ - Description: "Details about the container's last termination condition.", + Description: "LastTerminationState holds the last termination state of the container to help debug container crashes and restarts. This field is not populated if the container is still running and RestartCount is 0.", Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ContainerState"), }, }, "ready": { SchemaProps: spec.SchemaProps{ - Description: "Specifies whether the container has passed its readiness probe.", + Description: "Ready specifies whether the container is currently passing its readiness check. The value will change as readiness probes keep executing. If no readiness probes are specified, this field defaults to true once the container is fully started (see Started field).\n\nThe value is typically used to determine whether a container is ready to accept traffic.", Default: false, Type: []string{"boolean"}, Format: "", @@ -8264,7 +8375,7 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm }, "restartCount": { SchemaProps: spec.SchemaProps{ - Description: "The number of times the container has been restarted.", + Description: "RestartCount holds the number of times the container has been restarted. Kubelet makes an effort to always increment the value, but there are cases when the state may be lost due to node restarts and then the value may be reset to 0. The value is never negative.", Default: 0, Type: []string{"integer"}, Format: "int32", @@ -8272,7 +8383,7 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm }, "image": { SchemaProps: spec.SchemaProps{ - Description: "The image the container is running. More info: https://kubernetes.io/docs/concepts/containers/images.", + Description: "Image is the name of container image that the container is running. The container image may not match the image used in the PodSpec, as it may have been resolved by the runtime. More info: https://kubernetes.io/docs/concepts/containers/images.", Default: "", Type: []string{"string"}, Format: "", @@ -8280,7 +8391,7 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm }, "imageID": { SchemaProps: spec.SchemaProps{ - Description: "ImageID of the container's image.", + Description: "ImageID is the image ID of the container's image. The image ID may not match the image ID of the image used in the PodSpec, as it may have been resolved by the runtime.", Default: "", Type: []string{"string"}, Format: "", @@ -8288,24 +8399,44 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm }, "containerID": { SchemaProps: spec.SchemaProps{ - Description: "Container's ID in the format '://'.", + Description: "ContainerID is the ID of the container in the format '://'. Where type is a container runtime identifier, returned from Version call of CRI API (for example \"containerd\").", Type: []string{"string"}, Format: "", }, }, "started": { SchemaProps: spec.SchemaProps{ - Description: "Specifies whether the container has passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. Is always true when no startupProbe is defined.", + Description: "Started indicates whether the container has finished its postStart lifecycle hook and passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. In both cases, startup probes will run again. Is always true when no startupProbe is defined and container is running and has passed the postStart lifecycle hook. The null value must be treated the same as false.", Type: []string{"boolean"}, Format: "", }, }, + "allocatedResources": { + SchemaProps: spec.SchemaProps{ + Description: "AllocatedResources represents the compute resources allocated for this container by the node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission and after successfully admitting desired pod resize.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, + }, + }, + }, + "resources": { + SchemaProps: spec.SchemaProps{ + Description: "Resources represents the compute resource requests and limits that have been successfully enacted on the running container after it has been started or has been successfully resized.", + Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), + }, + }, }, Required: []string{"name", "ready", "restartCount", "image", "imageID"}, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerState"}, + "k8s.io/api/core/v1.ContainerState", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -8455,7 +8586,7 @@ func schema_k8sio_api_core_v1_EmptyDirVolumeSource(ref common.ReferenceCallback) }, "sizeLimit": { SchemaProps: spec.SchemaProps{ - Description: "sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir", + Description: "sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir", Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, @@ -8476,7 +8607,7 @@ func schema_k8sio_api_core_v1_EndpointAddress(ref common.ReferenceCallback) comm Properties: map[string]spec.Schema{ "ip": { SchemaProps: spec.SchemaProps{ - Description: "The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6 is also accepted but not fully supported on all platforms. Also, certain kubernetes components, like kube-proxy, are not IPv6 ready.", + Description: "The IP of this endpoint. May not be loopback (127.0.0.0/8 or ::1), link-local (169.254.0.0/16 or fe80::/10), or link-local multicast (224.0.0.0/24 or ff02::/16).", Default: "", Type: []string{"string"}, Format: "", @@ -8543,11 +8674,12 @@ func schema_k8sio_api_core_v1_EndpointPort(ref common.ReferenceCallback) common. Description: "The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.\n\nPossible enum values:\n - `\"SCTP\"` is the SCTP protocol.\n - `\"TCP\"` is the TCP protocol.\n - `\"UDP\"` is the UDP protocol.", Type: []string{"string"}, Format: "", - Enum: []interface{}{"SCTP", "TCP", "UDP"}}, + Enum: []interface{}{"SCTP", "TCP", "UDP"}, + }, }, "appProtocol": { SchemaProps: spec.SchemaProps{ - Description: "The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol.", + Description: "The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either:\n\n* Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).\n\n* Kubernetes-defined prefixed names:\n * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior-\n * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455\n * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455\n\n* Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.", Type: []string{"string"}, Format: "", }, @@ -8957,6 +9089,32 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), }, }, + "resizePolicy": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Resources resize policy for the container.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ContainerResizePolicy"), + }, + }, + }, + }, + }, + "restartPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "Restart policy for the container to manage the restart behavior of each container within a pod. This may only be set for init containers. You cannot set this field on ephemeral containers.", + Type: []string{"string"}, + Format: "", + }, + }, "volumeMounts": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -9033,14 +9191,16 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Description: "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n\nPossible enum values:\n - `\"FallbackToLogsOnError\"` will read the most recent contents of the container logs for the container status message when the container exits with an error and the terminationMessagePath has no contents.\n - `\"File\"` is the default behavior and will set the container status message to the contents of the container's terminationMessagePath when the container exits.", Type: []string{"string"}, Format: "", - Enum: []interface{}{"FallbackToLogsOnError", "File"}}, + Enum: []interface{}{"FallbackToLogsOnError", "File"}, + }, }, "imagePullPolicy": { SchemaProps: spec.SchemaProps{ Description: "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\nPossible enum values:\n - `\"Always\"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.\n - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.\n - `\"Never\"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Always", "IfNotPresent", "Never"}}, + Enum: []interface{}{"Always", "IfNotPresent", "Never"}, + }, }, "securityContext": { SchemaProps: spec.SchemaProps{ @@ -9081,7 +9241,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, + "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.ContainerResizePolicy", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, } } @@ -9210,6 +9370,32 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), }, }, + "resizePolicy": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Resources resize policy for the container.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ContainerResizePolicy"), + }, + }, + }, + }, + }, + "restartPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "Restart policy for the container to manage the restart behavior of each container within a pod. This may only be set for init containers. You cannot set this field on ephemeral containers.", + Type: []string{"string"}, + Format: "", + }, + }, "volumeMounts": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -9286,14 +9472,16 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Description: "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.\n\nPossible enum values:\n - `\"FallbackToLogsOnError\"` will read the most recent contents of the container logs for the container status message when the container exits with an error and the terminationMessagePath has no contents.\n - `\"File\"` is the default behavior and will set the container status message to the contents of the container's terminationMessagePath when the container exits.", Type: []string{"string"}, Format: "", - Enum: []interface{}{"FallbackToLogsOnError", "File"}}, + Enum: []interface{}{"FallbackToLogsOnError", "File"}, + }, }, "imagePullPolicy": { SchemaProps: spec.SchemaProps{ Description: "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\nPossible enum values:\n - `\"Always\"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.\n - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.\n - `\"Never\"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Always", "IfNotPresent", "Never"}}, + Enum: []interface{}{"Always", "IfNotPresent", "Never"}, + }, }, "securityContext": { SchemaProps: spec.SchemaProps{ @@ -9327,7 +9515,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, + "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.ContainerResizePolicy", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, } } @@ -9411,14 +9599,12 @@ func schema_k8sio_api_core_v1_Event(ref common.ReferenceCallback) common.OpenAPI "firstTimestamp": { SchemaProps: spec.SchemaProps{ Description: "The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, "lastTimestamp": { SchemaProps: spec.SchemaProps{ Description: "The time at which the most recent occurrence of this event was recorded.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -9439,7 +9625,6 @@ func schema_k8sio_api_core_v1_Event(ref common.ReferenceCallback) common.OpenAPI "eventTime": { SchemaProps: spec.SchemaProps{ Description: "Time when this Event was first observed.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime"), }, }, @@ -9555,7 +9740,6 @@ func schema_k8sio_api_core_v1_EventSeries(ref common.ReferenceCallback) common.O "lastObservedTime": { SchemaProps: spec.SchemaProps{ Description: "Time of the last occurrence observed", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime"), }, }, @@ -10039,7 +10223,6 @@ func schema_k8sio_api_core_v1_HTTPGetAction(ref common.ReferenceCallback) common "port": { SchemaProps: spec.SchemaProps{ Description: "Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), }, }, @@ -10055,7 +10238,8 @@ func schema_k8sio_api_core_v1_HTTPGetAction(ref common.ReferenceCallback) common Description: "Scheme to use for connecting to the host. Defaults to HTTP.\n\nPossible enum values:\n - `\"HTTP\"` means that the scheme used will be http://\n - `\"HTTPS\"` means that the scheme used will be https://", Type: []string{"string"}, Format: "", - Enum: []interface{}{"HTTP", "HTTPS"}}, + Enum: []interface{}{"HTTP", "HTTPS"}, + }, }, "httpHeaders": { SchemaProps: spec.SchemaProps{ @@ -10089,7 +10273,7 @@ func schema_k8sio_api_core_v1_HTTPHeader(ref common.ReferenceCallback) common.Op Properties: map[string]spec.Schema{ "name": { SchemaProps: spec.SchemaProps{ - Description: "The header field name", + Description: "The header field name. This will be canonicalized upon output, so case-variant names will be understood as the same header.", Default: "", Type: []string{"string"}, Format: "", @@ -10145,6 +10329,26 @@ func schema_k8sio_api_core_v1_HostAlias(ref common.ReferenceCallback) common.Ope } } +func schema_k8sio_api_core_v1_HostIP(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "HostIP represents a single IP address allocated to the host.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "ip": { + SchemaProps: spec.SchemaProps{ + Description: "IP is the IP address assigned to the host", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_k8sio_api_core_v1_HostPathVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -10162,9 +10366,10 @@ func schema_k8sio_api_core_v1_HostPathVolumeSource(ref common.ReferenceCallback) }, "type": { SchemaProps: spec.SchemaProps{ - Description: "type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", + Description: "type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath\n\nPossible enum values:\n - `\"\"` For backwards compatible, leave it empty if unset\n - `\"BlockDevice\"` A block device must exist at the given path\n - `\"CharDevice\"` A character device must exist at the given path\n - `\"Directory\"` A directory must exist at the given path\n - `\"DirectoryOrCreate\"` If nothing exists at the given path, an empty directory will be created there as needed with file mode 0755, having the same group and ownership with Kubelet.\n - `\"File\"` A file must exist at the given path\n - `\"FileOrCreate\"` If nothing exists at the given path, an empty file will be created there as needed with file mode 0644, having the same group and ownership with Kubelet.\n - `\"Socket\"` A UNIX socket must exist at the given path", Type: []string{"string"}, Format: "", + Enum: []interface{}{"", "BlockDevice", "CharDevice", "Directory", "DirectoryOrCreate", "File", "FileOrCreate", "Socket"}, }, }, }, @@ -10469,11 +10674,17 @@ func schema_k8sio_api_core_v1_LifecycleHandler(ref common.ReferenceCallback) com Ref: ref("k8s.io/api/core/v1.TCPSocketAction"), }, }, + "sleep": { + SchemaProps: spec.SchemaProps{ + Description: "Sleep represents the duration that the container should sleep before being terminated.", + Ref: ref("k8s.io/api/core/v1.SleepAction"), + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ExecAction", "k8s.io/api/core/v1.HTTPGetAction", "k8s.io/api/core/v1.TCPSocketAction"}, + "k8s.io/api/core/v1.ExecAction", "k8s.io/api/core/v1.HTTPGetAction", "k8s.io/api/core/v1.SleepAction", "k8s.io/api/core/v1.TCPSocketAction"}, } } @@ -10543,8 +10754,7 @@ func schema_k8sio_api_core_v1_LimitRangeItem(ref common.ReferenceCallback) commo Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -10558,8 +10768,7 @@ func schema_k8sio_api_core_v1_LimitRangeItem(ref common.ReferenceCallback) commo Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -10573,8 +10782,7 @@ func schema_k8sio_api_core_v1_LimitRangeItem(ref common.ReferenceCallback) commo Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -10588,8 +10796,7 @@ func schema_k8sio_api_core_v1_LimitRangeItem(ref common.ReferenceCallback) commo Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -10603,8 +10810,7 @@ func schema_k8sio_api_core_v1_LimitRangeItem(ref common.ReferenceCallback) commo Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -10735,8 +10941,7 @@ func schema_k8sio_api_core_v1_List(ref common.ReferenceCallback) common.OpenAPID Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), }, }, }, @@ -10772,6 +10977,13 @@ func schema_k8sio_api_core_v1_LoadBalancerIngress(ref common.ReferenceCallback) Format: "", }, }, + "ipMode": { + SchemaProps: spec.SchemaProps{ + Description: "IPMode specifies how the load-balancer IP behaves, and may only be specified when the ip field is specified. Setting this to \"VIP\" indicates that traffic is delivered to the node with the destination set to the load-balancer's IP and port. Setting this to \"Proxy\" indicates that traffic is delivered to the node or pod with the destination set to the node's IP and node port or the pod's IP and port. Service implementations may use this information to adjust traffic routing.", + Type: []string{"string"}, + Format: "", + }, + }, "ports": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -10882,6 +11094,36 @@ func schema_k8sio_api_core_v1_LocalVolumeSource(ref common.ReferenceCallback) co } } +func schema_k8sio_api_core_v1_ModifyVolumeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "targetVolumeAttributesClassName": { + SchemaProps: spec.SchemaProps{ + Description: "targetVolumeAttributesClassName is the name of the VolumeAttributesClass the PVC currently being reconciled", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status is the status of the ControllerModifyVolume operation. It can be in any of following states:\n - Pending\n Pending indicates that the PersistentVolumeClaim cannot be modified due to unmet requirements, such as\n the specified VolumeAttributesClass not existing.\n - InProgress\n InProgress indicates that the volume is being modified.\n - Infeasible\n Infeasible indicates that the request has been rejected as invalid by the CSI driver. To\n\t resolve the error, a valid VolumeAttributesClass needs to be specified.\nNote: New statuses can be added in the future. Consumers should check for unknown statuses and fail appropriately.\n\nPossible enum values:\n - `\"InProgress\"` InProgress indicates that the volume is being modified\n - `\"Infeasible\"` Infeasible indicates that the request has been rejected as invalid by the CSI driver. To resolve the error, a valid VolumeAttributesClass needs to be specified\n - `\"Pending\"` Pending indicates that the PersistentVolumeClaim cannot be modified due to unmet requirements, such as the specified VolumeAttributesClass not existing", + Default: "", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"InProgress", "Infeasible", "Pending"}, + }, + }, + }, + Required: []string{"status"}, + }, + }, + } +} + func schema_k8sio_api_core_v1_NFSVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -10994,8 +11236,7 @@ func schema_k8sio_api_core_v1_NamespaceCondition(ref common.ReferenceCallback) c }, "lastTransitionTime": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, "reason": { @@ -11110,7 +11351,8 @@ func schema_k8sio_api_core_v1_NamespaceStatus(ref common.ReferenceCallback) comm Description: "Phase is the current lifecycle phase of the namespace. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/\n\nPossible enum values:\n - `\"Active\"` means the namespace is available for use in the system\n - `\"Terminating\"` means the namespace is undergoing graceful termination", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Active", "Terminating"}}, + Enum: []interface{}{"Active", "Terminating"}, + }, }, "conditions": { VendorExtensible: spec.VendorExtensible{ @@ -11281,14 +11523,12 @@ func schema_k8sio_api_core_v1_NodeCondition(ref common.ReferenceCallback) common "lastHeartbeatTime": { SchemaProps: spec.SchemaProps{ Description: "Last time we got an update on a given condition.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, "lastTransitionTime": { SchemaProps: spec.SchemaProps{ Description: "Last time the condition transit from one status to another.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -11498,8 +11738,7 @@ func schema_k8sio_api_core_v1_NodeResources(ref common.ReferenceCallback) common Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -11570,7 +11809,8 @@ func schema_k8sio_api_core_v1_NodeSelectorRequirement(ref common.ReferenceCallba Default: "", Type: []string{"string"}, Format: "", - Enum: []interface{}{"DoesNotExist", "Exists", "Gt", "In", "Lt", "NotIn"}}, + Enum: []interface{}{"DoesNotExist", "Exists", "Gt", "In", "Lt", "NotIn"}, + }, }, "values": { SchemaProps: spec.SchemaProps{ @@ -11740,8 +11980,7 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -11755,8 +11994,7 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -11767,7 +12005,8 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Description: "NodePhase is the recently observed lifecycle phase of the node. More info: https://kubernetes.io/docs/concepts/nodes/node/#phase The field is never populated, and now is deprecated.\n\nPossible enum values:\n - `\"Pending\"` means the node has been created/added by the system, but not configured.\n - `\"Running\"` means the node has been configured and has Kubernetes components running.\n - `\"Terminated\"` means the node has been removed from the cluster.", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Pending", "Running", "Terminated"}}, + Enum: []interface{}{"Pending", "Running", "Terminated"}, + }, }, "conditions": { VendorExtensible: spec.VendorExtensible{ @@ -11797,7 +12036,7 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op }, }, SchemaProps: spec.SchemaProps{ - Description: "List of addresses reachable to the node. Queried from cloud provider, if available. More info: https://kubernetes.io/docs/concepts/nodes/node/#addresses Note: This field is declared as mergeable, but the merge key is not sufficiently unique, which can cause data corruption when it is merged. Callers should instead use a full-replacement patch. See https://pr.k8s.io/79391 for an example.", + Description: "List of addresses reachable to the node. Queried from cloud provider, if available. More info: https://kubernetes.io/docs/concepts/nodes/node/#addresses Note: This field is declared as mergeable, but the merge key is not sufficiently unique, which can cause data corruption when it is merged. Callers should instead use a full-replacement patch. See https://pr.k8s.io/79391 for an example. Consumers should assume that addresses can change during the lifetime of a Node. However, there are some exceptions where this may not be possible, such as Pods that inherit a Node's address in its own status or consumers of the downward API (status.hostIP).", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -12179,7 +12418,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimCondition(ref common.Referenc return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimCondition contails details about state of pvc", + Description: "PersistentVolumeClaimCondition contains details about state of pvc", Type: []string{"object"}, Properties: map[string]spec.Schema{ "type": { @@ -12199,14 +12438,12 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimCondition(ref common.Referenc "lastProbeTime": { SchemaProps: spec.SchemaProps{ Description: "lastProbeTime is the time we probed the condition.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, "lastTransitionTime": { SchemaProps: spec.SchemaProps{ Description: "lastTransitionTime is the time the condition transitioned from one status to another.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -12316,7 +12553,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall SchemaProps: spec.SchemaProps{ Description: "resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources", Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), + Ref: ref("k8s.io/api/core/v1.VolumeResourceRequirements"), }, }, "volumeName": { @@ -12335,9 +12572,10 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall }, "volumeMode": { SchemaProps: spec.SchemaProps{ - Description: "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.", + Description: "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.\n\nPossible enum values:\n - `\"Block\"` means the volume will not be formatted with a filesystem and will remain a raw block device.\n - `\"Filesystem\"` means the volume will be or is formatted with a filesystem.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"Block", "Filesystem"}, }, }, "dataSource": { @@ -12352,11 +12590,18 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall Ref: ref("k8s.io/api/core/v1.TypedObjectReference"), }, }, + "volumeAttributesClassName": { + SchemaProps: spec.SchemaProps{ + Description: "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass will be applied to the claim but it's not allowed to reset this field to empty string once it is set. If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass will be set by the persistentvolume controller if it exists. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#volumeattributesclass (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.", + Type: []string{"string"}, + Format: "", + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.TypedLocalObjectReference", "k8s.io/api/core/v1.TypedObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, + "k8s.io/api/core/v1.TypedLocalObjectReference", "k8s.io/api/core/v1.TypedObjectReference", "k8s.io/api/core/v1.VolumeResourceRequirements", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, } } @@ -12372,7 +12617,8 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Description: "phase represents the current phase of PersistentVolumeClaim.\n\nPossible enum values:\n - `\"Bound\"` used for PersistentVolumeClaims that are bound\n - `\"Lost\"` used for PersistentVolumeClaims that lost their underlying PersistentVolume. The claim was bound to a PersistentVolume and this volume does not exist any longer and all data on it was lost.\n - `\"Pending\"` used for PersistentVolumeClaims that are not yet bound", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Bound", "Lost", "Pending"}}, + Enum: []interface{}{"Bound", "Lost", "Pending"}, + }, }, "accessModes": { SchemaProps: spec.SchemaProps{ @@ -12397,8 +12643,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -12426,31 +12671,57 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa }, "allocatedResources": { SchemaProps: spec.SchemaProps{ - Description: "allocatedResources is the storage resource within AllocatedResources tracks the capacity allocated to a PVC. It may be larger than the actual capacity when a volume expansion operation is requested. For storage quota, the larger value from allocatedResources and PVC.spec.resources is used. If allocatedResources is not set, PVC.spec.resources alone is used for quota calculation. If a volume expansion capacity request is lowered, allocatedResources is only lowered if there are no expansion operations in progress and if the actual volume capacity is equal or lower than the requested capacity. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.", + Description: "allocatedResources tracks the resources allocated to a PVC including its capacity. Key names follow standard Kubernetes label syntax. Valid values are either:\n\t* Un-prefixed keys:\n\t\t- storage - the capacity of the volume.\n\t* Custom resources must use implementation-defined prefixed names such as \"example.com/my-custom-resource\"\nApart from above values - keys that are unprefixed or have kubernetes.io prefix are considered reserved and hence may not be used.\n\nCapacity reported here may be larger than the actual capacity when a volume expansion operation is requested. For storage quota, the larger value from allocatedResources and PVC.spec.resources is used. If allocatedResources is not set, PVC.spec.resources alone is used for quota calculation. If a volume expansion capacity request is lowered, allocatedResources is only lowered if there are no expansion operations in progress and if the actual volume capacity is equal or lower than the requested capacity.\n\nA controller that receives PVC update with previously unknown resourceName should ignore the update for the purpose it was designed. For example - a controller that only is responsible for resizing capacity of the volume, should ignore PVC updates that change other valid resources associated with PVC.\n\nThis is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.", Type: []string{"object"}, AdditionalProperties: &spec.SchemaOrBool{ Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, + }, + }, + }, + "allocatedResourceStatuses": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-map-type": "granular", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "allocatedResourceStatuses stores status of resource being resized for the given PVC. Key names follow standard Kubernetes label syntax. Valid values are either:\n\t* Un-prefixed keys:\n\t\t- storage - the capacity of the volume.\n\t* Custom resources must use implementation-defined prefixed names such as \"example.com/my-custom-resource\"\nApart from above values - keys that are unprefixed or have kubernetes.io prefix are considered reserved and hence may not be used.\n\nClaimResourceStatus can be in any of following states:\n\t- ControllerResizeInProgress:\n\t\tState set when resize controller starts resizing the volume in control-plane.\n\t- ControllerResizeFailed:\n\t\tState set when resize has failed in resize controller with a terminal error.\n\t- NodeResizePending:\n\t\tState set when resize controller has finished resizing the volume but further resizing of\n\t\tvolume is needed on the node.\n\t- NodeResizeInProgress:\n\t\tState set when kubelet starts resizing the volume.\n\t- NodeResizeFailed:\n\t\tState set when resizing has failed in kubelet with a terminal error. Transient errors don't set\n\t\tNodeResizeFailed.\nFor example: if expanding a PVC for more capacity - this field can be one of the following states:\n\t- pvc.status.allocatedResourceStatus['storage'] = \"ControllerResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] = \"ControllerResizeFailed\"\n - pvc.status.allocatedResourceStatus['storage'] = \"NodeResizePending\"\n - pvc.status.allocatedResourceStatus['storage'] = \"NodeResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] = \"NodeResizeFailed\"\nWhen this field is not set, it means that no resize operation is in progress for the given PVC.\n\nA controller that receives PVC update with previously unknown resourceName or ClaimResourceStatus should ignore the update for the purpose it was designed. For example - a controller that only is responsible for resizing capacity of the volume, should ignore PVC updates that change other valid resources associated with PVC.\n\nThis is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", }, }, }, }, }, - "resizeStatus": { + "currentVolumeAttributesClassName": { SchemaProps: spec.SchemaProps{ - Description: "resizeStatus stores status of resize operation. ResizeStatus is not set by default but when expansion is complete resizeStatus is set to empty string by resize controller or kubelet. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.", + Description: "currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim This is an alpha field and requires enabling VolumeAttributesClass feature.", Type: []string{"string"}, Format: "", }, }, + "modifyVolumeStatus": { + SchemaProps: spec.SchemaProps{ + Description: "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted. This is an alpha field and requires enabling VolumeAttributesClass feature.", + Ref: ref("k8s.io/api/core/v1.ModifyVolumeStatus"), + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimCondition", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + "k8s.io/api/core/v1.ModifyVolumeStatus", "k8s.io/api/core/v1.PersistentVolumeClaimCondition", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -12726,8 +12997,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -12896,7 +13166,8 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) Description: "persistentVolumeReclaimPolicy defines what happens to a persistent volume when released from its claim. Valid options are Retain (default for manually created PersistentVolumes), Delete (default for dynamically provisioned PersistentVolumes), and Recycle (deprecated). Recycle must be supported by the volume plugin underlying this PersistentVolume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming\n\nPossible enum values:\n - `\"Delete\"` means the volume will be deleted from Kubernetes on release from its claim. The volume plugin must support Deletion.\n - `\"Recycle\"` means the volume will be recycled back into the pool of unbound persistent volumes on release from its claim. The volume plugin must support Recycling.\n - `\"Retain\"` means the volume will be left in its current phase (Released) for manual reclamation by the administrator. The default policy is Retain.", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Delete", "Recycle", "Retain"}}, + Enum: []interface{}{"Delete", "Recycle", "Retain"}, + }, }, "storageClassName": { SchemaProps: spec.SchemaProps{ @@ -12922,9 +13193,10 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) }, "volumeMode": { SchemaProps: spec.SchemaProps{ - Description: "volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec.", + Description: "volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec.\n\nPossible enum values:\n - `\"Block\"` means the volume will not be formatted with a filesystem and will remain a raw block device.\n - `\"Filesystem\"` means the volume will be or is formatted with a filesystem.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"Block", "Filesystem"}, }, }, "nodeAffinity": { @@ -12933,6 +13205,13 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) Ref: ref("k8s.io/api/core/v1.VolumeNodeAffinity"), }, }, + "volumeAttributesClassName": { + SchemaProps: spec.SchemaProps{ + Description: "Name of VolumeAttributesClass to which this persistent volume belongs. Empty value is not allowed. When this field is not set, it indicates that this volume does not belong to any VolumeAttributesClass. This field is mutable and can be changed by the CSI driver after a volume has been updated successfully to a new class. For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound PersistentVolumeClaims during the binding process. This is an alpha field and requires enabling VolumeAttributesClass feature.", + Type: []string{"string"}, + Format: "", + }, + }, }, }, }, @@ -12953,7 +13232,8 @@ func schema_k8sio_api_core_v1_PersistentVolumeStatus(ref common.ReferenceCallbac Description: "phase indicates if a volume is available, bound to a claim, or released by a claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#phase\n\nPossible enum values:\n - `\"Available\"` used for PersistentVolumes that are not yet bound Available volumes are held by the binder and matched to PersistentVolumeClaims\n - `\"Bound\"` used for PersistentVolumes that are bound\n - `\"Failed\"` used for PersistentVolumes that failed to be correctly recycled or deleted after being released from a claim\n - `\"Pending\"` used for PersistentVolumes that are not available\n - `\"Released\"` used for PersistentVolumes where the bound PersistentVolumeClaim was deleted released volumes must be recycled before becoming available again this phase is used by the persistent volume claim binder to signal to another process to reclaim the resource", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Available", "Bound", "Failed", "Pending", "Released"}}, + Enum: []interface{}{"Available", "Bound", "Failed", "Pending", "Released"}, + }, }, "message": { SchemaProps: spec.SchemaProps{ @@ -12969,9 +13249,17 @@ func schema_k8sio_api_core_v1_PersistentVolumeStatus(ref common.ReferenceCallbac Format: "", }, }, + "lastPhaseTransitionTime": { + SchemaProps: spec.SchemaProps{ + Description: "lastPhaseTransitionTime is the time the phase transitioned from one to another and automatically resets to current time everytime a volume phase transitions. This is a beta field and requires the PersistentVolumeLastPhaseTransitionTime feature to be enabled (enabled by default).", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, }, }, }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -13106,7 +13394,7 @@ func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) comm Properties: map[string]spec.Schema{ "labelSelector": { SchemaProps: spec.SchemaProps{ - Description: "A label query over a set of resources, in this case pods.", + Description: "A label query over a set of resources, in this case pods. If it's null, this PodAffinityTerm matches with no Pods.", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), }, }, @@ -13139,6 +13427,46 @@ func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) comm Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), }, }, + "matchLabelKeys": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. Also, MatchLabelKeys cannot be set when LabelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "mismatchLabelKeys": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector. Also, MismatchLabelKeys cannot be set when LabelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, }, Required: []string{"topologyKey"}, }, @@ -13279,14 +13607,12 @@ func schema_k8sio_api_core_v1_PodCondition(ref common.ReferenceCallback) common. "lastProbeTime": { SchemaProps: spec.SchemaProps{ Description: "Last time we probed the condition.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, "lastTransitionTime": { SchemaProps: spec.SchemaProps{ Description: "Last time the condition transitioned from one status to another.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -13480,12 +13806,12 @@ func schema_k8sio_api_core_v1_PodIP(ref common.ReferenceCallback) common.OpenAPI return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "IP address information for entries in the (plural) PodIPs field. Each entry includes:\n\n\tIP: An IP address allocated to the pod. Routable at least within the cluster.", + Description: "PodIP represents a single IP address allocated to the pod.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "ip": { SchemaProps: spec.SchemaProps{ - Description: "ip is an IP address (IPv4 or IPv6) assigned to the pod", + Description: "IP is the IP address assigned to the pod", Type: []string{"string"}, Format: "", }, @@ -13789,6 +14115,35 @@ func schema_k8sio_api_core_v1_PodResourceClaim(ref common.ReferenceCallback) com } } +func schema_k8sio_api_core_v1_PodResourceClaimStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PodResourceClaimStatus is stored in the PodStatus for each PodResourceClaim which references a ResourceClaimTemplate. It stores the generated name for the corresponding ResourceClaim.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name uniquely identifies this resource claim inside the pod. This must match the name of an entry in pod.spec.resourceClaims, which implies that the string must be a DNS_LABEL.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resourceClaimName": { + SchemaProps: spec.SchemaProps{ + Description: "ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. It this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name"}, + }, + }, + } +} + func schema_k8sio_api_core_v1_PodSchedulingGate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -13889,9 +14244,10 @@ func schema_k8sio_api_core_v1_PodSecurityContext(ref common.ReferenceCallback) c }, "fsGroupChangePolicy": { SchemaProps: spec.SchemaProps{ - Description: "fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows.", + Description: "fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows.\n\nPossible enum values:\n - `\"Always\"` indicates that volume's ownership and permissions should always be changed whenever volume is mounted inside a Pod. This the default behavior.\n - `\"OnRootMismatch\"` indicates that volume's ownership and permissions will be changed only when permission and ownership of root directory does not match with expected permissions on the volume. This can help shorten the time it takes to change ownership and permissions of a volume.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"Always", "OnRootMismatch"}, }, }, "seccompProfile": { @@ -14018,10 +14374,11 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "restartPolicy": { SchemaProps: spec.SchemaProps{ - Description: "Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy\n\nPossible enum values:\n - `\"Always\"`\n - `\"Never\"`\n - `\"OnFailure\"`", + Description: "Restart policy for all containers within the pod. One of Always, OnFailure, Never. In some contexts, only a subset of those values may be permitted. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy\n\nPossible enum values:\n - `\"Always\"`\n - `\"Never\"`\n - `\"OnFailure\"`", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Always", "Never", "OnFailure"}}, + Enum: []interface{}{"Always", "Never", "OnFailure"}, + }, }, "terminationGracePeriodSeconds": { SchemaProps: spec.SchemaProps{ @@ -14042,7 +14399,8 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Description: "Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.\n\nPossible enum values:\n - `\"ClusterFirst\"` indicates that the pod should use cluster DNS first unless hostNetwork is true, if it is available, then fall back on the default (as determined by kubelet) DNS settings.\n - `\"ClusterFirstWithHostNet\"` indicates that the pod should use cluster DNS first, if it is available, then fall back on the default (as determined by kubelet) DNS settings.\n - `\"Default\"` indicates that the pod should use the default (as determined by kubelet) DNS settings.\n - `\"None\"` indicates that the pod should use empty DNS settings. DNS parameters such as nameservers and search paths should be defined via DNSConfig.", Type: []string{"string"}, Format: "", - Enum: []interface{}{"ClusterFirst", "ClusterFirstWithHostNet", "Default", "None"}}, + Enum: []interface{}{"ClusterFirst", "ClusterFirstWithHostNet", "Default", "None"}, + }, }, "nodeSelector": { VendorExtensible: spec.VendorExtensible{ @@ -14258,9 +14616,10 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "preemptionPolicy": { SchemaProps: spec.SchemaProps{ - Description: "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.", + Description: "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.\n\nPossible enum values:\n - `\"Never\"` means that pod never preempts other pods with lower priority.\n - `\"PreemptLowerPriority\"` means that pod can preempt other pods with lower priority.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"Never", "PreemptLowerPriority"}, }, }, "overhead": { @@ -14271,8 +14630,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -14335,7 +14693,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, }, SchemaProps: spec.SchemaProps{ - Description: "SchedulingGates is an opaque list of values that if specified will block scheduling the pod. More info: https://git.k8s.io/enhancements/keps/sig-scheduling/3521-pod-scheduling-readiness.\n\nThis is an alpha-level feature enabled by PodSchedulingReadiness feature gate.", + Description: "SchedulingGates is an opaque list of values that if specified will block scheduling the pod. If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the scheduler will not attempt to schedule the pod.\n\nSchedulingGates can only be set at pod creation time, and be removed only afterwards.\n\nThis is a beta feature enabled by the PodSchedulingReadiness feature gate.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -14392,7 +14750,8 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope Description: "The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. The conditions array, the reason and message fields, and the individual container status arrays contain more detail about the pod's status. There are five possible phase values:\n\nPending: The pod has been accepted by the Kubernetes system, but one or more of the container images has not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while. Running: The pod has been bound to a node, and all of the containers have been created. At least one container is still running, or is in the process of starting or restarting. Succeeded: All containers in the pod have terminated in success, and will not be restarted. Failed: All containers in the pod have terminated, and at least one container has terminated in failure. The container either exited with non-zero status or was terminated by the system. Unknown: For some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod.\n\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase\n\nPossible enum values:\n - `\"Failed\"` means that all containers in the pod have terminated, and at least one container has terminated in a failure (exited with a non-zero exit code or was stopped by the system).\n - `\"Pending\"` means the pod has been accepted by the system, but one or more of the containers has not been started. This includes time before being bound to a node, as well as time spent pulling images onto the host.\n - `\"Running\"` means the pod has been bound to a node and all of the containers have been started. At least one container is still running or is in the process of being restarted.\n - `\"Succeeded\"` means that all containers in the pod have voluntarily terminated with a container exit code of 0, and the system is not going to restart any of these containers.\n - `\"Unknown\"` means that for some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod. Deprecated: It isn't being set since 2015 (74da3b14b0c0f658b3bb8d2def5094686d0e9095)", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Failed", "Pending", "Running", "Succeeded", "Unknown"}}, + Enum: []interface{}{"Failed", "Pending", "Running", "Succeeded", "Unknown"}, + }, }, "conditions": { VendorExtensible: spec.VendorExtensible{ @@ -14437,14 +14796,35 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope }, "hostIP": { SchemaProps: spec.SchemaProps{ - Description: "IP address of the host to which the pod is assigned. Empty if not yet scheduled.", + Description: "hostIP holds the IP address of the host to which the pod is assigned. Empty if the pod has not started yet. A pod can be assigned to a node that has a problem in kubelet which in turns mean that HostIP will not be updated even if there is a node is assigned to pod", Type: []string{"string"}, Format: "", }, }, + "hostIPs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + "x-kubernetes-patch-merge-key": "ip", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "hostIPs holds the IP addresses allocated to the host. If this field is specified, the first entry must match the hostIP field. This list is empty if the pod has not started yet. A pod can be assigned to a node that has a problem in kubelet which in turns means that HostIPs will not be updated even if there is a node is assigned to this pod.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.HostIP"), + }, + }, + }, + }, + }, "podIP": { SchemaProps: spec.SchemaProps{ - Description: "IP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated.", + Description: "podIP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated.", Type: []string{"string"}, Format: "", }, @@ -14505,10 +14885,11 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope }, "qosClass": { SchemaProps: spec.SchemaProps{ - Description: "The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://git.k8s.io/community/contributors/design-proposals/node/resource-qos.md\n\nPossible enum values:\n - `\"BestEffort\"` is the BestEffort qos class.\n - `\"Burstable\"` is the Burstable qos class.\n - `\"Guaranteed\"` is the Guaranteed qos class.", + Description: "The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/#quality-of-service-classes\n\nPossible enum values:\n - `\"BestEffort\"` is the BestEffort qos class.\n - `\"Burstable\"` is the Burstable qos class.\n - `\"Guaranteed\"` is the Guaranteed qos class.", Type: []string{"string"}, Format: "", - Enum: []interface{}{"BestEffort", "Burstable", "Guaranteed"}}, + Enum: []interface{}{"BestEffort", "Burstable", "Guaranteed"}, + }, }, "ephemeralContainerStatuses": { SchemaProps: spec.SchemaProps{ @@ -14524,11 +14905,42 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope }, }, }, + "resize": { + SchemaProps: spec.SchemaProps{ + Description: "Status of resources resize desired for pod's containers. It is empty if no resources resize is pending. Any changes to container resources will automatically set this to \"Proposed\"", + Type: []string{"string"}, + Format: "", + }, + }, + "resourceClaimStatuses": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge,retainKeys", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Status of resource claims.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.PodResourceClaimStatus"), + }, + }, + }, + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerStatus", "k8s.io/api/core/v1.PodCondition", "k8s.io/api/core/v1.PodIP", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + "k8s.io/api/core/v1.ContainerStatus", "k8s.io/api/core/v1.HostIP", "k8s.io/api/core/v1.PodCondition", "k8s.io/api/core/v1.PodIP", "k8s.io/api/core/v1.PodResourceClaimStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -14718,7 +15130,8 @@ func schema_k8sio_api_core_v1_PortStatus(ref common.ReferenceCallback) common.Op Default: "", Type: []string{"string"}, Format: "", - Enum: []interface{}{"SCTP", "TCP", "UDP"}}, + Enum: []interface{}{"SCTP", "TCP", "UDP"}, + }, }, "error": { SchemaProps: spec.SchemaProps{ @@ -14787,7 +15200,6 @@ func schema_k8sio_api_core_v1_PreferAvoidPodsEntry(ref common.ReferenceCallback) "evictionTime": { SchemaProps: spec.SchemaProps{ Description: "Time at which this entry was added to the list.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -14872,7 +15284,7 @@ func schema_k8sio_api_core_v1_Probe(ref common.ReferenceCallback) common.OpenAPI }, "grpc": { SchemaProps: spec.SchemaProps{ - Description: "GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.", + Description: "GRPC specifies an action involving a GRPC port.", Ref: ref("k8s.io/api/core/v1.GRPCAction"), }, }, @@ -14953,7 +15365,7 @@ func schema_k8sio_api_core_v1_ProbeHandler(ref common.ReferenceCallback) common. }, "grpc": { SchemaProps: spec.SchemaProps{ - Description: "GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.", + Description: "GRPC specifies an action involving a GRPC port.", Ref: ref("k8s.io/api/core/v1.GRPCAction"), }, }, @@ -15347,7 +15759,6 @@ func schema_k8sio_api_core_v1_ReplicationControllerCondition(ref common.Referenc "lastTransitionTime": { SchemaProps: spec.SchemaProps{ Description: "The last time the condition transitioned from one status to another.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -15469,7 +15880,7 @@ func schema_k8sio_api_core_v1_ReplicationControllerSpec(ref common.ReferenceCall }, "template": { SchemaProps: spec.SchemaProps{ - Description: "Template is the object that describes the pod that will be created if insufficient replicas are detected. This takes precedence over a TemplateRef. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template", + Description: "Template is the object that describes the pod that will be created if insufficient replicas are detected. This takes precedence over a TemplateRef. The only allowed template.spec.restartPolicy value is \"Always\". More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template", Ref: ref("k8s.io/api/core/v1.PodTemplateSpec"), }, }, @@ -15600,7 +16011,6 @@ func schema_k8sio_api_core_v1_ResourceFieldSelector(ref common.ReferenceCallback "divisor": { SchemaProps: spec.SchemaProps{ Description: "Specifies the output format of the exposed resources, defaults to \"1\"", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, @@ -15734,8 +16144,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaSpec(ref common.ReferenceCallback) co Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -15785,8 +16194,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaStatus(ref common.ReferenceCallback) Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -15800,8 +16208,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaStatus(ref common.ReferenceCallback) Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -15830,8 +16237,7 @@ func schema_k8sio_api_core_v1_ResourceRequirements(ref common.ReferenceCallback) Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -15839,14 +16245,13 @@ func schema_k8sio_api_core_v1_ResourceRequirements(ref common.ReferenceCallback) }, "requests": { SchemaProps: spec.SchemaProps{ - Description: "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", + Description: "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", Type: []string{"object"}, AdditionalProperties: &spec.SchemaOrBool{ Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -16144,7 +16549,8 @@ func schema_k8sio_api_core_v1_ScopedResourceSelectorRequirement(ref common.Refer Default: "", Type: []string{"string"}, Format: "", - Enum: []interface{}{"BestEffort", "CrossNamespacePodAffinity", "NotBestEffort", "NotTerminating", "PriorityClass", "Terminating"}}, + Enum: []interface{}{"BestEffort", "CrossNamespacePodAffinity", "NotBestEffort", "NotTerminating", "PriorityClass", "Terminating"}, + }, }, "operator": { SchemaProps: spec.SchemaProps{ @@ -16152,7 +16558,8 @@ func schema_k8sio_api_core_v1_ScopedResourceSelectorRequirement(ref common.Refer Default: "", Type: []string{"string"}, Format: "", - Enum: []interface{}{"DoesNotExist", "Exists", "In", "NotIn"}}, + Enum: []interface{}{"DoesNotExist", "Exists", "In", "NotIn"}, + }, }, "values": { SchemaProps: spec.SchemaProps{ @@ -16189,11 +16596,12 @@ func schema_k8sio_api_core_v1_SeccompProfile(ref common.ReferenceCallback) commo Default: "", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Localhost", "RuntimeDefault", "Unconfined"}}, + Enum: []interface{}{"Localhost", "RuntimeDefault", "Unconfined"}, + }, }, "localhostProfile": { SchemaProps: spec.SchemaProps{ - Description: "localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is \"Localhost\".", + Description: "localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must be set if type is \"Localhost\". Must NOT be set for any other type.", Type: []string{"string"}, Format: "", }, @@ -16611,9 +17019,10 @@ func schema_k8sio_api_core_v1_SecurityContext(ref common.ReferenceCallback) comm }, "procMount": { SchemaProps: spec.SchemaProps{ - Description: "procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.", + Description: "procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.\n\nPossible enum values:\n - `\"Default\"` uses the container runtime defaults for readonly and masked paths for /proc. Most container runtimes mask certain paths in /proc to avoid accidental security exposure of special devices or information.\n - `\"Unmasked\"` bypasses the default masking behavior of the container runtime and ensures the newly created /proc the container stays in tact with no modifications.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"Default", "Unmasked"}, }, }, "seccompProfile": { @@ -16951,11 +17360,12 @@ func schema_k8sio_api_core_v1_ServicePort(ref common.ReferenceCallback) common.O Default: "TCP", Type: []string{"string"}, Format: "", - Enum: []interface{}{"SCTP", "TCP", "UDP"}}, + Enum: []interface{}{"SCTP", "TCP", "UDP"}, + }, }, "appProtocol": { SchemaProps: spec.SchemaProps{ - Description: "The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol.", + Description: "The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either:\n\n* Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).\n\n* Kubernetes-defined prefixed names:\n * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior-\n * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455\n * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455\n\n* Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.", Type: []string{"string"}, Format: "", }, @@ -16971,7 +17381,6 @@ func schema_k8sio_api_core_v1_ServicePort(ref common.ReferenceCallback) common.O "targetPort": { SchemaProps: spec.SchemaProps{ Description: "Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod's container ports. If this is not specified, the value of the 'port' field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the 'port' field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), }, }, @@ -17110,7 +17519,8 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Description: "type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer. \"ClusterIP\" allocates a cluster-internal IP address for load-balancing to endpoints. Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object or EndpointSlice objects. If clusterIP is \"None\", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a virtual IP. \"NodePort\" builds on ClusterIP and allocates a port on every node which routes to the same endpoints as the clusterIP. \"LoadBalancer\" builds on NodePort and creates an external load-balancer (if supported in the current cloud) which routes to the same endpoints as the clusterIP. \"ExternalName\" aliases this service to the specified externalName. Several other fields do not apply to ExternalName services. More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types\n\nPossible enum values:\n - `\"ClusterIP\"` means a service will only be accessible inside the cluster, via the cluster IP.\n - `\"ExternalName\"` means a service consists of only a reference to an external name that kubedns or equivalent will return as a CNAME record, with no exposing or proxying of any pods involved.\n - `\"LoadBalancer\"` means a service will be exposed via an external load balancer (if the cloud provider supports it), in addition to 'NodePort' type.\n - `\"NodePort\"` means a service will be exposed on one port of every node, in addition to 'ClusterIP' type.", Type: []string{"string"}, Format: "", - Enum: []interface{}{"ClusterIP", "ExternalName", "LoadBalancer", "NodePort"}}, + Enum: []interface{}{"ClusterIP", "ExternalName", "LoadBalancer", "NodePort"}, + }, }, "externalIPs": { SchemaProps: spec.SchemaProps{ @@ -17132,11 +17542,12 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Description: "Supports \"ClientIP\" and \"None\". Used to maintain session affinity. Enable client IP based session affinity. Must be ClientIP or None. Defaults to None. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies\n\nPossible enum values:\n - `\"ClientIP\"` is the Client IP based.\n - `\"None\"` - no session affinity.", Type: []string{"string"}, Format: "", - Enum: []interface{}{"ClientIP", "None"}}, + Enum: []interface{}{"ClientIP", "None"}, + }, }, "loadBalancerIP": { SchemaProps: spec.SchemaProps{ - Description: "Only applies to Service Type: LoadBalancer. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature. Deprecated: This field was under-specified and its meaning varies across implementations, and it cannot support dual-stack. As of Kubernetes v1.24, users are encouraged to use implementation-specific annotations when available. This field may be removed in a future API version.", + Description: "Only applies to Service Type: LoadBalancer. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature. Deprecated: This field was under-specified and its meaning varies across implementations. Using it is non-portable and it may not support dual-stack. Users are encouraged to use implementation-specific annotations when available.", Type: []string{"string"}, Format: "", }, @@ -17165,10 +17576,11 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O }, "externalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", + Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Cluster", "Local"}}, + Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, + }, }, "healthCheckNodePort": { SchemaProps: spec.SchemaProps{ @@ -17212,9 +17624,10 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O }, "ipFamilyPolicy": { SchemaProps: spec.SchemaProps{ - Description: "IPFamilyPolicy represents the dual-stack-ness requested or required by this Service. If there is no value provided, then this field will be set to SingleStack. Services can be \"SingleStack\" (a single IP family), \"PreferDualStack\" (two IP families on dual-stack configured clusters or a single IP family on single-stack clusters), or \"RequireDualStack\" (two IP families on dual-stack configured clusters, otherwise fail). The ipFamilies and clusterIPs fields depend on the value of this field. This field will be wiped when updating a service to type ExternalName.", + Description: "IPFamilyPolicy represents the dual-stack-ness requested or required by this Service. If there is no value provided, then this field will be set to SingleStack. Services can be \"SingleStack\" (a single IP family), \"PreferDualStack\" (two IP families on dual-stack configured clusters or a single IP family on single-stack clusters), or \"RequireDualStack\" (two IP families on dual-stack configured clusters, otherwise fail). The ipFamilies and clusterIPs fields depend on the value of this field. This field will be wiped when updating a service to type ExternalName.\n\nPossible enum values:\n - `\"PreferDualStack\"` indicates that this service prefers dual-stack when the cluster is configured for dual-stack. If the cluster is not configured for dual-stack the service will be assigned a single IPFamily. If the IPFamily is not set in service.spec.ipFamilies then the service will be assigned the default IPFamily configured on the cluster\n - `\"RequireDualStack\"` indicates that this service requires dual-stack. Using IPFamilyPolicyRequireDualStack on a single stack cluster will result in validation errors. The IPFamilies (and their order) assigned to this service is based on service.spec.ipFamilies. If service.spec.ipFamilies was not provided then it will be assigned according to how they are configured on the cluster. If service.spec.ipFamilies has only one entry then the alternative IPFamily will be added by apiserver\n - `\"SingleStack\"` indicates that this service is required to have a single IPFamily. The IPFamily assigned is based on the default IPFamily used by the cluster or as identified by service.spec.ipFamilies field", Type: []string{"string"}, Format: "", + Enum: []interface{}{"PreferDualStack", "RequireDualStack", "SingleStack"}, }, }, "allocateLoadBalancerNodePorts": { @@ -17233,9 +17646,10 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O }, "internalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "InternalTrafficPolicy describes how nodes distribute service traffic they receive on the ClusterIP. If set to \"Local\", the proxy will assume that pods only want to talk to endpoints of the service on the same node as the pod, dropping the traffic if there are no local endpoints. The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features).", + Description: "InternalTrafficPolicy describes how nodes distribute service traffic they receive on the ClusterIP. If set to \"Local\", the proxy will assume that pods only want to talk to endpoints of the service on the same node as the pod, dropping the traffic if there are no local endpoints. The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features).\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` routes traffic only to endpoints on the same node as the client pod (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", + Enum: []interface{}{"Cluster", "Local"}, }, }, }, @@ -17313,6 +17727,28 @@ func schema_k8sio_api_core_v1_SessionAffinityConfig(ref common.ReferenceCallback } } +func schema_k8sio_api_core_v1_SleepAction(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SleepAction describes a \"sleep\" action.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "seconds": { + SchemaProps: spec.SchemaProps{ + Description: "Seconds is the number of seconds to sleep.", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + Required: []string{"seconds"}, + }, + }, + } +} + func schema_k8sio_api_core_v1_StorageOSPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -17451,7 +17887,6 @@ func schema_k8sio_api_core_v1_TCPSocketAction(ref common.ReferenceCallback) comm "port": { SchemaProps: spec.SchemaProps{ Description: "Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), }, }, @@ -17499,7 +17934,8 @@ func schema_k8sio_api_core_v1_Taint(ref common.ReferenceCallback) common.OpenAPI Default: "", Type: []string{"string"}, Format: "", - Enum: []interface{}{"NoExecute", "NoSchedule", "PreferNoSchedule"}}, + Enum: []interface{}{"NoExecute", "NoSchedule", "PreferNoSchedule"}, + }, }, "timeAdded": { SchemaProps: spec.SchemaProps{ @@ -17535,7 +17971,8 @@ func schema_k8sio_api_core_v1_Toleration(ref common.ReferenceCallback) common.Op Description: "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.\n\nPossible enum values:\n - `\"Equal\"`\n - `\"Exists\"`", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Equal", "Exists"}}, + Enum: []interface{}{"Equal", "Exists"}, + }, }, "value": { SchemaProps: spec.SchemaProps{ @@ -17549,7 +17986,8 @@ func schema_k8sio_api_core_v1_Toleration(ref common.ReferenceCallback) common.Op Description: "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.\n\nPossible enum values:\n - `\"NoExecute\"` Evict any already-running pods that do not tolerate the taint. Currently enforced by NodeController.\n - `\"NoSchedule\"` Do not allow new pods to schedule onto the node unless they tolerate the taint, but allow all pods submitted to Kubelet without going through the scheduler to start, and allow all already-running pods to continue running. Enforced by the scheduler.\n - `\"PreferNoSchedule\"` Like TaintEffectNoSchedule, but the scheduler tries not to schedule new pods onto the node, rather than prohibiting new pods from scheduling onto the node entirely. Enforced by the scheduler.", Type: []string{"string"}, Format: "", - Enum: []interface{}{"NoExecute", "NoSchedule", "PreferNoSchedule"}}, + Enum: []interface{}{"NoExecute", "NoSchedule", "PreferNoSchedule"}, + }, }, "tolerationSeconds": { SchemaProps: spec.SchemaProps{ @@ -17664,7 +18102,8 @@ func schema_k8sio_api_core_v1_TopologySpreadConstraint(ref common.ReferenceCallb Default: "", Type: []string{"string"}, Format: "", - Enum: []interface{}{"DoNotSchedule", "ScheduleAnyway"}}, + Enum: []interface{}{"DoNotSchedule", "ScheduleAnyway"}, + }, }, "labelSelector": { SchemaProps: spec.SchemaProps{ @@ -17681,16 +18120,18 @@ func schema_k8sio_api_core_v1_TopologySpreadConstraint(ref common.ReferenceCallb }, "nodeAffinityPolicy": { SchemaProps: spec.SchemaProps{ - Description: "NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.\n\nIf this value is nil, the behavior is equivalent to the Honor policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.", + Description: "NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.\n\nIf this value is nil, the behavior is equivalent to the Honor policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.\n\nPossible enum values:\n - `\"Honor\"` means use this scheduling directive when calculating pod topology spread skew.\n - `\"Ignore\"` means ignore this scheduling directive when calculating pod topology spread skew.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"Honor", "Ignore"}, }, }, "nodeTaintsPolicy": { SchemaProps: spec.SchemaProps{ - Description: "NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included.\n\nIf this value is nil, the behavior is equivalent to the Ignore policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.", + Description: "NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included.\n\nIf this value is nil, the behavior is equivalent to the Ignore policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.\n\nPossible enum values:\n - `\"Honor\"` means use this scheduling directive when calculating pod topology spread skew.\n - `\"Ignore\"` means ignore this scheduling directive when calculating pod topology spread skew.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"Honor", "Ignore"}, }, }, "matchLabelKeys": { @@ -17700,7 +18141,7 @@ func schema_k8sio_api_core_v1_TopologySpreadConstraint(ref common.ReferenceCallb }, }, SchemaProps: spec.SchemaProps{ - Description: "MatchLabelKeys is a set of pod label keys to select the pods over which spreading will be calculated. The keys are used to lookup values from the incoming pod labels, those key-value labels are ANDed with labelSelector to select the group of existing pods over which spreading will be calculated for the incoming pod. Keys that don't exist in the incoming pod labels will be ignored. A null or empty list means only match against labelSelector.", + Description: "MatchLabelKeys is a set of pod label keys to select the pods over which spreading will be calculated. The keys are used to lookup values from the incoming pod labels, those key-value labels are ANDed with labelSelector to select the group of existing pods over which spreading will be calculated for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. MatchLabelKeys cannot be set when LabelSelector isn't set. Keys that don't exist in the incoming pod labels will be ignored. A null or empty list means only match against labelSelector.\n\nThis is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -18074,9 +18515,10 @@ func schema_k8sio_api_core_v1_VolumeMount(ref common.ReferenceCallback) common.O }, "mountPropagation": { SchemaProps: spec.SchemaProps{ - Description: "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.", + Description: "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.\n\nPossible enum values:\n - `\"Bidirectional\"` means that the volume in a container will receive new mounts from the host or other containers, and its own mounts will be propagated from the container to the host or other containers. Note that this mode is recursively applied to all mounts in the volume (\"rshared\" in Linux terminology).\n - `\"HostToContainer\"` means that the volume in a container will receive new mounts from the host or other containers, but filesystems mounted inside the container won't be propagated to the host or other containers. Note that this mode is recursively applied to all mounts in the volume (\"rslave\" in Linux terminology).\n - `\"None\"` means that the volume in a container will not receive new mounts from the host or other containers, and filesystems mounted inside the container won't be propagated to the host or other containers. Note that this mode corresponds to \"private\" in Linux terminology.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"Bidirectional", "HostToContainer", "None"}, }, }, "subPathExpr": { @@ -18145,11 +18587,60 @@ func schema_k8sio_api_core_v1_VolumeProjection(ref common.ReferenceCallback) com Ref: ref("k8s.io/api/core/v1.ServiceAccountTokenProjection"), }, }, + "clusterTrustBundle": { + SchemaProps: spec.SchemaProps{ + Description: "ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field of ClusterTrustBundle objects in an auto-updating file.\n\nAlpha, gated by the ClusterTrustBundleProjection feature gate.\n\nClusterTrustBundle objects can either be selected by name, or by the combination of signer name and a label selector.\n\nKubelet performs aggressive normalization of the PEM contents written into the pod filesystem. Esoteric PEM features such as inter-block comments and block headers are stripped. Certificates are deduplicated. The ordering of certificates within the file is arbitrary, and Kubelet may change the order over time.", + Ref: ref("k8s.io/api/core/v1.ClusterTrustBundleProjection"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.ClusterTrustBundleProjection", "k8s.io/api/core/v1.ConfigMapProjection", "k8s.io/api/core/v1.DownwardAPIProjection", "k8s.io/api/core/v1.SecretProjection", "k8s.io/api/core/v1.ServiceAccountTokenProjection"}, + } +} + +func schema_k8sio_api_core_v1_VolumeResourceRequirements(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VolumeResourceRequirements describes the storage resource requirements for a volume.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "limits": { + SchemaProps: spec.SchemaProps{ + Description: "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, + }, + }, + }, + "requests": { + SchemaProps: spec.SchemaProps{ + Description: "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + }, + }, + }, + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ConfigMapProjection", "k8s.io/api/core/v1.DownwardAPIProjection", "k8s.io/api/core/v1.SecretProjection", "k8s.io/api/core/v1.ServiceAccountTokenProjection"}, + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -18446,7 +18937,7 @@ func schema_k8sio_api_core_v1_WindowsSecurityContextOptions(ref common.Reference }, "hostProcess": { SchemaProps: spec.SchemaProps{ - Description: "HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true.", + Description: "HostProcess determines if a container should be run as a 'Host Process' container. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true.", Type: []string{"boolean"}, Format: "", }, @@ -18889,7 +19380,6 @@ func schema_pkg_apis_meta_v1_Condition(ref common.ReferenceCallback) common.Open "lastTransitionTime": { SchemaProps: spec.SchemaProps{ Description: "lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -18963,7 +19453,7 @@ func schema_pkg_apis_meta_v1_CreateOptions(ref common.ReferenceCallback) common. }, "fieldValidation": { SchemaProps: spec.SchemaProps{ - Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default when the `ServerSideFieldValidation` feature gate is enabled. - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", Type: []string{"string"}, Format: "", }, @@ -19373,12 +19863,6 @@ func schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref common.ReferenceCallba Type: []string{"object"}, Properties: map[string]spec.Schema{ "key": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "key", - "x-kubernetes-patch-strategy": "merge", - }, - }, SchemaProps: spec.SchemaProps{ Description: "key is the label key that the selector applies to.", Default: "", @@ -19451,8 +19935,7 @@ func schema_pkg_apis_meta_v1_List(ref common.ReferenceCallback) common.OpenAPIDe Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), }, }, }, @@ -19592,6 +20075,13 @@ func schema_pkg_apis_meta_v1_ListOptions(ref common.ReferenceCallback) common.Op Format: "", }, }, + "sendInitialEvents": { + SchemaProps: spec.SchemaProps{ + Description: "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", + Type: []string{"boolean"}, + Format: "", + }, + }, }, }, }, @@ -19681,7 +20171,7 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope Properties: map[string]spec.Schema{ "name": { SchemaProps: spec.SchemaProps{ - Description: "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names", + Description: "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", Type: []string{"string"}, Format: "", }, @@ -19695,7 +20185,7 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope }, "namespace": { SchemaProps: spec.SchemaProps{ - Description: "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces", + Description: "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces", Type: []string{"string"}, Format: "", }, @@ -19709,7 +20199,7 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope }, "uid": { SchemaProps: spec.SchemaProps{ - Description: "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids", + Description: "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", Type: []string{"string"}, Format: "", }, @@ -19731,7 +20221,6 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope "creationTimestamp": { SchemaProps: spec.SchemaProps{ Description: "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -19750,7 +20239,7 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope }, "labels": { SchemaProps: spec.SchemaProps{ - Description: "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels", + Description: "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels", Type: []string{"object"}, AdditionalProperties: &spec.SchemaOrBool{ Allows: true, @@ -19766,7 +20255,7 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope }, "annotations": { SchemaProps: spec.SchemaProps{ - Description: "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations", + Description: "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations", Type: []string{"object"}, AdditionalProperties: &spec.SchemaOrBool{ Allows: true, @@ -19867,7 +20356,7 @@ func schema_pkg_apis_meta_v1_OwnerReference(ref common.ReferenceCallback) common }, "name": { SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names", + Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", Default: "", Type: []string{"string"}, Format: "", @@ -19875,7 +20364,7 @@ func schema_pkg_apis_meta_v1_OwnerReference(ref common.ReferenceCallback) common }, "uid": { SchemaProps: spec.SchemaProps{ - Description: "UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids", + Description: "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", Default: "", Type: []string{"string"}, Format: "", @@ -20057,7 +20546,7 @@ func schema_pkg_apis_meta_v1_PatchOptions(ref common.ReferenceCallback) common.O }, "fieldValidation": { SchemaProps: spec.SchemaProps{ - Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default when the `ServerSideFieldValidation` feature gate is enabled. - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", Type: []string{"string"}, Format: "", }, @@ -20288,7 +20777,7 @@ func schema_pkg_apis_meta_v1_StatusDetails(ref common.ReferenceCallback) common. }, "uid": { SchemaProps: spec.SchemaProps{ - Description: "UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids", + Description: "UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", Type: []string{"string"}, Format: "", }, @@ -20513,7 +21002,6 @@ func schema_pkg_apis_meta_v1_TableRow(ref common.ReferenceCallback) common.OpenA "object": { SchemaProps: spec.SchemaProps{ Description: "This field contains the requested additional information about each object based on the includeObject policy when requesting the Table. If \"None\", this field is empty, if \"Object\" this will be the default serialization of the object for the current API version, and if \"Metadata\" (the default) will contain the object metadata. Check the returned kind and apiVersion of the object before parsing. The media type of the object will always match the enclosing list - if this as a JSON table, these will be JSON encoded objects.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), }, }, @@ -20684,7 +21172,7 @@ func schema_pkg_apis_meta_v1_UpdateOptions(ref common.ReferenceCallback) common. }, "fieldValidation": { SchemaProps: spec.SchemaProps{ - Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default when the `ServerSideFieldValidation` feature gate is enabled. - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", Type: []string{"string"}, Format: "", }, @@ -20712,7 +21200,6 @@ func schema_pkg_apis_meta_v1_WatchEvent(ref common.ReferenceCallback) common.Ope "object": { SchemaProps: spec.SchemaProps{ Description: "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), }, }, @@ -20780,13 +21267,6 @@ func schema_k8sio_apimachinery_pkg_runtime_Unknown(ref common.ReferenceCallback) Format: "", }, }, - "Raw": { - SchemaProps: spec.SchemaProps{ - Description: "Raw will hold the complete serialized object which couldn't be matched with a registered type. Most likely, nothing should be done with this except for passing it through the system.", - Type: []string{"string"}, - Format: "byte", - }, - }, "ContentEncoding": { SchemaProps: spec.SchemaProps{ Description: "ContentEncoding is encoding used to encode 'Raw' data. Unspecified means no encoding.", @@ -20804,7 +21284,7 @@ func schema_k8sio_apimachinery_pkg_runtime_Unknown(ref common.ReferenceCallback) }, }, }, - Required: []string{"Raw", "ContentEncoding", "ContentType"}, + Required: []string{"ContentEncoding", "ContentType"}, }, }, } diff --git a/pkg/apiserver/registry/controlplane/egressgroup/rest.go b/pkg/apiserver/registry/controlplane/egressgroup/rest.go index b644d4367c5..de11db3069c 100644 --- a/pkg/apiserver/registry/controlplane/egressgroup/rest.go +++ b/pkg/apiserver/registry/controlplane/egressgroup/rest.go @@ -38,11 +38,12 @@ type REST struct { } var ( - _ rest.Storage = &REST{} - _ rest.Watcher = &REST{} - _ rest.Scoper = &REST{} - _ rest.Lister = &REST{} - _ rest.Getter = &REST{} + _ rest.Storage = &REST{} + _ rest.Watcher = &REST{} + _ rest.Scoper = &REST{} + _ rest.Lister = &REST{} + _ rest.Getter = &REST{} + _ rest.SingularNameProvider = &REST{} ) // NewREST returns a REST object that will work against API services. @@ -104,3 +105,7 @@ func (r *REST) Watch(ctx context.Context, options *internalversion.ListOptions) func (r *REST) ConvertToTable(ctx context.Context, obj runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return rest.NewDefaultTableConvertor(controlplane.Resource("egressgroup")).ConvertToTable(ctx, obj, tableOptions) } + +func (r *REST) GetSingularName() string { + return "egressgroup" +} diff --git a/pkg/apiserver/registry/controlplane/nodestatssummary/rest.go b/pkg/apiserver/registry/controlplane/nodestatssummary/rest.go index 99e1a2d2e2b..a81d83425ef 100644 --- a/pkg/apiserver/registry/controlplane/nodestatssummary/rest.go +++ b/pkg/apiserver/registry/controlplane/nodestatssummary/rest.go @@ -34,8 +34,9 @@ type REST struct { } var ( - _ rest.Creater = &REST{} - _ rest.Scoper = &REST{} + _ rest.Creater = &REST{} + _ rest.Scoper = &REST{} + _ rest.SingularNameProvider = &REST{} ) // NewREST returns a REST object that will work against API services. @@ -60,3 +61,7 @@ func (r *REST) Create(ctx context.Context, obj runtime.Object, createValidation func (r *REST) NamespaceScoped() bool { return false } + +func (r *REST) GetSingularName() string { + return "nodestatssummary" +} diff --git a/pkg/apiserver/registry/controlplane/supportbundlecollection/rest.go b/pkg/apiserver/registry/controlplane/supportbundlecollection/rest.go index cccc08de861..b4b507694e0 100644 --- a/pkg/apiserver/registry/controlplane/supportbundlecollection/rest.go +++ b/pkg/apiserver/registry/controlplane/supportbundlecollection/rest.go @@ -38,11 +38,12 @@ type REST struct { } var ( - _ rest.Storage = &REST{} - _ rest.Watcher = &REST{} - _ rest.Scoper = &REST{} - _ rest.Lister = &REST{} - _ rest.Getter = &REST{} + _ rest.Storage = &REST{} + _ rest.Watcher = &REST{} + _ rest.Scoper = &REST{} + _ rest.Lister = &REST{} + _ rest.Getter = &REST{} + _ rest.SingularNameProvider = &REST{} ) // NewREST returns a REST object that will work against API services. @@ -104,3 +105,7 @@ func (r *REST) Watch(ctx context.Context, options *internalversion.ListOptions) func (r *REST) ConvertToTable(ctx context.Context, obj runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return rest.NewDefaultTableConvertor(controlplane.Resource("supportbundlecollection")).ConvertToTable(ctx, obj, tableOptions) } + +func (r *REST) GetSingularName() string { + return "supportbundlecollection" +} diff --git a/pkg/apiserver/registry/networkpolicy/addressgroup/rest.go b/pkg/apiserver/registry/networkpolicy/addressgroup/rest.go index 755e6263091..f1782f97d84 100644 --- a/pkg/apiserver/registry/networkpolicy/addressgroup/rest.go +++ b/pkg/apiserver/registry/networkpolicy/addressgroup/rest.go @@ -38,11 +38,12 @@ type REST struct { } var ( - _ rest.Storage = &REST{} - _ rest.Watcher = &REST{} - _ rest.Scoper = &REST{} - _ rest.Lister = &REST{} - _ rest.Getter = &REST{} + _ rest.Storage = &REST{} + _ rest.Watcher = &REST{} + _ rest.Scoper = &REST{} + _ rest.Lister = &REST{} + _ rest.Getter = &REST{} + _ rest.SingularNameProvider = &REST{} ) // NewREST returns a REST object that will work against API services. @@ -104,3 +105,7 @@ func (r *REST) Watch(ctx context.Context, options *internalversion.ListOptions) func (r *REST) ConvertToTable(ctx context.Context, obj runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return rest.NewDefaultTableConvertor(controlplane.Resource("addressgroup")).ConvertToTable(ctx, obj, tableOptions) } + +func (r *REST) GetSingularName() string { + return "addressgroup" +} diff --git a/pkg/apiserver/registry/networkpolicy/appliedtogroup/rest.go b/pkg/apiserver/registry/networkpolicy/appliedtogroup/rest.go index 7f1aba56a2b..c8b90cd2392 100644 --- a/pkg/apiserver/registry/networkpolicy/appliedtogroup/rest.go +++ b/pkg/apiserver/registry/networkpolicy/appliedtogroup/rest.go @@ -38,11 +38,12 @@ type REST struct { } var ( - _ rest.Storage = &REST{} - _ rest.Watcher = &REST{} - _ rest.Scoper = &REST{} - _ rest.Lister = &REST{} - _ rest.Getter = &REST{} + _ rest.Storage = &REST{} + _ rest.Watcher = &REST{} + _ rest.Scoper = &REST{} + _ rest.Lister = &REST{} + _ rest.Getter = &REST{} + _ rest.SingularNameProvider = &REST{} ) // NewREST returns a REST object that will work against API services. @@ -104,3 +105,7 @@ func (r *REST) Watch(ctx context.Context, options *internalversion.ListOptions) func (r *REST) ConvertToTable(ctx context.Context, obj runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return rest.NewDefaultTableConvertor(controlplane.Resource("appliedtogroup")).ConvertToTable(ctx, obj, tableOptions) } + +func (r *REST) GetSingularName() string { + return "appliedtogroup" +} diff --git a/pkg/apiserver/registry/networkpolicy/clustergroupmember/rest.go b/pkg/apiserver/registry/networkpolicy/clustergroupmember/rest.go index 566b2a5b407..4989cbc94d2 100644 --- a/pkg/apiserver/registry/networkpolicy/clustergroupmember/rest.go +++ b/pkg/apiserver/registry/networkpolicy/clustergroupmember/rest.go @@ -31,9 +31,10 @@ type REST struct { } var ( - _ rest.Storage = &REST{} - _ rest.Scoper = &REST{} - _ rest.GetterWithOptions = &REST{} + _ rest.Storage = &REST{} + _ rest.Scoper = &REST{} + _ rest.GetterWithOptions = &REST{} + _ rest.SingularNameProvider = &REST{} ) // NewREST returns a REST object that will work against API services. @@ -69,6 +70,10 @@ func (r *REST) NamespaceScoped() bool { return false } +func (r *REST) GetSingularName() string { + return "clustergroupmember" +} + func GetPaginatedMembers(querier GroupMembershipQuerier, name string, options runtime.Object) (members []controlplane.GroupMember, ipNets []controlplane.IPNet, totalMembers, totalPages, currentPage int64, err error) { groupMembers, ipBlocks, err := querier.GetGroupMembers(name) if err != nil { diff --git a/pkg/apiserver/registry/networkpolicy/groupassociation/rest.go b/pkg/apiserver/registry/networkpolicy/groupassociation/rest.go index 72bd955be59..5bf7e8c454b 100644 --- a/pkg/apiserver/registry/networkpolicy/groupassociation/rest.go +++ b/pkg/apiserver/registry/networkpolicy/groupassociation/rest.go @@ -32,9 +32,10 @@ type REST struct { } var ( - _ rest.Storage = &REST{} - _ rest.Scoper = &REST{} - _ rest.Getter = &REST{} + _ rest.Storage = &REST{} + _ rest.Scoper = &REST{} + _ rest.Getter = &REST{} + _ rest.SingularNameProvider = &REST{} ) // NewREST returns a REST object that will work against API services. @@ -76,3 +77,7 @@ func (r *REST) Get(ctx context.Context, name string, options *metav1.GetOptions) func (r *REST) NamespaceScoped() bool { return true } + +func (r *REST) GetSingularName() string { + return "groupassociation" +} diff --git a/pkg/apiserver/registry/networkpolicy/groupmember/rest.go b/pkg/apiserver/registry/networkpolicy/groupmember/rest.go index 8e2c3d53447..f1ba66583dd 100644 --- a/pkg/apiserver/registry/networkpolicy/groupmember/rest.go +++ b/pkg/apiserver/registry/networkpolicy/groupmember/rest.go @@ -32,9 +32,10 @@ type REST struct { } var ( - _ rest.Storage = &REST{} - _ rest.Scoper = &REST{} - _ rest.GetterWithOptions = &REST{} + _ rest.Storage = &REST{} + _ rest.Scoper = &REST{} + _ rest.GetterWithOptions = &REST{} + _ rest.SingularNameProvider = &REST{} ) // NewREST returns a REST object that will work against API services. @@ -71,3 +72,7 @@ func (r *REST) NewGetOptions() (runtime.Object, bool, string) { func (r *REST) NamespaceScoped() bool { return true } + +func (r *REST) GetSingularName() string { + return "groupmember" +} diff --git a/pkg/apiserver/registry/networkpolicy/ipgroupassociation/rest.go b/pkg/apiserver/registry/networkpolicy/ipgroupassociation/rest.go index 71f379a0364..f61c914bf75 100644 --- a/pkg/apiserver/registry/networkpolicy/ipgroupassociation/rest.go +++ b/pkg/apiserver/registry/networkpolicy/ipgroupassociation/rest.go @@ -42,9 +42,10 @@ type REST struct { } var ( - _ rest.Storage = &REST{} - _ rest.Scoper = &REST{} - _ rest.Getter = &REST{} + _ rest.Storage = &REST{} + _ rest.Scoper = &REST{} + _ rest.Getter = &REST{} + _ rest.SingularNameProvider = &REST{} ) // NewREST returns a REST object that will work against API services. @@ -137,3 +138,7 @@ func (r *REST) getAssociatedExternalEntities(ip string) []*v1alpha2.ExternalEnti func (r *REST) NamespaceScoped() bool { return false } + +func (r *REST) GetSingularName() string { + return "ipgroupassociation" +} diff --git a/pkg/apiserver/registry/networkpolicy/networkpolicy/rest.go b/pkg/apiserver/registry/networkpolicy/networkpolicy/rest.go index 2b2db670107..0fd1dd5c4d0 100644 --- a/pkg/apiserver/registry/networkpolicy/networkpolicy/rest.go +++ b/pkg/apiserver/registry/networkpolicy/networkpolicy/rest.go @@ -38,11 +38,12 @@ type REST struct { } var ( - _ rest.Storage = &REST{} - _ rest.Watcher = &REST{} - _ rest.Scoper = &REST{} - _ rest.Lister = &REST{} - _ rest.Getter = &REST{} + _ rest.Storage = &REST{} + _ rest.Watcher = &REST{} + _ rest.Scoper = &REST{} + _ rest.Lister = &REST{} + _ rest.Getter = &REST{} + _ rest.SingularNameProvider = &REST{} ) // NewREST returns a REST object that will work against API services. @@ -104,3 +105,7 @@ func (r *REST) Watch(ctx context.Context, options *internalversion.ListOptions) func (r *REST) ConvertToTable(ctx context.Context, obj runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return rest.NewDefaultTableConvertor(controlplane.Resource("networkpolicy")).ConvertToTable(ctx, obj, tableOptions) } + +func (r *REST) GetSingularName() string { + return "networkpolicy" +} diff --git a/pkg/apiserver/registry/networkpolicy/networkpolicyevaluation/rest.go b/pkg/apiserver/registry/networkpolicy/networkpolicyevaluation/rest.go index c005a9aeb6d..af3fca3248f 100644 --- a/pkg/apiserver/registry/networkpolicy/networkpolicyevaluation/rest.go +++ b/pkg/apiserver/registry/networkpolicy/networkpolicyevaluation/rest.go @@ -32,9 +32,10 @@ type REST struct { } var ( - _ rest.Storage = &REST{} - _ rest.Scoper = &REST{} - _ rest.Creater = &REST{} + _ rest.Storage = &REST{} + _ rest.Scoper = &REST{} + _ rest.Creater = &REST{} + _ rest.SingularNameProvider = &REST{} ) // NewREST returns a REST object that will work against API services. @@ -65,3 +66,7 @@ func (r *REST) Create(ctx context.Context, obj runtime.Object, createValidation func (r *REST) NamespaceScoped() bool { return false } + +func (r *REST) GetSingularName() string { + return "networkpolicyevaluation" +} diff --git a/pkg/apiserver/registry/stats/antreaclusternetworkpolicystats/rest.go b/pkg/apiserver/registry/stats/antreaclusternetworkpolicystats/rest.go index 4a840cfc60f..8926314a7ad 100644 --- a/pkg/apiserver/registry/stats/antreaclusternetworkpolicystats/rest.go +++ b/pkg/apiserver/registry/stats/antreaclusternetworkpolicystats/rest.go @@ -51,10 +51,11 @@ func NewREST(p statsProvider) *REST { } var ( - _ rest.Storage = &REST{} - _ rest.Scoper = &REST{} - _ rest.Getter = &REST{} - _ rest.Lister = &REST{} + _ rest.Storage = &REST{} + _ rest.Scoper = &REST{} + _ rest.Getter = &REST{} + _ rest.Lister = &REST{} + _ rest.SingularNameProvider = &REST{} ) type statsProvider interface { @@ -143,3 +144,7 @@ func (r *REST) ConvertToTable(ctx context.Context, obj runtime.Object, tableOpti func (r *REST) NamespaceScoped() bool { return false } + +func (r *REST) GetSingularName() string { + return "antreaclusternetworkpolicystats" +} diff --git a/pkg/apiserver/registry/stats/antreanetworkpolicystats/rest.go b/pkg/apiserver/registry/stats/antreanetworkpolicystats/rest.go index 76d1a49c1da..5621511fd5c 100644 --- a/pkg/apiserver/registry/stats/antreanetworkpolicystats/rest.go +++ b/pkg/apiserver/registry/stats/antreanetworkpolicystats/rest.go @@ -52,10 +52,11 @@ func NewREST(p statsProvider) *REST { } var ( - _ rest.Storage = &REST{} - _ rest.Scoper = &REST{} - _ rest.Getter = &REST{} - _ rest.Lister = &REST{} + _ rest.Storage = &REST{} + _ rest.Scoper = &REST{} + _ rest.Getter = &REST{} + _ rest.Lister = &REST{} + _ rest.SingularNameProvider = &REST{} ) type statsProvider interface { @@ -149,3 +150,7 @@ func (r *REST) ConvertToTable(ctx context.Context, obj runtime.Object, tableOpti func (r *REST) NamespaceScoped() bool { return true } + +func (r *REST) GetSingularName() string { + return "antreanetworkpolicystats" +} diff --git a/pkg/apiserver/registry/stats/multicastgroup/rest.go b/pkg/apiserver/registry/stats/multicastgroup/rest.go index cdae23704d7..4289184fd54 100644 --- a/pkg/apiserver/registry/stats/multicastgroup/rest.go +++ b/pkg/apiserver/registry/stats/multicastgroup/rest.go @@ -49,10 +49,11 @@ func NewREST(p statsProvider) *REST { } var ( - _ rest.Storage = &REST{} - _ rest.Scoper = &REST{} - _ rest.Getter = &REST{} - _ rest.Lister = &REST{} + _ rest.Storage = &REST{} + _ rest.Scoper = &REST{} + _ rest.Getter = &REST{} + _ rest.Lister = &REST{} + _ rest.SingularNameProvider = &REST{} ) type statsProvider interface { @@ -139,3 +140,7 @@ func formatPodReferenceList(pods []statsv1alpha1.PodReference, max int) string { func (r *REST) NamespaceScoped() bool { return false } + +func (r *REST) GetSingularName() string { + return "multicastgroup" +} diff --git a/pkg/apiserver/registry/stats/networkpolicystats/rest.go b/pkg/apiserver/registry/stats/networkpolicystats/rest.go index bab3183d58b..44737e2ca13 100644 --- a/pkg/apiserver/registry/stats/networkpolicystats/rest.go +++ b/pkg/apiserver/registry/stats/networkpolicystats/rest.go @@ -52,10 +52,11 @@ func NewREST(p statsProvider) *REST { } var ( - _ rest.Storage = &REST{} - _ rest.Scoper = &REST{} - _ rest.Getter = &REST{} - _ rest.Lister = &REST{} + _ rest.Storage = &REST{} + _ rest.Scoper = &REST{} + _ rest.Getter = &REST{} + _ rest.Lister = &REST{} + _ rest.SingularNameProvider = &REST{} ) type statsProvider interface { @@ -143,3 +144,7 @@ func (r *REST) ConvertToTable(ctx context.Context, obj runtime.Object, tableOpti func (r *REST) NamespaceScoped() bool { return true } + +func (r *REST) GetSingularName() string { + return "networkpolicystats" +} diff --git a/pkg/apiserver/registry/system/controllerinfo/rest.go b/pkg/apiserver/registry/system/controllerinfo/rest.go index eeb83745069..e25d72943d1 100644 --- a/pkg/apiserver/registry/system/controllerinfo/rest.go +++ b/pkg/apiserver/registry/system/controllerinfo/rest.go @@ -38,9 +38,10 @@ type REST struct { const ControllerInfoResourceName = "antrea-controller" var ( - _ rest.Scoper = &REST{} - _ rest.Getter = &REST{} - _ rest.Lister = &REST{} + _ rest.Scoper = &REST{} + _ rest.Getter = &REST{} + _ rest.Lister = &REST{} + _ rest.SingularNameProvider = &REST{} ) // NewREST returns a REST object that will work against API services. @@ -96,3 +97,7 @@ func (r *REST) NamespaceScoped() bool { func (r *REST) ConvertToTable(ctx context.Context, obj runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return rest.NewDefaultTableConvertor(system.Resource("controllerinfos")).ConvertToTable(ctx, obj, tableOptions) } + +func (r *REST) GetSingularName() string { + return "controllerinfo" +} diff --git a/pkg/apiserver/registry/system/supportbundle/rest.go b/pkg/apiserver/registry/system/supportbundle/rest.go index b62ef81f20a..ad1610ed22f 100644 --- a/pkg/apiserver/registry/system/supportbundle/rest.go +++ b/pkg/apiserver/registry/system/supportbundle/rest.go @@ -99,10 +99,11 @@ type Storage struct { } var ( - _ rest.Scoper = &supportBundleREST{} - _ rest.Getter = &supportBundleREST{} - _ rest.Creater = &supportBundleREST{} - _ rest.GracefulDeleter = &supportBundleREST{} + _ rest.Scoper = &supportBundleREST{} + _ rest.Getter = &supportBundleREST{} + _ rest.Creater = &supportBundleREST{} + _ rest.GracefulDeleter = &supportBundleREST{} + _ rest.SingularNameProvider = &supportBundleREST{} ) // supportBundleREST implements REST interfaces for bundle status querying. @@ -308,6 +309,10 @@ func (r *supportBundleREST) clean(ctx context.Context, bundlePath string, durati defaultFS.Remove(bundlePath) } +func (r *supportBundleREST) GetSingularName() string { + return "supportbundle" +} + var ( _ rest.Storage = new(downloadREST) _ rest.Getter = new(downloadREST) diff --git a/pkg/client/clientset/versioned/doc.go b/pkg/client/clientset/versioned/doc.go deleted file mode 100644 index 03053156dc6..00000000000 --- a/pkg/client/clientset/versioned/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2021 Antrea Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package versioned diff --git a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_addressgroup.go b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_addressgroup.go index e6415d245cb..9f651e12307 100644 --- a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_addressgroup.go +++ b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_addressgroup.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1beta2 "antrea.io/antrea/pkg/apis/controlplane/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" ) @@ -32,9 +31,9 @@ type FakeAddressGroups struct { Fake *FakeControlplaneV1beta2 } -var addressgroupsResource = schema.GroupVersionResource{Group: "controlplane.antrea.io", Version: "v1beta2", Resource: "addressgroups"} +var addressgroupsResource = v1beta2.SchemeGroupVersion.WithResource("addressgroups") -var addressgroupsKind = schema.GroupVersionKind{Group: "controlplane.antrea.io", Version: "v1beta2", Kind: "AddressGroup"} +var addressgroupsKind = v1beta2.SchemeGroupVersion.WithKind("AddressGroup") // Get takes name of the addressGroup, and returns the corresponding addressGroup object, and an error if there is any. func (c *FakeAddressGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.AddressGroup, err error) { diff --git a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_appliedtogroup.go b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_appliedtogroup.go index f5e49789d57..db6d027ba01 100644 --- a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_appliedtogroup.go +++ b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_appliedtogroup.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1beta2 "antrea.io/antrea/pkg/apis/controlplane/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" ) @@ -32,9 +31,9 @@ type FakeAppliedToGroups struct { Fake *FakeControlplaneV1beta2 } -var appliedtogroupsResource = schema.GroupVersionResource{Group: "controlplane.antrea.io", Version: "v1beta2", Resource: "appliedtogroups"} +var appliedtogroupsResource = v1beta2.SchemeGroupVersion.WithResource("appliedtogroups") -var appliedtogroupsKind = schema.GroupVersionKind{Group: "controlplane.antrea.io", Version: "v1beta2", Kind: "AppliedToGroup"} +var appliedtogroupsKind = v1beta2.SchemeGroupVersion.WithKind("AppliedToGroup") // Get takes name of the appliedToGroup, and returns the corresponding appliedToGroup object, and an error if there is any. func (c *FakeAppliedToGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.AppliedToGroup, err error) { diff --git a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_clustergroupmembers.go b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_clustergroupmembers.go index a41eff18a3a..bc05c15d7d7 100644 --- a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_clustergroupmembers.go +++ b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_clustergroupmembers.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import ( v1beta2 "antrea.io/antrea/pkg/apis/controlplane/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - schema "k8s.io/apimachinery/pkg/runtime/schema" testing "k8s.io/client-go/testing" ) @@ -30,9 +29,9 @@ type FakeClusterGroupMembers struct { Fake *FakeControlplaneV1beta2 } -var clustergroupmembersResource = schema.GroupVersionResource{Group: "controlplane.antrea.io", Version: "v1beta2", Resource: "clustergroupmembers"} +var clustergroupmembersResource = v1beta2.SchemeGroupVersion.WithResource("clustergroupmembers") -var clustergroupmembersKind = schema.GroupVersionKind{Group: "controlplane.antrea.io", Version: "v1beta2", Kind: "ClusterGroupMembers"} +var clustergroupmembersKind = v1beta2.SchemeGroupVersion.WithKind("ClusterGroupMembers") // Get takes name of the clusterGroupMembers, and returns the corresponding clusterGroupMembers object, and an error if there is any. func (c *FakeClusterGroupMembers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ClusterGroupMembers, err error) { diff --git a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_egressgroup.go b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_egressgroup.go index 8f1cbc2fadb..da62d07f498 100644 --- a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_egressgroup.go +++ b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_egressgroup.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1beta2 "antrea.io/antrea/pkg/apis/controlplane/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" ) @@ -32,9 +31,9 @@ type FakeEgressGroups struct { Fake *FakeControlplaneV1beta2 } -var egressgroupsResource = schema.GroupVersionResource{Group: "controlplane.antrea.io", Version: "v1beta2", Resource: "egressgroups"} +var egressgroupsResource = v1beta2.SchemeGroupVersion.WithResource("egressgroups") -var egressgroupsKind = schema.GroupVersionKind{Group: "controlplane.antrea.io", Version: "v1beta2", Kind: "EgressGroup"} +var egressgroupsKind = v1beta2.SchemeGroupVersion.WithKind("EgressGroup") // Get takes name of the egressGroup, and returns the corresponding egressGroup object, and an error if there is any. func (c *FakeEgressGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.EgressGroup, err error) { diff --git a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_groupassociation.go b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_groupassociation.go index 24e413cdf87..bfdd6ba1adb 100644 --- a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_groupassociation.go +++ b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_groupassociation.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import ( v1beta2 "antrea.io/antrea/pkg/apis/controlplane/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - schema "k8s.io/apimachinery/pkg/runtime/schema" testing "k8s.io/client-go/testing" ) @@ -31,9 +30,9 @@ type FakeGroupAssociations struct { ns string } -var groupassociationsResource = schema.GroupVersionResource{Group: "controlplane.antrea.io", Version: "v1beta2", Resource: "groupassociations"} +var groupassociationsResource = v1beta2.SchemeGroupVersion.WithResource("groupassociations") -var groupassociationsKind = schema.GroupVersionKind{Group: "controlplane.antrea.io", Version: "v1beta2", Kind: "GroupAssociation"} +var groupassociationsKind = v1beta2.SchemeGroupVersion.WithKind("GroupAssociation") // Get takes name of the groupAssociation, and returns the corresponding groupAssociation object, and an error if there is any. func (c *FakeGroupAssociations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.GroupAssociation, err error) { diff --git a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_groupmembers.go b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_groupmembers.go index 2805f704965..b3425ff5016 100644 --- a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_groupmembers.go +++ b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_groupmembers.go @@ -1,4 +1,4 @@ -// Copyright 2023 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import ( v1beta2 "antrea.io/antrea/pkg/apis/controlplane/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - schema "k8s.io/apimachinery/pkg/runtime/schema" testing "k8s.io/client-go/testing" ) @@ -31,9 +30,9 @@ type FakeGroupMembers struct { ns string } -var groupmembersResource = schema.GroupVersionResource{Group: "controlplane.antrea.io", Version: "v1beta2", Resource: "groupmembers"} +var groupmembersResource = v1beta2.SchemeGroupVersion.WithResource("groupmembers") -var groupmembersKind = schema.GroupVersionKind{Group: "controlplane.antrea.io", Version: "v1beta2", Kind: "GroupMembers"} +var groupmembersKind = v1beta2.SchemeGroupVersion.WithKind("GroupMembers") // Get takes name of the groupMembers, and returns the corresponding groupMembers object, and an error if there is any. func (c *FakeGroupMembers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.GroupMembers, err error) { diff --git a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_ipgroupassociation.go b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_ipgroupassociation.go index d0d63132ef4..b693dd78149 100644 --- a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_ipgroupassociation.go +++ b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_ipgroupassociation.go @@ -1,4 +1,4 @@ -// Copyright 2023 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import ( v1beta2 "antrea.io/antrea/pkg/apis/controlplane/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - schema "k8s.io/apimachinery/pkg/runtime/schema" testing "k8s.io/client-go/testing" ) @@ -30,9 +29,9 @@ type FakeIPGroupAssociations struct { Fake *FakeControlplaneV1beta2 } -var ipgroupassociationsResource = schema.GroupVersionResource{Group: "controlplane.antrea.io", Version: "v1beta2", Resource: "ipgroupassociations"} +var ipgroupassociationsResource = v1beta2.SchemeGroupVersion.WithResource("ipgroupassociations") -var ipgroupassociationsKind = schema.GroupVersionKind{Group: "controlplane.antrea.io", Version: "v1beta2", Kind: "IPGroupAssociation"} +var ipgroupassociationsKind = v1beta2.SchemeGroupVersion.WithKind("IPGroupAssociation") // Get takes name of the iPGroupAssociation, and returns the corresponding iPGroupAssociation object, and an error if there is any. func (c *FakeIPGroupAssociations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.IPGroupAssociation, err error) { diff --git a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_networkpolicy.go b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_networkpolicy.go index bad56b06270..9c4a85a4506 100644 --- a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_networkpolicy.go +++ b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_networkpolicy.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1beta2 "antrea.io/antrea/pkg/apis/controlplane/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" ) @@ -32,9 +31,9 @@ type FakeNetworkPolicies struct { Fake *FakeControlplaneV1beta2 } -var networkpoliciesResource = schema.GroupVersionResource{Group: "controlplane.antrea.io", Version: "v1beta2", Resource: "networkpolicies"} +var networkpoliciesResource = v1beta2.SchemeGroupVersion.WithResource("networkpolicies") -var networkpoliciesKind = schema.GroupVersionKind{Group: "controlplane.antrea.io", Version: "v1beta2", Kind: "NetworkPolicy"} +var networkpoliciesKind = v1beta2.SchemeGroupVersion.WithKind("NetworkPolicy") // Get takes name of the networkPolicy, and returns the corresponding networkPolicy object, and an error if there is any. func (c *FakeNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.NetworkPolicy, err error) { diff --git a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_networkpolicyevaluation.go b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_networkpolicyevaluation.go index 74ea3b78c39..f3f53270b75 100644 --- a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_networkpolicyevaluation.go +++ b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_networkpolicyevaluation.go @@ -21,7 +21,6 @@ import ( v1beta2 "antrea.io/antrea/pkg/apis/controlplane/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - schema "k8s.io/apimachinery/pkg/runtime/schema" testing "k8s.io/client-go/testing" ) @@ -30,9 +29,9 @@ type FakeNetworkPolicyEvaluations struct { Fake *FakeControlplaneV1beta2 } -var networkpolicyevaluationsResource = schema.GroupVersionResource{Group: "controlplane.antrea.io", Version: "v1beta2", Resource: "networkpolicyevaluations"} +var networkpolicyevaluationsResource = v1beta2.SchemeGroupVersion.WithResource("networkpolicyevaluations") -var networkpolicyevaluationsKind = schema.GroupVersionKind{Group: "controlplane.antrea.io", Version: "v1beta2", Kind: "NetworkPolicyEvaluation"} +var networkpolicyevaluationsKind = v1beta2.SchemeGroupVersion.WithKind("NetworkPolicyEvaluation") // Create takes the representation of a networkPolicyEvaluation and creates it. Returns the server's representation of the networkPolicyEvaluation, and an error, if there is any. func (c *FakeNetworkPolicyEvaluations) Create(ctx context.Context, networkPolicyEvaluation *v1beta2.NetworkPolicyEvaluation, opts v1.CreateOptions) (result *v1beta2.NetworkPolicyEvaluation, err error) { diff --git a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_nodestatssummary.go b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_nodestatssummary.go index 186929fc99c..92a41f11cde 100644 --- a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_nodestatssummary.go +++ b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_nodestatssummary.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import ( v1beta2 "antrea.io/antrea/pkg/apis/controlplane/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - schema "k8s.io/apimachinery/pkg/runtime/schema" testing "k8s.io/client-go/testing" ) @@ -30,9 +29,9 @@ type FakeNodeStatsSummaries struct { Fake *FakeControlplaneV1beta2 } -var nodestatssummariesResource = schema.GroupVersionResource{Group: "controlplane.antrea.io", Version: "v1beta2", Resource: "nodestatssummaries"} +var nodestatssummariesResource = v1beta2.SchemeGroupVersion.WithResource("nodestatssummaries") -var nodestatssummariesKind = schema.GroupVersionKind{Group: "controlplane.antrea.io", Version: "v1beta2", Kind: "NodeStatsSummary"} +var nodestatssummariesKind = v1beta2.SchemeGroupVersion.WithKind("NodeStatsSummary") // Create takes the representation of a nodeStatsSummary and creates it. Returns the server's representation of the nodeStatsSummary, and an error, if there is any. func (c *FakeNodeStatsSummaries) Create(ctx context.Context, nodeStatsSummary *v1beta2.NodeStatsSummary, opts v1.CreateOptions) (result *v1beta2.NodeStatsSummary, err error) { diff --git a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_supportbundlecollection.go b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_supportbundlecollection.go index 061fe9ccb65..a62aa85076e 100644 --- a/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_supportbundlecollection.go +++ b/pkg/client/clientset/versioned/typed/controlplane/v1beta2/fake/fake_supportbundlecollection.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1beta2 "antrea.io/antrea/pkg/apis/controlplane/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" ) @@ -32,9 +31,9 @@ type FakeSupportBundleCollections struct { Fake *FakeControlplaneV1beta2 } -var supportbundlecollectionsResource = schema.GroupVersionResource{Group: "controlplane.antrea.io", Version: "v1beta2", Resource: "supportbundlecollections"} +var supportbundlecollectionsResource = v1beta2.SchemeGroupVersion.WithResource("supportbundlecollections") -var supportbundlecollectionsKind = schema.GroupVersionKind{Group: "controlplane.antrea.io", Version: "v1beta2", Kind: "SupportBundleCollection"} +var supportbundlecollectionsKind = v1beta2.SchemeGroupVersion.WithKind("SupportBundleCollection") // Get takes name of the supportBundleCollection, and returns the corresponding supportBundleCollection object, and an error if there is any. func (c *FakeSupportBundleCollections) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.SupportBundleCollection, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_clusternetworkpolicy.go b/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_clusternetworkpolicy.go index e68734a3567..6e799c0079c 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_clusternetworkpolicy.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_clusternetworkpolicy.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeClusterNetworkPolicies struct { Fake *FakeCrdV1alpha1 } -var clusternetworkpoliciesResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1alpha1", Resource: "clusternetworkpolicies"} +var clusternetworkpoliciesResource = v1alpha1.SchemeGroupVersion.WithResource("clusternetworkpolicies") -var clusternetworkpoliciesKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1alpha1", Kind: "ClusterNetworkPolicy"} +var clusternetworkpoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterNetworkPolicy") // Get takes name of the clusterNetworkPolicy, and returns the corresponding clusterNetworkPolicy object, and an error if there is any. func (c *FakeClusterNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterNetworkPolicy, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_externalnode.go b/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_externalnode.go index f4d219ba389..9355950577b 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_externalnode.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_externalnode.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -34,9 +33,9 @@ type FakeExternalNodes struct { ns string } -var externalnodesResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1alpha1", Resource: "externalnodes"} +var externalnodesResource = v1alpha1.SchemeGroupVersion.WithResource("externalnodes") -var externalnodesKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1alpha1", Kind: "ExternalNode"} +var externalnodesKind = v1alpha1.SchemeGroupVersion.WithKind("ExternalNode") // Get takes name of the externalNode, and returns the corresponding externalNode object, and an error if there is any. func (c *FakeExternalNodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ExternalNode, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_networkpolicy.go b/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_networkpolicy.go index dbb2313822a..6732700ba51 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_networkpolicy.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_networkpolicy.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -34,9 +33,9 @@ type FakeNetworkPolicies struct { ns string } -var networkpoliciesResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1alpha1", Resource: "networkpolicies"} +var networkpoliciesResource = v1alpha1.SchemeGroupVersion.WithResource("networkpolicies") -var networkpoliciesKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1alpha1", Kind: "NetworkPolicy"} +var networkpoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("NetworkPolicy") // Get takes name of the networkPolicy, and returns the corresponding networkPolicy object, and an error if there is any. func (c *FakeNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NetworkPolicy, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_supportbundlecollection.go b/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_supportbundlecollection.go index 83e010cc806..2cb464500b0 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_supportbundlecollection.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_supportbundlecollection.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeSupportBundleCollections struct { Fake *FakeCrdV1alpha1 } -var supportbundlecollectionsResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1alpha1", Resource: "supportbundlecollections"} +var supportbundlecollectionsResource = v1alpha1.SchemeGroupVersion.WithResource("supportbundlecollections") -var supportbundlecollectionsKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1alpha1", Kind: "SupportBundleCollection"} +var supportbundlecollectionsKind = v1alpha1.SchemeGroupVersion.WithKind("SupportBundleCollection") // Get takes name of the supportBundleCollection, and returns the corresponding supportBundleCollection object, and an error if there is any. func (c *FakeSupportBundleCollections) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.SupportBundleCollection, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_tier.go b/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_tier.go index e4b60d99d04..76305519610 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_tier.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_tier.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeTiers struct { Fake *FakeCrdV1alpha1 } -var tiersResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1alpha1", Resource: "tiers"} +var tiersResource = v1alpha1.SchemeGroupVersion.WithResource("tiers") -var tiersKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1alpha1", Kind: "Tier"} +var tiersKind = v1alpha1.SchemeGroupVersion.WithKind("Tier") // Get takes name of the tier, and returns the corresponding tier object, and an error if there is any. func (c *FakeTiers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Tier, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_traceflow.go b/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_traceflow.go index add08a136e4..2e0fa627ad8 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_traceflow.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha1/fake/fake_traceflow.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/pkg/apis/crd/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeTraceflows struct { Fake *FakeCrdV1alpha1 } -var traceflowsResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1alpha1", Resource: "traceflows"} +var traceflowsResource = v1alpha1.SchemeGroupVersion.WithResource("traceflows") -var traceflowsKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1alpha1", Kind: "Traceflow"} +var traceflowsKind = v1alpha1.SchemeGroupVersion.WithKind("Traceflow") // Get takes name of the traceflow, and returns the corresponding traceflow object, and an error if there is any. func (c *FakeTraceflows) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Traceflow, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_egress.go b/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_egress.go index 4ff778d92c7..d860fcf738f 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_egress.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_egress.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeEgresses struct { Fake *FakeCrdV1alpha2 } -var egressesResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1alpha2", Resource: "egresses"} +var egressesResource = v1alpha2.SchemeGroupVersion.WithResource("egresses") -var egressesKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1alpha2", Kind: "Egress"} +var egressesKind = v1alpha2.SchemeGroupVersion.WithKind("Egress") // Get takes name of the egress, and returns the corresponding egress object, and an error if there is any. func (c *FakeEgresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.Egress, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_externalentity.go b/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_externalentity.go index 874b7917da4..d8c91d1c01a 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_externalentity.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_externalentity.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -34,9 +33,9 @@ type FakeExternalEntities struct { ns string } -var externalentitiesResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1alpha2", Resource: "externalentities"} +var externalentitiesResource = v1alpha2.SchemeGroupVersion.WithResource("externalentities") -var externalentitiesKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1alpha2", Kind: "ExternalEntity"} +var externalentitiesKind = v1alpha2.SchemeGroupVersion.WithKind("ExternalEntity") // Get takes name of the externalEntity, and returns the corresponding externalEntity object, and an error if there is any. func (c *FakeExternalEntities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ExternalEntity, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_externalippool.go b/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_externalippool.go index eef3998d402..c4c59f79043 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_externalippool.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_externalippool.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeExternalIPPools struct { Fake *FakeCrdV1alpha2 } -var externalippoolsResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1alpha2", Resource: "externalippools"} +var externalippoolsResource = v1alpha2.SchemeGroupVersion.WithResource("externalippools") -var externalippoolsKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1alpha2", Kind: "ExternalIPPool"} +var externalippoolsKind = v1alpha2.SchemeGroupVersion.WithKind("ExternalIPPool") // Get takes name of the externalIPPool, and returns the corresponding externalIPPool object, and an error if there is any. func (c *FakeExternalIPPools) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ExternalIPPool, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_ippool.go b/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_ippool.go index 60b3e11f2c5..fb98ea8e866 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_ippool.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_ippool.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeIPPools struct { Fake *FakeCrdV1alpha2 } -var ippoolsResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1alpha2", Resource: "ippools"} +var ippoolsResource = v1alpha2.SchemeGroupVersion.WithResource("ippools") -var ippoolsKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1alpha2", Kind: "IPPool"} +var ippoolsKind = v1alpha2.SchemeGroupVersion.WithKind("IPPool") // Get takes name of the iPPool, and returns the corresponding iPPool object, and an error if there is any. func (c *FakeIPPools) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.IPPool, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_trafficcontrol.go b/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_trafficcontrol.go index e216d668ab1..d956cef9b43 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_trafficcontrol.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha2/fake/fake_trafficcontrol.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha2 "antrea.io/antrea/pkg/apis/crd/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeTrafficControls struct { Fake *FakeCrdV1alpha2 } -var trafficcontrolsResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1alpha2", Resource: "trafficcontrols"} +var trafficcontrolsResource = v1alpha2.SchemeGroupVersion.WithResource("trafficcontrols") -var trafficcontrolsKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1alpha2", Kind: "TrafficControl"} +var trafficcontrolsKind = v1alpha2.SchemeGroupVersion.WithKind("TrafficControl") // Get takes name of the trafficControl, and returns the corresponding trafficControl object, and an error if there is any. func (c *FakeTrafficControls) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.TrafficControl, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_clustergroup.go b/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_clustergroup.go index 7df0e4fa0a6..7a2f9c174e2 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_clustergroup.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_clustergroup.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha3 "antrea.io/antrea/pkg/apis/crd/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeClusterGroups struct { Fake *FakeCrdV1alpha3 } -var clustergroupsResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1alpha3", Resource: "clustergroups"} +var clustergroupsResource = v1alpha3.SchemeGroupVersion.WithResource("clustergroups") -var clustergroupsKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1alpha3", Kind: "ClusterGroup"} +var clustergroupsKind = v1alpha3.SchemeGroupVersion.WithKind("ClusterGroup") // Get takes name of the clusterGroup, and returns the corresponding clusterGroup object, and an error if there is any. func (c *FakeClusterGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ClusterGroup, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_group.go b/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_group.go index 2d82e25e0d9..433ad34dbb2 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_group.go +++ b/pkg/client/clientset/versioned/typed/crd/v1alpha3/fake/fake_group.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha3 "antrea.io/antrea/pkg/apis/crd/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -34,9 +33,9 @@ type FakeGroups struct { ns string } -var groupsResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1alpha3", Resource: "groups"} +var groupsResource = v1alpha3.SchemeGroupVersion.WithResource("groups") -var groupsKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1alpha3", Kind: "Group"} +var groupsKind = v1alpha3.SchemeGroupVersion.WithKind("Group") // Get takes name of the group, and returns the corresponding group object, and an error if there is any. func (c *FakeGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.Group, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_antreaagentinfo.go b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_antreaagentinfo.go index ebe0a3d2c70..efb9b127c20 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_antreaagentinfo.go +++ b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_antreaagentinfo.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1beta1 "antrea.io/antrea/pkg/apis/crd/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeAntreaAgentInfos struct { Fake *FakeCrdV1beta1 } -var antreaagentinfosResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1beta1", Resource: "antreaagentinfos"} +var antreaagentinfosResource = v1beta1.SchemeGroupVersion.WithResource("antreaagentinfos") -var antreaagentinfosKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1beta1", Kind: "AntreaAgentInfo"} +var antreaagentinfosKind = v1beta1.SchemeGroupVersion.WithKind("AntreaAgentInfo") // Get takes name of the antreaAgentInfo, and returns the corresponding antreaAgentInfo object, and an error if there is any. func (c *FakeAntreaAgentInfos) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.AntreaAgentInfo, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_antreacontrollerinfo.go b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_antreacontrollerinfo.go index 5592700a736..5d7717603dd 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_antreacontrollerinfo.go +++ b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_antreacontrollerinfo.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1beta1 "antrea.io/antrea/pkg/apis/crd/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeAntreaControllerInfos struct { Fake *FakeCrdV1beta1 } -var antreacontrollerinfosResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1beta1", Resource: "antreacontrollerinfos"} +var antreacontrollerinfosResource = v1beta1.SchemeGroupVersion.WithResource("antreacontrollerinfos") -var antreacontrollerinfosKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1beta1", Kind: "AntreaControllerInfo"} +var antreacontrollerinfosKind = v1beta1.SchemeGroupVersion.WithKind("AntreaControllerInfo") // Get takes name of the antreaControllerInfo, and returns the corresponding antreaControllerInfo object, and an error if there is any. func (c *FakeAntreaControllerInfos) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.AntreaControllerInfo, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_clustergroup.go b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_clustergroup.go index 99e839507dd..7e588a5a72e 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_clustergroup.go +++ b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_clustergroup.go @@ -1,4 +1,4 @@ -// Copyright 2023 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1beta1 "antrea.io/antrea/pkg/apis/crd/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeClusterGroups struct { Fake *FakeCrdV1beta1 } -var clustergroupsResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1beta1", Resource: "clustergroups"} +var clustergroupsResource = v1beta1.SchemeGroupVersion.WithResource("clustergroups") -var clustergroupsKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1beta1", Kind: "ClusterGroup"} +var clustergroupsKind = v1beta1.SchemeGroupVersion.WithKind("ClusterGroup") // Get takes name of the clusterGroup, and returns the corresponding clusterGroup object, and an error if there is any. func (c *FakeClusterGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterGroup, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_clusternetworkpolicy.go b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_clusternetworkpolicy.go index d04d6544fbf..6d535fa435b 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_clusternetworkpolicy.go +++ b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_clusternetworkpolicy.go @@ -1,4 +1,4 @@ -// Copyright 2023 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1beta1 "antrea.io/antrea/pkg/apis/crd/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeClusterNetworkPolicies struct { Fake *FakeCrdV1beta1 } -var clusternetworkpoliciesResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1beta1", Resource: "clusternetworkpolicies"} +var clusternetworkpoliciesResource = v1beta1.SchemeGroupVersion.WithResource("clusternetworkpolicies") -var clusternetworkpoliciesKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1beta1", Kind: "ClusterNetworkPolicy"} +var clusternetworkpoliciesKind = v1beta1.SchemeGroupVersion.WithKind("ClusterNetworkPolicy") // Get takes name of the clusterNetworkPolicy, and returns the corresponding clusterNetworkPolicy object, and an error if there is any. func (c *FakeClusterNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterNetworkPolicy, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_egress.go b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_egress.go index 5a098af19da..22c8cb47e87 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_egress.go +++ b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_egress.go @@ -1,4 +1,4 @@ -// Copyright 2023 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1beta1 "antrea.io/antrea/pkg/apis/crd/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeEgresses struct { Fake *FakeCrdV1beta1 } -var egressesResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1beta1", Resource: "egresses"} +var egressesResource = v1beta1.SchemeGroupVersion.WithResource("egresses") -var egressesKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1beta1", Kind: "Egress"} +var egressesKind = v1beta1.SchemeGroupVersion.WithKind("Egress") // Get takes name of the egress, and returns the corresponding egress object, and an error if there is any. func (c *FakeEgresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Egress, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_externalippool.go b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_externalippool.go index 8688bcd963d..7380012b33c 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_externalippool.go +++ b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_externalippool.go @@ -1,4 +1,4 @@ -// Copyright 2023 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1beta1 "antrea.io/antrea/pkg/apis/crd/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeExternalIPPools struct { Fake *FakeCrdV1beta1 } -var externalippoolsResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1beta1", Resource: "externalippools"} +var externalippoolsResource = v1beta1.SchemeGroupVersion.WithResource("externalippools") -var externalippoolsKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1beta1", Kind: "ExternalIPPool"} +var externalippoolsKind = v1beta1.SchemeGroupVersion.WithKind("ExternalIPPool") // Get takes name of the externalIPPool, and returns the corresponding externalIPPool object, and an error if there is any. func (c *FakeExternalIPPools) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ExternalIPPool, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_group.go b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_group.go index 2ee7d88a77c..2a4842270a7 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_group.go +++ b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_group.go @@ -1,4 +1,4 @@ -// Copyright 2023 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1beta1 "antrea.io/antrea/pkg/apis/crd/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -34,9 +33,9 @@ type FakeGroups struct { ns string } -var groupsResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1beta1", Resource: "groups"} +var groupsResource = v1beta1.SchemeGroupVersion.WithResource("groups") -var groupsKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1beta1", Kind: "Group"} +var groupsKind = v1beta1.SchemeGroupVersion.WithKind("Group") // Get takes name of the group, and returns the corresponding group object, and an error if there is any. func (c *FakeGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Group, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_networkpolicy.go b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_networkpolicy.go index 9d9da2686b5..91204112417 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_networkpolicy.go +++ b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_networkpolicy.go @@ -1,4 +1,4 @@ -// Copyright 2023 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1beta1 "antrea.io/antrea/pkg/apis/crd/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -34,9 +33,9 @@ type FakeNetworkPolicies struct { ns string } -var networkpoliciesResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1beta1", Resource: "networkpolicies"} +var networkpoliciesResource = v1beta1.SchemeGroupVersion.WithResource("networkpolicies") -var networkpoliciesKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1beta1", Kind: "NetworkPolicy"} +var networkpoliciesKind = v1beta1.SchemeGroupVersion.WithKind("NetworkPolicy") // Get takes name of the networkPolicy, and returns the corresponding networkPolicy object, and an error if there is any. func (c *FakeNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.NetworkPolicy, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_tier.go b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_tier.go index 90f35333462..5b88ff4f367 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_tier.go +++ b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_tier.go @@ -1,4 +1,4 @@ -// Copyright 2023 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1beta1 "antrea.io/antrea/pkg/apis/crd/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeTiers struct { Fake *FakeCrdV1beta1 } -var tiersResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1beta1", Resource: "tiers"} +var tiersResource = v1beta1.SchemeGroupVersion.WithResource("tiers") -var tiersKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1beta1", Kind: "Tier"} +var tiersKind = v1beta1.SchemeGroupVersion.WithKind("Tier") // Get takes name of the tier, and returns the corresponding tier object, and an error if there is any. func (c *FakeTiers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Tier, err error) { diff --git a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_traceflow.go b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_traceflow.go index 4e7e530ac73..065830f9a19 100644 --- a/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_traceflow.go +++ b/pkg/client/clientset/versioned/typed/crd/v1beta1/fake/fake_traceflow.go @@ -1,4 +1,4 @@ -// Copyright 2023 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1beta1 "antrea.io/antrea/pkg/apis/crd/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -33,9 +32,9 @@ type FakeTraceflows struct { Fake *FakeCrdV1beta1 } -var traceflowsResource = schema.GroupVersionResource{Group: "crd.antrea.io", Version: "v1beta1", Resource: "traceflows"} +var traceflowsResource = v1beta1.SchemeGroupVersion.WithResource("traceflows") -var traceflowsKind = schema.GroupVersionKind{Group: "crd.antrea.io", Version: "v1beta1", Kind: "Traceflow"} +var traceflowsKind = v1beta1.SchemeGroupVersion.WithKind("Traceflow") // Get takes name of the traceflow, and returns the corresponding traceflow object, and an error if there is any. func (c *FakeTraceflows) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Traceflow, err error) { diff --git a/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_antreaclusternetworkpolicystats.go b/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_antreaclusternetworkpolicystats.go index c89e39a944e..9a7c63f5acd 100644 --- a/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_antreaclusternetworkpolicystats.go +++ b/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_antreaclusternetworkpolicystats.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/pkg/apis/stats/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" ) @@ -32,9 +31,9 @@ type FakeAntreaClusterNetworkPolicyStats struct { Fake *FakeStatsV1alpha1 } -var antreaclusternetworkpolicystatsResource = schema.GroupVersionResource{Group: "stats.antrea.io", Version: "v1alpha1", Resource: "antreaclusternetworkpolicystats"} +var antreaclusternetworkpolicystatsResource = v1alpha1.SchemeGroupVersion.WithResource("antreaclusternetworkpolicystats") -var antreaclusternetworkpolicystatsKind = schema.GroupVersionKind{Group: "stats.antrea.io", Version: "v1alpha1", Kind: "AntreaClusterNetworkPolicyStats"} +var antreaclusternetworkpolicystatsKind = v1alpha1.SchemeGroupVersion.WithKind("AntreaClusterNetworkPolicyStats") // Get takes name of the antreaClusterNetworkPolicyStats, and returns the corresponding antreaClusterNetworkPolicyStats object, and an error if there is any. func (c *FakeAntreaClusterNetworkPolicyStats) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AntreaClusterNetworkPolicyStats, err error) { diff --git a/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_antreanetworkpolicystats.go b/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_antreanetworkpolicystats.go index 9c09dcb1a26..dbd931186a4 100644 --- a/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_antreanetworkpolicystats.go +++ b/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_antreanetworkpolicystats.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/pkg/apis/stats/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" ) @@ -33,9 +32,9 @@ type FakeAntreaNetworkPolicyStats struct { ns string } -var antreanetworkpolicystatsResource = schema.GroupVersionResource{Group: "stats.antrea.io", Version: "v1alpha1", Resource: "antreanetworkpolicystats"} +var antreanetworkpolicystatsResource = v1alpha1.SchemeGroupVersion.WithResource("antreanetworkpolicystats") -var antreanetworkpolicystatsKind = schema.GroupVersionKind{Group: "stats.antrea.io", Version: "v1alpha1", Kind: "AntreaNetworkPolicyStats"} +var antreanetworkpolicystatsKind = v1alpha1.SchemeGroupVersion.WithKind("AntreaNetworkPolicyStats") // Get takes name of the antreaNetworkPolicyStats, and returns the corresponding antreaNetworkPolicyStats object, and an error if there is any. func (c *FakeAntreaNetworkPolicyStats) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AntreaNetworkPolicyStats, err error) { diff --git a/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_multicastgroup.go b/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_multicastgroup.go index 81c8cfecf0e..1c7d87bdfa9 100644 --- a/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_multicastgroup.go +++ b/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_multicastgroup.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/pkg/apis/stats/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" ) @@ -32,9 +31,9 @@ type FakeMulticastGroups struct { Fake *FakeStatsV1alpha1 } -var multicastgroupsResource = schema.GroupVersionResource{Group: "stats.antrea.io", Version: "v1alpha1", Resource: "multicastgroups"} +var multicastgroupsResource = v1alpha1.SchemeGroupVersion.WithResource("multicastgroups") -var multicastgroupsKind = schema.GroupVersionKind{Group: "stats.antrea.io", Version: "v1alpha1", Kind: "MulticastGroup"} +var multicastgroupsKind = v1alpha1.SchemeGroupVersion.WithKind("MulticastGroup") // Get takes name of the multicastGroup, and returns the corresponding multicastGroup object, and an error if there is any. func (c *FakeMulticastGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MulticastGroup, err error) { diff --git a/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_networkpolicystats.go b/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_networkpolicystats.go index 3b7a1b72abd..532b794518a 100644 --- a/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_networkpolicystats.go +++ b/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_networkpolicystats.go @@ -1,4 +1,4 @@ -// Copyright 2021 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,7 +22,6 @@ import ( v1alpha1 "antrea.io/antrea/pkg/apis/stats/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" ) @@ -33,9 +32,9 @@ type FakeNetworkPolicyStats struct { ns string } -var networkpolicystatsResource = schema.GroupVersionResource{Group: "stats.antrea.io", Version: "v1alpha1", Resource: "networkpolicystats"} +var networkpolicystatsResource = v1alpha1.SchemeGroupVersion.WithResource("networkpolicystats") -var networkpolicystatsKind = schema.GroupVersionKind{Group: "stats.antrea.io", Version: "v1alpha1", Kind: "NetworkPolicyStats"} +var networkpolicystatsKind = v1alpha1.SchemeGroupVersion.WithKind("NetworkPolicyStats") // Get takes name of the networkPolicyStats, and returns the corresponding networkPolicyStats object, and an error if there is any. func (c *FakeNetworkPolicyStats) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NetworkPolicyStats, err error) { diff --git a/pkg/client/clientset/versioned/typed/system/v1beta1/fake/fake_supportbundle.go b/pkg/client/clientset/versioned/typed/system/v1beta1/fake/fake_supportbundle.go index 027cb8e5e9b..bea73e9a3c2 100644 --- a/pkg/client/clientset/versioned/typed/system/v1beta1/fake/fake_supportbundle.go +++ b/pkg/client/clientset/versioned/typed/system/v1beta1/fake/fake_supportbundle.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import ( v1beta1 "antrea.io/antrea/pkg/apis/system/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - schema "k8s.io/apimachinery/pkg/runtime/schema" testing "k8s.io/client-go/testing" ) @@ -30,9 +29,9 @@ type FakeSupportBundles struct { Fake *FakeSystemV1beta1 } -var supportbundlesResource = schema.GroupVersionResource{Group: "system.antrea.io", Version: "v1beta1", Resource: "supportbundles"} +var supportbundlesResource = v1beta1.SchemeGroupVersion.WithResource("supportbundles") -var supportbundlesKind = schema.GroupVersionKind{Group: "system.antrea.io", Version: "v1beta1", Kind: "SupportBundle"} +var supportbundlesKind = v1beta1.SchemeGroupVersion.WithKind("SupportBundle") // Get takes name of the supportBundle, and returns the corresponding supportBundle object, and an error if there is any. func (c *FakeSupportBundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.SupportBundle, err error) { diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 011ad1f5b1d..09f1a888bb6 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -1,4 +1,4 @@ -// Copyright 2023 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,6 +40,7 @@ type sharedInformerFactory struct { lock sync.Mutex defaultResync time.Duration customResync map[reflect.Type]time.Duration + transform cache.TransformFunc informers map[reflect.Type]cache.SharedIndexInformer // startedInformers is used for tracking which informers have been started. @@ -78,6 +79,14 @@ func WithNamespace(namespace string) SharedInformerOption { } } +// WithTransform sets a transform on all informers. +func WithTransform(transform cache.TransformFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.transform = transform + return factory + } +} + // NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync) @@ -164,7 +173,7 @@ func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[ref return res } -// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// InformerFor returns the SharedIndexInformer for obj using an internal // client. func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { f.lock.Lock() @@ -182,6 +191,7 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal } informer = newFunc(f.client, resyncPeriod) + informer.SetTransform(f.transform) f.informers[informerType] = informer return informer @@ -237,7 +247,7 @@ type SharedInformerFactory interface { // ForResource gives generic access to a shared informer of the matching type. ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // InformerFor returns the SharedIndexInformer for obj using an internal // client. InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer diff --git a/pkg/controller/certificatesigningrequest/ipsec_csr_signing_controller_test.go b/pkg/controller/certificatesigningrequest/ipsec_csr_signing_controller_test.go index 5100f5bc63a..a996e051c9d 100644 --- a/pkg/controller/certificatesigningrequest/ipsec_csr_signing_controller_test.go +++ b/pkg/controller/certificatesigningrequest/ipsec_csr_signing_controller_test.go @@ -108,17 +108,18 @@ func TestIPsecCertificateApproverAndSigner(t *testing.T) { csr, err := clientset.CertificatesV1().CertificateSigningRequests().Create(context.TODO(), tt.csr, metav1.CreateOptions{}) require.NoError(t, err) - err = wait.PollImmediate(200*time.Millisecond, 10*time.Second, func() (done bool, err error) { - csr, err = clientset.CertificatesV1().CertificateSigningRequests().Get(context.TODO(), tt.csr.Name, metav1.GetOptions{}) - require.NoError(t, err) - if !isCertificateRequestApproved(csr) { - return false, nil - } - if len(csr.Status.Certificate) == 0 { - return false, nil - } - return true, nil - }) + err = wait.PollUntilContextTimeout(context.Background(), 200*time.Millisecond, 10*time.Second, true, + func(ctx context.Context) (done bool, err error) { + csr, err = clientset.CertificatesV1().CertificateSigningRequests().Get(context.TODO(), tt.csr.Name, metav1.GetOptions{}) + require.NoError(t, err) + if !isCertificateRequestApproved(csr) { + return false, nil + } + if len(csr.Status.Certificate) == 0 { + return false, nil + } + return true, nil + }) require.NoError(t, err) issued := csr.Status.Certificate parsed, err := certutil.ParseCertsPEM(issued) diff --git a/pkg/controller/egress/controller_test.go b/pkg/controller/egress/controller_test.go index 356774503aa..61303439d42 100644 --- a/pkg/controller/egress/controller_test.go +++ b/pkg/controller/egress/controller_test.go @@ -759,13 +759,14 @@ func TestSyncEgressIP(t *testing.T) { func checkExternalIPPoolUsed(t *testing.T, controller *egressController, poolName string, used int) { exists := controller.externalIPAllocator.IPPoolExists(poolName) require.True(t, exists) - err := wait.PollImmediate(50*time.Millisecond, 2*time.Second, func() (found bool, err error) { - eip, err := controller.crdClient.CrdV1beta1().ExternalIPPools().Get(context.TODO(), poolName, metav1.GetOptions{}) - if err != nil { - return false, err - } - return eip.Status.Usage.Used == used, nil - }) + err := wait.PollUntilContextTimeout(context.Background(), 50*time.Millisecond, 2*time.Second, true, + func(ctx context.Context) (found bool, err error) { + eip, err := controller.crdClient.CrdV1beta1().ExternalIPPools().Get(context.TODO(), poolName, metav1.GetOptions{}) + if err != nil { + return false, err + } + return eip.Status.Usage.Used == used, nil + }) assert.NoError(t, err) } diff --git a/pkg/controller/externalippool/controller_test.go b/pkg/controller/externalippool/controller_test.go index 3e8a3c594fc..d0e1052e316 100644 --- a/pkg/controller/externalippool/controller_test.go +++ b/pkg/controller/externalippool/controller_test.go @@ -458,7 +458,7 @@ func TestIPPoolHasIP(t *testing.T) { func checkExternalIPPoolStatus(t *testing.T, controller *controller, poolName string, expectedStatus antreacrds.IPPoolUsage) { exists := controller.IPPoolExists(poolName) require.True(t, exists) - err := wait.PollImmediate(50*time.Millisecond, 2*time.Second, func() (found bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), 50*time.Millisecond, 2*time.Second, true, func(ctx context.Context) (found bool, err error) { eip, err := controller.crdClient.CrdV1beta1().ExternalIPPools().Get(context.TODO(), poolName, metav1.GetOptions{}) if err != nil { return false, err diff --git a/pkg/controller/externalnode/controller_test.go b/pkg/controller/externalnode/controller_test.go index fa615abb1a7..04f5789deab 100644 --- a/pkg/controller/externalnode/controller_test.go +++ b/pkg/controller/externalnode/controller_test.go @@ -147,7 +147,7 @@ func TestAddExternalNode(t *testing.T) { defer close(stopCh) informerFactory.Start(stopCh) go controller.Run(stopCh) - err := wait.PollImmediate(time.Millisecond*50, time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Millisecond*50, time.Second, true, func(ctx context.Context) (done bool, err error) { for _, ee := range tc.expectedEntities { ok, err := checkExternalEntityExists(controller.crdClient, ee) if err != nil { @@ -416,7 +416,7 @@ func TestUpdateExternalNode(t *testing.T) { defer close(stopCh) informerFactory.Start(stopCh) go controller.Run(stopCh) - err := wait.PollImmediate(time.Millisecond*50, time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Millisecond*50, time.Second, true, func(ctx context.Context) (done bool, err error) { entities, listErr := controller.crdClient.CrdV1alpha2().ExternalEntities(tc.externalNode.Namespace).List(context.TODO(), metav1.ListOptions{}) if listErr != nil { return false, listErr @@ -437,7 +437,7 @@ func TestUpdateExternalNode(t *testing.T) { _, err = controller.crdClient.CrdV1alpha1().ExternalNodes(tc.externalNode.Namespace).Update(context.TODO(), tc.updatedExternalNode, metav1.UpdateOptions{}) require.NoError(t, err) - err = wait.PollImmediate(time.Millisecond*50, time.Second, func() (done bool, err error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Millisecond*50, time.Second, true, func(ctx context.Context) (done bool, err error) { return checkExternalEntityExists(controller.crdClient, tc.expectedEntity) }) assert.NoError(t, err) @@ -488,7 +488,7 @@ func TestDeleteExternalNode(t *testing.T) { err := controller.crdClient.CrdV1alpha1().ExternalNodes(externalNode.Namespace).Delete(context.TODO(), externalNode.Name, metav1.DeleteOptions{}) require.NoError(t, err) key, _ := keyFunc(externalNode) - err = wait.PollImmediate(time.Millisecond*50, time.Second, func() (done bool, err error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Millisecond*50, time.Second, true, func(ctx context.Context) (done bool, err error) { entities, listErr := controller.crdClient.CrdV1alpha2().ExternalEntities(externalNode.Namespace).List(context.TODO(), metav1.ListOptions{}) if listErr != nil { return false, listErr diff --git a/pkg/controller/grouping/controller.go b/pkg/controller/grouping/controller.go index b974e42b4db..1b6d6a009f8 100644 --- a/pkg/controller/grouping/controller.go +++ b/pkg/controller/grouping/controller.go @@ -15,6 +15,7 @@ package grouping import ( + "context" "fmt" "sync/atomic" "time" @@ -184,7 +185,7 @@ func (c *GroupEntityController) Run(stopCh <-chan struct{}) { } // Wait until all event handlers process the initial resources before setting groupEntityIndex as synced. - if err := wait.PollImmediateUntil(100*time.Millisecond, func() (done bool, err error) { + if err := wait.PollUntilContextCancel(wait.ContextForChannel(stopCh), 100*time.Millisecond, true, func(ctx context.Context) (done bool, err error) { if uint64(initialPodCount) > c.podAddEvents.Load() { return false, nil } @@ -197,7 +198,7 @@ func (c *GroupEntityController) Run(stopCh <-chan struct{}) { } } return true, nil - }, stopCh); err == nil { + }); err == nil { c.groupEntityIndex.setSynced(true) } diff --git a/pkg/controller/grouping/controller_test.go b/pkg/controller/grouping/controller_test.go index 9fcc7f9e294..97d1c425e78 100644 --- a/pkg/controller/grouping/controller_test.go +++ b/pkg/controller/grouping/controller_test.go @@ -22,7 +22,6 @@ import ( "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes/fake" featuregatetesting "k8s.io/component-base/featuregate/testing" @@ -100,9 +99,9 @@ func TestGroupEntityControllerRun(t *testing.T) { go c.groupEntityIndex.Run(stopCh) go c.Run(stopCh) - assert.NoError(t, wait.Poll(10*time.Millisecond, time.Second, func() (done bool, err error) { - return index.HasSynced(), nil - }), "GroupEntityIndex hasn't been synced in 1 second after starting GroupEntityController") + assert.Eventually(t, func() bool { + return index.HasSynced() + }, time.Second, 10*time.Millisecond, "GroupEntityIndex hasn't been synced in 1 second after starting GroupEntityController") }) } } diff --git a/pkg/controller/ipam/antrea_ipam_controller_test.go b/pkg/controller/ipam/antrea_ipam_controller_test.go index 5b624285948..6fecc2a2624 100644 --- a/pkg/controller/ipam/antrea_ipam_controller_test.go +++ b/pkg/controller/ipam/antrea_ipam_controller_test.go @@ -125,17 +125,18 @@ func initTestObjects(annotateNamespace bool, annotateStatefulSet bool, replicas func verifyPoolAllocatedSize(t *testing.T, poolName string, poolLister listers.IPPoolLister, size int) { - err := wait.PollImmediate(100*time.Millisecond, 1*time.Second, func() (bool, error) { - pool, err := poolLister.Get(poolName) - if err != nil { - return false, nil - } - if len(pool.Status.IPAddresses) == size { - return true, nil - } + err := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 1*time.Second, true, + func(ctx context.Context) (bool, error) { + pool, err := poolLister.Get(poolName) + if err != nil { + return false, nil + } + if len(pool.Status.IPAddresses) == size { + return true, nil + } - return false, nil - }) + return false, nil + }) require.NoError(t, err) } @@ -189,13 +190,14 @@ func TestStatefulSetLifecycle(t *testing.T) { var allocator *poolallocator.IPPoolAllocator var err error // Wait until pool propagates to the informer - pollErr := wait.PollImmediate(100*time.Millisecond, 3*time.Second, func() (bool, error) { - allocator, err = poolallocator.NewIPPoolAllocator(pool.Name, controller.crdClient, controller.poolLister) - if err != nil { - return false, nil - } - return true, nil - }) + pollErr := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 3*time.Second, true, + func(ctx context.Context) (bool, error) { + allocator, err = poolallocator.NewIPPoolAllocator(pool.Name, controller.crdClient, controller.poolLister) + if err != nil { + return false, nil + } + return true, nil + }) require.NoError(t, pollErr) defer allocator.ReleaseStatefulSet(statefulSet.Namespace, statefulSet.Name) @@ -262,7 +264,7 @@ func TestReleaseStaleAddresses(t *testing.T) { go controller.Run(stopCh) // verify two stale entries were deleted, one updated to Reserved status - err := wait.PollImmediate(100*time.Millisecond, 2*time.Second, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 2*time.Second, true, func(ctx context.Context) (bool, error) { pool, err := controller.poolLister.Get(pool.Name) if err != nil { return false, nil diff --git a/pkg/controller/labelidentity/controller.go b/pkg/controller/labelidentity/controller.go index 3accad43e7a..2722fa492bd 100644 --- a/pkg/controller/labelidentity/controller.go +++ b/pkg/controller/labelidentity/controller.go @@ -15,6 +15,7 @@ package labelidentity import ( + "context" "sync/atomic" "time" @@ -96,12 +97,12 @@ func (c *Controller) Run(stopCh <-chan struct{}) { } initialLabelCount := len(c.labelInformer.Informer().GetStore().List()) // Wait until initial label identities are processed before setting labelIdentityIndex as synced. - if err := wait.PollImmediateUntil(100*time.Millisecond, func() (done bool, err error) { + if err := wait.PollUntilContextCancel(wait.ContextForChannel(stopCh), 100*time.Millisecond, true, func(ctx context.Context) (done bool, err error) { if uint64(initialLabelCount) > c.labelAddEvents.Load() { return false, nil } return true, nil - }, stopCh); err == nil { + }); err == nil { c.labelIdentityIndex.setSynced(true) } <-stopCh diff --git a/pkg/controller/labelidentity/controller_test.go b/pkg/controller/labelidentity/controller_test.go index bf091fc3ced..b3ed33a0d99 100644 --- a/pkg/controller/labelidentity/controller_test.go +++ b/pkg/controller/labelidentity/controller_test.go @@ -21,7 +21,6 @@ import ( "github.com/stretchr/testify/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/wait" mcv1alpha1 "antrea.io/antrea/multicluster/apis/multicluster/v1alpha1" fakeversioned "antrea.io/antrea/multicluster/pkg/client/clientset/versioned/fake" @@ -78,7 +77,7 @@ func TestGroupEntityControllerRun(t *testing.T) { go c.labelIdentityIndex.Run(stopCh) go c.Run(stopCh) - assert.NoError(t, wait.Poll(10*time.Millisecond, time.Second, func() (done bool, err error) { - return index.HasSynced(), nil - }), "LabelIdentityIndex hasn't been synced in 1 second after starting LabelIdentityController") + assert.Eventually(t, func() bool { + return index.HasSynced() + }, 1*time.Second, 10*time.Millisecond, "LabelIdentityIndex hasn't been synced in 1 second after starting LabelIdentityController") } diff --git a/pkg/controller/networkpolicy/networkpolicy_controller_test.go b/pkg/controller/networkpolicy/networkpolicy_controller_test.go index 2ee35d67d12..74b12c182e0 100644 --- a/pkg/controller/networkpolicy/networkpolicy_controller_test.go +++ b/pkg/controller/networkpolicy/networkpolicy_controller_test.go @@ -41,7 +41,7 @@ import ( k8stesting "k8s.io/client-go/testing" "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/workqueue" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" fakepolicyversioned "sigs.k8s.io/network-policy-api/pkg/client/clientset/versioned/fake" policyv1a1informers "sigs.k8s.io/network-policy-api/pkg/client/informers/externalversions" @@ -2844,10 +2844,10 @@ func TestAddressGroupWithNodeSelector(t *testing.T) { if err != nil { return err } - assert.NoError(t, wait.Poll(time.Millisecond*100, time.Second, func() (done bool, err error) { + assert.Eventually(t, func() bool { newNode, err := c.nodeLister.Get(node.Name) - return reflect.DeepEqual(node, newNode), err - })) + return reflect.DeepEqual(node, newNode) && err == nil + }, time.Second, 100*time.Millisecond) return nil } fakeNode0.Labels = nodeSelectorA.MatchLabels @@ -3720,7 +3720,7 @@ func TestSyncInternalNetworkPolicyWithGroups(t *testing.T) { c.crdClient.CrdV1beta1().NetworkPolicies(tt.inputPolicy.Namespace).Create(context.TODO(), tt.inputPolicy, metav1.CreateOptions{}) var gotPolicy *antreatypes.NetworkPolicy - err := wait.PollImmediate(100*time.Millisecond, 3*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 3*time.Second, true, func(ctx context.Context) (done bool, err error) { obj, exists, _ := c.internalNetworkPolicyStore.Get(tt.expectedPolicy.Name) if !exists { return false, nil @@ -3939,7 +3939,7 @@ func TestClusterNetworkPolicyWithClusterGroup(t *testing.T) { UID: acnp.UID, Name: string(acnp.UID), SourceRef: &controlplane.NetworkPolicyReference{Type: controlplane.AntreaClusterNetworkPolicy, Name: acnp.Name, UID: acnp.UID}, - Priority: pointer.Float64(acnp.Spec.Priority), + Priority: ptr.To(acnp.Spec.Priority), Rules: []controlplane.NetworkPolicyRule{ { Direction: controlplane.DirectionIn, @@ -4010,7 +4010,7 @@ func TestClusterNetworkPolicyWithClusterGroup(t *testing.T) { UID: acnp.UID, Name: string(acnp.UID), SourceRef: &controlplane.NetworkPolicyReference{Type: controlplane.AntreaClusterNetworkPolicy, Name: acnp.Name, UID: acnp.UID}, - Priority: pointer.Float64(acnp.Spec.Priority), + Priority: ptr.To(acnp.Spec.Priority), Rules: []controlplane.NetworkPolicyRule{ {Direction: controlplane.DirectionIn, Action: &allowAction}, }, @@ -4027,7 +4027,7 @@ func TestClusterNetworkPolicyWithClusterGroup(t *testing.T) { UID: acnp.UID, Name: string(acnp.UID), SourceRef: &controlplane.NetworkPolicyReference{Type: controlplane.AntreaClusterNetworkPolicy, Name: acnp.Name, UID: acnp.UID}, - Priority: pointer.Float64(acnp.Spec.Priority), + Priority: ptr.To(acnp.Spec.Priority), Rules: []controlplane.NetworkPolicyRule{ {Direction: controlplane.DirectionIn, Action: &allowAction}, }, diff --git a/pkg/controller/stats/aggregator_test.go b/pkg/controller/stats/aggregator_test.go index 9ccc5b5d4a3..da135e72c79 100644 --- a/pkg/controller/stats/aggregator_test.go +++ b/pkg/controller/stats/aggregator_test.go @@ -68,7 +68,7 @@ var ( func runWrapper(t *testing.T, a *Aggregator, policyCount int, summaries []*controlplane.NodeStatsSummary) { stopCh := make(chan struct{}) doneCh := make(chan struct{}) - err := wait.PollImmediate(100*time.Millisecond, time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, time.Second, true, func(ctx context.Context) (done bool, err error) { count := len(a.ListNetworkPolicyStats("")) + len(a.ListAntreaNetworkPolicyStats("")) + len(a.ListAntreaClusterNetworkPolicyStats()) return (count >= policyCount), nil }) @@ -81,7 +81,7 @@ func runWrapper(t *testing.T, a *Aggregator, policyCount int, summaries []*contr a.Collect(summary) } // Wait for all summaries to be consumed. - err = wait.PollImmediate(100*time.Millisecond, time.Second, func() (done bool, err error) { + err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, time.Second, true, func(ctx context.Context) (done bool, err error) { return len(a.dataCh) == 0, nil }) require.NoError(t, err, "Timeout while waiting for summaries to be consummed by Aggregator") @@ -622,7 +622,7 @@ func TestDeleteNetworkPolicy(t *testing.T) { crdClient.CrdV1beta1().ClusterNetworkPolicies().Delete(context.TODO(), acnp1.Name, metav1.DeleteOptions{}) crdClient.CrdV1beta1().NetworkPolicies(annp1.Namespace).Delete(context.TODO(), annp1.Name, metav1.DeleteOptions{}) // Event handlers are asynchronous, it's supposed to finish very soon. - err := wait.PollImmediate(100*time.Millisecond, time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, time.Second, true, func(ctx context.Context) (done bool, err error) { return len(a.ListNetworkPolicyStats("")) == 0 && len(a.ListAntreaClusterNetworkPolicyStats()) == 0 && len(a.ListAntreaNetworkPolicyStats("")) == 0, nil }) assert.NoError(t, err) diff --git a/pkg/controller/supportbundlecollection/controller_test.go b/pkg/controller/supportbundlecollection/controller_test.go index 0b9cefd871c..678215dadd5 100644 --- a/pkg/controller/supportbundlecollection/controller_test.go +++ b/pkg/controller/supportbundlecollection/controller_test.go @@ -865,7 +865,7 @@ func TestCreateAndDeleteInternalSupportBundleCollection(t *testing.T) { } bundle, err := testClient.crdClient.CrdV1alpha1().SupportBundleCollections().Create(context.TODO(), generateSupportBundleResource(bundleConfig), metav1.CreateOptions{}) require.Nil(t, err) - err = wait.PollImmediate(time.Millisecond*50, time.Second, func() (done bool, err error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Millisecond*50, time.Second, true, func(ctx context.Context) (done bool, err error) { _, getErr := controller.supportBundleCollectionLister.Get(tc.bundleConfig.name) if getErr == nil { return true, nil @@ -1060,7 +1060,7 @@ func TestSyncSupportBundleCollection(t *testing.T) { go controller.worker() for _, tc := range testCases { - err := wait.PollImmediate(time.Millisecond*100, time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Millisecond*100, time.Second, true, func(ctx context.Context) (done bool, err error) { _, exists, err := controller.supportBundleCollectionStore.Get(tc.bundleConfig.name) if err != nil { return false, err diff --git a/pkg/controller/traceflow/controller_test.go b/pkg/controller/traceflow/controller_test.go index 661357a5c69..c40a37d2602 100644 --- a/pkg/controller/traceflow/controller_test.go +++ b/pkg/controller/traceflow/controller_test.go @@ -153,7 +153,7 @@ func TestTraceflow(t *testing.T) { func (tfc *traceflowController) waitForPodInNamespace(ns string, name string, timeout time.Duration) (*corev1.Pod, error) { var pod *corev1.Pod var err error - if err = wait.Poll(100*time.Millisecond, timeout, func() (bool, error) { + if err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, timeout, false, func(ctx context.Context) (bool, error) { // Make sure dummy Pod is synced by informer pod, err = tfc.podLister.Pods(ns).Get(name) if err != nil { @@ -169,7 +169,7 @@ func (tfc *traceflowController) waitForPodInNamespace(ns string, name string, ti func (tfc *traceflowController) waitForTraceflow(name string, phase crdv1beta1.TraceflowPhase, timeout time.Duration) (*crdv1beta1.Traceflow, error) { var tf *crdv1beta1.Traceflow var err error - if err = wait.Poll(100*time.Millisecond, timeout, func() (bool, error) { + if err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, timeout, false, func(ctx context.Context) (bool, error) { tf, err = tfc.client.CrdV1beta1().Traceflows().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil || tf.Status.Phase != phase { return false, nil diff --git a/pkg/flowaggregator/clickhouseclient/clickhouseclient.go b/pkg/flowaggregator/clickhouseclient/clickhouseclient.go index be21f777aaa..a53cd119973 100644 --- a/pkg/flowaggregator/clickhouseclient/clickhouseclient.go +++ b/pkg/flowaggregator/clickhouseclient/clickhouseclient.go @@ -427,7 +427,7 @@ func ConnectClickHouse(config *ClickHouseConfig) (*sql.DB, error) { connTimeout := 10 * time.Second // Connect to ClickHouse in a loop - if err := wait.PollImmediate(connRetryInterval, connTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.TODO(), connRetryInterval, connTimeout, true, func(ctx context.Context) (bool, error) { // Open the database and ping it opt := clickhouse.Options{ Addr: []string{addr}, diff --git a/pkg/flowaggregator/clickhouseclient/clickhouseclient_test.go b/pkg/flowaggregator/clickhouseclient/clickhouseclient_test.go index ce17f73d656..164a55d09b9 100644 --- a/pkg/flowaggregator/clickhouseclient/clickhouseclient_test.go +++ b/pkg/flowaggregator/clickhouseclient/clickhouseclient_test.go @@ -31,7 +31,6 @@ import ( ipfixentitiestesting "github.com/vmware/go-ipfix/pkg/entities/testing" "github.com/vmware/go-ipfix/pkg/registry" "go.uber.org/mock/gomock" - "k8s.io/apimachinery/pkg/util/wait" "antrea.io/antrea/pkg/flowaggregator/flowrecord" flowrecordtesting "antrea.io/antrea/pkg/flowaggregator/flowrecord/testing" @@ -314,10 +313,10 @@ func TestUpdateCH(t *testing.T) { chExportProc.Start() defer chExportProc.Stop() - require.NoError(t, wait.Poll(commitInterval, time.Second, func() (bool, error) { + require.Eventually(t, func() bool { err := mock1.ExpectationsWereMet() - return (err == nil), nil - }), "timeout while waiting for first flow record to be committed (before DB connection update)") + return err == nil + }, time.Second, commitInterval, "timeout while waiting for first flow record to be committed (before DB connection update)") mock2.ExpectBegin() mock2.ExpectPrepare(insertQuery).ExpectExec().WillReturnResult(sqlmock.NewResult(0, 1)) @@ -332,10 +331,10 @@ func TestUpdateCH(t *testing.T) { chExportProc.deque.PushBack(recordRow) }() - require.NoError(t, wait.Poll(commitInterval, time.Second, func() (bool, error) { + require.Eventually(t, func() bool { err := mock2.ExpectationsWereMet() - return (err == nil), nil - }), "timeout while waiting for second flow record to be committed (after DB connection update)") + return err == nil + }, time.Second, commitInterval, "timeout while waiting for second flow record to be committed (after DB connection update)") } func TestParseDatabaseURL(t *testing.T) { diff --git a/pkg/flowaggregator/exporter/clickhouse.go b/pkg/flowaggregator/exporter/clickhouse.go index 7276b20f3b4..239ad3e3757 100644 --- a/pkg/flowaggregator/exporter/clickhouse.go +++ b/pkg/flowaggregator/exporter/clickhouse.go @@ -15,6 +15,7 @@ package exporter import ( + "context" "fmt" "os" "path" @@ -62,7 +63,7 @@ func NewClickHouseExporter(k8sClient kubernetes.Interface, opt *options.Options) "compress", *chConfig.Compress, "commitInterval", chConfig.CommitInterval, "insecureSkipVerify", chConfig.InsecureSkipVerify, "caCert", chConfig.CACert) var errMessage error if chConfig.CACert { - err := wait.Poll(DefaultInterval, Timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.TODO(), DefaultInterval, Timeout, false, func(ctx context.Context) (bool, error) { caCertPath := path.Join(CertDir, CACertFile) certificate, err := os.ReadFile(caCertPath) if err != nil { diff --git a/pkg/flowaggregator/exporter/utils.go b/pkg/flowaggregator/exporter/utils.go index ced42593a41..7a1d0596323 100644 --- a/pkg/flowaggregator/exporter/utils.go +++ b/pkg/flowaggregator/exporter/utils.go @@ -15,6 +15,7 @@ package exporter import ( + "context" "fmt" "time" @@ -41,7 +42,7 @@ func getClusterUUID(k8sClient kubernetes.Interface) (uuid.UUID, error) { k8sClient, ) var clusterUUID uuid.UUID - if err := wait.PollImmediate(retryInterval, timeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.TODO(), retryInterval, timeout, true, func(ctx context.Context) (bool, error) { clusterIdentity, _, err := clusterIdentityProvider.Get() if err != nil { return false, nil diff --git a/pkg/ipam/poolallocator/allocator_test.go b/pkg/ipam/poolallocator/allocator_test.go index 78faa87aab5..5c53c5ce161 100644 --- a/pkg/ipam/poolallocator/allocator_test.go +++ b/pkg/ipam/poolallocator/allocator_test.go @@ -15,6 +15,7 @@ package poolallocator import ( + "context" "fmt" "net" "testing" @@ -60,7 +61,7 @@ func newTestIPPoolAllocator(pool *crdv1a2.IPPool, stopCh <-chan struct{}) *IPPoo var allocator *IPPoolAllocator var err error - wait.PollImmediate(100*time.Millisecond, 1*time.Second, func() (bool, error) { + wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 1*time.Second, true, func(ctx context.Context) (bool, error) { allocator, err = NewIPPoolAllocator(pool.Name, crdClient, pools.Lister()) if err != nil { return false, nil @@ -377,11 +378,10 @@ func TestHas(t *testing.T) { _, _, err := allocator.AllocateNext(crdv1a2.IPAddressPhaseAllocated, owner) require.NoError(t, err) - err = wait.PollImmediate(100*time.Millisecond, 1*time.Second, func() (bool, error) { + require.Eventually(t, func() bool { has, _ := allocator.hasPod(testNamespace, "fakePod") - return has, nil - }) - require.NoError(t, err) + return has + }, 1*time.Second, 100*time.Millisecond) has, err := allocator.hasPod(testNamespace, "realPod") require.NoError(t, err) diff --git a/pkg/monitor/controller.go b/pkg/monitor/controller.go index e0436938b28..321f28d182f 100644 --- a/pkg/monitor/controller.go +++ b/pkg/monitor/controller.go @@ -390,7 +390,7 @@ func (monitor *controllerMonitor) antreaAgentInfoAPIAvailable(stopCh <-chan stru } found := false - if err := wait.PollImmediateUntil(time.Second*10, func() (done bool, err error) { + if err := wait.PollUntilContextCancel(wait.ContextForChannel(stopCh), time.Second*10, true, func(ctx context.Context) (done bool, err error) { var checkErr error found, checkErr = checkFunc() if checkErr != nil { @@ -398,7 +398,7 @@ func (monitor *controllerMonitor) antreaAgentInfoAPIAvailable(stopCh <-chan stru return false, nil } return true, nil - }, stopCh); err != nil { + }); err != nil { klog.ErrorS(err, "Failed to get server resources for GroupVersion", "groupVersion", groupVersion) found = false } diff --git a/pkg/ovs/ovsctl/ovsctl_others.go b/pkg/ovs/ovsctl/ovsctl_others.go index c4a58ff2a39..26e55138fa5 100644 --- a/pkg/ovs/ovsctl/ovsctl_others.go +++ b/pkg/ovs/ovsctl/ovsctl_others.go @@ -53,7 +53,7 @@ func ovsVSwitchdUDS(ctx context.Context) (string, error) { var readErr error startTime := time.Now() hasFailure := false - err := wait.PollImmediateWithContext(ctx, 50*time.Millisecond, 5*time.Second, func(ctx context.Context) (bool, error) { + err := wait.PollUntilContextTimeout(ctx, 50*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) { pid, readErr = readOVSVSwitchdPID() if readErr != nil { hasFailure = true diff --git a/pkg/util/channel/channel_test.go b/pkg/util/channel/channel_test.go index 12efc053e6c..2891e20030f 100644 --- a/pkg/util/channel/channel_test.go +++ b/pkg/util/channel/channel_test.go @@ -22,7 +22,6 @@ import ( "github.com/stretchr/testify/assert" "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/wait" ) type eventReceiver struct { @@ -71,17 +70,17 @@ func TestSubscribe(t *testing.T) { var errReceiver int var errReceivedEvents sets.Set[string] - assert.NoError(t, wait.PollImmediate(10*time.Millisecond, 100*time.Millisecond, func() (done bool, err error) { + assert.Eventually(t, func() bool { for i, r := range eventReceivers { receivedEvents := r.received() if !receivedEvents.Equal(desiredEvents) { errReceiver = i errReceivedEvents = receivedEvents - return false, nil + return false } } - return true, nil - }), "Receiver %d failed to receive all events, expected %d events, got %d events", errReceiver, len(desiredEvents), len(errReceivedEvents)) + return true + }, 100*time.Millisecond, 10*time.Millisecond, "Receiver %d failed to receive all events, expected %d events, got %d events", errReceiver, len(desiredEvents), len(errReceivedEvents)) } func TestNotify(t *testing.T) { diff --git a/test/e2e/antreaipam_test.go b/test/e2e/antreaipam_test.go index da84884ed0f..db5fc8f2a9e 100644 --- a/test/e2e/antreaipam_test.go +++ b/test/e2e/antreaipam_test.go @@ -477,7 +477,7 @@ func checkStatefulSetIPPoolAllocation(tb testing.TB, data *TestData, name string expectedIPAddressJson, _ := json.Marshal(expectedIPAddressMap) tb.Logf("expectedIPAddressMap: %s", expectedIPAddressJson) - err = wait.Poll(time.Second*3, time.Second*15, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), time.Second*3, time.Second*15, false, func(ctx context.Context) (bool, error) { ipPool, err := data.crdClient.CrdV1alpha2().IPPools().Get(context.TODO(), ipPoolName, metav1.GetOptions{}) if err != nil { tb.Fatalf("Failed to get IPPool %s, err: %+v", ipPoolName, err) @@ -574,7 +574,7 @@ func deleteIPPoolWrapper(tb testing.TB, data *TestData, name string) { func checkIPPoolsEmpty(tb testing.TB, data *TestData, names []string) { count := 0 - err := wait.PollImmediate(3*time.Second, defaultTimeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), 3*time.Second, defaultTimeout, true, func(ctx context.Context) (bool, error) { for _, name := range names { ipPool, _ := data.crdClient.CrdV1alpha2().IPPools().Get(context.TODO(), name, metav1.GetOptions{}) if len(ipPool.Status.IPAddresses) > 0 { diff --git a/test/e2e/antreapolicy_test.go b/test/e2e/antreapolicy_test.go index cef8e0b4639..e4f0ce66ef6 100644 --- a/test/e2e/antreapolicy_test.go +++ b/test/e2e/antreapolicy_test.go @@ -3917,7 +3917,7 @@ func testACNPIGMPQuery(t *testing.T, data *TestData, acnpName, caseName, groupAd } // check if IGMP can be sent to Pod - if err := wait.Poll(3*time.Second, defaultTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 3*time.Second, defaultTimeout, false, func(ctx context.Context) (bool, error) { captured, err := checkPacketCaptureResult(t, data, tcpdumpName, cmd) if captured { return true, nil @@ -4000,7 +4000,7 @@ func testACNPMulticastEgress(t *testing.T, data *TestData, acnpName, caseName, g t.Fatalf("failed to call generateConnCheckCmd: %v", err) } - if err := wait.Poll(3*time.Second, defaultTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 3*time.Second, defaultTimeout, false, func(ctx context.Context) (bool, error) { captured, err := checkPacketCaptureResult(t, data, tcpdumpName, cmd) if captured { return true, nil @@ -4050,7 +4050,7 @@ func checkAuditLoggingResult(t *testing.T, data *TestData, nodeName, logLocator } cmd := []string{"cat", logDir + logfileName} - if err := wait.Poll(1*time.Second, 10*time.Second, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 1*time.Second, 10*time.Second, false, func(ctx context.Context) (bool, error) { stdout, stderr, err := data.RunCommandFromPod(antreaNamespace, antreaPodName, "antrea-agent", cmd) if err != nil || stderr != "" { // file may not exist yet @@ -4652,7 +4652,7 @@ func TestAntreaPolicyStatusWithAppliedToUnsupportedGroup(t *testing.T) { } func checkANNPStatus(t *testing.T, data *TestData, annp *crdv1beta1.NetworkPolicy, expectedStatus crdv1beta1.NetworkPolicyStatus) *crdv1beta1.NetworkPolicy { - err := wait.Poll(100*time.Millisecond, policyRealizedTimeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, policyRealizedTimeout, false, func(ctx context.Context) (bool, error) { var err error annp, err = data.crdClient.CrdV1beta1().NetworkPolicies(annp.Namespace).Get(context.TODO(), annp.Name, metav1.GetOptions{}) if err != nil { @@ -4665,7 +4665,7 @@ func checkANNPStatus(t *testing.T, data *TestData, annp *crdv1beta1.NetworkPolic } func checkACNPStatus(t *testing.T, data *TestData, acnp *crdv1beta1.ClusterNetworkPolicy, expectedStatus crdv1beta1.NetworkPolicyStatus) *crdv1beta1.ClusterNetworkPolicy { - err := wait.Poll(100*time.Millisecond, policyRealizedTimeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, policyRealizedTimeout, false, func(ctx context.Context) (bool, error) { var err error acnp, err = data.crdClient.CrdV1beta1().ClusterNetworkPolicies().Get(context.TODO(), acnp.Name, metav1.GetOptions{}) if err != nil { @@ -4682,7 +4682,7 @@ func checkACNPStatus(t *testing.T, data *TestData, acnp *crdv1beta1.ClusterNetwo // resource's Generation and the Phase is set to Realized. func (data *TestData) waitForANNPRealized(t *testing.T, namespace string, name string, timeout time.Duration) error { t.Logf("Waiting for ANNP '%s/%s' to be realized", namespace, name) - if err := wait.Poll(100*time.Millisecond, timeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, timeout, false, func(ctx context.Context) (bool, error) { annp, err := data.crdClient.CrdV1beta1().NetworkPolicies(namespace).Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return false, err @@ -4699,7 +4699,7 @@ func (data *TestData) waitForANNPRealized(t *testing.T, namespace string, name s // resource's Generation and the Phase is set to Realized. func (data *TestData) waitForACNPRealized(t *testing.T, name string, timeout time.Duration) error { t.Logf("Waiting for ACNP '%s' to be realized", name) - if err := wait.Poll(100*time.Millisecond, timeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, timeout, false, func(ctx context.Context) (bool, error) { acnp, err := data.crdClient.CrdV1beta1().ClusterNetworkPolicies().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return false, err @@ -4820,7 +4820,7 @@ func testANNPNetworkPolicyStatsWithDropAction(t *testing.T, data *TestData) { totalSessionsPerRule += sessionsPerAddressFamily } - if err := wait.Poll(5*time.Second, defaultTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 5*time.Second, defaultTimeout, false, func(ctx context.Context) (bool, error) { stats, err := data.crdClient.StatsV1alpha1().AntreaNetworkPolicyStats(data.testNamespace).Get(context.TODO(), "np1", metav1.GetOptions{}) if err != nil { return false, err @@ -4955,7 +4955,7 @@ func testAntreaClusterNetworkPolicyStats(t *testing.T, data *TestData) { totalSessionsPerRule += sessionsPerAddressFamily } - if err := wait.Poll(5*time.Second, defaultTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 5*time.Second, defaultTimeout, false, func(ctx context.Context) (bool, error) { stats, err := data.crdClient.StatsV1alpha1().AntreaClusterNetworkPolicyStats().Get(context.TODO(), "cnp1", metav1.GetOptions{}) if err != nil { return false, err diff --git a/test/e2e/basic_test.go b/test/e2e/basic_test.go index 10f1ed3b6ff..21b4b0b0075 100644 --- a/test/e2e/basic_test.go +++ b/test/e2e/basic_test.go @@ -15,6 +15,7 @@ package e2e import ( + "context" "encoding/json" "fmt" "net" @@ -380,7 +381,7 @@ func testReconcileGatewayRoutesOnStartup(t *testing.T, data *TestData, isIPv6 bo t.Logf("Retrieving gateway routes on Node '%s'", nodeName) var routes []Route - if err := wait.PollImmediate(defaultInterval, defaultTimeout, func() (found bool, err error) { + if err := wait.PollUntilContextTimeout(context.Background(), defaultInterval, defaultTimeout, true, func(ctx context.Context) (found bool, err error) { var llRoute *Route routes, _, llRoute, err = getGatewayRoutes(t, data, antreaGWName, nodeName, isIPv6) if err != nil { @@ -397,7 +398,7 @@ func testReconcileGatewayRoutesOnStartup(t *testing.T, data *TestData, isIPv6 bo return false, fmt.Errorf("IPv6 link-local route not found") } return true, nil - }); err == wait.ErrWaitTimeout { + }); wait.Interrupted(err) { t.Fatalf("Not enough gateway routes after %v", defaultTimeout) } else if err != nil { t.Fatalf("Error while waiting for gateway routes: %v", err) @@ -478,7 +479,7 @@ func testReconcileGatewayRoutesOnStartup(t *testing.T, data *TestData, isIPv6 bo // We expect the agent to delete the extra route we added and add back the route we deleted t.Logf("Waiting for gateway routes to converge") - if err := wait.Poll(defaultInterval, defaultTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), defaultInterval, defaultTimeout, false, func(ctx context.Context) (bool, error) { var llRoute *Route newRoutes, _, llRoute, err := getGatewayRoutes(t, data, antreaGWName, nodeName, isIPv6) if err != nil { @@ -509,7 +510,7 @@ func testReconcileGatewayRoutesOnStartup(t *testing.T, data *TestData, isIPv6 bo } // We haven't found the deleted route, keep trying return false, nil - }); err == wait.ErrWaitTimeout { + }); wait.Interrupted(err) { t.Errorf("Gateway routes did not converge after %v", defaultTimeout) } else if err != nil { t.Fatalf("Error while waiting for gateway routes to converge: %v", err) @@ -567,7 +568,7 @@ func testCleanStaleClusterIPRoutes(t *testing.T, data *TestData, isIPv6 bool) { t.Fatalf("Failed to detect gateway interface name from ConfigMap: %v", err) } var routes []Route - if err := wait.PollImmediate(defaultInterval, defaultTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), defaultInterval, defaultTimeout, true, func(ctx context.Context) (bool, error) { _, routes, _, err = getGatewayRoutes(t, data, antreaGWName, nodeName, isIPv6) if err != nil { t.Logf("Failed to get Service gateway routes: %v", err) @@ -739,7 +740,7 @@ func testDeletePreviousRoundFlowsOnStartup(t *testing.T, data *TestData) { waitForNextRoundNum := func(roundNum uint64) uint64 { var nextRoundNum uint64 - if err := wait.Poll(defaultInterval, defaultTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), defaultInterval, defaultTimeout, false, func(ctx context.Context) (bool, error) { nextRoundNum = roundNumber(podName) if nextRoundNum != roundNum { return true, nil @@ -814,7 +815,7 @@ func testDeletePreviousRoundFlowsOnStartup(t *testing.T, data *TestData) { // In theory there should be no need to poll here because the agent only persists the new // round number after stale flows have been deleted, but it is probably better not to make // this assumption in an e2e test. - if err := wait.PollImmediate(defaultInterval, smallTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), defaultInterval, smallTimeout, true, func(ctx context.Context) (bool, error) { return !checkFlow(), nil }); err != nil { @@ -880,7 +881,7 @@ func testClusterIdentity(t *testing.T, data *TestData) { const retryInterval = time.Second const timeout = 10 * time.Second var clusterUUID uuid.UUID - err := wait.PollImmediate(retryInterval, timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), retryInterval, timeout, true, func(ctx context.Context) (bool, error) { clusterIdentity, _, err := clusterIdentityProvider.Get() if err != nil { return false, nil diff --git a/test/e2e/batch_test.go b/test/e2e/batch_test.go index e076c300488..64d026e9e14 100644 --- a/test/e2e/batch_test.go +++ b/test/e2e/batch_test.go @@ -23,7 +23,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/wait" ) // TestBatchCreatePods verifies there is no FD leak after batched Pod creation. @@ -67,10 +66,8 @@ func TestBatchCreatePods(t *testing.T) { // reasons (health probes, CNI invocations, ...). In that case, the new set of FDs can // contain additional entries compared to the old set of FDs. However, eventually, getFDs() // should return a subset of oldFDs. - // Most of the time, wait.PollImmediate will return immediately, after the first call to the - // condition function. - assert.NoError(t, wait.PollImmediate(100*time.Millisecond, 2*time.Second, func() (bool, error) { + assert.Eventually(t, func() bool { newFDs := getFDs() - return oldFDs.IsSuperset(newFDs), nil - }), "Batched Pod creation allocated new FDs") + return oldFDs.IsSuperset(newFDs) + }, 2*time.Second, 100*time.Millisecond, "Batched Pod creation allocated new FDs") } diff --git a/test/e2e/connectivity_test.go b/test/e2e/connectivity_test.go index 2c081b60803..87df12205af 100644 --- a/test/e2e/connectivity_test.go +++ b/test/e2e/connectivity_test.go @@ -236,7 +236,7 @@ func createPodsOnDifferentNodes(t *testing.T, data *TestData, namespace, tag str return fmt.Errorf("error deleting DaemonSet") } // Wait for all Pods managed by DaemonSet to be deleted to avoid affecting following tests. - err := wait.Poll(defaultInterval, timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), defaultInterval, timeout, false, func(ctx context.Context) (bool, error) { pods, err := getDaemonSetPods() if err != nil { return false, fmt.Errorf("error getting Pods managed by DaemonSet") diff --git a/test/e2e/egress_test.go b/test/e2e/egress_test.go index fc674d1506d..d128598f778 100644 --- a/test/e2e/egress_test.go +++ b/test/e2e/egress_test.go @@ -167,13 +167,14 @@ func testEgressClientIP(t *testing.T, data *TestData) { assertClientIP(data, t, remotePod, toolboxContainerName, tt.serverIP, egressNodeIP) var err error - err = wait.Poll(time.Millisecond*100, time.Second, func() (bool, error) { - egress, err = data.crdClient.CrdV1beta1().Egresses().Get(context.TODO(), egress.Name, metav1.GetOptions{}) - if err != nil { - return false, err - } - return egress.Status.EgressNode == egressNode, nil - }) + err = wait.PollUntilContextTimeout(context.Background(), time.Millisecond*100, time.Second, false, + func(ctx context.Context) (bool, error) { + egress, err = data.crdClient.CrdV1beta1().Egresses().Get(context.TODO(), egress.Name, metav1.GetOptions{}) + if err != nil { + return false, err + } + return egress.Status.EgressNode == egressNode, nil + }) assert.NoError(t, err, "Egress failed to reach expected status") t.Log("Checking the client IP of a Pod whose Egress has been created in advance") @@ -313,7 +314,7 @@ func testEgressClientIPFromVLANSubnet(t *testing.T, data *TestData) { egress := data.createEgress(t, "egress-vlan", nil, map[string]string{"antrea-e2e": clientPod1}, pool.Name, "", nil) defer data.crdClient.CrdV1beta1().Egresses().Delete(context.TODO(), egress.Name, metav1.DeleteOptions{}) - err := wait.PollImmediate(500*time.Millisecond, 3*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), 500*time.Millisecond, 3*time.Second, true, func(ctx context.Context) (done bool, err error) { egress, err = data.crdClient.CrdV1beta1().Egresses().Get(context.TODO(), egress.Name, metav1.GetOptions{}) if err != nil { return false, err @@ -456,7 +457,7 @@ func testEgressCRUD(t *testing.T, data *TestData) { defer data.crdClient.CrdV1beta1().Egresses().Delete(context.TODO(), egress.Name, metav1.DeleteOptions{}) // Use Poll to wait the interval before the first run to detect the case that the IP is assigned to any Node // when it's not supposed to. - err := wait.Poll(500*time.Millisecond, 3*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), 500*time.Millisecond, 3*time.Second, false, func(ctx context.Context) (done bool, err error) { egress, err = data.crdClient.CrdV1beta1().Egresses().Get(context.TODO(), egress.Name, metav1.GetOptions{}) if err != nil { return false, err @@ -495,20 +496,21 @@ func testEgressCRUD(t *testing.T, data *TestData) { checkEIPStatus := func(expectedUsed int) { var gotUsed, gotTotal int - err := wait.PollImmediate(200*time.Millisecond, 2*time.Second, func() (done bool, err error) { - pool, err := data.crdClient.CrdV1beta1().ExternalIPPools().Get(context.TODO(), pool.Name, metav1.GetOptions{}) - if err != nil { - return false, fmt.Errorf("failed to get ExternalIPPool: %v", err) - } - gotUsed, gotTotal = pool.Status.Usage.Used, pool.Status.Usage.Total - if expectedUsed != pool.Status.Usage.Used { - return false, nil - } - if tt.expectedTotal != pool.Status.Usage.Total { - return false, nil - } - return true, nil - }) + err := wait.PollUntilContextTimeout(context.Background(), 200*time.Millisecond, 2*time.Second, true, + func(ctx context.Context) (done bool, err error) { + pool, err := data.crdClient.CrdV1beta1().ExternalIPPools().Get(context.TODO(), pool.Name, metav1.GetOptions{}) + if err != nil { + return false, fmt.Errorf("failed to get ExternalIPPool: %v", err) + } + gotUsed, gotTotal = pool.Status.Usage.Used, pool.Status.Usage.Total + if expectedUsed != pool.Status.Usage.Used { + return false, nil + } + if tt.expectedTotal != pool.Status.Usage.Total { + return false, nil + } + return true, nil + }) require.NoError(t, err, "ExternalIPPool status not match: expectedTotal=%d, got=%d, expectedUsed=%d, got=%d", tt.expectedTotal, gotTotal, expectedUsed, gotUsed) } checkEIPStatus(1) @@ -516,13 +518,14 @@ func testEgressCRUD(t *testing.T, data *TestData) { err = data.crdClient.CrdV1beta1().Egresses().Delete(context.TODO(), egress.Name, metav1.DeleteOptions{}) require.NoError(t, err, "Failed to delete Egress") if egress.Status.EgressNode != "" { - err := wait.PollImmediate(200*time.Millisecond, timeout, func() (done bool, err error) { - exists, err := hasIP(data, egress.Status.EgressNode, egress.Spec.EgressIP) - if err != nil { - return false, fmt.Errorf("check ip error: %v", err) - } - return !exists, nil - }) + err := wait.PollUntilContextTimeout(context.Background(), 200*time.Millisecond, timeout, true, + func(ctx context.Context) (done bool, err error) { + exists, err := hasIP(data, egress.Status.EgressNode, egress.Spec.EgressIP) + if err != nil { + return false, fmt.Errorf("check ip error: %v", err) + } + return !exists, nil + }) require.NoError(t, err, "Found stale IP (%s) exists on Node (%s)", egress.Spec.EgressIP, egress.Status.EgressNode) } checkEIPStatus(0) @@ -600,13 +603,14 @@ func testEgressUpdateEgressIP(t *testing.T, data *TestData) { _, err = data.checkEgressState(egress.Name, tt.newEgressIP, tt.newNode, "", time.Second) require.NoError(t, err) - err = wait.PollImmediate(200*time.Millisecond, timeout, func() (done bool, err error) { - exists, err := hasIP(data, tt.originalNode, tt.originalEgressIP) - if err != nil { - return false, fmt.Errorf("check ip error: %v", err) - } - return !exists, nil - }) + err = wait.PollUntilContextTimeout(context.Background(), 200*time.Millisecond, timeout, true, + func(ctx context.Context) (done bool, err error) { + exists, err := hasIP(data, tt.originalNode, tt.originalEgressIP) + if err != nil { + return false, fmt.Errorf("check ip error: %v", err) + } + return !exists, nil + }) require.NoError(t, err, "Found stale IP (%s) exists on Node (%s)", tt.originalEgressIP, tt.originalNode) }) } @@ -831,7 +835,7 @@ func testEgressUpdateBandwidth(t *testing.T, data *TestData) { func (data *TestData) checkEgressState(egressName, expectedIP, expectedNode, otherNode string, timeout time.Duration) (*v1beta1.Egress, error) { var egress *v1beta1.Egress var expectedNodeHasIP, otherNodeHasIP bool - pollErr := wait.PollImmediate(200*time.Millisecond, timeout, func() (bool, error) { + pollErr := wait.PollUntilContextTimeout(context.Background(), 200*time.Millisecond, timeout, true, func(ctx context.Context) (bool, error) { var err error egress, err = data.crdClient.CrdV1beta1().Egresses().Get(context.TODO(), egressName, metav1.GetOptions{}) if err != nil { @@ -976,16 +980,17 @@ func (data *TestData) createEgress(t *testing.T, generateName string, matchExpre } func (data *TestData) waitForEgressRealized(egress *v1beta1.Egress) (*v1beta1.Egress, error) { - err := wait.PollImmediate(200*time.Millisecond, waitEgressRealizedTimeout, func() (done bool, err error) { - egress, err = data.crdClient.CrdV1beta1().Egresses().Get(context.TODO(), egress.Name, metav1.GetOptions{}) - if err != nil { - return false, err - } - if egress.Spec.EgressIP == "" || egress.Status.EgressNode == "" { - return false, nil - } - return true, nil - }) + err := wait.PollUntilContextTimeout(context.Background(), 200*time.Millisecond, waitEgressRealizedTimeout, true, + func(ctx context.Context) (done bool, err error) { + egress, err = data.crdClient.CrdV1beta1().Egresses().Get(context.TODO(), egress.Name, metav1.GetOptions{}) + if err != nil { + return false, err + } + if egress.Spec.EgressIP == "" || egress.Status.EgressNode == "" { + return false, nil + } + return true, nil + }) if err != nil { return nil, fmt.Errorf("wait for Egress %#v realized failed: %v", egress, err) } @@ -996,7 +1001,7 @@ func (data *TestData) waitForEgressRealized(egress *v1beta1.Egress) (*v1beta1.Eg func assertClientIP(data *TestData, t *testing.T, pod, container, serverIP string, clientIPs ...string) { var exeErr error var stdout, stderr string - err := wait.Poll(100*time.Millisecond, 5*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 5*time.Second, false, func(ctx context.Context) (done bool, err error) { url := getHTTPURLFromIPPort(serverIP, 8080, "clientip") stdout, stderr, exeErr = data.runWgetCommandFromTestPodWithRetry(pod, data.testNamespace, container, url, 5) if exeErr != nil { @@ -1022,14 +1027,15 @@ func assertClientIP(data *TestData, t *testing.T, pod, container, serverIP strin func assertConnError(data *TestData, t *testing.T, pod, container, serverIP string) { var exeErr error var stdout, stderr string - err := wait.Poll(100*time.Millisecond, 2*time.Second, func() (done bool, err error) { - url := getHTTPURLFromIPPort(serverIP, 8080, "clientip") - stdout, stderr, exeErr = data.runWgetCommandFromTestPodWithRetry(pod, data.testNamespace, url, container, 5) - if exeErr != nil { - return true, nil - } - return false, nil - }) + err := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 2*time.Second, false, + func(ctx context.Context) (done bool, err error) { + url := getHTTPURLFromIPPort(serverIP, 8080, "clientip") + stdout, stderr, exeErr = data.runWgetCommandFromTestPodWithRetry(pod, data.testNamespace, url, container, 5) + if exeErr != nil { + return true, nil + } + return false, nil + }) require.NoError(t, err, "Failed to get expected error, stdout: %v, stderr: %v, err: %v", stdout, stderr, exeErr) } diff --git a/test/e2e/flowaggregator_test.go b/test/e2e/flowaggregator_test.go index 848b739b401..5c17f98067e 100644 --- a/test/e2e/flowaggregator_test.go +++ b/test/e2e/flowaggregator_test.go @@ -1437,7 +1437,7 @@ func getCollectorOutput(t *testing.T, srcIP, dstIP, srcPort string, isDstService var recordSlices []string // In the ToExternalFlows test, flow record will arrive 5.5s (exporterActiveFlowExportTimeout+aggregatorActiveFlowRecordTimeout) after executing wget command // We set the timeout to 9s (5.5s plus one more aggregatorActiveFlowRecordTimeout) to make the ToExternalFlows test more stable - err := wait.PollImmediate(500*time.Millisecond, exporterActiveFlowExportTimeout+aggregatorActiveFlowRecordTimeout*2, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), 500*time.Millisecond, exporterActiveFlowExportTimeout+aggregatorActiveFlowRecordTimeout*2, true, func(ctx context.Context) (bool, error) { var rc int var err error var cmd string @@ -1499,7 +1499,7 @@ func getClickHouseOutput(t *testing.T, data *TestData, srcIP, dstIP, srcPort str } // ClickHouse output expected to be checked after IPFIX collector. // Waiting additional 4x commit interval to be adequate for 3 commit attempts. - err := wait.PollImmediate(500*time.Millisecond, aggregatorClickHouseCommitInterval*4, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), 500*time.Millisecond, aggregatorClickHouseCommitInterval*4, true, func(ctx context.Context) (bool, error) { queryOutput, _, err := data.RunCommandFromPod(flowVisibilityNamespace, clickHousePodName, "clickhouse", cmd) if err != nil { return false, err @@ -1791,7 +1791,7 @@ func addLabelToTestPods(t *testing.T, data *TestData, label string, podNames []s testPod.Labels["targetLabel"] = label _, err = data.clientset.CoreV1().Pods(data.testNamespace).Update(context.TODO(), testPod, metav1.UpdateOptions{}) require.NoErrorf(t, err, "Error when adding label to %s", testPod.Name) - err = wait.Poll(defaultInterval, timeout, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), defaultInterval, timeout, false, func(ctx context.Context) (bool, error) { pod, err := data.clientset.CoreV1().Pods(data.testNamespace).Get(context.TODO(), testPod.Name, metav1.GetOptions{}) if err != nil { if errors.IsNotFound(err) { @@ -1863,7 +1863,7 @@ func getAndCheckFlowAggregatorMetrics(t *testing.T, data *TestData) error { } podName := flowAggPod.Name command := []string{"antctl", "get", "recordmetrics", "-o", "json"} - if err := wait.Poll(defaultInterval, 2*defaultTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), defaultInterval, 2*defaultTimeout, false, func(ctx context.Context) (bool, error) { stdout, _, err := runAntctl(podName, command, data) if err != nil { t.Logf("Error when requesting recordmetrics, %v", err) diff --git a/test/e2e/framework.go b/test/e2e/framework.go index 4ec22253ca3..c3a5a342318 100644 --- a/test/e2e/framework.go +++ b/test/e2e/framework.go @@ -53,7 +53,7 @@ import ( aggregatorclientset "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" "k8s.io/kubectl/pkg/util/podutils" utilnet "k8s.io/utils/net" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" "antrea.io/antrea/pkg/agent/config" crdclientset "antrea.io/antrea/pkg/client/clientset/versioned" @@ -801,7 +801,7 @@ func (data *TestData) DeleteNamespace(namespace string, timeout time.Duration) e return fmt.Errorf("error when deleting '%s' Namespace: %v", namespace, err) } if timeout >= 0 { - return wait.Poll(defaultInterval, timeout, func() (bool, error) { + return wait.PollUntilContextTimeout(context.TODO(), defaultInterval, timeout, false, func(ctx context.Context) (bool, error) { if ns, err := data.clientset.CoreV1().Namespaces().Get(context.TODO(), namespace, metav1.GetOptions{}); err != nil { if errors.IsNotFound(err) { // Success @@ -865,7 +865,7 @@ func (data *TestData) deployFlowVisibilityClickHouse(o flowVisibilityTestOptions if err != nil || rc != 0 { return "", fmt.Errorf("error when deploying the ClickHouse Operator YML; %s not available on the control-plane Node", chOperatorYML) } - if err := wait.Poll(2*time.Second, 10*time.Second, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.TODO(), 2*time.Second, 10*time.Second, false, func(ctx context.Context) (bool, error) { rc, stdout, stderr, err := data.provider.RunCommandOnNode(controlPlaneNodeName(), fmt.Sprintf("kubectl apply -f %s", visibilityYML)) if err != nil || rc != 0 { // ClickHouseInstallation CRD from ClickHouse Operator install bundle applied soon before @@ -888,7 +888,7 @@ func (data *TestData) deployFlowVisibilityClickHouse(o flowVisibilityTestOptions // check clickhouse service http port for service connectivity var chSvc *corev1.Service - if err := wait.PollImmediate(defaultInterval, defaultTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.TODO(), defaultInterval, defaultTimeout, true, func(ctx context.Context) (bool, error) { chSvc, err = data.GetService(flowVisibilityNamespace, "clickhouse-clickhouse") if err != nil { return false, nil @@ -899,7 +899,7 @@ func (data *TestData) deployFlowVisibilityClickHouse(o flowVisibilityTestOptions return "", fmt.Errorf("timeout waiting for ClickHouse Service: %v", err) } - if err := wait.PollImmediate(defaultInterval, defaultTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.TODO(), defaultInterval, defaultTimeout, true, func(ctx context.Context) (bool, error) { rc, stdout, stderr, err := testData.RunCommandOnNode(controlPlaneNodeName(), fmt.Sprintf("curl -Ss %s:%s", chSvc.Spec.ClusterIP, clickHouseHTTPPort)) if rc != 0 || err != nil { @@ -1075,7 +1075,7 @@ func (data *TestData) getAgentContainersRestartCount() (int, error) { // waitForAntreaDaemonSetPods waits for the K8s apiserver to report that all the Antrea Pods are // available, i.e. all the Nodes have one or more of the Antrea daemon Pod running and available. func (data *TestData) waitForAntreaDaemonSetPods(timeout time.Duration) error { - err := wait.Poll(defaultInterval, timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.TODO(), defaultInterval, timeout, false, func(ctx context.Context) (bool, error) { getDS := func(dsName string, os string) (*appsv1.DaemonSet, error) { ds, err := data.clientset.AppsV1().DaemonSets(antreaNamespace).Get(context.TODO(), dsName, metav1.GetOptions{}) if err != nil { @@ -1126,7 +1126,7 @@ func (data *TestData) waitForAntreaDaemonSetPods(timeout time.Duration) error { } return true, nil }) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { _, stdout, _, _ := data.provider.RunCommandOnNode(controlPlaneNodeName(), fmt.Sprintf("kubectl -n %s describe pod", antreaNamespace)) return fmt.Errorf("antrea-agent DaemonSet not ready within %v; kubectl describe pod output: %v", defaultTimeout, stdout) } else if err != nil { @@ -1138,7 +1138,7 @@ func (data *TestData) waitForAntreaDaemonSetPods(timeout time.Duration) error { // waitForCoreDNSPods waits for the K8s apiserver to report that all the CoreDNS Pods are available. func (data *TestData) waitForCoreDNSPods(timeout time.Duration) error { - err := wait.PollImmediate(defaultInterval, timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.TODO(), defaultInterval, timeout, true, func(ctx context.Context) (bool, error) { deployment, err := data.clientset.AppsV1().Deployments("kube-system").Get(context.TODO(), "coredns", metav1.GetOptions{}) if err != nil { return false, fmt.Errorf("error when retrieving CoreDNS deployment: %v", err) @@ -1149,7 +1149,7 @@ func (data *TestData) waitForCoreDNSPods(timeout time.Duration) error { // Keep trying return false, nil }) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { return fmt.Errorf("some CoreDNS replicas are still unavailable after %v", defaultTimeout) } else if err != nil { return err @@ -1240,7 +1240,7 @@ func (data *TestData) deleteAntrea(timeout time.Duration) error { } return fmt.Errorf("error when trying to delete Antrea DaemonSet: %v", err) } - err := wait.Poll(defaultInterval, timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.TODO(), defaultInterval, timeout, false, func(ctx context.Context) (bool, error) { if _, err := data.clientset.AppsV1().DaemonSets(antreaNamespace).Get(context.TODO(), ds, metav1.GetOptions{}); err != nil { if errors.IsNotFound(err) { // Antrea DaemonSet does not exist any more, success @@ -1448,7 +1448,7 @@ func (b *PodBuilder) Create(data *TestData) error { HostNetwork: b.HostNetwork, ServiceAccountName: b.ServiceAccountName, // Set it to 1s for immediate shutdown to reduce test run time and to avoid affecting subsequent tests. - TerminationGracePeriodSeconds: pointer.Int64(1), + TerminationGracePeriodSeconds: ptr.To[int64](1), } if b.NodeName != "" { podSpec.NodeSelector = map[string]string{ @@ -1579,7 +1579,7 @@ func (data *TestData) DeletePodAndWait(timeout time.Duration, name string, ns st if err := data.DeletePod(ns, name); err != nil { return err } - err := wait.Poll(defaultInterval, timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.TODO(), defaultInterval, timeout, false, func(ctx context.Context) (bool, error) { if _, err := data.clientset.CoreV1().Pods(ns).Get(context.TODO(), name, metav1.GetOptions{}); err != nil { if errors.IsNotFound(err) { return true, nil @@ -1589,7 +1589,7 @@ func (data *TestData) DeletePodAndWait(timeout time.Duration, name string, ns st // Keep trying return false, nil }) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { return fmt.Errorf("Pod '%s' still visible to client after %v", name, timeout) } return err @@ -1601,7 +1601,7 @@ type PodCondition func(*corev1.Pod) (bool, error) // the condition predicate is met (or until the provided timeout expires). func (data *TestData) PodWaitFor(timeout time.Duration, name, namespace string, condition PodCondition) (*corev1.Pod, error) { var pod *corev1.Pod - err := wait.Poll(defaultInterval, timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.TODO(), defaultInterval, timeout, false, func(ctx context.Context) (bool, error) { var err error pod, err = data.clientset.CoreV1().Pods(namespace).Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { @@ -1613,7 +1613,7 @@ func (data *TestData) PodWaitFor(timeout time.Duration, name, namespace string, return condition(pod) }) if err != nil { - if err == wait.ErrWaitTimeout && pod != nil { + if wait.Interrupted(err) && pod != nil { return nil, fmt.Errorf("timed out waiting for the condition, Pod.Status: %s", pod.Status.String()) } return nil, err @@ -1743,7 +1743,7 @@ func (data *TestData) deleteAntreaAgentOnNode(nodeName string, gracePeriodSecond return 0, fmt.Errorf("error when deleting antrea-agent Pods on Node '%s': %v", nodeName, err) } - if err := wait.Poll(defaultInterval, timeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.TODO(), defaultInterval, timeout, false, func(ctx context.Context) (bool, error) { for _, pod := range pods.Items { if _, err := data.clientset.CoreV1().Pods(antreaNamespace).Get(context.TODO(), pod.Name, metav1.GetOptions{}); err != nil { if errors.IsNotFound(err) { @@ -1762,7 +1762,7 @@ func (data *TestData) deleteAntreaAgentOnNode(nodeName string, gracePeriodSecond delay := time.Since(start) // wait for new antrea-agent Pod - if err := wait.Poll(defaultInterval, timeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.TODO(), defaultInterval, timeout, false, func(ctx context.Context) (bool, error) { pods, err := data.clientset.CoreV1().Pods(antreaNamespace).List(context.TODO(), listOptions) if err != nil { return false, fmt.Errorf("failed to list antrea-agent Pods on Node '%s': %v", nodeName, err) @@ -1857,7 +1857,7 @@ func (data *TestData) restartAntreaControllerPod(timeout time.Duration) (*corev1 var newPod *corev1.Pod // wait for new antrea-controller Pod - if err := wait.Poll(defaultInterval, timeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.TODO(), defaultInterval, timeout, false, func(ctx context.Context) (bool, error) { pods, err := data.clientset.CoreV1().Pods(antreaNamespace).List(context.TODO(), listOptions) if err != nil { return false, fmt.Errorf("failed to list antrea-controller Pods: %v", err) @@ -2075,7 +2075,7 @@ func (data *TestData) deleteServiceAndWait(timeout time.Duration, name, namespac if err := data.deleteService(namespace, name); err != nil { return err } - err := wait.Poll(defaultInterval, timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.TODO(), defaultInterval, timeout, false, func(ctx context.Context) (bool, error) { if _, err := data.clientset.CoreV1().Services(namespace).Get(context.TODO(), name, metav1.GetOptions{}); err != nil { if errors.IsNotFound(err) { return true, nil @@ -2085,7 +2085,7 @@ func (data *TestData) deleteServiceAndWait(timeout time.Duration, name, namespac // Keep trying return false, nil }) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { return fmt.Errorf("Service '%s' still visible to client after %v", name, timeout) } return err @@ -2660,7 +2660,7 @@ func (data *TestData) killProcessAndCollectCovFiles(namespace, podName, containe } log.Infof("Copying coverage files from Pod '%s'", podName) - if err := wait.PollImmediate(1*time.Second, 5*time.Second, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.TODO(), 1*time.Second, 5*time.Second, true, func(ctx context.Context) (bool, error) { if err = data.copyPodFiles(podName, containerName, namespace, covFile, covDir); err != nil { log.Infof("Coverage file not available yet for copy: %v", err) return false, nil @@ -2863,7 +2863,7 @@ func (data *TestData) createDaemonSet(name string, ns string, ctrName string, im podSpec := corev1.PodSpec{ Tolerations: controlPlaneNoScheduleTolerations(), // Set it to 1s for immediate shutdown to reduce test run time and to avoid affecting subsequent tests. - TerminationGracePeriodSeconds: pointer.Int64(1), + TerminationGracePeriodSeconds: ptr.To[int64](1), Containers: []corev1.Container{ { Name: ctrName, @@ -2917,7 +2917,7 @@ func (data *TestData) createDaemonSet(name string, ns string, ctrName string, im } func (data *TestData) waitForDaemonSetPods(timeout time.Duration, dsName string, namespace string) error { - err := wait.Poll(defaultInterval, timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.TODO(), defaultInterval, timeout, false, func(ctx context.Context) (bool, error) { ds, err := data.clientset.AppsV1().DaemonSets(namespace).Get(context.TODO(), dsName, metav1.GetOptions{}) if err != nil { return false, err @@ -2946,7 +2946,7 @@ func (data *TestData) createStatefulSet(name string, ns string, size int32, ctrN }, }, // Set it to 1s for immediate shutdown to reduce test run time and to avoid affecting subsequent tests. - TerminationGracePeriodSeconds: pointer.Int64(1), + TerminationGracePeriodSeconds: ptr.To[int64](1), } stsSpec := appsv1.StatefulSetSpec{ Selector: &metav1.LabelSelector{ @@ -3019,7 +3019,7 @@ func (data *TestData) restartStatefulSet(name string, ns string) (*appsv1.Statef } func (data *TestData) waitForStatefulSetPods(timeout time.Duration, stsName string, namespace string) error { - err := wait.Poll(defaultInterval, timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.TODO(), defaultInterval, timeout, false, func(ctx context.Context) (bool, error) { sts, err := data.clientset.AppsV1().StatefulSets(namespace).Get(context.TODO(), stsName, metav1.GetOptions{}) if err != nil { return false, err @@ -3046,7 +3046,7 @@ func retryOnConnectionLostError(backoff wait.Backoff, fn func() error) error { } func (data *TestData) checkAntreaAgentInfo(interval time.Duration, timeout time.Duration, name string) error { - err := wait.PollImmediate(interval, timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.TODO(), interval, timeout, true, func(ctx context.Context) (bool, error) { aai, err := data.crdClient.CrdV1beta1().AntreaAgentInfos().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { if errors.IsNotFound(err) { diff --git a/test/e2e/ipsec_test.go b/test/e2e/ipsec_test.go index 417a6e382a5..b972f18ecdf 100644 --- a/test/e2e/ipsec_test.go +++ b/test/e2e/ipsec_test.go @@ -15,6 +15,7 @@ package e2e import ( + "context" "fmt" "regexp" "strconv" @@ -180,9 +181,9 @@ func testIPSecDeleteStaleTunnelPorts(t *testing.T, data *TestData) { } t.Logf("Checking that tunnel port has been created") - if err := wait.PollImmediate(defaultInterval, defaultTimeout, func() (found bool, err error) { + if err := wait.PollUntilContextTimeout(context.Background(), defaultInterval, defaultTimeout, true, func(ctx context.Context) (found bool, err error) { return doesOVSPortExist(), nil - }); err == wait.ErrWaitTimeout { + }); wait.Interrupted(err) { t.Fatalf("Timed out while waiting for OVS tunnel port to be created") } else if err != nil { t.Fatalf("Error while waiting for OVS tunnel port to be created") @@ -192,9 +193,9 @@ func testIPSecDeleteStaleTunnelPorts(t *testing.T, data *TestData) { data.redeployAntrea(t, deployAntreaDefault) t.Logf("Checking that tunnel port has been deleted") - if err := wait.PollImmediate(defaultInterval, defaultTimeout, func() (found bool, err error) { + if err := wait.PollUntilContextTimeout(context.Background(), defaultInterval, defaultTimeout, true, func(ctx context.Context) (found bool, err error) { return !doesOVSPortExist(), nil - }); err == wait.ErrWaitTimeout { + }); wait.Interrupted(err) { t.Fatalf("Timed out while waiting for OVS tunnel port to be deleted") } else if err != nil { t.Fatalf("Error while waiting for OVS tunnel port to be deleted") diff --git a/test/e2e/k8s_util.go b/test/e2e/k8s_util.go index ef0720afc6d..c4c36d12415 100644 --- a/test/e2e/k8s_util.go +++ b/test/e2e/k8s_util.go @@ -938,7 +938,7 @@ func (data *TestData) CleanANNPs(namespaces []string) error { func (data *TestData) WaitForANNPCreationAndRealization(t *testing.T, namespace string, name string, timeout time.Duration) error { t.Logf("Waiting for ANNP '%s/%s' to be realized", namespace, name) - if err := wait.Poll(100*time.Millisecond, timeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.TODO(), 100*time.Millisecond, timeout, false, func(ctx context.Context) (bool, error) { annp, err := data.crdClient.CrdV1beta1().NetworkPolicies(namespace).Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return false, nil @@ -952,7 +952,7 @@ func (data *TestData) WaitForANNPCreationAndRealization(t *testing.T, namespace func (data *TestData) WaitForACNPCreationAndRealization(t *testing.T, name string, timeout time.Duration) error { t.Logf("Waiting for ACNP '%s' to be created and realized", name) - if err := wait.Poll(100*time.Millisecond, timeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.TODO(), 100*time.Millisecond, timeout, false, func(ctx context.Context) (bool, error) { acnp, err := data.crdClient.CrdV1beta1().ClusterNetworkPolicies().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return false, nil diff --git a/test/e2e/l7networkpolicy_test.go b/test/e2e/l7networkpolicy_test.go index 378834c80f5..730a968070f 100644 --- a/test/e2e/l7networkpolicy_test.go +++ b/test/e2e/l7networkpolicy_test.go @@ -25,7 +25,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/wait" crdv1beta1 "antrea.io/antrea/pkg/apis/crd/v1beta1" agentconfig "antrea.io/antrea/pkg/config/agent" @@ -129,59 +128,59 @@ func probeL7NetworkPolicyHTTP(t *testing.T, data *TestData, serverPodName, clien baseURL := net.JoinHostPort(ip.String(), "8080") // Verify that access to path /clientip is as expected. - assert.NoError(t, wait.PollImmediate(time.Second, 5*time.Second, func() (bool, error) { + assert.Eventually(t, func() bool { _, err := probeClientIPFromPod(data, clientPodName, agnhostContainerName, baseURL) if (allowHTTPPathClientIP && err != nil) || (!allowHTTPPathClientIP && err == nil) { - return false, nil + return false } - return true, nil - })) + return true + }, 5*time.Second, time.Second) // Verify that access to path /hostname is as expected. - assert.NoError(t, wait.PollImmediate(time.Second, 5*time.Second, func() (bool, error) { + assert.Eventually(t, func() bool { hostname, err := probeHostnameFromPod(data, clientPodName, agnhostContainerName, baseURL) if (allowHTTPPathHostname && err != nil) || (!allowHTTPPathHostname && err == nil) { - return false, nil + return false } if allowHTTPPathHostname && serverPodName != hostname { - return false, nil + return false } - return true, nil - })) + return true + }, 5*time.Second, time.Second) // For IPv4, non-HTTP connections should be rejected by Suricata. For IPv6, there is an issue that reject // packet cannot be generated by Suricata and sent back to client. if ip.To4() != nil { cmd := []string{"bash", "-c", fmt.Sprintf("dig @%s google.com a +tcp -p 8080", ip)} - assert.NoError(t, wait.PollImmediate(time.Second, 5*time.Second, func() (bool, error) { + assert.Eventually(t, func() bool { stdout, _, err := data.RunCommandFromPod(data.testNamespace, clientPodName, agnhostContainerName, cmd) // For the client Pod which is selected by the L7 NetworkPolicy, the expected output returned // from Suricata should contain "connection reset". if err != nil { - return false, nil + return false } if !strings.Contains(stdout, fmt.Sprintf("communications error to %s#8080: connection reset", ip)) { - return false, nil + return false } - return true, nil - })) + return true + }, 5*time.Second, time.Second) } } } func probeL7NetworkPolicyTLS(t *testing.T, data *TestData, clientPodName string, serverName string, canAccess bool) { url := fmt.Sprintf("https://%s", serverName) - assert.NoError(t, wait.PollImmediate(time.Second, 5*time.Second, func() (bool, error) { + assert.Eventually(t, func() bool { stdout, stderr, err := data.runWgetCommandFromTestPodWithRetry(clientPodName, data.testNamespace, agnhostContainerName, url, 5) if canAccess && err != nil { t.Logf("Failed to access %s: %v\nStdout: %s\nStderr: %s\n", url, err, stdout, stderr) - return false, err + return false } else if !canAccess && err == nil { t.Logf("Expected not to access the server, but the request succeeded.\nStdout: %s\nStderr: %s\n", stdout, stderr) - return false, fmt.Errorf("expected not to access the server %s, but the request succeeded", url) + return false } - return true, nil - })) + return true + }, 5*time.Second, time.Second) } func testL7NetworkPolicyHTTP(t *testing.T, data *TestData) { diff --git a/test/e2e/multicast_test.go b/test/e2e/multicast_test.go index 72f6bcf8666..8134467a4d7 100644 --- a/test/e2e/multicast_test.go +++ b/test/e2e/multicast_test.go @@ -465,7 +465,7 @@ func testMulticastStatsWithSendersReceivers(t *testing.T, data *TestData, testNa } wg.Wait() - if err := wait.Poll(5*time.Second, defaultTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 5*time.Second, defaultTimeout, false, func(ctx context.Context) (bool, error) { for _, senderConfig := range mc.senderConfigs { stats := mc.antctlResults[senderConfig.name] t.Logf("Checking antctl get podmulticaststats result for %s", senderConfig.name) @@ -571,7 +571,7 @@ func testMulticastForwardToMultipleInterfaces(t *testing.T, data *TestData, send data.RunCommandFromPod(data.testNamespace, senderName, mcjoinContainerName, sendMulticastCommand) }() - if err := wait.Poll(5*time.Second, defaultTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 5*time.Second, defaultTimeout, false, func(ctx context.Context) (bool, error) { // Check whether multicast interfaces can receive multicast traffic in the server side. // The check is needed for verifying external interfaces acting as multicast interfaces are able to forward multicast traffic. // If multicast traffic is sent from non-HostNetwork pods, all multicast interfaces in senders should receive multicast traffic. @@ -644,7 +644,7 @@ func runTestMulticastBetweenPods(t *testing.T, data *TestData, mc multicastTestc readyReceivers := sets.New[int]() senderReady := false - if err := wait.Poll(3*time.Second, defaultTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 3*time.Second, defaultTimeout, false, func(ctx context.Context) (bool, error) { if checkSenderRoute && !senderReady { // Sender pods should add an outbound multicast route except when running as HostNetwork. mRoutesResult, err := getMroutes(nodeName(mc.senderConfig.nodeIdx), gatewayInterface, mc.group.String(), strings.Join(nodeMulticastInterfaces[mc.senderConfig.nodeIdx], " ")) diff --git a/test/e2e/networkpolicy_test.go b/test/e2e/networkpolicy_test.go index 24995915d26..1a5e3199752 100644 --- a/test/e2e/networkpolicy_test.go +++ b/test/e2e/networkpolicy_test.go @@ -193,7 +193,7 @@ func testNetworkPolicyStats(t *testing.T, data *TestData) { totalSessions += sessionsPerAddressFamily } - if err := wait.Poll(5*time.Second, defaultTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 5*time.Second, defaultTimeout, false, func(ctx context.Context) (bool, error) { var ingressStats *v1alpha1.NetworkPolicyStats for _, np := range []string{"test-networkpolicy-ingress", "test-networkpolicy-egress"} { stats, err := data.crdClient.StatsV1alpha1().NetworkPolicyStats(data.testNamespace).Get(context.TODO(), np, metav1.GetOptions{}) @@ -1133,7 +1133,7 @@ func createAndWaitForPodWithLabels(t *testing.T, data *TestData, createFunc func } func waitForAgentCondition(t *testing.T, data *TestData, podName string, conditionType v1beta1.AgentConditionType, expectedStatus corev1.ConditionStatus) { - if err := wait.Poll(defaultInterval, defaultTimeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), defaultInterval, defaultTimeout, false, func(ctx context.Context) (bool, error) { cmds := []string{"antctl", "get", "agentinfo", "-o", "json"} t.Logf("cmds: %s", cmds) diff --git a/test/e2e/nodeportlocal_test.go b/test/e2e/nodeportlocal_test.go index 3a95ed3bf96..6aa801c38c9 100644 --- a/test/e2e/nodeportlocal_test.go +++ b/test/e2e/nodeportlocal_test.go @@ -16,6 +16,7 @@ package e2e import ( "bufio" + "context" "encoding/json" "fmt" "regexp" @@ -207,7 +208,7 @@ func checkForNPLRuleInIPTables(t *testing.T, data *TestData, r *require.Assertio cmd := []string{"iptables", "-t", "nat", "-S"} t.Logf("Verifying iptables rules %v, present: %v", rules, present) const timeout = 60 * time.Second - err := wait.Poll(time.Second, timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second, timeout, false, func(ctx context.Context) (bool, error) { stdout, _, err := data.RunCommandFromPod(antreaNamespace, antreaPod, agentContainerName, cmd) if err != nil { t.Logf("Error while checking rules in iptables: %v", err) @@ -251,7 +252,7 @@ func checkForNPLRuleInNetNat(t *testing.T, data *TestData, r *require.Assertions defaultnodeIP := "0.0.0.0" t.Logf("Verifying NetNat rules %v, present: %v", rules, present) const timeout = 60 * time.Second - err := wait.Poll(time.Second, timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second, timeout, false, func(ctx context.Context) (bool, error) { _, _, _, err := data.RunCommandOnNode(nodeName, "Get-NetNatStaticMapping") if err != nil { t.Logf("Error while checking NPL rules on Windows Node: %v", err) @@ -294,7 +295,7 @@ func checkForNPLRuleInNetNat(t *testing.T, data *TestData, r *require.Assertions func checkForNPLListeningSockets(t *testing.T, data *TestData, r *require.Assertions, antreaPod string, rules []nplRuleData, present bool) { t.Logf("Verifying NPL listening sockets") const timeout = 30 * time.Second - err := wait.Poll(time.Second, timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second, timeout, false, func(ctx context.Context) (bool, error) { for _, rule := range rules { protocolOption := "--" + rule.protocol cmd := []string{"ss", "--listening", protocolOption, "-H", "-n"} diff --git a/test/e2e/performance_test.go b/test/e2e/performance_test.go index 947fe2395ac..da64de14754 100644 --- a/test/e2e/performance_test.go +++ b/test/e2e/performance_test.go @@ -278,7 +278,7 @@ func networkPolicyRealize(policyRules int, data *TestData, b *testing.B) { } func WaitNetworkPolicyRealize(nodeName string, table *openflow.Table, policyRules int, data *TestData) error { - return wait.PollImmediate(50*time.Millisecond, *realizeTimeout, func() (bool, error) { + return wait.PollUntilContextTimeout(context.Background(), 50*time.Millisecond, *realizeTimeout, true, func(ctx context.Context) (bool, error) { return checkRealize(nodeName, table, policyRules, data) }) } diff --git a/test/e2e/prometheus_test.go b/test/e2e/prometheus_test.go index 577826bb960..bb607700c96 100644 --- a/test/e2e/prometheus_test.go +++ b/test/e2e/prometheus_test.go @@ -143,7 +143,7 @@ func getMetricsFromAPIServer(t *testing.T, url string, token string) string { } var body []byte - err = wait.PollImmediate(defaultInterval, defaultTimeout, func() (bool, error) { + err = wait.PollUntilContextTimeout(context.Background(), defaultInterval, defaultTimeout, true, func(ctx context.Context) (bool, error) { // Query metrics via HTTPS from Pod resp, err := client.Do(req) if err != nil { @@ -285,7 +285,7 @@ func testMetricsFromPrometheusServer(t *testing.T, data *TestData, prometheusJob client := &http.Client{} var output prometheusServerOutput - err := wait.PollImmediate(defaultInterval, defaultTimeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), defaultInterval, defaultTimeout, true, func(ctx context.Context) (bool, error) { resp, err := client.Get(queryURL) if err != nil { // Retry when accessing prometheus failed for flexible-ipam diff --git a/test/e2e/security_test.go b/test/e2e/security_test.go index 9401e5e4905..b8adff2a570 100644 --- a/test/e2e/security_test.go +++ b/test/e2e/security_test.go @@ -166,7 +166,7 @@ func testCert(t *testing.T, data *TestData, expectedCABundle string, restartPod var caBundle string var configMap *v1.ConfigMap - if err := wait.Poll(2*time.Second, timeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 2*time.Second, timeout, false, func(ctx context.Context) (bool, error) { var err error configMap, err = data.clientset.CoreV1().ConfigMaps(caConfigMapNamespace).Get(context.TODO(), certificate.AntreaCAConfigMapName, metav1.GetOptions{}) if err != nil { @@ -214,7 +214,7 @@ func testCert(t *testing.T, data *TestData, expectedCABundle string, restartPod require.NoError(t, NewPodBuilder(clientName, data.testNamespace, agnhostImage).WithContainerName(getImageName(agnhostImage)).MountConfigMap(configMapCopy.Name, "/etc/config/", "config-volume").WithHostNetwork(false).Create(data)) defer data.DeletePodAndWait(defaultTimeout, clientName, data.testNamespace) require.NoError(t, data.podWaitForRunning(defaultTimeout, clientName, data.testNamespace)) - if err := wait.Poll(2*time.Second, timeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 2*time.Second, timeout, false, func(ctx context.Context) (bool, error) { stdout, stderr, err := data.RunCommandFromPod(data.testNamespace, clientName, agnhostContainerName, cmd) if err != nil { t.Logf("error when running cmd: %v , stdout: <%v>, stderr: <%v>", err, stdout, stderr) @@ -241,7 +241,7 @@ func testCert(t *testing.T, data *TestData, expectedCABundle string, restartPod } // antrea-agents reconnect every 5 seconds, we expect their connections are restored in a few seconds. - if err := wait.Poll(2*time.Second, 30*time.Second, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 2*time.Second, 30*time.Second, false, func(ctx context.Context) (bool, error) { cmds := []string{"antctl", "get", "controllerinfo", "-o", "json"} stdout, _, err := runAntctl(antreaController.Name, cmds, data) if err != nil { diff --git a/test/e2e/service_externalip_test.go b/test/e2e/service_externalip_test.go index 57692e7ce6f..555c39592d3 100644 --- a/test/e2e/service_externalip_test.go +++ b/test/e2e/service_externalip_test.go @@ -343,20 +343,21 @@ func testServiceWithExternalIPCRUD(t *testing.T, data *TestData) { checkEIPStatus := func(expectedUsed int) { var gotUsed, gotTotal int - err := wait.PollImmediate(200*time.Millisecond, 2*time.Second, func() (done bool, err error) { - pool, err := data.crdClient.CrdV1alpha2().ExternalIPPools().Get(context.TODO(), ipPool.Name, metav1.GetOptions{}) - if err != nil { - return false, fmt.Errorf("failed to get ExternalIPPool: %v", err) - } - gotUsed, gotTotal = pool.Status.Usage.Used, pool.Status.Usage.Total - if expectedUsed != pool.Status.Usage.Used { - return false, nil - } - if tt.expectedTotal != pool.Status.Usage.Total { - return false, nil - } - return true, nil - }) + err := wait.PollUntilContextTimeout(context.Background(), 200*time.Millisecond, 2*time.Second, true, + func(ctx context.Context) (done bool, err error) { + pool, err := data.crdClient.CrdV1alpha2().ExternalIPPools().Get(context.TODO(), ipPool.Name, metav1.GetOptions{}) + if err != nil { + return false, fmt.Errorf("failed to get ExternalIPPool: %v", err) + } + gotUsed, gotTotal = pool.Status.Usage.Used, pool.Status.Usage.Total + if expectedUsed != pool.Status.Usage.Used { + return false, nil + } + if tt.expectedTotal != pool.Status.Usage.Total { + return false, nil + } + return true, nil + }) require.NoError(t, err, "ExternalIPPool status not match: expectedTotal=%d, got=%d, expectedUsed=%d, got=%d", tt.expectedTotal, gotTotal, expectedUsed, gotUsed) } checkEIPStatus(1) @@ -520,7 +521,7 @@ func testServiceNodeFailure(t *testing.T, data *TestData) { expectedMigratedNode = nodeName(0) } // The Agent on the original Node is paused. Run antctl from the expected migrated Node instead. - err = wait.PollImmediate(200*time.Millisecond, 15*time.Second, func() (done bool, err error) { + err = wait.PollUntilContextTimeout(context.Background(), 200*time.Millisecond, 15*time.Second, true, func(ctx context.Context) (done bool, err error) { assignedNode, err := data.getServiceAssignedNode(expectedMigratedNode, service) if err != nil { return false, nil @@ -600,7 +601,7 @@ func testExternalIPAccess(t *testing.T, data *TestData) { waitExternalIPConfigured := func(service *v1.Service) (string, string, error) { var ip string var assignedNode string - err := wait.PollImmediate(200*time.Millisecond, 5*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), 200*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (done bool, err error) { service, err = data.clientset.CoreV1().Services(service.Namespace).Get(context.TODO(), service.Name, metav1.GetOptions{}) if err != nil { return false, err @@ -713,7 +714,7 @@ func (data *TestData) getServiceAssignedNode(node string, service *v1.Service) ( func (data *TestData) waitForServiceConfigured(service *v1.Service, expectedExternalIP string, expectedNodeName string) (*v1.Service, string, error) { var assignedNode string - err := wait.PollImmediate(200*time.Millisecond, 15*time.Second, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), 200*time.Millisecond, 15*time.Second, true, func(ctx context.Context) (done bool, err error) { service, err = data.clientset.CoreV1().Services(service.Namespace).Get(context.TODO(), service.Name, metav1.GetOptions{}) if err != nil { return false, err diff --git a/test/e2e/supportbundle_test.go b/test/e2e/supportbundle_test.go index a7a51e07cd0..08633112efb 100644 --- a/test/e2e/supportbundle_test.go +++ b/test/e2e/supportbundle_test.go @@ -111,7 +111,7 @@ func getAndCheckSupportBundle(t *testing.T, name, podIP string, podPort int, tok require.Equal(t, systemv1beta1.SupportBundleStatusCollecting, bundle.Status) // Waiting for the generation to be completed. ddl := time.After(defaultTimeout) - err = wait.PollImmediateUntil(200*time.Millisecond, func() (done bool, err error) { + err = wait.PollUntilContextCancel(context.TODO(), 200*time.Millisecond, true, func(ctx context.Context) (done bool, err error) { select { case <-ddl: return false, fmt.Errorf("collecting timeout") @@ -120,7 +120,7 @@ func getAndCheckSupportBundle(t *testing.T, name, podIP string, podPort int, tok bundle, err = clients.SystemV1beta1().SupportBundles().Get(context.TODO(), name, metav1.GetOptions{}) require.NoError(t, err) return bundle.Status == systemv1beta1.SupportBundleStatusCollected, nil - }, nil) + }) require.NoError(t, err) // Checking the complete status. bundle, err = clients.SystemV1beta1().SupportBundles().Get(context.TODO(), name, metav1.GetOptions{}) diff --git a/test/e2e/traceflow_test.go b/test/e2e/traceflow_test.go index 98bc03e52f4..f8df547836e 100644 --- a/test/e2e/traceflow_test.go +++ b/test/e2e/traceflow_test.go @@ -2315,7 +2315,7 @@ func (data *TestData) waitForTraceflow(t *testing.T, name string, phase v1beta1. var tf *v1beta1.Traceflow var err error timeout := 15 * time.Second - if err = wait.PollImmediate(defaultInterval, timeout, func() (bool, error) { + if err = wait.PollUntilContextTimeout(context.Background(), defaultInterval, timeout, true, func(ctx context.Context) (bool, error) { tf, err = data.crdClient.CrdV1beta1().Traceflows().Get(context.TODO(), name, metav1.GetOptions{}) if err != nil || tf.Status.Phase != phase { return false, nil @@ -2442,7 +2442,7 @@ func (data *TestData) waitForNetworkpolicyRealized(pod string, node string, isWi if npType == v1beta2.AntreaNetworkPolicy { npOption = "ANNP" } - if err := wait.Poll(200*time.Millisecond, 5*time.Second, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 200*time.Millisecond, 5*time.Second, false, func(ctx context.Context) (bool, error) { var stdout, stderr string var err error if isWindows { @@ -2458,7 +2458,7 @@ func (data *TestData) waitForNetworkpolicyRealized(pod string, node string, isWi return false, fmt.Errorf("Error when executing antctl get NetworkPolicy, stdout: %s, stderr: %s, err: %v", stdout, stderr, err) } return strings.Contains(stdout, fmt.Sprintf("%s:%s/%s", npType, data.testNamespace, networkpolicy)), nil - }); err == wait.ErrWaitTimeout { + }); wait.Interrupted(err) { return fmt.Errorf("NetworkPolicy %s isn't realized in time", networkpolicy) } else if err != nil { return err diff --git a/test/e2e/vmagent_test.go b/test/e2e/vmagent_test.go index 9b5551d9007..94bbf55cd54 100644 --- a/test/e2e/vmagent_test.go +++ b/test/e2e/vmagent_test.go @@ -84,14 +84,14 @@ func TestVMAgent(t *testing.T) { func (data *TestData) waitForDeploymentReady(t *testing.T, namespace string, name string, timeout time.Duration) error { t.Logf("Waiting for Deployment '%s/%s' to be ready", namespace, name) - err := wait.Poll(1*time.Second, timeout, func() (bool, error) { + err := wait.PollUntilContextTimeout(context.Background(), 1*time.Second, timeout, false, func(ctx context.Context) (bool, error) { dp, err := data.clientset.AppsV1().Deployments(namespace).Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return false, err } return dp.Status.ObservedGeneration == dp.Generation && dp.Status.ReadyReplicas == *dp.Spec.Replicas, nil }) - if err == wait.ErrWaitTimeout { + if wait.Interrupted(err) { _, stdout, _, _ := data.provider.RunCommandOnNode(controlPlaneNodeName(), fmt.Sprintf("kubectl -n %s describe pod -l app=sftp", namespace)) return fmt.Errorf("some replicas for Deployment '%s/%s' are not ready after %v:\n%v", namespace, name, timeout, stdout) } else if err != nil { @@ -103,7 +103,7 @@ func (data *TestData) waitForDeploymentReady(t *testing.T, namespace string, nam func (data *TestData) waitForSupportBundleCollectionRealized(t *testing.T, name string, timeout time.Duration) error { t.Logf("Waiting for SupportBundleCollection '%s' to be realized", name) var sbc *crdv1alpha1.SupportBundleCollection - if err := wait.Poll(100*time.Millisecond, timeout, func() (bool, error) { + if err := wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, timeout, false, func(ctx context.Context) (bool, error) { var getErr error sbc, getErr = data.crdClient.CrdV1alpha1().SupportBundleCollections().Get(context.TODO(), name, metav1.GetOptions{}) if getErr != nil { @@ -265,7 +265,7 @@ func setupVMAgentTest(t *testing.T, data *TestData) ([]vmInfo, error) { // and verifies uplink configuration is restored. func teardownVMAgentTest(t *testing.T, data *TestData, vmList []vmInfo) { verifyUpLinkAfterCleanup := func(vm vmInfo) { - err := wait.PollImmediate(10*time.Second, 1*time.Minute, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), 10*time.Second, 1*time.Minute, true, func(ctx context.Context) (done bool, err error) { var tempVM vmInfo if vm.osType == linuxOS { tempVM = getVMInfo(t, data, vm.nodeName) @@ -294,7 +294,7 @@ func teardownVMAgentTest(t *testing.T, data *TestData, vmList []vmInfo) { } func verifyExternalEntityExistence(t *testing.T, data *TestData, eeName string, vmNodeName string, expectExists bool) { - if err := wait.PollImmediate(10*time.Second, 1*time.Minute, func() (done bool, err error) { + if err := wait.PollUntilContextTimeout(context.Background(), 10*time.Second, 1*time.Minute, true, func(ctx context.Context) (done bool, err error) { t.Logf("Verifying ExternalEntity %s, expectExists %t", eeName, expectExists) _, err = data.crdClient.CrdV1alpha2().ExternalEntities(namespace).Get(context.TODO(), eeName, metav1.GetOptions{}) if err != nil && !errors.IsNotFound(err) { @@ -325,7 +325,7 @@ func verifyExternalEntityExistence(t *testing.T, data *TestData, eeName string, func testExternalNode(t *testing.T, data *TestData, vmList []vmInfo) { verifyExternalNodeRealization := func(vm vmInfo) { - err := wait.PollImmediate(10*time.Second, 1*time.Minute, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), 10*time.Second, 1*time.Minute, true, func(ctx context.Context) (done bool, err error) { t.Logf("Verify host interface configuration for VM: %s", vm.nodeName) exists, err := verifyInterfaceIsInOVS(t, data, vm) return exists, err @@ -665,7 +665,7 @@ func runPingCommandOnVM(data *TestData, dstVM vmInfo, connected bool) error { expOutput := fmt.Sprintf("%d packets transmitted, %d received", pingCount, expCount) // Use master Node to run ping command. pingClient := nodeName(0) - err := wait.PollImmediate(time.Second*5, time.Second*20, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second*5, time.Second*20, true, func(ctx context.Context) (done bool, err error) { if err := runCommandAndCheckResult(data, pingClient, cmdStr, expOutput, ""); err != nil { return false, nil } @@ -676,7 +676,7 @@ func runPingCommandOnVM(data *TestData, dstVM vmInfo, connected bool) error { func runIperfCommandOnVMs(t *testing.T, data *TestData, srcVM vmInfo, dstVM vmInfo, connected bool, isUDP bool, ruleAction crdv1beta1.RuleAction) error { svrIP := net.ParseIP(dstVM.ip) - err := wait.PollImmediate(time.Second*5, time.Second*20, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second*5, time.Second*20, true, func(ctx context.Context) (done bool, err error) { if err := runIperfClient(t, data, srcVM, svrIP, iperfPort, isUDP, connected, ruleAction); err != nil { return false, nil } @@ -769,7 +769,7 @@ func runCurlCommandOnVM(data *TestData, targetVM vmInfo, url string, action crdv case crdv1beta1.RuleActionReject: expectedErr = "Connection refused" } - err := wait.PollImmediate(time.Second*5, time.Second*20, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), time.Second*5, time.Second*20, true, func(ctx context.Context) (done bool, err error) { if err := runCommandAndCheckResult(data, targetVM.nodeName, cmdStr, expectedOutput, expectedErr); err != nil { return false, nil } diff --git a/test/integration/agent/route_test.go b/test/integration/agent/route_test.go index 974fb3f7919..63ed6adcab8 100644 --- a/test/integration/agent/route_test.go +++ b/test/integration/agent/route_test.go @@ -18,6 +18,7 @@ package agent import ( + "context" "fmt" "net" "os" @@ -472,7 +473,7 @@ func TestSyncGatewayKernelRoute(t *testing.T) { listCmd := fmt.Sprintf("ip route show table 0 exact %s", podCIDR) - err = wait.PollImmediate(100*time.Millisecond, 2*time.Second, func() (done bool, err error) { + err = wait.PollUntilContextTimeout(context.Background(), 100*time.Millisecond, 2*time.Second, true, func(ctx context.Context) (done bool, err error) { expOutput, err := exec.Command("bash", "-c", listCmd).Output() if err != nil { return false, err @@ -490,7 +491,7 @@ func TestSyncGatewayKernelRoute(t *testing.T) { route.SyncInterval = 2 * time.Second go routeClient.Run(stopCh) - err = wait.Poll(1*time.Second, 2*route.SyncInterval, func() (done bool, err error) { + err = wait.PollUntilContextTimeout(context.Background(), 1*time.Second, 2*route.SyncInterval, false, func(ctx context.Context) (done bool, err error) { expOutput, err := exec.Command("bash", "-c", listCmd).Output() if err != nil { return false, err diff --git a/test/integration/ovs/ofctrl_test.go b/test/integration/ovs/ofctrl_test.go index 0faa93f50d4..4b00fe5cbac 100644 --- a/test/integration/ovs/ofctrl_test.go +++ b/test/integration/ovs/ofctrl_test.go @@ -15,6 +15,7 @@ package ovs import ( + "context" "fmt" "net" "strings" @@ -222,7 +223,7 @@ func TestOFctrlFlow(t *testing.T) { // Test: DumpFlows dumpCookieID, dumpCookieMask := getCookieIDMask() flowStates, err := bridge.DumpFlows(dumpCookieID, dumpCookieMask) - require.Nil(t, err, "no error returns in DumpFlows") + require.NoError(t, err, "no error returns in DumpFlows") if len(flowStates) != len(flowList) { t.Errorf("Flow count in dump result is incorrect") } @@ -240,11 +241,11 @@ func TestOFctrlFlow(t *testing.T) { if err != nil { t.Errorf("Failed to DeleteFlowsByCookie: %v", err) } - require.NoError(t, wait.PollImmediate(time.Millisecond*100, time.Second, func() (done bool, err error) { - flowList, err = OfctlDumpTableFlowsWithoutName(ovsCtlClient, myTable.GetID()) - require.Nil(t, err) - return len(flowList) == 0, nil - }), "Failed to delete flows by CookieID") + require.Eventually(t, func() bool { + flowList, err := OfctlDumpTableFlowsWithoutName(ovsCtlClient, myTable.GetID()) + require.NoError(t, err) + return len(flowList) == 0 + }, time.Second, time.Millisecond*100, "Failed to delete flows by CookieID") } } @@ -310,13 +311,14 @@ func TestOFctrlGroup(t *testing.T) { group = bucketBuilder.Done() } // Check if the group could be added. - require.Nil(t, group.Add()) + require.NoError(t, group.Add()) var groups [][]string - require.NoError(t, wait.PollImmediate(openFlowCheckInterval, openFlowCheckTimeout, func() (done bool, err error) { - groups, err = OfCtlDumpGroups(ovsCtlClient) - require.Nil(t, err) - return len(groups) == 1, nil - }), "Failed to install group") + require.NoError(t, wait.PollUntilContextTimeout(context.Background(), openFlowCheckInterval, openFlowCheckTimeout, true, + func(ctx context.Context) (done bool, err error) { + groups, err = OfCtlDumpGroups(ovsCtlClient) + require.Nil(t, err) + return len(groups) == 1, nil + }), "Failed to install group") dumpedGroup := groups[0] for i, bucket := range buckets { if name == "Normal" { @@ -341,12 +343,12 @@ func TestOFctrlGroup(t *testing.T) { } } // Check if the group could be deleted. - require.Nil(t, group.Delete()) - require.NoError(t, wait.PollImmediate(openFlowCheckInterval, openFlowCheckTimeout, func() (done bool, err error) { - groups, err = OfCtlDumpGroups(ovsCtlClient) - require.Nil(t, err) - return len(groups) == 0, nil - }), "Failed to delete group") + require.NoError(t, group.Delete()) + require.Eventually(t, func() bool { + groups, err := OfCtlDumpGroups(ovsCtlClient) + require.NoError(t, err) + return len(groups) == 0 + }, openFlowCheckTimeout, openFlowCheckInterval, "Failed to delete group") }) id++ } @@ -355,24 +357,23 @@ func TestOFctrlGroup(t *testing.T) { func TestTransactions(t *testing.T) { br := "br04" err := PrepareOVSBridge(br) - require.Nil(t, err, fmt.Sprintf("Failed to prepare OVS bridge: %v", err)) + require.NoError(t, err, "Failed to prepare OVS bridge") defer func() { err = DeleteOVSBridge(br) - require.Nil(t, err, fmt.Sprintf("error while deleting OVS bridge: %v", err)) + require.NoError(t, err, "error while deleting OVS bridge") }() bridge := newOFBridge(br) table = bridge.NewTable(t2, t3.GetID(), binding.TableMissActionNext) - err = bridge.Connect(maxRetry, make(chan struct{})) - require.Nil(t, err, "Failed to start OFService") + require.NoError(t, bridge.Connect(maxRetry, make(chan struct{})), "Failed to start OFService") defer bridge.Disconnect() ovsCtlClient := ovsctl.NewClient(br) flows, expectflows := prepareFlows(table) err = bridge.AddFlowsInBundle(openflow.GetFlowModMessages(flows, binding.AddMessage), nil, nil) - require.Nil(t, err, fmt.Sprintf("Failed to add flows in a transaction: %v", err)) + require.NoError(t, err, "Failed to add flows in a transaction") dumpTable := table.GetID() flowList := CheckFlowExists(t, ovsCtlClient, "", dumpTable, true, expectflows) @@ -387,7 +388,7 @@ func TestTransactions(t *testing.T) { // Delete flows in a bundle err = bridge.AddFlowsInBundle(nil, nil, openflow.GetFlowModMessages(flows, binding.DeleteMessage)) - require.Nil(t, err, fmt.Sprintf("Failed to delete flows in a transaction: %v", err)) + require.NoError(t, err, "Failed to delete flows in a transaction") dumpTable = table.GetID() flowList = CheckFlowExists(t, ovsCtlClient, "", dumpTable, false, expectflows) @@ -401,7 +402,7 @@ func TestTransactions(t *testing.T) { // Invoke AddFlowsInBundle with no Flow to add/modify/delete. err = bridge.AddFlowsInBundle(nil, nil, nil) - require.Nil(t, err, fmt.Sprintf("Not compatible with none flows in the request: %v", err)) + require.NoError(t, err, "Not compatible with none flows in the request") for _, tableStates := range bridge.DumpTableStatus() { if tableStates.ID == uint(dumpTable) { if int(tableStates.FlowCount) != len(flowList) { @@ -414,17 +415,17 @@ func TestTransactions(t *testing.T) { func TestBundleErrorWhenOVSRestart(t *testing.T) { br := "br06" err := PrepareOVSBridge(br) - require.Nil(t, err, fmt.Sprintf("Failed to prepare OVS bridge: %v", err)) + require.NoError(t, err, "Failed to prepare OVS bridge") defer func() { err = DeleteOVSBridge(br) - require.Nil(t, err, fmt.Sprintf("error while deleting OVS bridge: %v", err)) + require.NoError(t, err, "Failed to delete bridge") }() bridge := newOFBridge(br) table = bridge.NewTable(t2, t3.GetID(), binding.TableMissActionNext) err = bridge.Connect(maxRetry, make(chan struct{})) - require.Nil(t, err, "Failed to start OFService") + require.NoError(t, err, "Failed to start OFService") defer bridge.Disconnect() // Ensure OVS is connected before sending bundle messages. @@ -501,7 +502,7 @@ func TestBundleErrorWhenOVSRestart(t *testing.T) { func TestReconnectOFSwitch(t *testing.T) { br := "br07" err := PrepareOVSBridge(br) - require.Nil(t, err, fmt.Sprintf("Failed to prepare OVS bridge: %v", err)) + require.NoError(t, err, "Failed to prepare OVS bridge") defer DeleteOVSBridge(br) bridge := newOFBridge(br) @@ -513,7 +514,7 @@ func TestReconnectOFSwitch(t *testing.T) { } }() err = bridge.Connect(maxRetry, reconnectCh) - require.Nil(t, err, "Failed to start OFService") + require.NoError(t, err, "Failed to start OFService") defer bridge.Disconnect() require.Equal(t, connectCount, 1) @@ -523,11 +524,11 @@ func TestReconnectOFSwitch(t *testing.T) { DeleteOVSBridge(br) time.Sleep(8 * time.Second) err := PrepareOVSBridge(br) - require.Nil(t, err, fmt.Sprintf("Failed to prepare OVS bridge: %v", err)) + require.NoError(t, err, "Failed to prepare OVS bridge") }() err = DeleteOVSBridge(br) - require.Nil(t, err, fmt.Sprintf("Failed to delete bridge: %v", err)) + require.NoError(t, err, "Failed to delete bridge") time.Sleep(12 * time.Second) require.Equal(t, 2, connectCount) } @@ -536,14 +537,14 @@ func TestReconnectOFSwitch(t *testing.T) { func TestBundleWithGroupAndFlow(t *testing.T) { br := "br08" err := PrepareOVSBridge(br) - require.Nil(t, err, fmt.Sprintf("Failed to prepare OVS bridge: %v", err)) + require.NoError(t, err, "Failed to prepare OVS bridge") defer DeleteOVSBridge(br) bridge := newOFBridge(br) table = bridge.NewTable(t2, t3.GetID(), binding.TableMissActionNext) err = bridge.Connect(maxRetry, make(chan struct{})) - require.Nil(t, err, "Failed to start OFService") + require.NoError(t, err, "Failed to start OFService") defer bridge.Disconnect() ovsCtlClient := ovsctl.NewClient(br) @@ -583,12 +584,12 @@ func TestBundleWithGroupAndFlow(t *testing.T) { bucket1 := "weight:100,actions=set_field:0xa0a0202->reg1,set_field:0x35->reg2,set_field:0xfff1->reg3,resubmit(,3)" expectedGroupBuckets := []string{bucket0, bucket1} err = bridge.AddOFEntriesInBundle([]binding.OFEntry{flow, group}, nil, nil) - require.Nil(t, err) + require.NoError(t, err) CheckFlowExists(t, ovsCtlClient, "", table.GetID(), true, expectedFlows) CheckGroupExists(t, ovsCtlClient, groupID, "select", expectedGroupBuckets, true) err = bridge.AddOFEntriesInBundle(nil, nil, []binding.OFEntry{flow, group}) - require.Nil(t, err) + require.NoError(t, err) CheckFlowExists(t, ovsCtlClient, "", table.GetID(), false, expectedFlows) CheckGroupExists(t, ovsCtlClient, groupID, "select", expectedGroupBuckets, false) } @@ -596,7 +597,7 @@ func TestBundleWithGroupAndFlow(t *testing.T) { func TestPacketOutIn(t *testing.T) { br := "br09" err := PrepareOVSBridge(br) - require.Nil(t, err, fmt.Sprintf("Failed to prepare OVS bridge: %v", err)) + require.NoError(t, err, "Failed to prepare OVS bridge") defer DeleteOVSBridge(br) bridge := newOFBridge(br) @@ -604,13 +605,13 @@ func TestPacketOutIn(t *testing.T) { table1 := bridge.NewTable(t1, t2.GetID(), binding.TableMissActionNext) err = bridge.Connect(maxRetry, make(chan struct{})) - require.Nil(t, err, "Failed to start OFService") + require.NoError(t, err, "Failed to start OFService") defer bridge.Disconnect() category := uint8(1) pktInQueue := binding.NewPacketInQueue(200, rate.Limit(100)) err = bridge.SubscribePacketIn(category, pktInQueue) - require.Nil(t, err) + require.NoError(t, err) srcMAC, _ := net.ParseMAC("11:11:11:11:11:11") dstcMAC, _ := net.ParseMAC("11:11:11:11:11:22") @@ -664,7 +665,7 @@ func TestPacketOutIn(t *testing.T) { SetTCPSrcPort(srcPort).SetTCPDstPort(dstPort). AddLoadRegMark(mark). Done() - require.Nil(t, err) + require.NoError(t, err) flow0 := table0.BuildFlow(100). MatchSrcMAC(srcMAC).MatchDstMAC(dstcMAC). MatchSrcIP(srcIP).MatchDstIP(dstIP).MatchProtocol(binding.ProtocolTCP). @@ -681,7 +682,7 @@ func TestPacketOutIn(t *testing.T) { Action().SendToController([]byte{0x1}, false). Done() err = bridge.AddFlowsInBundle(openflow.GetFlowModMessages([]binding.Flow{flow0, flow1}, binding.AddMessage), nil, nil) - require.Nil(t, err) + require.NoError(t, err) err = bridge.SendPacketOut(pkt) require.NoError(t, err) <-stopCh @@ -690,14 +691,14 @@ func TestPacketOutIn(t *testing.T) { func TestFlowWithCTMatchers(t *testing.T) { br := "br09" err := PrepareOVSBridge(br) - require.Nil(t, err, fmt.Sprintf("Failed to prepare OVS bridge: %v", err)) + require.NoError(t, err, "Failed to prepare OVS bridge") defer DeleteOVSBridge(br) bridge := newOFBridge(br) table = bridge.NewTable(t2, t3.GetID(), binding.TableMissActionNext) err = bridge.Connect(maxRetry, make(chan struct{})) - require.Nil(t, err, "Failed to start OFService") + require.NoError(t, err, "Failed to start OFService") defer bridge.Disconnect() ofctlClient := ovsctl.NewClient(br) @@ -779,14 +780,14 @@ func TestFlowWithCTMatchers(t *testing.T) { func TestNoteAction(t *testing.T) { br := "br10" err := PrepareOVSBridge(br) - require.Nil(t, err, fmt.Sprintf("Failed to prepare OVS bridge: %v", err)) + require.NoError(t, err, "Failed to prepare OVS bridge") defer DeleteOVSBridge(br) bridge := newOFBridge(br) table = bridge.NewTable(t2, t3.GetID(), binding.TableMissActionNext) err = bridge.Connect(maxRetry, make(chan struct{})) - require.Nil(t, err, "Failed to start OFService") + require.NoError(t, err, "Failed to start OFService") defer bridge.Disconnect() ofctlClient := ovsctl.NewClient(br) @@ -830,14 +831,14 @@ func TestNoteAction(t *testing.T) { func TestLoadToLabelFieldAction(t *testing.T) { br := "br13" err := PrepareOVSBridge(br) - require.Nil(t, err, fmt.Sprintf("Failed to prepare OVS bridge: %v", err)) + require.NoError(t, err, "Failed to prepare OVS bridge") defer DeleteOVSBridge(br) bridge := newOFBridge(br) table = bridge.NewTable(t2, t3.GetID(), binding.TableMissActionNext) err = bridge.Connect(maxRetry, make(chan struct{})) - require.Nil(t, err, "Failed to start OFService") + require.NoError(t, err, "Failed to start OFService") defer bridge.Disconnect() ovsCtlClient := ovsctl.NewClient(br) @@ -896,7 +897,7 @@ func TestLoadToLabelFieldAction(t *testing.T) { func TestBundleWithGroupInsertBucket(t *testing.T) { br := "br12" err := PrepareOVSBridge(br) - require.Nil(t, err, fmt.Sprintf("Failed to prepare OVS bridge: %v", err)) + require.NoError(t, err, "Failed to prepare OVS bridge") defer DeleteOVSBridge(br) bridge := newOFBridge(br) @@ -909,7 +910,7 @@ func TestBundleWithGroupInsertBucket(t *testing.T) { }() err = bridge.Connect(maxRetry, make(chan struct{})) - require.Nil(t, err, "Failed to start OFService") + require.NoError(t, err, "Failed to start OFService") defer bridge.Disconnect() ovsCtlClient := ovsctl.NewClient(br) @@ -918,7 +919,7 @@ func TestBundleWithGroupInsertBucket(t *testing.T) { group := bridge.NewGroup(groupID) expectedGroupBuckets := []string{} err = bridge.AddOFEntriesInBundle([]binding.OFEntry{group}, nil, nil) - require.Nil(t, err) + require.NoError(t, err) CheckGroupExists(t, ovsCtlClient, groupID, "select", expectedGroupBuckets, true) field1 := binding.NewRegField(1, 0, 31) @@ -946,7 +947,7 @@ func TestBundleWithGroupInsertBucket(t *testing.T) { bucket3 := "weight:100,actions=set_field:0xa0a0202->reg1,set_field:0x3->reg2,set_field:0xfff1->reg3,resubmit(,3)" expectedGroupBuckets = []string{bucket1, bucket2, bucket3} err = bridge.AddOFEntriesInBundle(nil, []binding.OFEntry{group}, nil) - require.Nil(t, err) + require.NoError(t, err) CheckGroupExists(t, ovsCtlClient, groupID, "select", expectedGroupBuckets, true) group = group. @@ -959,13 +960,13 @@ func TestBundleWithGroupInsertBucket(t *testing.T) { bucket4 := "weight:100,actions=set_field:0xa0a0202->reg1,set_field:0x4->reg2,set_field:0xfff1->reg3,resubmit(,3)" expectedGroupBuckets = []string{bucket1, bucket2, bucket3, bucket4} err = bridge.AddOFEntriesInBundle(nil, []binding.OFEntry{group}, nil) - require.Nil(t, err) + require.NoError(t, err) CheckGroupExists(t, ovsCtlClient, groupID, "select", expectedGroupBuckets, true) group.ResetBuckets() expectedGroupBuckets = []string{} err = bridge.AddOFEntriesInBundle(nil, []binding.OFEntry{group}, nil) - require.Nil(t, err) + require.NoError(t, err) CheckGroupExists(t, ovsCtlClient, groupID, "select", expectedGroupBuckets, true) } diff --git a/test/integration/ovs/openflow_test_utils.go b/test/integration/ovs/openflow_test_utils.go index 81b3abbc811..168cd42eab7 100644 --- a/test/integration/ovs/openflow_test_utils.go +++ b/test/integration/ovs/openflow_test_utils.go @@ -15,6 +15,7 @@ package ovs import ( + "context" "fmt" "os/exec" "strings" @@ -71,7 +72,7 @@ func CheckFlowExists(t *testing.T, ovsCtlClient ovsctl.OVSCtlClient, tableName s if table == "" { table = fmt.Sprintf("%d", tableID) } - if err := wait.PollImmediate(openFlowCheckInterval, openFlowCheckTimeout, func() (done bool, err error) { + if err := wait.PollUntilContextTimeout(context.TODO(), openFlowCheckInterval, openFlowCheckTimeout, true, func(ctx context.Context) (done bool, err error) { unexpectedFlows = unexpectedFlows[:0] if tableName != "" { flowList, err = OfctlDumpTableFlows(ovsCtlClient, tableName) @@ -108,25 +109,26 @@ func CheckGroupExists(t *testing.T, ovsCtlClient ovsctl.OVSCtlClient, groupID bi } groupStr := fmt.Sprintf("group_id=%d,type=%s,%s", groupID, groupType, strings.Join(bucketStrs, ",")) var groupList [][]string - if err := wait.PollImmediate(openFlowCheckInterval, openFlowCheckTimeout, func() (done bool, err error) { - groupList, err = OfCtlDumpGroups(ovsCtlClient) - require.NoError(t, err, "Error dumping groups") - found := false - for _, groupElems := range groupList { - groupEntry := fmt.Sprintf("%s,bucket=", groupElems[0]) - var groupElemStrs []string - for _, elem := range groupElems[1:] { - elemStr := strings.Join(strings.Split(elem, ",")[1:], ",") - groupElemStrs = append(groupElemStrs, elemStr) + if err := wait.PollUntilContextTimeout(context.TODO(), openFlowCheckInterval, openFlowCheckTimeout, true, + func(ctx context.Context) (done bool, err error) { + groupList, err = OfCtlDumpGroups(ovsCtlClient) + require.NoError(t, err, "Error dumping groups") + found := false + for _, groupElems := range groupList { + groupEntry := fmt.Sprintf("%s,bucket=", groupElems[0]) + var groupElemStrs []string + for _, elem := range groupElems[1:] { + elemStr := strings.Join(strings.Split(elem, ",")[1:], ",") + groupElemStrs = append(groupElemStrs, elemStr) + } + groupEntry = fmt.Sprintf("%s%s", groupEntry, strings.Join(groupElemStrs, ",bucket=")) + if strings.Contains(groupEntry, groupStr) { + found = true + break + } } - groupEntry = fmt.Sprintf("%s%s", groupEntry, strings.Join(groupElemStrs, ",bucket=")) - if strings.Contains(groupEntry, groupStr) { - found = true - break - } - } - return found == expectFound, nil - }); err != nil { + return found == expectFound, nil + }); err != nil { if expectFound { t.Errorf("Failed to install group: %s", groupStr) } else { diff --git a/third_party/ipam/nodeipam/ipam/cidr_allocator.go b/third_party/ipam/nodeipam/ipam/cidr_allocator.go index 06bab81ad10..4b0fa301fa9 100644 --- a/third_party/ipam/nodeipam/ipam/cidr_allocator.go +++ b/third_party/ipam/nodeipam/ipam/cidr_allocator.go @@ -41,7 +41,7 @@ import ( "net" "time" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/labels" @@ -144,18 +144,19 @@ func listNodes(kubeClient clientset.Interface) (*v1.NodeList, error) { var nodeList *v1.NodeList // We must poll because apiserver might not be up. This error causes // controller manager to restart. - if pollErr := wait.Poll(nodePollInterval, apiserverStartupGracePeriod, func() (bool, error) { - var err error - nodeList, err = kubeClient.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{ - FieldSelector: fields.Everything().String(), - LabelSelector: labels.Everything().String(), - }) - if err != nil { - klog.Errorf("Failed to list all nodes: %v", err) - return false, nil - } - return true, nil - }); pollErr != nil { + if pollErr := wait.PollUntilContextTimeout(context.TODO(), nodePollInterval, apiserverStartupGracePeriod, false, + func(ctx context.Context) (bool, error) { + var err error + nodeList, err = kubeClient.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{ + FieldSelector: fields.Everything().String(), + LabelSelector: labels.Everything().String(), + }) + if err != nil { + klog.Errorf("Failed to list all nodes: %v", err) + return false, nil + } + return true, nil + }); pollErr != nil { return nil, fmt.Errorf("failed to list all nodes in %v, cannot proceed without updating CIDR map", apiserverStartupGracePeriod) } diff --git a/third_party/proxy/service.go b/third_party/proxy/service.go index 53c8c72c745..625a63804b5 100644 --- a/third_party/proxy/service.go +++ b/third_party/proxy/service.go @@ -244,12 +244,11 @@ func (sct *ServiceChangeTracker) newBaseServiceInfo(port *v1.ServicePort, servic internalPolicyLocal: internalPolicyLocal, internalTrafficPolicy: service.Spec.InternalTrafficPolicy, } - // TODO: Switch to v1.DeprecatedAnnotationTopologyAwareHints and v1.AnnotationTopologyMode after - // upgrading Antrea K8s API to at least 1.27 + var ok bool - info.hintsAnnotation, ok = service.Annotations[v1.AnnotationTopologyAwareHints] + info.hintsAnnotation, ok = service.Annotations[v1.DeprecatedAnnotationTopologyAwareHints] if !ok { - info.hintsAnnotation, _ = service.Annotations["service.kubernetes.io/topology-mode"] + info.hintsAnnotation = service.Annotations[v1.AnnotationTopologyMode] } loadBalancerSourceRanges := make([]string, len(service.Spec.LoadBalancerSourceRanges)) diff --git a/third_party/proxy/types.go b/third_party/proxy/types.go index 85632ee6425..4ac809e148b 100644 --- a/third_party/proxy/types.go +++ b/third_party/proxy/types.go @@ -108,7 +108,7 @@ type ServicePort interface { InternalPolicyLocal() bool // InternalTrafficPolicy returns service InternalTrafficPolicy InternalTrafficPolicy() *v1.ServiceInternalTrafficPolicyType - // HintsAnnotation returns the value of the v1.AnnotationTopologyAwareHints annotation or + // HintsAnnotation returns the value of the v1.DeprecatedAnnotationTopologyAwareHints annotation or // service.kubernetes.io/topology-mode annotation. HintsAnnotation() string // ExternallyAccessible returns true if the service port is reachable via something