diff --git a/CODEOWNERS b/CODEOWNERS index cc9c944b4b..7ff67616aa 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -27,6 +27,42 @@ /bgp/ @cilium/sig-bgp /cmd/ @cilium/cli /clustermesh/ @cilium/sig-clustermesh +/connectivity/ @cilium/ci-structure +/connectivity/check/ipcache.go @cilium/ipcache +/connectivity/check/metrics*.go @cilium/metrics +/connectivity/check/policy.go @cilium/sig-policy +/connectivity/builder/** @cilium/ci-structure +/connectivity/builder/all_ingress_deny_from_outside.go @cilium/sig-encryption +/connectivity/builder/cluster_entity_multi_cluster.go @cilium/sig-clustermesh +/connectivity/builder/dns_only.go @cilium/sig-clustermesh +/connectivity/builder/echo_ingress.go @cilium/sig-servicemesh +/connectivity/builder/echo_ingress_auth_always_fail.go @cilium/sig-servicemesh +/connectivity/builder/echo_ingress_from_other_client_deny.go @cilium/sig-servicemesh +/connectivity/builder/echo_ingress_from_outside.go @cilium/sig-servicemesh +/connectivity/builder/echo_ingress_knp.go @cilium/sig-servicemesh +/connectivity/builder/echo_ingress_l7.go @cilium/sig-servicemesh +/connectivity/builder/echo_ingress_l7_named_port.go @cilium/sig-servicemesh +/connectivity/builder/echo_ingress_mutual_auth_spiffe.go @cilium/sig-servicemesh +/connectivity/builder/egress_gateway.go @cilium/egress-gateway +/connectivity/builder/egress_gateway_excluded_cidrs.go @cilium/egress-gateway +/connectivity/builder/no_ipsec_xfrm_errors.go @cilium/sig-encryption +/connectivity/builder/node_to_node_encryption.go @cilium/sig-encryption +/connectivity/builder/pod_to_pod_encryption.go @cilium/sig-encryption +/connectivity/tests/egressgateway.go @cilium/egress-gateway +/connectivity/tests/encryption.go @cilium/sig-encryption +/connectivity/tests/errors.go @cilium/sig-agent @cilium/sig-datapath +/connectivity/tests/externalworkload.go @cilium/sig-clustermesh +/connectivity/tests/from-cidr.go @cilium/sig-policy +/connectivity/tests/health.go @cilium/sig-agent +/connectivity/tests/host.go @cilium/sig-agent +/connectivity/tests/ipsec_xfrm.go @cilium/ipsec +/connectivity/tests/perfpod.go @cilium/sig-datapath +/connectivity/tests/pod.go @cilium/sig-agent +/connectivity/tests/service.go @cilium/sig-lb +/connectivity/tests/testloop.sh @jrajahalme +/connectivity/tests/to-cidr.go @cilium/sig-policy +/connectivity/tests/upgrade.go @cilium/sig-datapath +/connectivity/tests/world.go @cilium/proxy /encrypt/ @cilium/sig-encryption /hubble/ @cilium/sig-hubble /install/ @cilium/cli @cilium/helm diff --git a/api/api.go b/api/api.go index 4c5eaf28c0..e8dc77572e 100644 --- a/api/api.go +++ b/api/api.go @@ -6,11 +6,11 @@ package api import ( "context" - "github.com/cilium/cilium/cilium-cli/connectivity" - "github.com/cilium/cilium/cilium-cli/connectivity/check" "github.com/spf13/cobra" "github.com/spf13/pflag" + "github.com/cilium/cilium-cli/connectivity" + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/k8s" "github.com/cilium/cilium-cli/sysdump" ) diff --git a/cli/cmd.go b/cli/cmd.go index c205841ba6..3646c1320e 100644 --- a/cli/cmd.go +++ b/cli/cmd.go @@ -8,7 +8,6 @@ import ( "fmt" "os" - command "github.com/cilium/cilium/cilium-cli/cli" "github.com/spf13/cobra" "github.com/cilium/cilium-cli/api" @@ -86,7 +85,7 @@ cilium connectivity test`, newCmdBgp(), newCmdClusterMesh(), newCmdConfig(), - command.NewCmdConnectivity(hooks), + newCmdConnectivity(hooks), newCmdContext(), newCmdEncrypt(), newCmdHubble(), diff --git a/vendor/github.com/cilium/cilium/cilium-cli/cli/connectivity.go b/cli/connectivity.go similarity index 91% rename from vendor/github.com/cilium/cilium/cilium-cli/cli/connectivity.go rename to cli/connectivity.go index 1ce28db863..e6be4c9518 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/cli/connectivity.go +++ b/cli/connectivity.go @@ -7,27 +7,26 @@ import ( "context" "errors" "fmt" - "github.com/cilium/cilium/cilium-cli/connectivity" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" "os" "os/signal" "regexp" "strings" "syscall" + "time" - "github.com/cilium/cilium-cli/api" - "github.com/cilium/cilium-cli/defaults" - "github.com/cilium/cilium-cli/sysdump" "github.com/spf13/cobra" "github.com/spf13/pflag" - "github.com/cilium/cilium/pkg/option" - "github.com/cilium/cilium/pkg/time" + "github.com/cilium/cilium-cli/api" + "github.com/cilium/cilium-cli/connectivity" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/defaults" + "github.com/cilium/cilium-cli/sysdump" ) var errInternal = errors.New("encountered internal error, exiting") -func NewCmdConnectivity(hooks api.Hooks) *cobra.Command { +func newCmdConnectivity(hooks api.Hooks) *cobra.Command { cmd := &cobra.Command{ Use: "connectivity", Short: "Connectivity troubleshooting", @@ -40,7 +39,7 @@ func NewCmdConnectivity(hooks api.Hooks) *cobra.Command { return cmd } -var params = check2.Parameters{ +var params = check.Parameters{ Writer: os.Stdout, SysdumpOptions: sysdump.Options{ LargeSysdumpAbortTimeout: sysdump.DefaultLargeSysdumpAbortTimeout, @@ -53,15 +52,6 @@ var tests []string func RunE(hooks api.Hooks) func(cmd *cobra.Command, args []string) error { return func(cmd *cobra.Command, _ []string) error { - namespace, ok := api.GetNamespaceContextValue(cmd.Context()) - if !ok { - return fmt.Errorf("failed to get namespace") - } - k8sClient, ok := api.GetK8sClientContextValue(cmd.Context()) - if !ok { - return fmt.Errorf("failed to get k8sClient") - } - params.CiliumNamespace = namespace for _, test := range tests { @@ -81,7 +71,7 @@ func RunE(hooks api.Hooks) func(cmd *cobra.Command, args []string) error { } // Instantiate the test harness. - cc, err := check2.NewConnectivityTest(k8sClient, params, defaults.CLIVersion) + cc, err := check.NewConnectivityTest(k8sClient, params, defaults.CLIVersion) if err != nil { return err } @@ -148,7 +138,7 @@ func newCmdConnectivityTest(hooks api.Hooks) *cobra.Command { cmd.Flags().MarkHidden("deployment-pod-annotations") cmd.Flags().StringVar(¶ms.MultiCluster, "multi-cluster", "", "Test across clusters to given context") cmd.Flags().StringSliceVar(&tests, "test", []string{}, "Run tests that match one of the given regular expressions, skip tests by starting the expression with '!', target Scenarios with e.g. '/pod-to-cidr'") - cmd.Flags().StringVar(¶ms.FlowValidation, "flow-validation", check2.FlowValidationModeWarning, "Enable Hubble flow validation { disabled | warning | strict }") + cmd.Flags().StringVar(¶ms.FlowValidation, "flow-validation", check.FlowValidationModeWarning, "Enable Hubble flow validation { disabled | warning | strict }") cmd.Flags().BoolVar(¶ms.AllFlows, "all-flows", false, "Print all flows during flow validation") cmd.Flags().StringVar(¶ms.AssumeCiliumVersion, "assume-cilium-version", "", "Assume Cilium version for connectivity tests") cmd.Flags().BoolVarP(¶ms.Verbose, "verbose", "v", false, "Show informational messages and don't buffer any lines") @@ -162,7 +152,7 @@ func newCmdConnectivityTest(hooks api.Hooks) *cobra.Command { cmd.Flags().StringVar(¶ms.ExternalOtherIP, "external-other-ip", "1.0.0.1", "Other IP to use as external target in connectivity tests") cmd.Flags().StringSliceVar(¶ms.NodeCIDRs, "node-cidr", nil, "one or more CIDRs that cover all nodes in the cluster") cmd.Flags().StringVar(¶ms.JunitFile, "junit-file", "", "Generate junit report and write to file") - cmd.Flags().Var(option.NewNamedMapOptions("kvstore-opts", ¶ms.JunitProperties, nil), "junit-property", "Add key=value properties to the generated junit file") + cmd.Flags().StringToStringVar(¶ms.JunitProperties, "junit-property", map[string]string{}, "Add key=value properties to the generated junit file") cmd.Flags().BoolVar(¶ms.SkipIPCacheCheck, "skip-ip-cache-check", true, "Skip IPCache check") cmd.Flags().MarkHidden("skip-ip-cache-check") cmd.Flags().BoolVar(¶ms.IncludeUnsafeTests, "include-unsafe-tests", false, "Include tests which can modify cluster nodes state") @@ -243,7 +233,7 @@ func newCmdConnectivityPerf(hooks api.Hooks) *cobra.Command { func registerCommonFlags(flags *pflag.FlagSet) { flags.BoolVarP(¶ms.Debug, "debug", "d", false, "Show debug messages") - flags.Var(option.NewNamedMapOptions("node-selector", ¶ms.NodeSelector, nil), "node-selector", "Restrict connectivity pods to nodes matching this label") + flags.StringToStringVar(¶ms.NodeSelector, "node-selector", map[string]string{}, "Restrict connectivity pods to nodes matching this label") flags.StringVar(¶ms.TestNamespace, "test-namespace", defaults.ConnectivityCheckNamespace, "Namespace to perform the connectivity in") flags.Var(¶ms.DeploymentAnnotations, "deployment-pod-annotations", "Add annotations to the connectivity pods, e.g. '{\"client\":{\"foo\":\"bar\"}}'") } diff --git a/cli/install.go b/cli/install.go index d8437b8f32..dfd7c18f55 100644 --- a/cli/install.go +++ b/cli/install.go @@ -9,13 +9,13 @@ import ( "io" "os" - "github.com/cilium/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium/pkg/inctimer" "github.com/spf13/cobra" "github.com/spf13/pflag" k8sErrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/defaults" "github.com/cilium/cilium-cli/hubble" "github.com/cilium/cilium-cli/install" diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_egress_deny.go b/connectivity/builder/all_egress_deny.go similarity index 55% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_egress_deny.go rename to connectivity/builder/all_egress_deny.go index fcd5746ea6..e84d4e4b7f 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_egress_deny.go +++ b/connectivity/builder/all_egress_deny.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/deny-all-egress.yaml @@ -14,7 +15,7 @@ var denyAllEgressPolicyYAML string type allEgressDeny struct{} -func (t allEgressDeny) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t allEgressDeny) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy denies all egresses by default newTest("all-egress-deny", ct). WithCiliumPolicy(denyAllEgressPolicyYAML). @@ -22,7 +23,7 @@ func (t allEgressDeny) build(ct *check2.ConnectivityTest, _ map[string]string) { tests.PodToPod(), tests.PodToPodWithEndpoints(), ). - WithExpectations(func(_ *check2.Action) (egress, ingress check2.Result) { - return check2.ResultDefaultDenyEgressDrop, check2.ResultNone + WithExpectations(func(_ *check.Action) (egress, ingress check.Result) { + return check.ResultDefaultDenyEgressDrop, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_egress_deny_knp.go b/connectivity/builder/all_egress_deny_knp.go similarity index 56% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_egress_deny_knp.go rename to connectivity/builder/all_egress_deny_knp.go index 693a747cd9..ec36a27ebc 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_egress_deny_knp.go +++ b/connectivity/builder/all_egress_deny_knp.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/deny-all-egress-knp.yaml @@ -14,7 +15,7 @@ var denyAllEgressPolicyKNPYAML string type allEgressDenyKnp struct{} -func (t allEgressDenyKnp) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t allEgressDenyKnp) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy denies all egresses by default using KNP. newTest("all-egress-deny-knp", ct). WithK8SPolicy(denyAllEgressPolicyKNPYAML). @@ -22,7 +23,7 @@ func (t allEgressDenyKnp) build(ct *check2.ConnectivityTest, _ map[string]string tests.PodToPod(), tests.PodToPodWithEndpoints(), ). - WithExpectations(func(_ *check2.Action) (egress, ingress check2.Result) { - return check2.ResultDefaultDenyEgressDrop, check2.ResultNone + WithExpectations(func(_ *check.Action) (egress, ingress check.Result) { + return check.ResultDefaultDenyEgressDrop, check.ResultNone }) } diff --git a/connectivity/builder/all_entities_deny.go b/connectivity/builder/all_entities_deny.go new file mode 100644 index 0000000000..945ef6981c --- /dev/null +++ b/connectivity/builder/all_entities_deny.go @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Authors of Cilium + +package builder + +import ( + _ "embed" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" +) + +//go:embed manifests/deny-all-entities.yaml +var denyAllEntitiesPolicyYAML string + +type allEntitiesDeny struct{} + +func (t allEntitiesDeny) build(ct *check.ConnectivityTest, _ map[string]string) { + // This policy denies all entities by default + newTest("all-entities-deny", ct). + WithCiliumPolicy(denyAllEntitiesPolicyYAML). + WithScenarios( + tests.PodToPod(), + tests.PodToCIDR(), + ). + WithExpectations(func(_ *check.Action) (egress, ingress check.Result) { + return check.ResultPolicyDenyEgressDrop, check.ResultNone + }) +} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_ingress_deny.go b/connectivity/builder/all_ingress_deny.go similarity index 67% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_ingress_deny.go rename to connectivity/builder/all_ingress_deny.go index 295fd7df1f..c8d02158a4 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_ingress_deny.go +++ b/connectivity/builder/all_ingress_deny.go @@ -4,14 +4,14 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type allIngressDeny struct{} -func (t allIngressDeny) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t allIngressDeny) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy denies all ingresses by default. // // 1. Pod to Pod fails because there is no egress policy (so egress traffic originating from a pod is allowed), @@ -21,12 +21,12 @@ func (t allIngressDeny) build(ct *check2.ConnectivityTest, _ map[string]string) // so they are not subject to ingress policy. newTest("all-ingress-deny", ct). WithCiliumPolicy(denyAllIngressPolicyYAML). - WithScenarios(tests2.PodToPod(), tests2.PodToCIDR(tests2.WithRetryAll())). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithScenarios(tests.PodToPod(), tests.PodToCIDR(tests.WithRetryAll())). + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().Address(features.GetIPFamily(ct.Params().ExternalOtherIP)) == ct.Params().ExternalOtherIP || a.Destination().Address(features.GetIPFamily(ct.Params().ExternalIP)) == ct.Params().ExternalIP { - return check2.ResultOK, check2.ResultNone + return check.ResultOK, check.ResultNone } - return check2.ResultDrop, check2.ResultDefaultDenyIngressDrop + return check.ResultDrop, check.ResultDefaultDenyIngressDrop }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_ingress_deny_from_outside.go b/connectivity/builder/all_ingress_deny_from_outside.go similarity index 64% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_ingress_deny_from_outside.go rename to connectivity/builder/all_ingress_deny_from_outside.go index a0336fe08d..2d48908be6 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_ingress_deny_from_outside.go +++ b/connectivity/builder/all_ingress_deny_from_outside.go @@ -4,25 +4,25 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type allIngressDenyFromOutside struct{} -func (t allIngressDenyFromOutside) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t allIngressDenyFromOutside) build(ct *check.ConnectivityTest, _ map[string]string) { newTest("all-ingress-deny-from-outside", ct). WithCondition(func() bool { return ct.Params().IncludeUnsafeTests }). WithCiliumPolicy(denyAllIngressPolicyYAML). WithFeatureRequirements(features.RequireEnabled(features.NodeWithoutCilium)). WithIPRoutesFromOutsideToPodCIDRs(). WithScenarios(tests.FromCIDRToPod()). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().Address(features.GetIPFamily(ct.Params().ExternalOtherIP)) == ct.Params().ExternalOtherIP || a.Destination().Address(features.GetIPFamily(ct.Params().ExternalIP)) == ct.Params().ExternalIP { - return check2.ResultOK, check2.ResultNone + return check.ResultOK, check.ResultNone } - return check2.ResultDrop, check2.ResultDefaultDenyIngressDrop + return check.ResultDrop, check.ResultDefaultDenyIngressDrop }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_ingress_deny_knp.go b/connectivity/builder/all_ingress_deny_knp.go similarity index 70% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_ingress_deny_knp.go rename to connectivity/builder/all_ingress_deny_knp.go index bff0eb36e4..fc04ecde4c 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_ingress_deny_knp.go +++ b/connectivity/builder/all_ingress_deny_knp.go @@ -5,9 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" ) @@ -16,24 +16,24 @@ var denyAllIngressPolicyKNPYAML string type allIngressDenyKnp struct{} -func (t allIngressDenyKnp) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t allIngressDenyKnp) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy denies all ingresses by default newTest("all-ingress-deny-knp", ct). WithK8SPolicy(denyAllIngressPolicyKNPYAML). WithScenarios( // Pod to Pod fails because there is no egress policy (so egress traffic originating from a pod is allowed), // but then at the destination there is ingress policy that denies the traffic. - tests2.PodToPod(), + tests.PodToPod(), // Egress to world works because there is no egress policy (so egress traffic originating from a pod is allowed), // then when replies come back, they are considered as "replies" to the outbound connection. // so they are not subject to ingress policy. - tests2.PodToCIDR(tests2.WithRetryAll()), + tests.PodToCIDR(tests.WithRetryAll()), ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().Address(features.GetIPFamily(ct.Params().ExternalOtherIP)) == ct.Params().ExternalOtherIP || a.Destination().Address(features.GetIPFamily(ct.Params().ExternalIP)) == ct.Params().ExternalIP { - return check2.ResultOK, check2.ResultNone + return check.ResultOK, check.ResultNone } - return check2.ResultDrop, check2.ResultDefaultDenyIngressDrop + return check.ResultDrop, check.ResultDefaultDenyIngressDrop }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/allow_all_except_world.go b/connectivity/builder/allow_all_except_world.go similarity index 73% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/allow_all_except_world.go rename to connectivity/builder/allow_all_except_world.go index 782d08d101..13aa72d007 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/allow_all_except_world.go +++ b/connectivity/builder/allow_all_except_world.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/allow-all-except-world.yaml @@ -19,15 +20,15 @@ func (t allowAllExceptWorld) build(ct *check.ConnectivityTest, _ map[string]stri newTest("allow-all-except-world", ct). WithCiliumPolicy(allowAllExceptWorldPolicyYAML). WithScenarios( - tests2.PodToPod(), - tests2.ClientToClient(), - tests2.PodToService(), + tests.PodToPod(), + tests.ClientToClient(), + tests.PodToService(), // We are skipping the following checks because NodePort is // intended to be used for N-S traffic, which conflicts with // policies. See GH-17144. // tests.PodToRemoteNodePort(), // tests.PodToLocalNodePort(), - tests2.PodToHost(), - tests2.PodToExternalWorkload(), + tests.PodToHost(), + tests.PodToExternalWorkload(), ) } diff --git a/connectivity/builder/allow_all_with_metrics_check.go b/connectivity/builder/allow_all_with_metrics_check.go new file mode 100644 index 0000000000..fa316b5595 --- /dev/null +++ b/connectivity/builder/allow_all_with_metrics_check.go @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Authors of Cilium + +package builder + +import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" +) + +type allowAllWithMetricsCheck struct{} + +func (t allowAllWithMetricsCheck) build(ct *check.ConnectivityTest, _ map[string]string) { + // This policy allows traffic pod to pod and checks if the metric cilium_forward_count_total increases on cilium agent. + newTest("allow-all-with-metrics-check", ct). + WithScenarios(tests.PodToPod()). + WithExpectations(func(_ *check.Action) (egress, ingress check.Result) { + return check.ResultOK.ExpectMetricsIncrease(ct.CiliumAgentMetrics(), "cilium_forward_count_total"), + check.ResultOK.ExpectMetricsIncrease(ct.CiliumAgentMetrics(), "cilium_forward_count_total") + }) +} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/builder.go b/connectivity/builder/builder.go similarity index 90% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/builder.go rename to connectivity/builder/builder.go index 52bb09fb7c..8cc7117dd8 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/builder.go +++ b/connectivity/builder/builder.go @@ -5,9 +5,9 @@ package builder import ( _ "embed" - "github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/template" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/builder/manifests/template" + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/utils/features" ) @@ -153,11 +153,11 @@ var ( ) type testBuilder interface { - build(ct *check2.ConnectivityTest, templates map[string]string) + build(ct *check.ConnectivityTest, templates map[string]string) } // InjectTests function injects needed connectivity tests in a proper order. -func InjectTests(ct *check2.ConnectivityTest, extraTests func(ct *check2.ConnectivityTest) error) error { +func InjectTests(ct *check.ConnectivityTest, extraTests func(ct *check.ConnectivityTest) error) error { templates, err := renderTemplates(ct.Params()) if err != nil { return err @@ -190,7 +190,7 @@ func InjectTests(ct *check2.ConnectivityTest, extraTests func(ct *check2.Connect return nil } -func renderTemplates(param check2.Parameters) (map[string]string, error) { +func renderTemplates(param check.Parameters) (map[string]string, error) { templates := map[string]string{ "clientEgressToCIDRExternalPolicyYAML": clientEgressToCIDRExternalPolicyYAML, "clientEgressToCIDRExternalPolicyKNPYAML": clientEgressToCIDRExternalPolicyKNPYAML, @@ -220,18 +220,18 @@ func renderTemplates(param check2.Parameters) (map[string]string, error) { return renderedTemplates, nil } -func newTest(name string, ct *check2.ConnectivityTest) *check2.Test { - test := check2.NewTest(name, ct.Params().Verbose, ct.Params().Debug) +func newTest(name string, ct *check.ConnectivityTest) *check.Test { + test := check.NewTest(name, ct.Params().Verbose, ct.Params().Debug) return ct.AddTest(test) } -func injectTests(ct *check2.ConnectivityTest, templates map[string]string, tests ...testBuilder) { +func injectTests(ct *check.ConnectivityTest, templates map[string]string, tests ...testBuilder) { for _, t := range tests { t.build(ct, templates) } } -func withKPRReqForMultiCluster(ct *check2.ConnectivityTest, reqs ...features.Requirement) []features.Requirement { +func withKPRReqForMultiCluster(ct *check.ConnectivityTest, reqs ...features.Requirement) []features.Requirement { // Skip the nodeport-related tests in the multicluster scenario if KPR is not // enabled, since global nodeport services are not supported in that case. if ct.Params().MultiCluster != "" { diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/check_log_errors.go b/connectivity/builder/check_log_errors.go similarity index 61% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/check_log_errors.go rename to connectivity/builder/check_log_errors.go index 489b62f16d..0cf35a771c 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/check_log_errors.go +++ b/connectivity/builder/check_log_errors.go @@ -4,18 +4,19 @@ package builder import ( - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium/pkg/versioncheck" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) type checkLogErrors struct{} -func (t checkLogErrors) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t checkLogErrors) build(ct *check.ConnectivityTest, _ map[string]string) { newTest("check-log-errors", ct). WithCondition(func() bool { return versioncheck.MustCompile(">=1.14.0")(ct.CiliumVersion) || ct.Params().IncludeUnsafeTests }). - WithSysdumpPolicy(check2.SysdumpPolicyOnce). + WithSysdumpPolicy(check.SysdumpPolicyOnce). WithScenarios(tests.NoErrorsInLogs(ct.CiliumVersion)) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress.go b/connectivity/builder/client_egress.go similarity index 81% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress.go rename to connectivity/builder/client_egress.go index 3bd5864d3d..e4756ca2e2 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress.go +++ b/connectivity/builder/client_egress.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-egress-to-echo.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_expression.go b/connectivity/builder/client_egress_expression.go similarity index 83% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_expression.go rename to connectivity/builder/client_egress_expression.go index a86b3d3507..d82c19a5c7 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_expression.go +++ b/connectivity/builder/client_egress_expression.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-egress-to-echo-expression.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_expression_knp.go b/connectivity/builder/client_egress_expression_knp.go similarity index 84% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_expression_knp.go rename to connectivity/builder/client_egress_expression_knp.go index c7e41c3742..f405260abe 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_expression_knp.go +++ b/connectivity/builder/client_egress_expression_knp.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-egress-to-echo-expression-knp.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_knp.go b/connectivity/builder/client_egress_knp.go similarity index 81% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_knp.go rename to connectivity/builder/client_egress_knp.go index ac80e79827..5435fdc0d2 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_knp.go +++ b/connectivity/builder/client_egress_knp.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-egress-to-echo-knp.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7.go b/connectivity/builder/client_egress_l7.go similarity index 65% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7.go rename to connectivity/builder/client_egress_l7.go index 87b5f1a695..4dfd7f14cf 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7.go +++ b/connectivity/builder/client_egress_l7.go @@ -4,39 +4,39 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type clientEgressL7 struct{} -func (t clientEgressL7) build(ct *check2.ConnectivityTest, templates map[string]string) { +func (t clientEgressL7) build(ct *check.ConnectivityTest, templates map[string]string) { // Test L7 HTTP introspection using an egress policy on the clients. newTest("client-egress-l7", ct). WithFeatureRequirements(features.RequireEnabled(features.L7Proxy)). WithCiliumPolicy(clientEgressOnlyDNSPolicyYAML). // DNS resolution only WithCiliumPolicy(templates["clientEgressL7HTTPPolicyYAML"]). // L7 allow policy with HTTP introspection WithScenarios( - tests2.PodToPod(), - tests2.PodToWorld(tests2.WithRetryDestPort(80), tests2.WithRetryPodLabel("other", "client")), + tests.PodToPod(), + tests.PodToWorld(tests.WithRetryDestPort(80), tests.WithRetryPodLabel("other", "client")), ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Source().HasLabel("other", "client") && // Only client2 is allowed to make HTTP calls. // Outbound HTTP to set domain-name defaults to one.one.one.one is L7-introspected and allowed. (a.Destination().Port() == 80 && a.Destination().Address(features.GetIPFamily(ct.Params().ExternalTarget)) == ct.Params().ExternalTarget || a.Destination().Port() == 8080) { // 8080 is traffic to echo Pod. if a.Destination().Path() == "/" || a.Destination().Path() == "" { - egress = check2.ResultOK + egress = check.ResultOK // Expect all curls from client2 to be proxied and to be GET calls. - egress.HTTP = check2.HTTP{ + egress.HTTP = check.HTTP{ Method: "GET", } - return egress, check2.ResultNone + return egress, check.ResultNone } // Else expect HTTP drop by proxy - return check2.ResultDNSOKDropCurlHTTPError, check2.ResultNone + return check.ResultDNSOKDropCurlHTTPError, check.ResultNone } - return check2.ResultDefaultDenyEgressDrop, check2.ResultNone + return check.ResultDefaultDenyEgressDrop, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7_method.go b/connectivity/builder/client_egress_l7_method.go similarity index 58% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7_method.go rename to connectivity/builder/client_egress_l7_method.go index 41ca0bf68f..e4cfce6b16 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7_method.go +++ b/connectivity/builder/client_egress_l7_method.go @@ -5,9 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" ) @@ -16,30 +16,30 @@ var clientEgressL7HTTPMethodPolicyYAML string type clientEgressL7Method struct{} -func (t clientEgressL7Method) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t clientEgressL7Method) build(ct *check.ConnectivityTest, _ map[string]string) { // Test L7 HTTP with different methods introspection using an egress policy on the clients. newTest("client-egress-l7-method", ct). WithFeatureRequirements(features.RequireEnabled(features.L7Proxy)). WithCiliumPolicy(clientEgressOnlyDNSPolicyYAML). // DNS resolution only WithCiliumPolicy(clientEgressL7HTTPMethodPolicyYAML). // L7 allow policy with HTTP introspection (POST only) WithScenarios( - tests2.PodToPodWithEndpoints(tests2.WithMethod("POST"), tests2.WithDestinationLabelsOption(map[string]string{"other": "echo"})), - tests2.PodToPodWithEndpoints(tests2.WithDestinationLabelsOption(map[string]string{"first": "echo"})), + tests.PodToPodWithEndpoints(tests.WithMethod("POST"), tests.WithDestinationLabelsOption(map[string]string{"other": "echo"})), + tests.PodToPodWithEndpoints(tests.WithDestinationLabelsOption(map[string]string{"first": "echo"})), ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Source().HasLabel("other", "client") && // Only client2 is allowed to make HTTP calls. (a.Destination().Port() == 8080) { // port 8080 is traffic to echo Pod. if a.Destination().HasLabel("other", "echo") { //we are POSTing only other echo - egress = check2.ResultOK + egress = check.ResultOK - egress.HTTP = check2.HTTP{ + egress.HTTP = check.HTTP{ Method: "POST", } - return egress, check2.ResultNone + return egress, check.ResultNone } // Else expect HTTP drop by proxy - return check2.ResultDropCurlHTTPError, check2.ResultNone + return check.ResultDropCurlHTTPError, check.ResultNone } - return check2.ResultDefaultDenyEgressDrop, check2.ResultNone + return check.ResultDefaultDenyEgressDrop, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7_named_port.go b/connectivity/builder/client_egress_l7_named_port.go similarity index 66% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7_named_port.go rename to connectivity/builder/client_egress_l7_named_port.go index c6f7917c3c..b870bcdcb2 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7_named_port.go +++ b/connectivity/builder/client_egress_l7_named_port.go @@ -4,39 +4,39 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type clientEgressL7NamedPort struct{} -func (t clientEgressL7NamedPort) build(ct *check2.ConnectivityTest, templates map[string]string) { +func (t clientEgressL7NamedPort) build(ct *check.ConnectivityTest, templates map[string]string) { // Test L7 HTTP named port introspection using an egress policy on the clients. newTest("client-egress-l7-named-port", ct). WithFeatureRequirements(features.RequireEnabled(features.L7Proxy)). WithCiliumPolicy(clientEgressOnlyDNSPolicyYAML). // DNS resolution only WithCiliumPolicy(templates["clientEgressL7HTTPNamedPortPolicyYAML"]). // L7 allow policy with HTTP introspection (named port) WithScenarios( - tests2.PodToPod(), - tests2.PodToWorld(tests2.WithRetryDestPort(80), tests2.WithRetryPodLabel("other", "client")), + tests.PodToPod(), + tests.PodToWorld(tests.WithRetryDestPort(80), tests.WithRetryPodLabel("other", "client")), ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Source().HasLabel("other", "client") && // Only client2 is allowed to make HTTP calls. // Outbound HTTP to domain-name, default one.one.one.one, is L7-introspected and allowed. (a.Destination().Port() == 80 && a.Destination().Address(features.GetIPFamily(ct.Params().ExternalTarget)) == ct.Params().ExternalTarget || a.Destination().Port() == 8080) { // named port http-8080 is traffic to echo Pod. if a.Destination().Path() == "/" || a.Destination().Path() == "" { - egress = check2.ResultOK + egress = check.ResultOK // Expect all curls from client2 to be proxied and to be GET calls. - egress.HTTP = check2.HTTP{ + egress.HTTP = check.HTTP{ Method: "GET", } - return egress, check2.ResultNone + return egress, check.ResultNone } // Else expect HTTP drop by proxy - return check2.ResultDNSOKDropCurlHTTPError, check2.ResultNone + return check.ResultDNSOKDropCurlHTTPError, check.ResultNone } - return check2.ResultDefaultDenyEgressDrop, check2.ResultNone + return check.ResultDefaultDenyEgressDrop, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7_set_header.go b/connectivity/builder/client_egress_l7_set_header.go similarity index 55% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7_set_header.go rename to connectivity/builder/client_egress_l7_set_header.go index ef835e226b..f10110b6c3 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7_set_header.go +++ b/connectivity/builder/client_egress_l7_set_header.go @@ -4,16 +4,17 @@ package builder import ( - "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/utils/features" ) type clientEgressL7SetHeader struct{} -func (t clientEgressL7SetHeader) build(ct *check2.ConnectivityTest, templates map[string]string) { +func (t clientEgressL7SetHeader) build(ct *check.ConnectivityTest, templates map[string]string) { // Test L7 HTTP with a header replace set in the policy newTest("client-egress-l7-set-header", ct). WithFeatureRequirements(features.RequireEnabled(features.L7Proxy)). @@ -28,14 +29,14 @@ func (t clientEgressL7SetHeader) build(ct *check2.ConnectivityTest, templates ma }). WithCiliumPolicy(templates["clientEgressL7HTTPMatchheaderSecretYAML"]). // L7 allow policy with HTTP introspection (POST only) WithScenarios( - tests2.PodToPodWithEndpoints(tests2.WithMethod("POST"), tests2.WithPath("auth-header-required"), tests2.WithDestinationLabelsOption(map[string]string{"other": "echo"})), - tests2.PodToPodWithEndpoints(tests2.WithMethod("POST"), tests2.WithPath("auth-header-required"), tests2.WithDestinationLabelsOption(map[string]string{"first": "echo"})), + tests.PodToPodWithEndpoints(tests.WithMethod("POST"), tests.WithPath("auth-header-required"), tests.WithDestinationLabelsOption(map[string]string{"other": "echo"})), + tests.PodToPodWithEndpoints(tests.WithMethod("POST"), tests.WithPath("auth-header-required"), tests.WithDestinationLabelsOption(map[string]string{"first": "echo"})), ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Source().HasLabel("other", "client") && // Only client2 has the header policy. (a.Destination().Port() == 8080) { // port 8080 is traffic to echo Pod. - return check2.ResultOK, check2.ResultNone + return check.ResultOK, check.ResultNone } - return check2.ResultCurlHTTPError, check2.ResultNone // if the header is not set the request will get a 401 + return check.ResultCurlHTTPError, check.ResultNone // if the header is not set the request will get a 401 }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7_tls_deny_without_headers.go b/connectivity/builder/client_egress_l7_tls_deny_without_headers.go similarity index 67% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7_tls_deny_without_headers.go rename to connectivity/builder/client_egress_l7_tls_deny_without_headers.go index 03d535514e..e65e731636 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7_tls_deny_without_headers.go +++ b/connectivity/builder/client_egress_l7_tls_deny_without_headers.go @@ -4,14 +4,14 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type clientEgressL7TlsDenyWithoutHeaders struct{} -func (t clientEgressL7TlsDenyWithoutHeaders) build(ct *check2.ConnectivityTest, templates map[string]string) { +func (t clientEgressL7TlsDenyWithoutHeaders) build(ct *check.ConnectivityTest, templates map[string]string) { // Test L7 HTTPS interception using an egress policy on the clients. // Fail to load site due to missing headers. newTest("client-egress-l7-tls-deny-without-headers", ct). @@ -21,7 +21,7 @@ func (t clientEgressL7TlsDenyWithoutHeaders) build(ct *check2.ConnectivityTest, WithCertificate("externaltarget-tls", ct.Params().ExternalTarget). WithCiliumPolicy(templates["clientEgressL7TLSPolicyYAML"]). // L7 allow policy with TLS interception WithScenarios(tests.PodToWorldWithTLSIntercept()). - WithExpectations(func(_ *check2.Action) (egress, ingress check2.Result) { - return check2.ResultDropCurlHTTPError, check2.ResultNone + WithExpectations(func(_ *check.Action) (egress, ingress check.Result) { + return check.ResultDropCurlHTTPError, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7_tls_headers.go b/connectivity/builder/client_egress_l7_tls_headers.go similarity index 68% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7_tls_headers.go rename to connectivity/builder/client_egress_l7_tls_headers.go index f76fe4a9ba..72eb4f9f64 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_l7_tls_headers.go +++ b/connectivity/builder/client_egress_l7_tls_headers.go @@ -4,14 +4,14 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type clientEgressL7TlsHeaders struct{} -func (t clientEgressL7TlsHeaders) build(ct *check2.ConnectivityTest, templates map[string]string) { +func (t clientEgressL7TlsHeaders) build(ct *check.ConnectivityTest, templates map[string]string) { // Test L7 HTTPS interception using an egress policy on the clients. newTest("client-egress-l7-tls-headers", ct). WithFeatureRequirements(features.RequireEnabled(features.L7Proxy)). @@ -20,7 +20,7 @@ func (t clientEgressL7TlsHeaders) build(ct *check2.ConnectivityTest, templates m WithCertificate("externaltarget-tls", ct.Params().ExternalTarget). WithCiliumPolicy(templates["clientEgressL7TLSPolicyYAML"]). // L7 allow policy with TLS interception WithScenarios(tests.PodToWorldWithTLSIntercept("-H", "X-Very-Secret-Token: 42")). - WithExpectations(func(_ *check2.Action) (egress, ingress check2.Result) { - return check2.ResultOK, check2.ResultNone + WithExpectations(func(_ *check.Action) (egress, ingress check.Result) { + return check.ResultOK, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_cidr_deny.go b/connectivity/builder/client_egress_to_cidr_deny.go similarity index 54% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_cidr_deny.go rename to connectivity/builder/client_egress_to_cidr_deny.go index 0d26106212..a0d241d901 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_cidr_deny.go +++ b/connectivity/builder/client_egress_to_cidr_deny.go @@ -4,28 +4,28 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type clientEgressToCidrDeny struct{} -func (t clientEgressToCidrDeny) build(ct *check2.ConnectivityTest, templates map[string]string) { +func (t clientEgressToCidrDeny) build(ct *check.ConnectivityTest, templates map[string]string) { // This policy denies L3 traffic to ExternalCIDR except ExternalIP/32 newTest("client-egress-to-cidr-deny", ct). WithCiliumPolicy(allowAllEgressPolicyYAML). // Allow all egress traffic WithCiliumPolicy(templates["clientEgressToCIDRExternalDenyPolicyYAML"]). WithScenarios( - tests2.PodToCIDR(tests2.WithRetryDestIP(ct.Params().ExternalIP)), // Denies all traffic to ExternalOtherIP, but allow ExternalIP + tests.PodToCIDR(tests.WithRetryDestIP(ct.Params().ExternalIP)), // Denies all traffic to ExternalOtherIP, but allow ExternalIP ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().Address(features.GetIPFamily(ct.Params().ExternalOtherIP)) == ct.Params().ExternalOtherIP { - return check2.ResultPolicyDenyEgressDrop, check2.ResultNone + return check.ResultPolicyDenyEgressDrop, check.ResultNone } if a.Destination().Address(features.GetIPFamily(ct.Params().ExternalIP)) == ct.Params().ExternalIP { - return check2.ResultOK, check2.ResultNone + return check.ResultOK, check.ResultNone } - return check2.ResultDrop, check2.ResultDrop + return check.ResultDrop, check.ResultDrop }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_cidr_deny_default.go b/connectivity/builder/client_egress_to_cidr_deny_default.go similarity index 61% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_cidr_deny_default.go rename to connectivity/builder/client_egress_to_cidr_deny_default.go index 68c05f9050..645078ec9a 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_cidr_deny_default.go +++ b/connectivity/builder/client_egress_to_cidr_deny_default.go @@ -4,26 +4,26 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type clientEgressToCidrDenyDefault struct{} -func (t clientEgressToCidrDenyDefault) build(ct *check2.ConnectivityTest, templates map[string]string) { +func (t clientEgressToCidrDenyDefault) build(ct *check.ConnectivityTest, templates map[string]string) { // This test is same as the previous one, but there is no allowed policy. // The goal is to test default deny policy newTest("client-egress-to-cidr-deny-default", ct). WithCiliumPolicy(templates["clientEgressToCIDRExternalDenyPolicyYAML"]). WithScenarios(tests.PodToCIDR()). // Denies all traffic to ExternalOtherIP, but allow ExternalIP - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().Address(features.GetIPFamily(ct.Params().ExternalOtherIP)) == ct.Params().ExternalOtherIP { - return check2.ResultPolicyDenyEgressDrop, check2.ResultNone + return check.ResultPolicyDenyEgressDrop, check.ResultNone } if a.Destination().Address(features.GetIPFamily(ct.Params().ExternalIP)) == ct.Params().ExternalIP { - return check2.ResultDefaultDenyEgressDrop, check2.ResultNone + return check.ResultDefaultDenyEgressDrop, check.ResultNone } - return check2.ResultDrop, check2.ResultDrop + return check.ResultDrop, check.ResultDrop }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_echo_deny.go b/connectivity/builder/client_egress_to_echo_deny.go similarity index 58% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_echo_deny.go rename to connectivity/builder/client_egress_to_echo_deny.go index aae91abaf4..c3a50966c1 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_echo_deny.go +++ b/connectivity/builder/client_egress_to_echo_deny.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-egress-to-echo-deny.yaml @@ -14,22 +15,22 @@ var clientEgressToEchoDenyPolicyYAML string type clientEgressToEchoDeny struct{} -func (t clientEgressToEchoDeny) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t clientEgressToEchoDeny) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy denies port 8080 from client to echo newTest("client-egress-to-echo-deny", ct). WithCiliumPolicy(allowAllEgressPolicyYAML). // Allow all egress traffic WithCiliumPolicy(allowAllIngressPolicyYAML). // Allow all ingress traffic WithCiliumPolicy(clientEgressToEchoDenyPolicyYAML). // Deny client to echo traffic via port 8080 WithScenarios( - tests2.ClientToClient(), // Client to client traffic should be allowed - tests2.PodToPod(), // Client to echo traffic should be denied + tests.ClientToClient(), // Client to client traffic should be allowed + tests.PodToPod(), // Client to echo traffic should be denied ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Source().HasLabel("kind", "client") && a.Destination().HasLabel("kind", "echo") && a.Destination().Port() == 8080 { - return check2.ResultPolicyDenyEgressDrop, check2.ResultNone + return check.ResultPolicyDenyEgressDrop, check.ResultNone } - return check2.ResultOK, check2.ResultNone + return check.ResultOK, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_echo_expression_deny.go b/connectivity/builder/client_egress_to_echo_expression_deny.go similarity index 56% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_echo_expression_deny.go rename to connectivity/builder/client_egress_to_echo_expression_deny.go index a5b245b757..a930e0ed8b 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_echo_expression_deny.go +++ b/connectivity/builder/client_egress_to_echo_expression_deny.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-egress-to-echo-expression-deny.yaml @@ -14,21 +15,21 @@ var clientEgressToEchoExpressionDenyPolicyYAML string type clientEgressToEchoExpressionDeny struct{} -func (t clientEgressToEchoExpressionDeny) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t clientEgressToEchoExpressionDeny) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy denies port 8080 from client to echo (using label match expression), but allows traffic from client2 newTest("client-egress-to-echo-expression-deny", ct). WithCiliumPolicy(allowAllEgressPolicyYAML). // Allow all egress traffic WithCiliumPolicy(allowAllIngressPolicyYAML). // Allow all ingress traffic WithCiliumPolicy(clientEgressToEchoExpressionDenyPolicyYAML). WithScenarios( - tests2.PodToPod(tests2.WithSourceLabelsOption(clientLabel)), // Client to echo should be denied - tests2.PodToPod(tests2.WithSourceLabelsOption(client2Label)), // Client2 to echo should be allowed + tests.PodToPod(tests.WithSourceLabelsOption(clientLabel)), // Client to echo should be denied + tests.PodToPod(tests.WithSourceLabelsOption(client2Label)), // Client2 to echo should be allowed ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().HasLabel("kind", "echo") && a.Source().HasLabel("name", "client") { - return check2.ResultPolicyDenyEgressDrop, check2.ResultNone + return check.ResultPolicyDenyEgressDrop, check.ResultNone } - return check2.ResultOK, check2.ResultOK + return check.ResultOK, check.ResultOK }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_echo_service_account.go b/connectivity/builder/client_egress_to_echo_service_account.go similarity index 54% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_echo_service_account.go rename to connectivity/builder/client_egress_to_echo_service_account.go index d9176fcc64..152c3e4cb1 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_echo_service_account.go +++ b/connectivity/builder/client_egress_to_echo_service_account.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-egress-to-echo-service-account.yaml @@ -14,17 +15,17 @@ var clientEgressToEchoServiceAccountPolicyYAML string type clientEgressToEchoServiceAccount struct{} -func (t clientEgressToEchoServiceAccount) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t clientEgressToEchoServiceAccount) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy allows port 8080 from client to endpoint with service account label as echo-same-node newTest("client-egress-to-echo-service-account", ct). WithCiliumPolicy(clientEgressToEchoServiceAccountPolicyYAML). WithScenarios( - tests2.PodToPod(tests2.WithSourceLabelsOption(map[string]string{"kind": "client"})), + tests.PodToPod(tests.WithSourceLabelsOption(map[string]string{"kind": "client"})), ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().HasLabel("name", "echo-same-node") { - return check2.ResultOK, check2.ResultOK + return check.ResultOK, check.ResultOK } - return check2.ResultDefaultDenyEgressDrop, check2.ResultNone + return check.ResultDefaultDenyEgressDrop, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_echo_service_account_deny.go b/connectivity/builder/client_egress_to_echo_service_account_deny.go similarity index 60% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_echo_service_account_deny.go rename to connectivity/builder/client_egress_to_echo_service_account_deny.go index 2e4c2541a6..5e3135d64e 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_egress_to_echo_service_account_deny.go +++ b/connectivity/builder/client_egress_to_echo_service_account_deny.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-egress-to-echo-service-account-deny.yaml @@ -14,19 +15,19 @@ var clientEgressToEchoServiceAccountDenyPolicyYAML string type clientEgressToEchoServiceAccountDeny struct{} -func (t clientEgressToEchoServiceAccountDeny) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t clientEgressToEchoServiceAccountDeny) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy denies port 8080 from client to endpoint with service account, but not from client2 newTest("client-egress-to-echo-service-account-deny", ct). WithCiliumPolicy(allowAllEgressPolicyYAML). // Allow all egress traffic WithCiliumPolicy(allowAllIngressPolicyYAML). // Allow all ingress traffic WithCiliumPolicy(clientEgressToEchoServiceAccountDenyPolicyYAML). WithScenarios( - tests2.PodToPod(tests2.WithSourceLabelsOption(map[string]string{"name": "client"})), + tests.PodToPod(tests.WithSourceLabelsOption(map[string]string{"name": "client"})), ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().HasLabel("name", "echo-same-node") { - return check2.ResultPolicyDenyEgressDrop, check2.ResultNone + return check.ResultPolicyDenyEgressDrop, check.ResultNone } - return check2.ResultOK, check2.ResultOK + return check.ResultOK, check.ResultOK }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_ingress.go b/connectivity/builder/client_ingress.go similarity index 56% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_ingress.go rename to connectivity/builder/client_ingress.go index efdd50e464..7de17737c6 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_ingress.go +++ b/connectivity/builder/client_ingress.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-ingress-from-client2.yaml @@ -14,15 +15,15 @@ var clientIngressFromClient2PolicyYAML string type clientIngress struct{} -func (t clientIngress) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t clientIngress) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy only allows ingress into client from client2. newTest("client-ingress", ct). WithCiliumPolicy(clientIngressFromClient2PolicyYAML). WithScenarios(tests.ClientToClient()). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Source().HasLabel("other", "client") { - return check2.ResultOK, check2.ResultOK + return check.ResultOK, check.ResultOK } - return check2.ResultOK, check2.ResultDefaultDenyIngressDrop + return check.ResultOK, check.ResultDefaultDenyIngressDrop }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_ingress_from_other_client_icmp_deny.go b/connectivity/builder/client_ingress_from_other_client_icmp_deny.go similarity index 61% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_ingress_from_other_client_icmp_deny.go rename to connectivity/builder/client_ingress_from_other_client_icmp_deny.go index 63c98fc39c..4e7907fe8c 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_ingress_from_other_client_icmp_deny.go +++ b/connectivity/builder/client_ingress_from_other_client_icmp_deny.go @@ -5,9 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" ) @@ -16,7 +16,7 @@ var echoIngressICMPDenyPolicyYAML string type clientIngressFromOtherClientIcmpDeny struct{} -func (t clientIngressFromOtherClientIcmpDeny) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t clientIngressFromOtherClientIcmpDeny) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy denies ICMP ingress to client only from other client newTest("client-ingress-from-other-client-icmp-deny", ct). WithCiliumPolicy(allowAllEgressPolicyYAML). // Allow all egress traffic @@ -24,14 +24,14 @@ func (t clientIngressFromOtherClientIcmpDeny) build(ct *check2.ConnectivityTest, WithCiliumPolicy(echoIngressICMPDenyPolicyYAML). // Deny ICMP traffic from client to another client WithFeatureRequirements(features.RequireEnabled(features.ICMPPolicy)). WithScenarios( - tests2.PodToPod(), // Client to echo traffic should be allowed - tests2.ClientToClient(), // Client to client traffic should be denied + tests.PodToPod(), // Client to echo traffic should be allowed + tests.ClientToClient(), // Client to client traffic should be denied ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Source().HasLabel("other", "client") && a.Destination().HasLabel("kind", "client") { - return check2.ResultDrop, check2.ResultPolicyDenyIngressDrop + return check.ResultDrop, check.ResultPolicyDenyIngressDrop } - return check2.ResultOK, check2.ResultNone + return check.ResultOK, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_ingress_icmp.go b/connectivity/builder/client_ingress_icmp.go similarity index 60% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_ingress_icmp.go rename to connectivity/builder/client_ingress_icmp.go index e712fb501e..2336eb4061 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_ingress_icmp.go +++ b/connectivity/builder/client_ingress_icmp.go @@ -5,9 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" ) @@ -16,16 +16,16 @@ var echoIngressICMPPolicyYAML string type clientIngressIcmp struct{} -func (t clientIngressIcmp) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t clientIngressIcmp) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy allowed ICMP traffic from client to another client. newTest("client-ingress-icmp", ct). WithCiliumPolicy(echoIngressICMPPolicyYAML). WithFeatureRequirements(features.RequireEnabled(features.ICMPPolicy)). WithScenarios(tests.ClientToClient()). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Source().HasLabel("other", "client") { - return check2.ResultOK, check2.ResultOK + return check.ResultOK, check.ResultOK } - return check2.ResultOK, check2.ResultDefaultDenyIngressDrop + return check.ResultOK, check.ResultDefaultDenyIngressDrop }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_ingress_knp.go b/connectivity/builder/client_ingress_knp.go similarity index 55% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_ingress_knp.go rename to connectivity/builder/client_ingress_knp.go index e716297411..7c2a4f41b6 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_ingress_knp.go +++ b/connectivity/builder/client_ingress_knp.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-ingress-from-client2-knp.yaml @@ -14,15 +15,15 @@ var clientIngressFromClient2PolicyKNPYAML string type clientIngressKnp struct{} -func (t clientIngressKnp) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t clientIngressKnp) build(ct *check.ConnectivityTest, _ map[string]string) { // Run a simple test with k8s Network Policy. newTest("client-ingress-knp", ct). WithK8SPolicy(clientIngressFromClient2PolicyKNPYAML). WithScenarios(tests.ClientToClient()). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Source().HasLabel("other", "client") { - return check2.ResultOK, check2.ResultOK + return check.ResultOK, check.ResultOK } - return check2.ResultOK, check2.ResultDefaultDenyIngressDrop + return check.ResultOK, check.ResultDefaultDenyIngressDrop }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_ingress_to_echo_named_port_deny.go b/connectivity/builder/client_ingress_to_echo_named_port_deny.go similarity index 55% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_ingress_to_echo_named_port_deny.go rename to connectivity/builder/client_ingress_to_echo_named_port_deny.go index 7a7568e4d0..72903414c6 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_ingress_to_echo_named_port_deny.go +++ b/connectivity/builder/client_ingress_to_echo_named_port_deny.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-egress-to-echo-named-port-deny.yaml @@ -14,20 +15,20 @@ var clientEgressToEchoDenyNamedPortPolicyYAML string type clientIngressToEchoNamedPortDeny struct{} -func (t clientIngressToEchoNamedPortDeny) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t clientIngressToEchoNamedPortDeny) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy denies port http-8080 from client to echo, but allows traffic from client2 to echo newTest("client-ingress-to-echo-named-port-deny", ct). WithCiliumPolicy(allowAllEgressPolicyYAML). // Allow all egress traffic WithCiliumPolicy(allowAllIngressPolicyYAML). // Allow all ingress traffic WithCiliumPolicy(clientEgressToEchoDenyNamedPortPolicyYAML). WithScenarios( - tests2.PodToPod(tests2.WithSourceLabelsOption(clientLabel)), // Client to echo should be denied - tests2.PodToPod(tests2.WithSourceLabelsOption(client2Label)), // Client2 to echo should be allowed + tests.PodToPod(tests.WithSourceLabelsOption(clientLabel)), // Client to echo should be denied + tests.PodToPod(tests.WithSourceLabelsOption(client2Label)), // Client2 to echo should be allowed ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().HasLabel("kind", "echo") && a.Source().HasLabel("name", "client") { - return check2.ResultDropCurlTimeout, check2.ResultPolicyDenyIngressDrop + return check.ResultDropCurlTimeout, check.ResultPolicyDenyIngressDrop } - return check2.ResultOK, check2.ResultOK + return check.ResultOK, check.ResultOK }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_with_service_account_egress_to_echo.go b/connectivity/builder/client_with_service_account_egress_to_echo.go similarity index 74% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_with_service_account_egress_to_echo.go rename to connectivity/builder/client_with_service_account_egress_to_echo.go index 63cc5e8907..ef3a4b27b9 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_with_service_account_egress_to_echo.go +++ b/connectivity/builder/client_with_service_account_egress_to_echo.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-with-service-account-egress-to-echo.yaml @@ -19,6 +20,6 @@ func (t clientWithServiceAccountEgressToEcho) build(ct *check.ConnectivityTest, newTest("client-with-service-account-egress-to-echo", ct). WithCiliumPolicy(clientWithServiceAccountEgressToEchoPolicyYAML). WithScenarios( - tests2.PodToPod(tests2.WithSourceLabelsOption(map[string]string{"kind": "client"})), + tests.PodToPod(tests.WithSourceLabelsOption(map[string]string{"kind": "client"})), ) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_with_service_account_egress_to_echo_deny.go b/connectivity/builder/client_with_service_account_egress_to_echo_deny.go similarity index 59% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_with_service_account_egress_to_echo_deny.go rename to connectivity/builder/client_with_service_account_egress_to_echo_deny.go index 9cc555c6bf..0ba9b77d97 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/client_with_service_account_egress_to_echo_deny.go +++ b/connectivity/builder/client_with_service_account_egress_to_echo_deny.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-with-service-account-egress-to-echo-deny.yaml @@ -14,20 +15,20 @@ var clientWithServiceAccountEgressToEchoDenyPolicyYAML string type clientWithServiceAccountEgressToEchoDeny struct{} -func (t clientWithServiceAccountEgressToEchoDeny) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t clientWithServiceAccountEgressToEchoDeny) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy denies port 8080 from client with service account selector to echo, but not from client2 newTest("client-with-service-account-egress-to-echo-deny", ct). WithCiliumPolicy(allowAllEgressPolicyYAML). // Allow all egress traffic WithCiliumPolicy(allowAllIngressPolicyYAML). // Allow all ingress traffic WithCiliumPolicy(clientWithServiceAccountEgressToEchoDenyPolicyYAML). WithScenarios( - tests2.PodToPod(tests2.WithSourceLabelsOption(map[string]string{"name": "client"})), // Client to echo should be denied - tests2.PodToPod(tests2.WithSourceLabelsOption(map[string]string{"name": "client2"})), // Client2 to echo should be allowed + tests.PodToPod(tests.WithSourceLabelsOption(map[string]string{"name": "client"})), // Client to echo should be denied + tests.PodToPod(tests.WithSourceLabelsOption(map[string]string{"name": "client2"})), // Client2 to echo should be allowed ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().HasLabel("kind", "echo") && a.Source().HasLabel("name", "client") { - return check2.ResultPolicyDenyEgressDrop, check2.ResultNone + return check.ResultPolicyDenyEgressDrop, check.ResultNone } - return check2.ResultOK, check2.ResultOK + return check.ResultOK, check.ResultOK }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/cluster_entity.go b/connectivity/builder/cluster_entity.go similarity index 51% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/cluster_entity.go rename to connectivity/builder/cluster_entity.go index 600c90eb41..facca5b184 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/cluster_entity.go +++ b/connectivity/builder/cluster_entity.go @@ -4,22 +4,22 @@ package builder import ( - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) type clusterEntity struct{} -func (t clusterEntity) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t clusterEntity) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy allows cluster entity newTest("cluster-entity", ct). WithCiliumPolicy(allowClusterEntityPolicyYAML). WithScenarios( // Only enable to local cluster for now due to the below // https://github.com/cilium/cilium/blob/88c4dddede2a3b5b9a7339c1316a0dedd7229a26/pkg/policy/api/entity.go#L126 - tests2.PodToPod(tests2.WithDestinationLabelsOption(map[string]string{"name": "echo-same-node"})), + tests.PodToPod(tests.WithDestinationLabelsOption(map[string]string{"name": "echo-same-node"})), ). - WithExpectations(func(_ *check2.Action) (egress, ingress check2.Result) { - return check2.ResultOK, check2.ResultOK + WithExpectations(func(_ *check.Action) (egress, ingress check.Result) { + return check.ResultOK, check.ResultOK }) } diff --git a/connectivity/builder/cluster_entity_multi_cluster.go b/connectivity/builder/cluster_entity_multi_cluster.go new file mode 100644 index 0000000000..7f76d4e624 --- /dev/null +++ b/connectivity/builder/cluster_entity_multi_cluster.go @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Authors of Cilium + +package builder + +import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" +) + +type clusterEntityMultiCluster struct{} + +func (t clusterEntityMultiCluster) build(ct *check.ConnectivityTest, _ map[string]string) { + newTest("cluster-entity-multi-cluster", ct). + WithCondition(func() bool { return ct.Params().MultiCluster != "" }). + WithCiliumPolicy(allowClusterEntityPolicyYAML). + WithScenarios( + tests.PodToPod(tests.WithDestinationLabelsOption(map[string]string{"name": "echo-other-node"})), + ). + WithExpectations(func(_ *check.Action) (egress, ingress check.Result) { + return check.ResultDefaultDenyEgressDrop, check.ResultNone + }) +} diff --git a/connectivity/builder/dns_only.go b/connectivity/builder/dns_only.go new file mode 100644 index 0000000000..d24701ae82 --- /dev/null +++ b/connectivity/builder/dns_only.go @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Authors of Cilium + +package builder + +import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/utils/features" +) + +type dnsOnly struct{} + +func (t dnsOnly) build(ct *check.ConnectivityTest, _ map[string]string) { + // Only allow UDP:53 to kube-dns, no DNS proxy enabled. + newTest("dns-only", ct). + WithCiliumPolicy(clientEgressOnlyDNSPolicyYAML). + WithFeatureRequirements(features.RequireEnabled(features.L7Proxy)). + WithScenarios( + tests.PodToPod(), // connects to other Pods directly, no DNS + tests.PodToWorld(), // resolves set domain-name defaults to one.one.one.one + ). + WithExpectations(func(_ *check.Action) (egress check.Result, ingress check.Result) { + return check.ResultDropCurlTimeout, check.ResultNone + }) +} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress.go b/connectivity/builder/echo_ingress.go similarity index 58% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress.go rename to connectivity/builder/echo_ingress.go index 0ed490ba0f..64c095af41 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress.go +++ b/connectivity/builder/echo_ingress.go @@ -4,23 +4,23 @@ package builder import ( - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) type echoIngress struct{} -func (t echoIngress) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t echoIngress) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy allows ingress to echo only from client with a label 'other:client'. newTest("echo-ingress", ct). WithCiliumPolicy(echoIngressFromOtherClientPolicyYAML). WithScenarios(tests.PodToPod()). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().HasLabel("kind", "echo") && !a.Source().HasLabel("other", "client") { // TCP handshake fails both in egress and ingress when // L3(/L4) policy drops at either location. - return check2.ResultDropCurlTimeout, check2.ResultDropCurlTimeout + return check.ResultDropCurlTimeout, check.ResultDropCurlTimeout } - return check2.ResultOK, check2.ResultOK + return check.ResultOK, check.ResultOK }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_auth_always_fail.go b/connectivity/builder/echo_ingress_auth_always_fail.go similarity index 66% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_auth_always_fail.go rename to connectivity/builder/echo_ingress_auth_always_fail.go index 39e98bd649..8687c2518b 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_auth_always_fail.go +++ b/connectivity/builder/echo_ingress_auth_always_fail.go @@ -5,9 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" ) @@ -16,7 +16,7 @@ var echoIngressAuthFailPolicyYAML string type echoIngressAuthAlwaysFail struct{} -func (t echoIngressAuthAlwaysFail) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t echoIngressAuthAlwaysFail) build(ct *check.ConnectivityTest, _ map[string]string) { // Test mutual auth with always-fail newTest("echo-ingress-auth-always-fail", ct). WithCiliumPolicy(echoIngressAuthFailPolicyYAML). @@ -24,7 +24,7 @@ func (t echoIngressAuthAlwaysFail) build(ct *check2.ConnectivityTest, _ map[stri // currently this is tested spiffe as that is the only functional auth method WithFeatureRequirements(features.RequireEnabled(features.AuthSpiffe)). WithScenarios(tests.PodToPod()). - WithExpectations(func(_ *check2.Action) (egress, ingress check2.Result) { - return check2.ResultDropCurlTimeout, check2.ResultDropAuthRequired + WithExpectations(func(_ *check.Action) (egress, ingress check.Result) { + return check.ResultDropCurlTimeout, check.ResultDropAuthRequired }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_from_other_client_deny.go b/connectivity/builder/echo_ingress_from_other_client_deny.go similarity index 52% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_from_other_client_deny.go rename to connectivity/builder/echo_ingress_from_other_client_deny.go index 1d5b521517..bf629b9c1d 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_from_other_client_deny.go +++ b/connectivity/builder/echo_ingress_from_other_client_deny.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/echo-ingress-from-other-client-deny.yaml @@ -14,21 +15,21 @@ var echoIngressFromOtherClientDenyPolicyYAML string type echoIngressFromOtherClientDeny struct{} -func (t echoIngressFromOtherClientDeny) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t echoIngressFromOtherClientDeny) build(ct *check.ConnectivityTest, _ map[string]string) { // Tests with deny policy newTest("echo-ingress-from-other-client-deny", ct). WithCiliumPolicy(allowAllEgressPolicyYAML). // Allow all egress traffic WithCiliumPolicy(allowAllIngressPolicyYAML). // Allow all ingress traffic WithCiliumPolicy(echoIngressFromOtherClientDenyPolicyYAML). // Deny other client contact echo WithScenarios( - tests2.PodToPod(tests2.WithSourceLabelsOption(clientLabel)), // Client to echo should be allowed - tests2.PodToPod(tests2.WithSourceLabelsOption(client2Label)), // Client2 to echo should be denied - tests2.ClientToClient(), // Client to client should be allowed + tests.PodToPod(tests.WithSourceLabelsOption(clientLabel)), // Client to echo should be allowed + tests.PodToPod(tests.WithSourceLabelsOption(client2Label)), // Client2 to echo should be denied + tests.ClientToClient(), // Client to client should be allowed ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Source().HasLabel("other", "client") && a.Destination().HasLabel("kind", "echo") { - return check2.ResultDrop, check2.ResultPolicyDenyIngressDrop + return check.ResultDrop, check.ResultPolicyDenyIngressDrop } - return check2.ResultOK, check2.ResultOK + return check.ResultOK, check.ResultOK }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_from_outside.go b/connectivity/builder/echo_ingress_from_outside.go similarity index 64% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_from_outside.go rename to connectivity/builder/echo_ingress_from_outside.go index 87c0f94e37..246b494363 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_from_outside.go +++ b/connectivity/builder/echo_ingress_from_outside.go @@ -4,26 +4,26 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type echoIngressFromOutside struct{} -func (t echoIngressFromOutside) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t echoIngressFromOutside) build(ct *check.ConnectivityTest, _ map[string]string) { newTest("echo-ingress-from-outside", ct). WithCondition(func() bool { return ct.Params().IncludeUnsafeTests }). WithCiliumPolicy(echoIngressFromOtherClientPolicyYAML). WithFeatureRequirements(features.RequireEnabled(features.NodeWithoutCilium)). WithIPRoutesFromOutsideToPodCIDRs(). WithScenarios(tests.FromCIDRToPod()). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().HasLabel("kind", "echo") && !a.Source().HasLabel("other", "client") { // TCP handshake fails both in egress and ingress when // L3(/L4) policy drops at either location. - return check2.ResultDropCurlTimeout, check2.ResultDropCurlTimeout + return check.ResultDropCurlTimeout, check.ResultDropCurlTimeout } - return check2.ResultOK, check2.ResultOK + return check.ResultOK, check.ResultOK }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_knp.go b/connectivity/builder/echo_ingress_knp.go similarity index 63% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_knp.go rename to connectivity/builder/echo_ingress_knp.go index 0aff42f7fc..4cb2d061c1 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_knp.go +++ b/connectivity/builder/echo_ingress_knp.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/echo-ingress-from-other-client-knp.yaml @@ -14,17 +15,17 @@ var echoIngressFromOtherClientPolicyKNPYAML string type echoIngressKnp struct{} -func (t echoIngressKnp) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t echoIngressKnp) build(ct *check.ConnectivityTest, _ map[string]string) { // This k8s policy allows ingress to echo only from client with a label 'other:client'. newTest("echo-ingress-knp", ct). WithK8SPolicy(echoIngressFromOtherClientPolicyKNPYAML). WithScenarios(tests.PodToPod()). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().HasLabel("kind", "echo") && !a.Source().HasLabel("other", "client") { // TCP handshake fails both in egress and ingress when // L3(/L4) policy drops at either location. - return check2.ResultDropCurlTimeout, check2.ResultDropCurlTimeout + return check.ResultDropCurlTimeout, check.ResultDropCurlTimeout } - return check2.ResultOK, check2.ResultOK + return check.ResultOK, check.ResultOK }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_l7.go b/connectivity/builder/echo_ingress_l7.go similarity index 66% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_l7.go rename to connectivity/builder/echo_ingress_l7.go index 07a148730c..b0ba386579 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_l7.go +++ b/connectivity/builder/echo_ingress_l7.go @@ -5,9 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" ) @@ -16,26 +16,26 @@ var echoIngressL7HTTPPolicyYAML string type echoIngressL7 struct{} -func (t echoIngressL7) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t echoIngressL7) build(ct *check.ConnectivityTest, _ map[string]string) { // Test L7 HTTP introspection using an ingress policy on echo pods. newTest("echo-ingress-l7", ct). WithFeatureRequirements(features.RequireEnabled(features.L7Proxy)). WithCiliumPolicy(echoIngressL7HTTPPolicyYAML). // L7 allow policy with HTTP introspection WithScenarios(tests.PodToPodWithEndpoints()). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Source().HasLabel("other", "client") { // Only client2 is allowed to make HTTP calls. // Trying to access private endpoint without "secret" header set // should lead to a drop. if a.Destination().Path() == "/private" && !a.Destination().HasLabel("X-Very-Secret-Token", "42") { - return check2.ResultDropCurlHTTPError, check2.ResultNone + return check.ResultDropCurlHTTPError, check.ResultNone } - egress = check2.ResultOK + egress = check.ResultOK // Expect all curls from client2 to be proxied and to be GET calls. - egress.HTTP = check2.HTTP{ + egress.HTTP = check.HTTP{ Method: "GET", } - return egress, check2.ResultNone + return egress, check.ResultNone } - return check2.ResultDrop, check2.ResultDefaultDenyIngressDrop + return check.ResultDrop, check.ResultDefaultDenyIngressDrop }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_l7_named_port.go b/connectivity/builder/echo_ingress_l7_named_port.go similarity index 67% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_l7_named_port.go rename to connectivity/builder/echo_ingress_l7_named_port.go index 89444f5b2d..bcc00cb125 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_l7_named_port.go +++ b/connectivity/builder/echo_ingress_l7_named_port.go @@ -5,9 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" ) @@ -16,26 +16,26 @@ var echoIngressL7HTTPNamedPortPolicyYAML string type echoIngressL7NamedPort struct{} -func (t echoIngressL7NamedPort) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t echoIngressL7NamedPort) build(ct *check.ConnectivityTest, _ map[string]string) { // Test L7 HTTP introspection using an ingress policy on echo pods. newTest("echo-ingress-l7-named-port", ct). WithFeatureRequirements(features.RequireEnabled(features.L7Proxy)). WithCiliumPolicy(echoIngressL7HTTPNamedPortPolicyYAML). // L7 allow policy with HTTP introspection (named port) WithScenarios(tests.PodToPodWithEndpoints()). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Source().HasLabel("other", "client") { // Only client2 is allowed to make HTTP calls. // Trying to access private endpoint without "secret" header set // should lead to a drop. if a.Destination().Path() == "/private" && !a.Destination().HasLabel("X-Very-Secret-Token", "42") { - return check2.ResultDropCurlHTTPError, check2.ResultNone + return check.ResultDropCurlHTTPError, check.ResultNone } - egress = check2.ResultOK + egress = check.ResultOK // Expect all curls from client2 to be proxied and to be GET calls. - egress.HTTP = check2.HTTP{ + egress.HTTP = check.HTTP{ Method: "GET", } - return egress, check2.ResultNone + return egress, check.ResultNone } - return check2.ResultDrop, check2.ResultDefaultDenyIngressDrop + return check.ResultDrop, check.ResultDefaultDenyIngressDrop }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_mutual_auth_spiffe.go b/connectivity/builder/echo_ingress_mutual_auth_spiffe.go similarity index 84% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_mutual_auth_spiffe.go rename to connectivity/builder/echo_ingress_mutual_auth_spiffe.go index cd9cbdaeac..18930e2ffb 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/echo_ingress_mutual_auth_spiffe.go +++ b/connectivity/builder/echo_ingress_mutual_auth_spiffe.go @@ -5,9 +5,9 @@ package builder import ( _ "embed" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" ) diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/egress_gateway.go b/connectivity/builder/egress_gateway.go similarity index 65% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/egress_gateway.go rename to connectivity/builder/egress_gateway.go index 5605cb124f..cf1af4a266 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/egress_gateway.go +++ b/connectivity/builder/egress_gateway.go @@ -4,21 +4,21 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type egressGateway struct{} -func (t egressGateway) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t egressGateway) build(ct *check.ConnectivityTest, _ map[string]string) { newTest("egress-gateway", ct). WithCondition(func() bool { return ct.Params().IncludeUnsafeTests }). - WithCiliumEgressGatewayPolicy(check2.CiliumEgressGatewayPolicyParams{ + WithCiliumEgressGatewayPolicy(check.CiliumEgressGatewayPolicyParams{ Name: "cegp-sample-client", PodSelectorKind: "client", }). - WithCiliumEgressGatewayPolicy(check2.CiliumEgressGatewayPolicyParams{ + WithCiliumEgressGatewayPolicy(check.CiliumEgressGatewayPolicyParams{ Name: "cegp-sample-echo", PodSelectorKind: "echo", }). diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/egress_gateway_excluded_cidrs.go b/connectivity/builder/egress_gateway_excluded_cidrs.go similarity index 65% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/egress_gateway_excluded_cidrs.go rename to connectivity/builder/egress_gateway_excluded_cidrs.go index 43691fa0d6..06744f5e29 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/egress_gateway_excluded_cidrs.go +++ b/connectivity/builder/egress_gateway_excluded_cidrs.go @@ -4,24 +4,24 @@ package builder import ( - "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" - "github.com/cilium/cilium/pkg/versioncheck" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/utils/features" ) type egressGatewayExcludedCidrs struct{} -func (t egressGatewayExcludedCidrs) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t egressGatewayExcludedCidrs) build(ct *check.ConnectivityTest, _ map[string]string) { newTest("egress-gateway-excluded-cidrs", ct). WithCondition(func() bool { return versioncheck.MustCompile(">=1.14.0")(ct.CiliumVersion) }). - WithCiliumEgressGatewayPolicy(check2.CiliumEgressGatewayPolicyParams{ + WithCiliumEgressGatewayPolicy(check.CiliumEgressGatewayPolicyParams{ Name: "cegp-sample-client", PodSelectorKind: "client", - ExcludedCIDRsConf: check2.ExternalNodeExcludedCIDRs, + ExcludedCIDRsConf: check.ExternalNodeExcludedCIDRs, }). WithFeatureRequirements( features.RequireEnabled(features.EgressGateway), diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/from_cidr_host_netns.go b/connectivity/builder/from_cidr_host_netns.go similarity index 60% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/from_cidr_host_netns.go rename to connectivity/builder/from_cidr_host_netns.go index 58facb6ccb..b3e276f85f 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/from_cidr_host_netns.go +++ b/connectivity/builder/from_cidr_host_netns.go @@ -4,21 +4,21 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type fromCidrHostNetns struct{} -func (t fromCidrHostNetns) build(ct *check2.ConnectivityTest, templates map[string]string) { +func (t fromCidrHostNetns) build(ct *check.ConnectivityTest, templates map[string]string) { newTest("from-cidr-host-netns", ct). WithCondition(func() bool { return ct.Params().IncludeUnsafeTests }). WithFeatureRequirements(features.RequireEnabled(features.NodeWithoutCilium)). WithCiliumPolicy(templates["echoIngressFromCIDRYAML"]). WithIPRoutesFromOutsideToPodCIDRs(). WithScenarios(tests.FromCIDRToPod()). - WithExpectations(func(_ *check2.Action) (egress, ingress check2.Result) { - return check2.ResultOK, check2.ResultNone + WithExpectations(func(_ *check.Action) (egress, ingress check.Result) { + return check.ResultOK, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/health.go b/connectivity/builder/health.go similarity index 77% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/health.go rename to connectivity/builder/health.go index 2fb92e2879..b6356517e1 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/health.go +++ b/connectivity/builder/health.go @@ -4,9 +4,9 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type health struct{} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/host_entity_egress.go b/connectivity/builder/host_entity_egress.go similarity index 56% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/host_entity_egress.go rename to connectivity/builder/host_entity_egress.go index 9f264026ca..415b039e90 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/host_entity_egress.go +++ b/connectivity/builder/host_entity_egress.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/allow-host-entity-egress.yaml @@ -14,12 +15,12 @@ var allowHostEntityEgressPolicyYAML string type hostEntityEgress struct{} -func (t hostEntityEgress) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t hostEntityEgress) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy allows egress traffic towards the host entity newTest("host-entity-egress", ct). WithCiliumPolicy(allowHostEntityEgressPolicyYAML). WithScenarios(tests.PodToHost()). - WithExpectations(func(_ *check2.Action) (egress, ingress check2.Result) { - return check2.ResultOK, check2.ResultNone + WithExpectations(func(_ *check.Action) (egress, ingress check.Result) { + return check.ResultOK, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/host_entity_ingress.go b/connectivity/builder/host_entity_ingress.go similarity index 81% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/host_entity_ingress.go rename to connectivity/builder/host_entity_ingress.go index 9b79ec3ef6..a2e995c6a8 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/host_entity_ingress.go +++ b/connectivity/builder/host_entity_ingress.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/allow-host-entity-ingress.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/allow-all-egress.yaml b/connectivity/builder/manifests/allow-all-egress.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/allow-all-egress.yaml rename to connectivity/builder/manifests/allow-all-egress.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/allow-all-except-world.yaml b/connectivity/builder/manifests/allow-all-except-world.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/allow-all-except-world.yaml rename to connectivity/builder/manifests/allow-all-except-world.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/allow-all-ingress.yaml b/connectivity/builder/manifests/allow-all-ingress.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/allow-all-ingress.yaml rename to connectivity/builder/manifests/allow-all-ingress.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/allow-cluster-entity.yaml b/connectivity/builder/manifests/allow-cluster-entity.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/allow-cluster-entity.yaml rename to connectivity/builder/manifests/allow-cluster-entity.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/allow-host-entity-egress.yaml b/connectivity/builder/manifests/allow-host-entity-egress.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/allow-host-entity-egress.yaml rename to connectivity/builder/manifests/allow-host-entity-egress.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/allow-host-entity-ingress.yaml b/connectivity/builder/manifests/allow-host-entity-ingress.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/allow-host-entity-ingress.yaml rename to connectivity/builder/manifests/allow-host-entity-ingress.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/allow-ingress-identity.yaml b/connectivity/builder/manifests/allow-ingress-identity.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/allow-ingress-identity.yaml rename to connectivity/builder/manifests/allow-ingress-identity.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-l7-http-matchheader-secret.yaml b/connectivity/builder/manifests/client-egress-l7-http-matchheader-secret.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-l7-http-matchheader-secret.yaml rename to connectivity/builder/manifests/client-egress-l7-http-matchheader-secret.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-l7-http-method.yaml b/connectivity/builder/manifests/client-egress-l7-http-method.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-l7-http-method.yaml rename to connectivity/builder/manifests/client-egress-l7-http-method.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-l7-http-named-port.yaml b/connectivity/builder/manifests/client-egress-l7-http-named-port.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-l7-http-named-port.yaml rename to connectivity/builder/manifests/client-egress-l7-http-named-port.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-l7-http.yaml b/connectivity/builder/manifests/client-egress-l7-http.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-l7-http.yaml rename to connectivity/builder/manifests/client-egress-l7-http.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-l7-tls.yaml b/connectivity/builder/manifests/client-egress-l7-tls.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-l7-tls.yaml rename to connectivity/builder/manifests/client-egress-l7-tls.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-only-dns.yaml b/connectivity/builder/manifests/client-egress-only-dns.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-only-dns.yaml rename to connectivity/builder/manifests/client-egress-only-dns.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-cidr-cp-host-knp.yaml b/connectivity/builder/manifests/client-egress-to-cidr-cp-host-knp.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-cidr-cp-host-knp.yaml rename to connectivity/builder/manifests/client-egress-to-cidr-cp-host-knp.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-cidr-external-deny.yaml b/connectivity/builder/manifests/client-egress-to-cidr-external-deny.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-cidr-external-deny.yaml rename to connectivity/builder/manifests/client-egress-to-cidr-external-deny.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-cidr-external-knp.yaml b/connectivity/builder/manifests/client-egress-to-cidr-external-knp.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-cidr-external-knp.yaml rename to connectivity/builder/manifests/client-egress-to-cidr-external-knp.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-cidr-external.yaml b/connectivity/builder/manifests/client-egress-to-cidr-external.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-cidr-external.yaml rename to connectivity/builder/manifests/client-egress-to-cidr-external.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-cidr-k8s.yaml b/connectivity/builder/manifests/client-egress-to-cidr-k8s.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-cidr-k8s.yaml rename to connectivity/builder/manifests/client-egress-to-cidr-k8s.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-cidr-node-knp.yaml b/connectivity/builder/manifests/client-egress-to-cidr-node-knp.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-cidr-node-knp.yaml rename to connectivity/builder/manifests/client-egress-to-cidr-node-knp.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-deny.yaml b/connectivity/builder/manifests/client-egress-to-echo-deny.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-deny.yaml rename to connectivity/builder/manifests/client-egress-to-echo-deny.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-expression-deny.yaml b/connectivity/builder/manifests/client-egress-to-echo-expression-deny.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-expression-deny.yaml rename to connectivity/builder/manifests/client-egress-to-echo-expression-deny.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-expression-knp.yaml b/connectivity/builder/manifests/client-egress-to-echo-expression-knp.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-expression-knp.yaml rename to connectivity/builder/manifests/client-egress-to-echo-expression-knp.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-expression.yaml b/connectivity/builder/manifests/client-egress-to-echo-expression.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-expression.yaml rename to connectivity/builder/manifests/client-egress-to-echo-expression.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-knp.yaml b/connectivity/builder/manifests/client-egress-to-echo-knp.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-knp.yaml rename to connectivity/builder/manifests/client-egress-to-echo-knp.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-named-port-deny.yaml b/connectivity/builder/manifests/client-egress-to-echo-named-port-deny.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-named-port-deny.yaml rename to connectivity/builder/manifests/client-egress-to-echo-named-port-deny.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-service-account-deny.yaml b/connectivity/builder/manifests/client-egress-to-echo-service-account-deny.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-service-account-deny.yaml rename to connectivity/builder/manifests/client-egress-to-echo-service-account-deny.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-service-account.yaml b/connectivity/builder/manifests/client-egress-to-echo-service-account.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo-service-account.yaml rename to connectivity/builder/manifests/client-egress-to-echo-service-account.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo.yaml b/connectivity/builder/manifests/client-egress-to-echo.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-echo.yaml rename to connectivity/builder/manifests/client-egress-to-echo.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-entities-host.yaml b/connectivity/builder/manifests/client-egress-to-entities-host.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-entities-host.yaml rename to connectivity/builder/manifests/client-egress-to-entities-host.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-entities-k8s.yaml b/connectivity/builder/manifests/client-egress-to-entities-k8s.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-entities-k8s.yaml rename to connectivity/builder/manifests/client-egress-to-entities-k8s.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-entities-world.yaml b/connectivity/builder/manifests/client-egress-to-entities-world.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-entities-world.yaml rename to connectivity/builder/manifests/client-egress-to-entities-world.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-fqdns.yaml b/connectivity/builder/manifests/client-egress-to-fqdns.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-egress-to-fqdns.yaml rename to connectivity/builder/manifests/client-egress-to-fqdns.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-ingress-from-client2-knp.yaml b/connectivity/builder/manifests/client-ingress-from-client2-knp.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-ingress-from-client2-knp.yaml rename to connectivity/builder/manifests/client-ingress-from-client2-knp.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-ingress-from-client2.yaml b/connectivity/builder/manifests/client-ingress-from-client2.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-ingress-from-client2.yaml rename to connectivity/builder/manifests/client-ingress-from-client2.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-with-service-account-egress-to-echo-deny.yaml b/connectivity/builder/manifests/client-with-service-account-egress-to-echo-deny.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-with-service-account-egress-to-echo-deny.yaml rename to connectivity/builder/manifests/client-with-service-account-egress-to-echo-deny.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-with-service-account-egress-to-echo.yaml b/connectivity/builder/manifests/client-with-service-account-egress-to-echo.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/client-with-service-account-egress-to-echo.yaml rename to connectivity/builder/manifests/client-with-service-account-egress-to-echo.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-all-egress-knp.yaml b/connectivity/builder/manifests/deny-all-egress-knp.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-all-egress-knp.yaml rename to connectivity/builder/manifests/deny-all-egress-knp.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-all-egress.yaml b/connectivity/builder/manifests/deny-all-egress.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-all-egress.yaml rename to connectivity/builder/manifests/deny-all-egress.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-all-entities.yaml b/connectivity/builder/manifests/deny-all-entities.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-all-entities.yaml rename to connectivity/builder/manifests/deny-all-entities.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-all-ingress-knp.yaml b/connectivity/builder/manifests/deny-all-ingress-knp.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-all-ingress-knp.yaml rename to connectivity/builder/manifests/deny-all-ingress-knp.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-all-ingress.yaml b/connectivity/builder/manifests/deny-all-ingress.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-all-ingress.yaml rename to connectivity/builder/manifests/deny-all-ingress.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-cidr.yaml b/connectivity/builder/manifests/deny-cidr.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-cidr.yaml rename to connectivity/builder/manifests/deny-cidr.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-ingress-backend.yaml b/connectivity/builder/manifests/deny-ingress-backend.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-ingress-backend.yaml rename to connectivity/builder/manifests/deny-ingress-backend.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-ingress-entity.yaml b/connectivity/builder/manifests/deny-ingress-entity.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-ingress-entity.yaml rename to connectivity/builder/manifests/deny-ingress-entity.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-world-entity.yaml b/connectivity/builder/manifests/deny-world-entity.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/deny-world-entity.yaml rename to connectivity/builder/manifests/deny-world-entity.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-from-cidr.yaml b/connectivity/builder/manifests/echo-ingress-from-cidr.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-from-cidr.yaml rename to connectivity/builder/manifests/echo-ingress-from-cidr.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-from-other-client-deny.yaml b/connectivity/builder/manifests/echo-ingress-from-other-client-deny.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-from-other-client-deny.yaml rename to connectivity/builder/manifests/echo-ingress-from-other-client-deny.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-from-other-client-knp.yaml b/connectivity/builder/manifests/echo-ingress-from-other-client-knp.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-from-other-client-knp.yaml rename to connectivity/builder/manifests/echo-ingress-from-other-client-knp.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-from-other-client.yaml b/connectivity/builder/manifests/echo-ingress-from-other-client.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-from-other-client.yaml rename to connectivity/builder/manifests/echo-ingress-from-other-client.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-icmp-deny.yaml b/connectivity/builder/manifests/echo-ingress-icmp-deny.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-icmp-deny.yaml rename to connectivity/builder/manifests/echo-ingress-icmp-deny.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-icmp.yaml b/connectivity/builder/manifests/echo-ingress-icmp.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-icmp.yaml rename to connectivity/builder/manifests/echo-ingress-icmp.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-l7-http-from-anywhere.yaml b/connectivity/builder/manifests/echo-ingress-l7-http-from-anywhere.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-l7-http-from-anywhere.yaml rename to connectivity/builder/manifests/echo-ingress-l7-http-from-anywhere.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-l7-http-named-port.yaml b/connectivity/builder/manifests/echo-ingress-l7-http-named-port.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-l7-http-named-port.yaml rename to connectivity/builder/manifests/echo-ingress-l7-http-named-port.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-l7-http.yaml b/connectivity/builder/manifests/echo-ingress-l7-http.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-l7-http.yaml rename to connectivity/builder/manifests/echo-ingress-l7-http.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-mutual-authentication-fail.yaml b/connectivity/builder/manifests/echo-ingress-mutual-authentication-fail.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-mutual-authentication-fail.yaml rename to connectivity/builder/manifests/echo-ingress-mutual-authentication-fail.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-mutual-authentication.yaml b/connectivity/builder/manifests/echo-ingress-mutual-authentication.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/echo-ingress-mutual-authentication.yaml rename to connectivity/builder/manifests/echo-ingress-mutual-authentication.yaml diff --git a/connectivity/builder/manifests/host-firewall-egress.yaml b/connectivity/builder/manifests/host-firewall-egress.yaml new file mode 100644 index 0000000000..01c2ae74fa --- /dev/null +++ b/connectivity/builder/manifests/host-firewall-egress.yaml @@ -0,0 +1,18 @@ +apiVersion: "cilium.io/v2" +kind: CiliumClusterwideNetworkPolicy +metadata: + name: "host-firewall-egress" +spec: + nodeSelector: {} + egress: + - toEntities: + - health + - kube-apiserver + - remote-node + - world + - toEndpoints: + - matchExpressions: + - key: name + operator: NotIn + values: + - echo-other-node diff --git a/connectivity/builder/manifests/host-firewall-ingress.yaml b/connectivity/builder/manifests/host-firewall-ingress.yaml new file mode 100644 index 0000000000..20796459f3 --- /dev/null +++ b/connectivity/builder/manifests/host-firewall-ingress.yaml @@ -0,0 +1,18 @@ +apiVersion: "cilium.io/v2" +kind: CiliumClusterwideNetworkPolicy +metadata: + name: "host-firewall-ingress" +spec: + nodeSelector: {} + ingress: + - fromEntities: + - health + - kube-apiserver + - remote-node + - world + - fromEndpoints: + - matchExpressions: + - key: name + operator: NotIn + values: + - client diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/template/template.go b/connectivity/builder/manifests/template/template.go similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/template/template.go rename to connectivity/builder/manifests/template/template.go diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/network_perf.go b/connectivity/builder/network_perf.go similarity index 71% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/network_perf.go rename to connectivity/builder/network_perf.go index a7a7aec720..f10b63c2a3 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/network_perf.go +++ b/connectivity/builder/network_perf.go @@ -4,8 +4,8 @@ package builder import ( - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/perf/benchmarks/netperf" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/perf/benchmarks/netperf" ) type networkPerf struct{} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_interrupted_connections.go b/connectivity/builder/no_interrupted_connections.go similarity index 77% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_interrupted_connections.go rename to connectivity/builder/no_interrupted_connections.go index f1b1acd609..994b0c2101 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_interrupted_connections.go +++ b/connectivity/builder/no_interrupted_connections.go @@ -4,8 +4,8 @@ package builder import ( - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) type noInterruptedConnections struct{} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_ipsec_xfrm_errors.go b/connectivity/builder/no_ipsec_xfrm_errors.go similarity index 82% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_ipsec_xfrm_errors.go rename to connectivity/builder/no_ipsec_xfrm_errors.go index d6ce31f7f7..5a7c56dee7 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_ipsec_xfrm_errors.go +++ b/connectivity/builder/no_ipsec_xfrm_errors.go @@ -4,9 +4,9 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type noIpsecXfrmErrors struct{} diff --git a/connectivity/builder/no_policies.go b/connectivity/builder/no_policies.go new file mode 100644 index 0000000000..8a9f8e9747 --- /dev/null +++ b/connectivity/builder/no_policies.go @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Authors of Cilium + +package builder + +import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" +) + +type noPolicies struct{} + +func (t noPolicies) build(ct *check.ConnectivityTest, _ map[string]string) { + newTest("no-policies", ct). + WithScenarios( + tests.PodToPod(), + tests.ClientToClient(), + tests.PodToService(), + tests.PodToHostPort(), + tests.PodToWorld(tests.WithRetryAll()), + tests.PodToHost(), + tests.HostToPod(), + tests.PodToExternalWorkload(), + tests.PodToCIDR(tests.WithRetryAll()), + ) +} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_policies_extra.go b/connectivity/builder/no_policies_extra.go similarity index 77% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_policies_extra.go rename to connectivity/builder/no_policies_extra.go index 4e1c6ecbd5..4d455558c1 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_policies_extra.go +++ b/connectivity/builder/no_policies_extra.go @@ -4,8 +4,8 @@ package builder import ( - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) type noPoliciesExtra struct{} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_policies_from_outside.go b/connectivity/builder/no_policies_from_outside.go similarity index 82% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_policies_from_outside.go rename to connectivity/builder/no_policies_from_outside.go index 0bf54ab5e3..c93bdb3cbd 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_policies_from_outside.go +++ b/connectivity/builder/no_policies_from_outside.go @@ -4,9 +4,9 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type noPoliciesFromOutside struct{} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_unexpected_packet_drops.go b/connectivity/builder/no_unexpected_packet_drops.go similarity index 50% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_unexpected_packet_drops.go rename to connectivity/builder/no_unexpected_packet_drops.go index 0ddc32aeec..2e8e3bed58 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_unexpected_packet_drops.go +++ b/connectivity/builder/no_unexpected_packet_drops.go @@ -4,14 +4,14 @@ package builder import ( - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) type noUnexpectedPacketDrops struct{} -func (t noUnexpectedPacketDrops) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t noUnexpectedPacketDrops) build(ct *check.ConnectivityTest, _ map[string]string) { newTest("no-unexpected-packet-drops", ct). WithScenarios(tests.NoUnexpectedPacketDrops(ct.Params().ExpectedDropReasons)). - WithSysdumpPolicy(check2.SysdumpPolicyOnce) + WithSysdumpPolicy(check.SysdumpPolicyOnce) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/node_to_node_encryption.go b/connectivity/builder/node_to_node_encryption.go similarity index 85% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/node_to_node_encryption.go rename to connectivity/builder/node_to_node_encryption.go index 4102f7a10b..7df8e2ece4 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/node_to_node_encryption.go +++ b/connectivity/builder/node_to_node_encryption.go @@ -4,9 +4,9 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type nodeToNodeEncryption struct{} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/north_south_loadbalancing.go b/connectivity/builder/north_south_loadbalancing.go similarity index 80% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/north_south_loadbalancing.go rename to connectivity/builder/north_south_loadbalancing.go index 696f4c4105..c2046bdb8b 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/north_south_loadbalancing.go +++ b/connectivity/builder/north_south_loadbalancing.go @@ -4,9 +4,9 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type northSouthLoadbalancing struct{} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/north_south_loadbalancing_with_l7_policy.go b/connectivity/builder/north_south_loadbalancing_with_l7_policy.go similarity index 88% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/north_south_loadbalancing_with_l7_policy.go rename to connectivity/builder/north_south_loadbalancing_with_l7_policy.go index 799bdf9f3a..e25bdd2fe0 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/north_south_loadbalancing_with_l7_policy.go +++ b/connectivity/builder/north_south_loadbalancing_with_l7_policy.go @@ -5,9 +5,9 @@ package builder import ( _ "embed" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" ) diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/outside_to_ingress_service.go b/connectivity/builder/outside_to_ingress_service.go similarity index 81% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/outside_to_ingress_service.go rename to connectivity/builder/outside_to_ingress_service.go index 2f68427575..0cc4b55f93 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/outside_to_ingress_service.go +++ b/connectivity/builder/outside_to_ingress_service.go @@ -4,9 +4,9 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type outsideToIngressService struct{} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/outside_to_ingress_service_deny_all_ingress.go b/connectivity/builder/outside_to_ingress_service_deny_all_ingress.go similarity index 57% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/outside_to_ingress_service_deny_all_ingress.go rename to connectivity/builder/outside_to_ingress_service_deny_all_ingress.go index 04d7f9bcd3..4c2979ed29 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/outside_to_ingress_service_deny_all_ingress.go +++ b/connectivity/builder/outside_to_ingress_service_deny_all_ingress.go @@ -4,14 +4,14 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type outsideToIngressServiceDenyAllIngress struct{} -func (t outsideToIngressServiceDenyAllIngress) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t outsideToIngressServiceDenyAllIngress) build(ct *check.ConnectivityTest, _ map[string]string) { newTest("outside-to-ingress-service-deny-all-ingress", ct). WithFeatureRequirements( features.RequireEnabled(features.IngressController), @@ -19,7 +19,7 @@ func (t outsideToIngressServiceDenyAllIngress) build(ct *check2.ConnectivityTest ). WithCiliumPolicy(denyAllIngressPolicyYAML). WithScenarios(tests.OutsideToIngressService()). - WithExpectations(func(_ *check2.Action) (egress check2.Result, ingress check2.Result) { - return check2.ResultDefaultDenyEgressDrop, check2.ResultNone + WithExpectations(func(_ *check.Action) (egress check.Result, ingress check.Result) { + return check.ResultDefaultDenyEgressDrop, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/outside_to_ingress_service_deny_cidr.go b/connectivity/builder/outside_to_ingress_service_deny_cidr.go similarity index 56% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/outside_to_ingress_service_deny_cidr.go rename to connectivity/builder/outside_to_ingress_service_deny_cidr.go index a1c3a6ace6..fd209312e6 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/outside_to_ingress_service_deny_cidr.go +++ b/connectivity/builder/outside_to_ingress_service_deny_cidr.go @@ -4,14 +4,14 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type outsideToIngressServiceDenyCidr struct{} -func (t outsideToIngressServiceDenyCidr) build(ct *check2.ConnectivityTest, templates map[string]string) { +func (t outsideToIngressServiceDenyCidr) build(ct *check.ConnectivityTest, templates map[string]string) { newTest("outside-to-ingress-service-deny-cidr", ct). WithFeatureRequirements( features.RequireEnabled(features.IngressController), @@ -19,7 +19,7 @@ func (t outsideToIngressServiceDenyCidr) build(ct *check2.ConnectivityTest, temp ). WithCiliumPolicy(templates["denyCIDRPolicyYAML"]). WithScenarios(tests.OutsideToIngressService()). - WithExpectations(func(_ *check2.Action) (egress check2.Result, ingress check2.Result) { - return check2.ResultDefaultDenyEgressDrop, check2.ResultNone + WithExpectations(func(_ *check.Action) (egress check.Result, ingress check.Result) { + return check.ResultDefaultDenyEgressDrop, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/outside_to_ingress_service_deny_world_identity.go b/connectivity/builder/outside_to_ingress_service_deny_world_identity.go similarity index 67% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/outside_to_ingress_service_deny_world_identity.go rename to connectivity/builder/outside_to_ingress_service_deny_world_identity.go index 245458d41b..7ab6eb46ae 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/outside_to_ingress_service_deny_world_identity.go +++ b/connectivity/builder/outside_to_ingress_service_deny_world_identity.go @@ -5,9 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" ) @@ -16,7 +16,7 @@ var denyWorldIdentityPolicyYAML string type outsideToIngressServiceDenyWorldIdentity struct{} -func (t outsideToIngressServiceDenyWorldIdentity) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t outsideToIngressServiceDenyWorldIdentity) build(ct *check.ConnectivityTest, _ map[string]string) { newTest("outside-to-ingress-service-deny-world-identity", ct). WithFeatureRequirements( features.RequireEnabled(features.IngressController), @@ -24,7 +24,7 @@ func (t outsideToIngressServiceDenyWorldIdentity) build(ct *check2.ConnectivityT ). WithCiliumPolicy(denyWorldIdentityPolicyYAML). WithScenarios(tests.OutsideToIngressService()). - WithExpectations(func(_ *check2.Action) (egress check2.Result, ingress check2.Result) { - return check2.ResultDefaultDenyEgressDrop, check2.ResultNone + WithExpectations(func(_ *check.Action) (egress check.Result, ingress check.Result) { + return check.ResultDefaultDenyEgressDrop, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_controlplane_host.go b/connectivity/builder/pod_to_controlplane_host.go similarity index 82% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_controlplane_host.go rename to connectivity/builder/pod_to_controlplane_host.go index e0b954f38a..f203308947 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_controlplane_host.go +++ b/connectivity/builder/pod_to_controlplane_host.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-egress-to-entities-host.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_controlplane_host_cidr.go b/connectivity/builder/pod_to_controlplane_host_cidr.go similarity index 85% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_controlplane_host_cidr.go rename to connectivity/builder/pod_to_controlplane_host_cidr.go index 91f0850534..76bb7e9bb0 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_controlplane_host_cidr.go +++ b/connectivity/builder/pod_to_controlplane_host_cidr.go @@ -4,9 +4,9 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type podToControlplaneHostCidr struct{} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_ingress_service.go b/connectivity/builder/pod_to_ingress_service.go similarity index 79% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_ingress_service.go rename to connectivity/builder/pod_to_ingress_service.go index 4fb129a350..83b25cc5e5 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_ingress_service.go +++ b/connectivity/builder/pod_to_ingress_service.go @@ -4,9 +4,9 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type podToIngressService struct{} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_ingress_service_allow_ingress_identity.go b/connectivity/builder/pod_to_ingress_service_allow_ingress_identity.go similarity index 85% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_ingress_service_allow_ingress_identity.go rename to connectivity/builder/pod_to_ingress_service_allow_ingress_identity.go index bc2fce1e6d..b50856bfca 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_ingress_service_allow_ingress_identity.go +++ b/connectivity/builder/pod_to_ingress_service_allow_ingress_identity.go @@ -5,9 +5,9 @@ package builder import ( _ "embed" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" ) diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_ingress_service_deny_all.go b/connectivity/builder/pod_to_ingress_service_deny_all.go similarity index 52% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_ingress_service_deny_all.go rename to connectivity/builder/pod_to_ingress_service_deny_all.go index 87df2dda89..e1d023c287 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_ingress_service_deny_all.go +++ b/connectivity/builder/pod_to_ingress_service_deny_all.go @@ -4,19 +4,19 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type podToIngressServiceDenyAll struct{} -func (t podToIngressServiceDenyAll) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t podToIngressServiceDenyAll) build(ct *check.ConnectivityTest, _ map[string]string) { newTest("pod-to-ingress-service-deny-all", ct). WithFeatureRequirements(features.RequireEnabled(features.IngressController)). WithCiliumPolicy(denyAllIngressPolicyYAML). WithScenarios(tests.PodToIngress()). - WithExpectations(func(_ *check2.Action) (egress check2.Result, ingress check2.Result) { - return check2.ResultDefaultDenyEgressDrop, check2.ResultNone + WithExpectations(func(_ *check.Action) (egress check.Result, ingress check.Result) { + return check.ResultDefaultDenyEgressDrop, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_ingress_service_deny_backend_service.go b/connectivity/builder/pod_to_ingress_service_deny_backend_service.go similarity index 58% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_ingress_service_deny_backend_service.go rename to connectivity/builder/pod_to_ingress_service_deny_backend_service.go index 5dfa297b11..b269736405 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_ingress_service_deny_backend_service.go +++ b/connectivity/builder/pod_to_ingress_service_deny_backend_service.go @@ -5,9 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" ) @@ -16,12 +16,12 @@ var denyIngressBackendPolicyYAML string type podToIngressServiceDenyBackendService struct{} -func (t podToIngressServiceDenyBackendService) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t podToIngressServiceDenyBackendService) build(ct *check.ConnectivityTest, _ map[string]string) { newTest("pod-to-ingress-service-deny-backend-service", ct). WithFeatureRequirements(features.RequireEnabled(features.IngressController)). WithCiliumPolicy(denyIngressBackendPolicyYAML). WithScenarios(tests.PodToIngress()). - WithExpectations(func(_ *check2.Action) (egress check2.Result, ingress check2.Result) { - return check2.ResultDefaultDenyEgressDrop, check2.ResultNone + WithExpectations(func(_ *check.Action) (egress check.Result, ingress check.Result) { + return check.ResultDefaultDenyEgressDrop, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_ingress_service_deny_ingress_identity.go b/connectivity/builder/pod_to_ingress_service_deny_ingress_identity.go similarity index 58% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_ingress_service_deny_ingress_identity.go rename to connectivity/builder/pod_to_ingress_service_deny_ingress_identity.go index a0d7bfd39b..85c325e3b3 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_ingress_service_deny_ingress_identity.go +++ b/connectivity/builder/pod_to_ingress_service_deny_ingress_identity.go @@ -5,9 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" ) @@ -16,12 +16,12 @@ var denyIngressIdentityPolicyYAML string type podToIngressServiceDenyIngressIdentity struct{} -func (t podToIngressServiceDenyIngressIdentity) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t podToIngressServiceDenyIngressIdentity) build(ct *check.ConnectivityTest, _ map[string]string) { newTest("pod-to-ingress-service-deny-ingress-identity", ct). WithFeatureRequirements(features.RequireEnabled(features.IngressController)). WithCiliumPolicy(denyIngressIdentityPolicyYAML). WithScenarios(tests.PodToIngress()). - WithExpectations(func(_ *check2.Action) (egress check2.Result, ingress check2.Result) { - return check2.ResultDefaultDenyEgressDrop, check2.ResultNone + WithExpectations(func(_ *check.Action) (egress check.Result, ingress check.Result) { + return check.ResultDefaultDenyEgressDrop, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_k8s_on_controlplane.go b/connectivity/builder/pod_to_k8s_on_controlplane.go similarity index 82% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_k8s_on_controlplane.go rename to connectivity/builder/pod_to_k8s_on_controlplane.go index 6067dfec7a..aa4e21cc86 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_k8s_on_controlplane.go +++ b/connectivity/builder/pod_to_k8s_on_controlplane.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-egress-to-entities-k8s.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_k8s_on_controlplane_cidr.go b/connectivity/builder/pod_to_k8s_on_controlplane_cidr.go similarity index 83% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_k8s_on_controlplane_cidr.go rename to connectivity/builder/pod_to_k8s_on_controlplane_cidr.go index fce57f9b4a..f86294ad80 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_k8s_on_controlplane_cidr.go +++ b/connectivity/builder/pod_to_k8s_on_controlplane_cidr.go @@ -4,9 +4,9 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type podToK8sOnControlplaneCidr struct{} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_node_cidrpolicy.go b/connectivity/builder/pod_to_node_cidrpolicy.go similarity index 83% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_node_cidrpolicy.go rename to connectivity/builder/pod_to_node_cidrpolicy.go index 77c75b1b1c..43f0436002 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_node_cidrpolicy.go +++ b/connectivity/builder/pod_to_node_cidrpolicy.go @@ -4,9 +4,9 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type podToNodeCidrpolicy struct{} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_pod_encryption.go b/connectivity/builder/pod_to_pod_encryption.go similarity index 84% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_pod_encryption.go rename to connectivity/builder/pod_to_pod_encryption.go index 48bc32b2e6..3739762734 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/pod_to_pod_encryption.go +++ b/connectivity/builder/pod_to_pod_encryption.go @@ -4,9 +4,9 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type podToPodEncryption struct{} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/to_cidr_external.go b/connectivity/builder/to_cidr_external.go similarity index 55% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/to_cidr_external.go rename to connectivity/builder/to_cidr_external.go index 81ea5eaac1..b11231d88f 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/to_cidr_external.go +++ b/connectivity/builder/to_cidr_external.go @@ -4,26 +4,26 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type toCidrExternal struct{} -func (t toCidrExternal) build(ct *check2.ConnectivityTest, templates map[string]string) { +func (t toCidrExternal) build(ct *check.ConnectivityTest, templates map[string]string) { // This policy allows L3 traffic to ExternalCIDR/24 (including ExternalIP), with the // exception of ExternalOtherIP. newTest("to-cidr-external", ct). WithCiliumPolicy(templates["clientEgressToCIDRExternalPolicyYAML"]). WithScenarios( - tests2.PodToCIDR(tests2.WithRetryDestIP(ct.Params().ExternalIP)), + tests.PodToCIDR(tests.WithRetryDestIP(ct.Params().ExternalIP)), ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().Address(features.IPFamilyV4) == ct.Params().ExternalOtherIP { // Expect packets for ExternalOtherIP to be dropped. - return check2.ResultDropCurlTimeout, check2.ResultNone + return check.ResultDropCurlTimeout, check.ResultNone } - return check2.ResultOK, check2.ResultNone + return check.ResultOK, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/to_cidr_external_knp.go b/connectivity/builder/to_cidr_external_knp.go similarity index 55% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/to_cidr_external_knp.go rename to connectivity/builder/to_cidr_external_knp.go index e4a1d3cadf..b208570d9d 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/to_cidr_external_knp.go +++ b/connectivity/builder/to_cidr_external_knp.go @@ -4,26 +4,26 @@ package builder import ( + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" ) type toCidrExternalKnp struct{} -func (t toCidrExternalKnp) build(ct *check2.ConnectivityTest, templates map[string]string) { +func (t toCidrExternalKnp) build(ct *check.ConnectivityTest, templates map[string]string) { // This policy allows L3 traffic to ExternalCIDR/24 (including ExternalIP), with the // exception of ExternalOtherIP. newTest("to-cidr-external-knp", ct). WithK8SPolicy(templates["clientEgressToCIDRExternalPolicyKNPYAML"]). WithScenarios( - tests2.PodToCIDR(tests2.WithRetryDestIP(ct.Params().ExternalIP)), + tests.PodToCIDR(tests.WithRetryDestIP(ct.Params().ExternalIP)), ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().Address(features.IPFamilyV4) == ct.Params().ExternalOtherIP { // Expect packets for ExternalOtherIP to be dropped. - return check2.ResultDropCurlTimeout, check2.ResultNone + return check.ResultDropCurlTimeout, check.ResultNone } - return check2.ResultOK, check2.ResultNone + return check.ResultOK, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/to_entities_world.go b/connectivity/builder/to_entities_world.go similarity index 54% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/to_entities_world.go rename to connectivity/builder/to_entities_world.go index 2b159554dc..a3a29d94d6 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/to_entities_world.go +++ b/connectivity/builder/to_entities_world.go @@ -5,8 +5,9 @@ package builder import ( _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" ) //go:embed manifests/client-egress-to-entities-world.yaml @@ -14,16 +15,16 @@ var clientEgressToEntitiesWorldPolicyYAML string type toEntitiesWorld struct{} -func (t toEntitiesWorld) build(ct *check2.ConnectivityTest, _ map[string]string) { +func (t toEntitiesWorld) build(ct *check.ConnectivityTest, _ map[string]string) { // This policy allows UDP to kube-dns and port 80 TCP to all 'world' endpoints. newTest("to-entities-world", ct). WithCiliumPolicy(clientEgressToEntitiesWorldPolicyYAML). - WithScenarios(tests2.PodToWorld(tests2.WithRetryDestPort(80))). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithScenarios(tests.PodToWorld(tests.WithRetryDestPort(80))). + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().Port() == 80 { - return check2.ResultOK, check2.ResultNone + return check.ResultOK, check.ResultNone } // PodToWorld traffic to port 443 will be dropped by the policy - return check2.ResultDropCurlTimeout, check2.ResultNone + return check.ResultDropCurlTimeout, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/to_fqdns.go b/connectivity/builder/to_fqdns.go similarity index 62% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/to_fqdns.go rename to connectivity/builder/to_fqdns.go index ee03cc7554..826f8ddc01 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/to_fqdns.go +++ b/connectivity/builder/to_fqdns.go @@ -5,55 +5,55 @@ package builder import ( "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" "strings" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/tests" "github.com/cilium/cilium-cli/utils/features" ) type toFqdns struct{} -func (t toFqdns) build(ct *check2.ConnectivityTest, templates map[string]string) { +func (t toFqdns) build(ct *check.ConnectivityTest, templates map[string]string) { // This policy only allows port 80 to domain-name, default one.one.one.one., DNS proxy enabled. newTest("to-fqdns", ct). WithCiliumPolicy(templates["clientEgressToFQDNsPolicyYAML"]). WithFeatureRequirements(features.RequireEnabled(features.L7Proxy)). WithScenarios( - tests2.PodToWorld(tests2.WithRetryDestPort(80)), - tests2.PodToWorld2(), // resolves cilium.io. + tests.PodToWorld(tests.WithRetryDestPort(80)), + tests.PodToWorld2(), // resolves cilium.io. ). - WithExpectations(func(a *check2.Action) (egress, ingress check2.Result) { + WithExpectations(func(a *check.Action) (egress, ingress check.Result) { if a.Destination().Address(features.IPFamilyAny) == "cilium.io." { if a.Destination().Path() == "/" || a.Destination().Path() == "" { - egress = check2.ResultDNSOK - egress.HTTP = check2.HTTP{ + egress = check.ResultDNSOK + egress.HTTP = check.HTTP{ Method: "GET", URL: "https://cilium.io", } // Expect packets for cilium.io / 104.198.14.52 to be dropped. - return check2.ResultDropCurlTimeout, check2.ResultNone + return check.ResultDropCurlTimeout, check.ResultNone } // Else expect HTTP drop by proxy - return check2.ResultDNSOKDropCurlHTTPError, check2.ResultNone + return check.ResultDNSOKDropCurlHTTPError, check.ResultNone } extTarget := ct.Params().ExternalTarget if a.Destination().Port() == 80 && a.Destination().Address(features.GetIPFamily(extTarget)) == extTarget { if a.Destination().Path() == "/" || a.Destination().Path() == "" { - egress = check2.ResultDNSOK - egress.HTTP = check2.HTTP{ + egress = check.ResultDNSOK + egress.HTTP = check.HTTP{ Method: "GET", // Trim the trailing dot, if any, to match the behavior of the curl // action and make sure that flow validation can succeed. URL: fmt.Sprintf("http://%s/", strings.TrimSuffix(extTarget, ".")), } - return egress, check2.ResultNone + return egress, check.ResultNone } // Else expect HTTP drop by proxy - return check2.ResultDNSOKDropCurlHTTPError, check2.ResultNone + return check.ResultDNSOKDropCurlHTTPError, check.ResultNone } // No HTTP proxy on other ports - return check2.ResultDNSOKDropCurlTimeout, check2.ResultNone + return check.ResultDNSOKDropCurlTimeout, check.ResultNone }) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/action.go b/connectivity/check/action.go similarity index 99% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/action.go rename to connectivity/check/action.go index 826c40eb53..c7bc2a08da 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/action.go +++ b/connectivity/check/action.go @@ -9,7 +9,6 @@ import ( "encoding/base64" "errors" "fmt" - "github.com/cilium/cilium/cilium-cli/connectivity/filters" "io" "math" "net" @@ -17,9 +16,8 @@ import ( "strconv" "strings" "sync" + "time" - "github.com/cilium/cilium-cli/defaults" - "github.com/cilium/cilium-cli/utils/features" hubprinter "github.com/cilium/hubble/pkg/printer" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -27,9 +25,10 @@ import ( "github.com/cilium/cilium/api/v1/flow" "github.com/cilium/cilium/api/v1/observer" "github.com/cilium/cilium/api/v1/relay" - "github.com/cilium/cilium/pkg/inctimer" - "github.com/cilium/cilium/pkg/lock" - "github.com/cilium/cilium/pkg/time" + + "github.com/cilium/cilium-cli/connectivity/filters" + "github.com/cilium/cilium-cli/defaults" + "github.com/cilium/cilium-cli/utils/features" ) const ( @@ -69,7 +68,7 @@ type Action struct { expIngress Result // flowsMu protects flows. - flowsMu lock.Mutex + flowsMu sync.Mutex // flows is a map of all flow logs generated during the Action. flows flowsSet @@ -794,7 +793,7 @@ func (a *Action) waitForRelay(ctx context.Context, client observer.ObserverClien select { case <-ctx.Done(): return fmt.Errorf("hubble server status failure: %w", ctx.Err()) - case <-inctimer.After(time.Second): + case <-time.After(time.Second): a.Debug("retrying hubble relay server status request") } } diff --git a/connectivity/check/action_test.go b/connectivity/check/action_test.go new file mode 100644 index 0000000000..01bbba105a --- /dev/null +++ b/connectivity/check/action_test.go @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Authors of Cilium + +package check + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestAction_PingHeaderPattern(t *testing.T) { + type args struct { + output string + } + tests := []struct { + name string + args args + want bool + }{ + { + name: "Only ping header output", + args: args{ + output: `PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.`, + }, + want: true, + }, + { + name: "Only ping header output without dot", + args: args{ + output: `PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data`, + }, + want: false, + }, + { + name: "Splitted ping header output with newline", + args: args{ + output: `PING 10.0.0.1 (10.0.0.1) 56(84) bytes of +data.`, + }, + want: false, + }, + { + name: "Ping header output with preceding output", + args: args{ + output: `First PING 10.0.0.1 (10.0.0.1) 56(84) bytes of +data.`, + }, + want: false, + }, + { + name: "Full ping command output", + args: args{ + output: `PING www.google.com(zrh04s15-in-x04.1e100.net (2a00:1450:400a:803::2004)) 56 data bytes +64 bytes from zrh04s15-in-x04.1e100.net (2a00:1450:400a:803::2004): icmp_seq=1 ttl=119 time=5.78 ms +64 bytes from zrh04s15-in-x04.1e100.net (2a00:1450:400a:803::2004): icmp_seq=2 ttl=119 time=6.01 ms + +--- www.google.com ping statistics --- +2 packets transmitted, 2 received, 0% packet loss, time 1000ms +rtt min/avg/max/mdev = 5.780/5.895/6.010/0.115 ms`, + }, + want: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equal(t, tt.want, strings.TrimSpace(pingHeaderPattern.ReplaceAllString(tt.args.output, "")) == "") + }) + } +} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/assets/cacert.pem b/connectivity/check/assets/cacert.pem similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/assets/cacert.pem rename to connectivity/check/assets/cacert.pem diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/check.go b/connectivity/check/check.go similarity index 98% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/check.go rename to connectivity/check/check.go index 7db0c68e3a..c257231f76 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/check.go +++ b/connectivity/check/check.go @@ -6,17 +6,17 @@ package check import ( "encoding/json" "fmt" - "github.com/cilium/cilium/cilium-cli/connectivity/filters" "io" "regexp" "strings" - - "github.com/cilium/cilium-cli/k8s" - "github.com/cilium/cilium-cli/sysdump" + "time" "github.com/cilium/cilium/api/v1/flow" "github.com/cilium/cilium/api/v1/observer" - "github.com/cilium/cilium/pkg/time" + + "github.com/cilium/cilium-cli/connectivity/filters" + "github.com/cilium/cilium-cli/k8s" + "github.com/cilium/cilium-cli/sysdump" ) type Parameters struct { diff --git a/connectivity/check/check_test.go b/connectivity/check/check_test.go new file mode 100644 index 0000000000..9376800cfc --- /dev/null +++ b/connectivity/check/check_test.go @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Authors of Cilium + +package check + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestAnnotationMap(t *testing.T) { + var a annotationsMap + err := a.Set(`not json`) + assert.IsType(t, err, &json.SyntaxError{}) + + err = a.Set(`{"foo*bar":{}}`) + assert.ErrorContains(t, err, "wildcard only allowed at end of key") + + err = a.Set(`{"baz*qux*":{}}`) + assert.ErrorContains(t, err, "wildcard only allowed at end of key") + + err = a.Set(`{"**":{}}`) + assert.ErrorContains(t, err, "wildcard only allowed at end of key") + + var clientAnnotations = annotations{"baz": "qux"} + var echoSameNodeAnnotations = annotations{"quux": "corge"} + var echoWildcardAnnotations = annotations{"grault": "grault"} + var wildcardAnnotations = annotations{"waldo": "fred"} + + err = a.Set(`{ + "client": ` + clientAnnotations.String() + `, + "echo-same-node": ` + echoSameNodeAnnotations.String() + `, + "echo*": ` + echoWildcardAnnotations.String() + `, + "*": ` + wildcardAnnotations.String() + ` + }`) + assert.NoError(t, err) + assert.Equal(t, annotationsMap{ + "client": clientAnnotations, + "echo-same-node": echoSameNodeAnnotations, + "echo*": echoWildcardAnnotations, + "*": wildcardAnnotations, + }, a) + + // Test wildcard fallback + assert.Equal(t, a.Match("echo*"), annotations(nil)) // wildcard not allowed here + assert.Equal(t, a.Match("*"), annotations(nil)) // wildcard not allowed here + + assert.Equal(t, a.Match("client"), clientAnnotations) + assert.Equal(t, a.Match("echo-same-node"), echoSameNodeAnnotations) + assert.Equal(t, a.Match("echo-other-node"), echoWildcardAnnotations) + assert.Equal(t, a.Match("other"), wildcardAnnotations) + + err = a.Set(`{ + "echo-same-*": ` + echoSameNodeAnnotations.String() + `, + "echo*": ` + echoWildcardAnnotations.String() + ` + }`) + assert.NoError(t, err) + assert.Equal(t, annotationsMap{ + "echo-same-*": echoSameNodeAnnotations, + "echo*": echoWildcardAnnotations, + }, a) + + // Tests longest prefix match + assert.Equal(t, a.Match("echo-same-node"), echoSameNodeAnnotations) + assert.Equal(t, a.Match("echo-other-node"), echoWildcardAnnotations) + assert.Equal(t, a.Match("echo"), echoWildcardAnnotations) + assert.Equal(t, a.Match("other"), annotations(nil)) + +} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/context.go b/connectivity/check/context.go similarity index 99% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/context.go rename to connectivity/check/context.go index d4b268a3c3..abf08ce6f4 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/context.go +++ b/connectivity/check/context.go @@ -7,19 +7,15 @@ import ( "context" "errors" "fmt" - "github.com/cilium/cilium/cilium-cli/connectivity/internal/junit" - "github.com/cilium/cilium/cilium-cli/connectivity/perf/common" "net" "net/netip" "os" "strconv" "strings" "sync" + "time" "github.com/blang/semver/v4" - "github.com/cilium/cilium-cli/defaults" - "github.com/cilium/cilium-cli/k8s" - "github.com/cilium/cilium-cli/utils/features" "golang.org/x/exp/maps" "golang.org/x/exp/slices" "google.golang.org/grpc" @@ -29,7 +25,12 @@ import ( "github.com/cilium/cilium/api/v1/observer" ciliumv2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" - "github.com/cilium/cilium/pkg/time" + + "github.com/cilium/cilium-cli/connectivity/internal/junit" + "github.com/cilium/cilium-cli/connectivity/perf/common" + "github.com/cilium/cilium-cli/defaults" + "github.com/cilium/cilium-cli/k8s" + "github.com/cilium/cilium-cli/utils/features" ) // ConnectivityTest is the root context of the connectivity test suite diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/deployment.go b/connectivity/check/deployment.go similarity index 99% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/deployment.go rename to connectivity/check/deployment.go index edb7d6e889..4af6de0390 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/deployment.go +++ b/connectivity/check/deployment.go @@ -10,10 +10,8 @@ import ( "strconv" "strings" "sync" + "time" - "github.com/cilium/cilium-cli/defaults" - "github.com/cilium/cilium-cli/k8s" - "github.com/cilium/cilium-cli/utils/features" "golang.org/x/exp/maps" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" @@ -23,7 +21,9 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/intstr" - "github.com/cilium/cilium/pkg/time" + "github.com/cilium/cilium-cli/defaults" + "github.com/cilium/cilium-cli/k8s" + "github.com/cilium/cilium-cli/utils/features" ) const ( diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/features.go b/connectivity/check/features.go similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/features.go rename to connectivity/check/features.go diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/ipcache.go b/connectivity/check/ipcache.go similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/ipcache.go rename to connectivity/check/ipcache.go diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/logging.go b/connectivity/check/logging.go similarity index 99% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/logging.go rename to connectivity/check/logging.go index 05f792f6e3..a7a52f5d62 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/logging.go +++ b/connectivity/check/logging.go @@ -11,8 +11,7 @@ import ( "os/signal" "runtime" "syscall" - - "github.com/cilium/cilium/pkg/time" + "time" ) const ( diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/manifests/egress-gateway-policy.yaml b/connectivity/check/manifests/egress-gateway-policy.yaml similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/manifests/egress-gateway-policy.yaml rename to connectivity/check/manifests/egress-gateway-policy.yaml diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/metrics.go b/connectivity/check/metrics.go similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/metrics.go rename to connectivity/check/metrics.go diff --git a/connectivity/check/metrics_test.go b/connectivity/check/metrics_test.go new file mode 100644 index 0000000000..ea6b15b0c8 --- /dev/null +++ b/connectivity/check/metrics_test.go @@ -0,0 +1,132 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Authors of Cilium + +package check + +import ( + "strings" + "testing" + + prommodel "github.com/prometheus/client_model/go" + "github.com/stretchr/testify/assert" +) + +func TestParsePromMetrics(t *testing.T) { + input := ` +# HELP cilium_forward_count_total Total forwarded packets, tagged by ingress/egress direction +# TYPE cilium_forward_count_total counter +cilium_forward_count_total{direction="EGRESS"} 444088 +cilium_forward_count_total{direction="INGRESS"} 812973 +` + + metricName := "cilium_forward_count_total" + metricHelp := "Total forwarded packets, tagged by ingress/egress direction" + metricTypeCounter := prommodel.MetricType_COUNTER + labelName := "direction" + labelEgress := "EGRESS" + labelIngress := "INGRESS" + valueEgress := float64(444088) + valueIngress := float64(812973) + + want := promMetricsFamily{ + metricName: { + Name: &metricName, + Help: &metricHelp, + Type: &metricTypeCounter, + Metric: []*prommodel.Metric{ + { + Label: []*prommodel.LabelPair{{Name: &labelName, Value: &labelEgress}}, + Counter: &prommodel.Counter{Value: &valueEgress}, + }, + { + Label: []*prommodel.LabelPair{{Name: &labelName, Value: &labelIngress}}, + Counter: &prommodel.Counter{Value: &valueIngress}, + }, + }, + }, + } + + reader := strings.NewReader(input) + got, err := parseMetrics(reader) + assert.NoError(t, err) + assert.Exactly(t, want, got) +} + +func TestMetricsIncrease(t *testing.T) { + metricName := "cilium_forward_count_total" + metricHelp := "Total forwarded packets, tagged by ingress/egress direction" + metricTypeCounter := prommodel.MetricType_COUNTER + labelName := "direction" + labelEgress := "EGRESS" + labelIngress := "INGRESS" + valueEgress := 444088. + valueIngress := 812973. + + valueEgressAfter := 1599128. + valueIngressAfter := 3789798. + + ciliumForwardCountTotalBefore := prommodel.MetricFamily{ + Name: &metricName, + Help: &metricHelp, + Type: &metricTypeCounter, + Metric: []*prommodel.Metric{ + { + Label: []*prommodel.LabelPair{{Name: &labelName, Value: &labelEgress}}, + Counter: &prommodel.Counter{Value: &valueEgress}, + }, + { + Label: []*prommodel.LabelPair{{Name: &labelName, Value: &labelIngress}}, + Counter: &prommodel.Counter{Value: &valueIngress}, + }, + }, + } + + ciliumForwardCountTotalAfter := prommodel.MetricFamily{ + Name: &metricName, + Help: &metricHelp, + Type: &metricTypeCounter, + Metric: []*prommodel.Metric{ + { + Label: []*prommodel.LabelPair{{Name: &labelName, Value: &labelEgress}}, + Counter: &prommodel.Counter{Value: &valueEgressAfter}, + }, + { + Label: []*prommodel.LabelPair{{Name: &labelName, Value: &labelIngress}}, + Counter: &prommodel.Counter{Value: &valueIngressAfter}, + }, + }, + } + + tt := map[string]struct { + before *prommodel.MetricFamily + after *prommodel.MetricFamily + err bool + }{ + "metric increases": { + before: &ciliumForwardCountTotalBefore, + after: &ciliumForwardCountTotalAfter, + err: false, + }, + "metrics are equals": { + before: &ciliumForwardCountTotalBefore, + after: &ciliumForwardCountTotalBefore, + err: true, + }, + "metric decreases": { + before: &ciliumForwardCountTotalAfter, + after: &ciliumForwardCountTotalBefore, + err: true, + }, + } + + for name, tc := range tt { + t.Run(name, func(t *testing.T) { + err := metricsIncrease(tc.before, tc.after) + if tc.err { + assert.Error(t, err) + } else { + assert.NoError(t, err) + } + }) + } +} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/metricssource.go b/connectivity/check/metricssource.go similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/metricssource.go rename to connectivity/check/metricssource.go diff --git a/connectivity/check/metricssource_test.go b/connectivity/check/metricssource_test.go new file mode 100644 index 0000000000..2b604daf5a --- /dev/null +++ b/connectivity/check/metricssource_test.go @@ -0,0 +1,84 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Authors of Cilium + +package check + +import ( + "testing" + + "github.com/cilium/cilium/pkg/components" + + "github.com/stretchr/testify/assert" + corev1 "k8s.io/api/core/v1" +) + +func TestConnectivityTestCiliumAgentMetrics(t *testing.T) { + ciliumPod := Pod{ + Pod: &corev1.Pod{ + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: components.CiliumAgentName, + Ports: []corev1.ContainerPort{ + { + Name: prometheusContainerPortName, + HostPort: 9962, + ContainerPort: 9962, + Protocol: corev1.ProtocolTCP, + }}, + }, + }, + }, + }, + } + + podWithPrometheusMissing := Pod{ + Pod: &corev1.Pod{ + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: components.CiliumAgentName, + Ports: []corev1.ContainerPort{ + { + Name: "peer-service", + HostPort: 4244, + ContainerPort: 4244, + Protocol: corev1.ProtocolTCP, + }}, + }, + }, + }, + }, + } + + tests := map[string]struct { + ct ConnectivityTest + want MetricsSource + }{ + "nominal case": { + ct: ConnectivityTest{ciliumPods: map[string]Pod{ + components.CiliumAgentName: ciliumPod, + }}, + want: MetricsSource{ + Name: components.CiliumAgentName, + Pods: []Pod{ciliumPod}, + Port: "9962", + }, + }, + "no cilium pods": { + ct: ConnectivityTest{ciliumPods: map[string]Pod{}}, + want: MetricsSource{}, + }, + "no prometheus container port": { + ct: ConnectivityTest{ciliumPods: map[string]Pod{components.CiliumAgentName: podWithPrometheusMissing}}, + want: MetricsSource{}, + }, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + got := tc.ct.CiliumAgentMetrics() + assert.Equal(t, tc.want, got) + }) + } +} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/peer.go b/connectivity/check/peer.go similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/peer.go rename to connectivity/check/peer.go index ba58165823..5eb9ebff13 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/peer.go +++ b/connectivity/check/peer.go @@ -9,12 +9,12 @@ import ( "net/url" "strconv" - "github.com/cilium/cilium-cli/k8s" - "github.com/cilium/cilium-cli/utils/features" - corev1 "k8s.io/api/core/v1" - "github.com/cilium/cilium/api/v1/flow" ciliumv2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + corev1 "k8s.io/api/core/v1" + + "github.com/cilium/cilium-cli/k8s" + "github.com/cilium/cilium-cli/utils/features" ) // TestPeer is the abstraction used for all peer types (pods, services, IPs, diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/policy.go b/connectivity/check/policy.go similarity index 99% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/policy.go rename to connectivity/check/policy.go index a082fe15dc..9a4cc04fd2 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/policy.go +++ b/connectivity/check/policy.go @@ -10,9 +10,11 @@ import ( "reflect" "strconv" "strings" + "time" - "github.com/cilium/cilium-cli/defaults" - "github.com/cilium/cilium-cli/k8s" + flowpb "github.com/cilium/cilium/api/v1/flow" + ciliumv2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" networkingv1 "k8s.io/api/networking/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -20,10 +22,8 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer" clientsetscheme "k8s.io/client-go/kubernetes/scheme" - flowpb "github.com/cilium/cilium/api/v1/flow" - ciliumv2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" - "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" - "github.com/cilium/cilium/pkg/time" + "github.com/cilium/cilium-cli/defaults" + "github.com/cilium/cilium-cli/k8s" ) /* How many times we should retry getting the policy revisions before diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/result.go b/connectivity/check/result.go similarity index 99% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/result.go rename to connectivity/check/result.go index eca382b9ac..352465ef8e 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/result.go +++ b/connectivity/check/result.go @@ -9,9 +9,8 @@ import ( "strconv" "strings" - dto "github.com/prometheus/client_model/go" - flowpb "github.com/cilium/cilium/api/v1/flow" + dto "github.com/prometheus/client_model/go" ) type Result struct { diff --git a/connectivity/check/result_test.go b/connectivity/check/result_test.go new file mode 100644 index 0000000000..6d29a7d686 --- /dev/null +++ b/connectivity/check/result_test.go @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Authors of Cilium + +package check + +import ( + "testing" + + "github.com/cilium/cilium/pkg/components" + + prommodel "github.com/prometheus/client_model/go" + "github.com/stretchr/testify/assert" + corev1 "k8s.io/api/core/v1" +) + +func TestExpectMetricsToIncrease(t *testing.T) { + ciliumPod := Pod{ + Pod: &corev1.Pod{ + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: components.CiliumAgentName, + Ports: []corev1.ContainerPort{ + { + Name: "prometheus", + HostPort: 9962, + ContainerPort: 9962, + Protocol: corev1.ProtocolTCP, + }}, + }, + }, + }, + }, + } + + metricName := "cilium_forward_count_total" + metricHelp := "Total forwarded packets, tagged by ingress/egress direction" + metricTypeCounter := prommodel.MetricType_COUNTER + labelName := "direction" + labelEgress := "EGRESS" + labelIngress := "INGRESS" + valueBefore := 1432571. + valueAfter := 1432625. + + metricsBefore := promMetricsFamily{ + metricName: { + Name: &metricName, + Help: &metricHelp, + Type: &metricTypeCounter, + Metric: []*prommodel.Metric{ + { + Label: []*prommodel.LabelPair{{Name: &labelName, Value: &labelEgress}}, + Counter: &prommodel.Counter{Value: &valueBefore}, + }, + { + Label: []*prommodel.LabelPair{{Name: &labelName, Value: &labelIngress}}, + Counter: &prommodel.Counter{Value: &valueBefore}, + }, + }, + }, + } + + metricsAfter := promMetricsFamily{ + metricName: { + Name: &metricName, + Help: &metricHelp, + Type: &metricTypeCounter, + Metric: []*prommodel.Metric{ + { + Label: []*prommodel.LabelPair{{Name: &labelName, Value: &labelEgress}}, + Counter: &prommodel.Counter{Value: &valueAfter}, + }, + { + Label: []*prommodel.LabelPair{{Name: &labelName, Value: &labelIngress}}, + Counter: &prommodel.Counter{Value: &valueAfter}, + }, + }, + }, + } + + otherMetric := promMetricsFamily{ + "other_metrics": { + Name: &metricName, + Help: &metricHelp, + Type: &metricTypeCounter, + Metric: []*prommodel.Metric{ + { + Label: []*prommodel.LabelPair{{Name: &labelName, Value: &labelEgress}}, + Counter: &prommodel.Counter{Value: &valueAfter}, + }, + { + Label: []*prommodel.LabelPair{{Name: &labelName, Value: &labelIngress}}, + Counter: &prommodel.Counter{Value: &valueAfter}, + }, + }, + }, + } + + tests := map[string]struct { + source MetricsSource + metrics string + metricsBefore promMetricsFamily + metricsAfter promMetricsFamily + wantErr bool + }{ + "nominal case: metrics increase": { + metrics: "cilium_forward_count_total", + metricsBefore: metricsBefore, + metricsAfter: metricsAfter, + wantErr: false, + }, + "metrics decrease": { + metrics: "cilium_forward_count_total", + metricsBefore: metricsAfter, + metricsAfter: metricsBefore, + wantErr: true, + }, + "metric name not present in the metrics before, counters should be set 0": { + metrics: "cilium_forward_count_total", + source: MetricsSource{ + Name: components.CiliumAgentName, + Pods: []Pod{ciliumPod}, + Port: "9962", + }, + metricsBefore: otherMetric, + metricsAfter: metricsAfter, + wantErr: false, + }, + "metric name not present in the metrics after": { + metrics: "cilium_forward_count_total", + metricsBefore: metricsBefore, + metricsAfter: otherMetric, + wantErr: true, + }, + "metric name not present in the metrics before and after": { + metrics: "unknown_metric", + metricsBefore: metricsBefore, + metricsAfter: metricsAfter, + wantErr: true, + }, + } + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + r := Result{} + got := r.ExpectMetricsIncrease(tc.source, tc.metrics) + + for _, m := range got.Metrics { + // check the source + assert.Equal(t, tc.source, m.Source) + + // check the assert method + err := m.Assert(tc.metricsBefore, tc.metricsAfter) + if tc.wantErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + } + } + }) + } +} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/scenario.go b/connectivity/check/scenario.go similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/scenario.go rename to connectivity/check/scenario.go diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/secrets.go b/connectivity/check/secrets.go similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/secrets.go rename to connectivity/check/secrets.go diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/test.go b/connectivity/check/test.go similarity index 99% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/test.go rename to connectivity/check/test.go index 293ab3d2bb..ff825810a3 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/test.go +++ b/connectivity/check/test.go @@ -10,11 +10,14 @@ import ( "fmt" "io" "net" + "sync" + "time" "github.com/blang/semver/v4" - "github.com/cilium/cilium-cli/defaults" - "github.com/cilium/cilium-cli/sysdump" - "github.com/cilium/cilium-cli/utils/features" + k8sConst "github.com/cilium/cilium/pkg/k8s/apis/cilium.io" + ciliumv2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + "github.com/cilium/cilium/pkg/policy/api" + "github.com/cilium/cilium/pkg/versioncheck" "github.com/cloudflare/cfssl/cli/genkey" "github.com/cloudflare/cfssl/config" "github.com/cloudflare/cfssl/csr" @@ -26,12 +29,9 @@ import ( networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - k8sConst "github.com/cilium/cilium/pkg/k8s/apis/cilium.io" - ciliumv2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" - "github.com/cilium/cilium/pkg/lock" - "github.com/cilium/cilium/pkg/policy/api" - "github.com/cilium/cilium/pkg/time" - "github.com/cilium/cilium/pkg/versioncheck" + "github.com/cilium/cilium-cli/defaults" + "github.com/cilium/cilium-cli/sysdump" + "github.com/cilium/cilium-cli/utils/features" ) const ( @@ -144,7 +144,7 @@ type Test struct { // Buffer to store output until it's flushed by a failure. // Unused when run in verbose or debug mode. - logMu lock.RWMutex + logMu sync.RWMutex logBuf io.ReadWriter warnBuf *bytes.Buffer verbose bool diff --git a/connectivity/check/test_test.go b/connectivity/check/test_test.go new file mode 100644 index 0000000000..9e84d5917b --- /dev/null +++ b/connectivity/check/test_test.go @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Authors of Cilium + +package check + +import ( + "reflect" + "testing" + + "github.com/cilium/cilium-cli/utils/features" +) + +func TestWithFeatureRequirements(t *testing.T) { + tests := map[string]struct { + requirements []features.Requirement + in []features.Requirement + want []features.Requirement + }{ + "Adding a feature to an empty list": { + requirements: nil, + in: []features.Requirement{{Feature: features.L7Proxy}}, + want: []features.Requirement{{Feature: features.L7Proxy}}, + }, + "Adding several features to an existing list with no duplicate": { + requirements: []features.Requirement{{Feature: features.CNP}, {Feature: features.IPv6}}, + in: []features.Requirement{{Feature: features.L7Proxy}, {Feature: features.EncryptionNode}}, + want: []features.Requirement{{Feature: features.CNP}, {Feature: features.IPv6}, {Feature: features.L7Proxy}, {Feature: features.EncryptionNode}}, + }, + "Adding one duplicate": { + requirements: []features.Requirement{{Feature: features.CNP}, {Feature: features.IPv6}}, + in: []features.Requirement{{Feature: features.L7Proxy}, {Feature: features.IPv6}}, + want: []features.Requirement{{Feature: features.CNP}, {Feature: features.IPv6}, {Feature: features.L7Proxy}}, + }, + "Adding two same features as input": { + requirements: []features.Requirement{{Feature: features.CNP}, {Feature: features.IPv6}}, + in: []features.Requirement{{Feature: features.L7Proxy}, {Feature: features.L7Proxy}}, + want: []features.Requirement{{Feature: features.CNP}, {Feature: features.IPv6}, {Feature: features.L7Proxy}}, + }, + "Adding an empty list": { + requirements: []features.Requirement{{Feature: features.CNP}, {Feature: features.IPv6}}, + in: []features.Requirement{}, + want: []features.Requirement{{Feature: features.CNP}, {Feature: features.IPv6}}, + }, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + test := Test{requirements: tc.requirements} + if got := test.WithFeatureRequirements(tc.in...); !reflect.DeepEqual(got.requirements, tc.want) { + t.Errorf("WithFeatureRequirements() = %v, want %v", got.requirements, tc.want) + } + }) + } +} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/wait.go b/connectivity/check/wait.go similarity index 96% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/wait.go rename to connectivity/check/wait.go index 092dfc2018..0150c02b24 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/check/wait.go +++ b/connectivity/check/wait.go @@ -11,16 +11,15 @@ import ( "net/netip" "strconv" "strings" + "time" - "github.com/cilium/cilium-cli/defaults" - "github.com/cilium/cilium-cli/k8s" - "github.com/cilium/cilium-cli/utils/features" + "github.com/cilium/cilium/api/v1/models" "golang.org/x/exp/slices" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/cilium/cilium/api/v1/models" - "github.com/cilium/cilium/pkg/inctimer" - "github.com/cilium/cilium/pkg/time" + "github.com/cilium/cilium-cli/defaults" + "github.com/cilium/cilium-cli/k8s" + "github.com/cilium/cilium-cli/utils/features" ) const ( @@ -45,7 +44,7 @@ func WaitForDeployment(ctx context.Context, log Logger, client *k8s.Client, name log.Debugf("[%s] Deployment %s/%s is not yet ready: %s", client.ClusterName(), namespace, name, err) select { - case <-inctimer.After(PollInterval): + case <-time.After(PollInterval): case <-ctx.Done(): return fmt.Errorf("timeout reached waiting for deployment %s/%s to become ready (last error: %w)", namespace, name, err) @@ -68,7 +67,7 @@ func WaitForDaemonSet(ctx context.Context, log Logger, client *k8s.Client, names log.Debugf("[%s] DaemonSet %s/%s is not yet ready: %s", client.ClusterName(), namespace, name, err) select { - case <-inctimer.After(PollInterval): + case <-time.After(PollInterval): case <-ctx.Done(): return fmt.Errorf("timeout reached waiting for DaemonSet %s/%s to become ready (last error: %w)", namespace, name, err) @@ -100,7 +99,7 @@ func WaitForPodDNS(ctx context.Context, log Logger, src, dst Pod) error { src.K8sClient.ClusterName(), target, src.Name(), dst.Name(), err, stdout.String()) select { - case <-inctimer.After(PollInterval): + case <-time.After(PollInterval): case <-ctx.Done(): return fmt.Errorf("timeout reached waiting for lookup for %s from pod %s to server on pod %s to succeed (last error: %w)", target, src.Name(), dst.Name(), err, @@ -128,7 +127,7 @@ func WaitForCoreDNS(ctx context.Context, log Logger, client Pod) error { client.K8sClient.ClusterName(), target, client.Name(), err, stdout.String()) select { - case <-inctimer.After(PollInterval): + case <-time.After(PollInterval): case <-ctx.Done(): return fmt.Errorf("timeout reached waiting for lookup for %s from pod %s to succeed (last error: %w)", target, client.Name(), err) @@ -151,7 +150,7 @@ func WaitForServiceRetrieval(ctx context.Context, log Logger, client *k8s.Client log.Debugf("[%s] Failed to retrieve Service %s/%s: %s", client.ClusterName(), namespace, name, err) select { - case <-inctimer.After(PollInterval): + case <-time.After(PollInterval): case <-ctx.Done(): return Service{}, fmt.Errorf("timeout reached waiting for service %s/%s to be retrieved (last error: %w)", namespace, name, err) @@ -189,7 +188,7 @@ func WaitForService(ctx context.Context, log Logger, client Pod, service Service client.K8sClient.ClusterName(), service.Name(), err, stdout.String()) select { - case <-inctimer.After(PollInterval): + case <-time.After(PollInterval): case <-ctx.Done(): return fmt.Errorf("timeout reached waiting for service %s (last error: %w)", service.Name(), err) } @@ -215,7 +214,7 @@ func WaitForServiceEndpoints(ctx context.Context, log Logger, agent Pod, service agent.K8sClient.ClusterName(), service.Name(), agent.Name(), err) select { - case <-inctimer.After(PollInterval): + case <-time.After(PollInterval): case <-ctx.Done(): return fmt.Errorf("timeout reached waiting for service %s to appear in Cilium pod %s (last error: %w)", service.Name(), agent.Name(), err) @@ -295,7 +294,7 @@ func WaitForNodePorts(ctx context.Context, log Logger, client Pod, nodeIP string client.K8sClient.ClusterName(), nodeIP, nodePort, service.Name(), err, stdout.String()) select { - case <-inctimer.After(PollInterval): + case <-time.After(PollInterval): case <-ctx.Done(): return fmt.Errorf("timeout reached waiting for NodePort %s:%d (%s) (last error: %w)", nodeIP, nodePort, service.Name(), err) @@ -323,7 +322,7 @@ func WaitForIPCache(ctx context.Context, log Logger, agent Pod, pods []Pod) erro log.Debugf("[%s] Error checking pod IPs in IPCache: %s", agent.K8sClient.ClusterName(), err) select { - case <-inctimer.After(PollInterval): + case <-time.After(PollInterval): case <-ctx.Done(): return fmt.Errorf("timeout reached waiting for pod IPs to be in IPCache of Cilium pod %s (last error: %w)", agent.Name(), err) diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/filters/filters.go b/connectivity/filters/filters.go similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/filters/filters.go rename to connectivity/filters/filters.go diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/internal/junit/junit.go b/connectivity/internal/junit/junit.go similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/internal/junit/junit.go rename to connectivity/internal/junit/junit.go diff --git a/connectivity/internal/junit/junit_test.go b/connectivity/internal/junit/junit_test.go new file mode 100644 index 0000000000..48e593d079 --- /dev/null +++ b/connectivity/internal/junit/junit_test.go @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Authors of Cilium + +package junit + +import ( + "bytes" + "testing" + + "github.com/stretchr/testify/assert" +) + +var suitesText = ` + + + + + + + + failure > expected + + + ` + +var suites = TestSuites{ + Tests: 3, + Disabled: 1, + Failures: 1, + Time: 14.7, + TestSuites: []*TestSuite{ + { + Name: "testSuite", + Package: "test", + Tests: 3, + Skipped: 1, + Failures: 1, + Time: 14.7, + Timestamp: "2023-05-08T11:24:14", + TestCases: []*TestCase{ + {Name: "test1", Classname: "test", Status: "passed", Time: 7.7}, + {Name: "test2", Classname: "test", Status: "skipped", Time: 0, + Skipped: &Skipped{Message: "test2 skipped"}}, + {Name: "test3", Classname: "test", Status: "failed", Time: 7, + Failure: &Failure{Message: "test3 failed", Type: "failure", Value: "failure > expected"}}, + }, + }, + }, +} + +func TestWriteReport(t *testing.T) { + buf := &bytes.Buffer{} + assert.NoError(t, suites.WriteReport(buf)) + assert.Equal(t, suitesText, buf.String()) +} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/perf/benchmarks/netperf/perfpod.go b/connectivity/perf/benchmarks/netperf/perfpod.go similarity index 85% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/perf/benchmarks/netperf/perfpod.go rename to connectivity/perf/benchmarks/netperf/perfpod.go index e08416b826..db160db8c3 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/perf/benchmarks/netperf/perfpod.go +++ b/connectivity/perf/benchmarks/netperf/perfpod.go @@ -6,14 +6,13 @@ package netperf import ( "context" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/perf/common" "strconv" "strings" + "time" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/perf/common" "github.com/cilium/cilium-cli/utils/features" - - "github.com/cilium/cilium/pkg/time" ) const ( @@ -22,7 +21,7 @@ const ( ) // Network Performance -func Netperf(n string) check2.Scenario { +func Netperf(n string) check.Scenario { return &netPerf{ name: n, } @@ -39,7 +38,7 @@ func (s *netPerf) Name() string { return fmt.Sprintf("%s:%s", netperfToolName, s.name) } -func (s *netPerf) Run(ctx context.Context, t *check2.Test) { +func (s *netPerf) Run(ctx context.Context, t *check.Test) { samples := t.Context().Params().PerfSamples duration := t.Context().Params().PerfDuration @@ -56,26 +55,26 @@ func (s *netPerf) Run(ctx context.Context, t *check2.Test) { c := c for _, server := range t.Context().PerfServerPod() { scenarioName := "" - if strings.Contains(c.Pod.Name, check2.PerfHostName) { + if strings.Contains(c.Pod.Name, check.PerfHostName) { scenarioName += "host" } else { scenarioName += "pod" } scenarioName += "-to-" - if strings.Contains(server.Pod.Name, check2.PerfHostName) { + if strings.Contains(server.Pod.Name, check.PerfHostName) { scenarioName += "host" } else { scenarioName += "pod" } sameNode := true - if strings.Contains(c.Pod.Name, check2.PerfOtherNode) { + if strings.Contains(c.Pod.Name, check.PerfOtherNode) { sameNode = false } for _, test := range tests { action := t.NewAction(s, netperfToolName, &c, server, features.IPFamilyV4) action.CollectFlows = false - action.Run(func(a *check2.Action) { + action.Run(func(a *check.Action) { k := common.PerfTests{ Test: test, Tool: netperfToolName, @@ -100,7 +99,7 @@ func buildExecCommand(test string, sip string, duration time.Duration, args []st return exec } -func parseDuration(a *check2.Action, value string) time.Duration { +func parseDuration(a *check.Action, value string) time.Duration { res, err := time.ParseDuration(value + "us") // by default latencies in netperf are reported in microseconds if err != nil { a.Fatalf("Unable to process netperf result, duration: %s", value) @@ -108,7 +107,7 @@ func parseDuration(a *check2.Action, value string) time.Duration { return res } -func parseFloat(a *check2.Action, value string) float64 { +func parseFloat(a *check.Action, value string) float64 { res, err := strconv.ParseFloat(value, 64) if err != nil { a.Fatalf("Unable to process netperf result, float: %s", value) @@ -116,7 +115,7 @@ func parseFloat(a *check2.Action, value string) float64 { return res } -func netperf(ctx context.Context, sip string, perfTest common.PerfTests, a *check2.Action) common.PerfResult { +func netperf(ctx context.Context, sip string, perfTest common.PerfTests, a *check.Action) common.PerfResult { args := []string{"-o", "MIN_LATENCY,MEAN_LATENCY,MAX_LATENCY,P50_LATENCY,P90_LATENCY,P99_LATENCY,TRANSACTION_RATE,THROUGHPUT,THROUGHPUT_UNITS"} exec := buildExecCommand(perfTest.Test, sip, perfTest.Duration, args) diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/perf/common/metrics.go b/connectivity/perf/common/metrics.go similarity index 99% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/perf/common/metrics.go rename to connectivity/perf/common/metrics.go index 9750f62a67..bb8ad1020b 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/perf/common/metrics.go +++ b/connectivity/perf/common/metrics.go @@ -11,8 +11,7 @@ import ( "os" "path" "strings" - - "github.com/cilium/cilium/pkg/time" + "time" ) // LatencyMetric captures latency metrics of network performance test diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/sniff/filters.go b/connectivity/sniff/filters.go similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/sniff/filters.go rename to connectivity/sniff/filters.go diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/sniff/sniffer.go b/connectivity/sniff/sniffer.go similarity index 94% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/sniff/sniffer.go rename to connectivity/sniff/sniffer.go index 4435ff397c..4fd1f90c24 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/sniff/sniffer.go +++ b/connectivity/sniff/sniffer.go @@ -7,14 +7,12 @@ import ( "context" "errors" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" "io" "strings" + "time" + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/utils/lock" - - "github.com/cilium/cilium/pkg/inctimer" - "github.com/cilium/cilium/pkg/time" ) // Mode configures the Sniffer validation mode. @@ -29,7 +27,7 @@ const ( ) type Sniffer struct { - target *check2.Pod + target *check.Pod dumpPath string mode Mode cmd []string @@ -46,7 +44,7 @@ type debugLogger interface { // Start starts a tcpdump capture on the given pod, listening to the specified // interface. The mode configures whether Validate() will (not) expect any packet // to match the filter. -func Sniff(ctx context.Context, name string, target *check2.Pod, +func Sniff(ctx context.Context, name string, target *check.Pod, iface string, filter string, mode Mode, dbg debugLogger, ) (*Sniffer, error) { cmdctx, cancel := context.WithCancel(ctx) @@ -100,7 +98,7 @@ func Sniff(ctx context.Context, name string, target *check2.Pod, } return nil, fmt.Errorf("Failed to execute tcpdump: %w", err) - case <-inctimer.After(100 * time.Millisecond): + case <-time.After(100 * time.Millisecond): line, err := sniffer.stdout.ReadString('\n') if err != nil && !errors.Is(err, io.EOF) { return nil, fmt.Errorf("Failed to read kubectl exec's stdout: %w", err) @@ -115,7 +113,7 @@ func Sniff(ctx context.Context, name string, target *check2.Pod, // Validate stops the tcpdump capture previously started by Sniff and asserts that // no packets (or at least one packet when running in sanity mode) got captured. It // additionally dumps the captured packets in case of failure if debug logs are enabled. -func (sniffer *Sniffer) Validate(ctx context.Context, a *check2.Action) { +func (sniffer *Sniffer) Validate(ctx context.Context, a *check.Action) { // Wait until tcpdump has exited if err := sniffer.stopAndWait(ctx); err != nil { a.Fatalf("Failed to execute tcpdump on %s (%s): %s", sniffer.target.String(), sniffer.target.NodeName(), err) diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/suite.go b/connectivity/suite.go similarity index 86% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/suite.go rename to connectivity/suite.go index c1a6ca3c00..a5a93b1d05 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/suite.go +++ b/connectivity/suite.go @@ -5,8 +5,9 @@ package connectivity import ( "context" - "github.com/cilium/cilium/cilium-cli/connectivity/builder" - "github.com/cilium/cilium/cilium-cli/connectivity/check" + + "github.com/cilium/cilium-cli/connectivity/builder" + "github.com/cilium/cilium-cli/connectivity/check" ) // Hooks defines the extension hooks provided by connectivity tests. diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/client.go b/connectivity/tests/client.go similarity index 74% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/client.go rename to connectivity/tests/client.go index 68d1ae3fb1..86ace27d58 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/client.go +++ b/connectivity/tests/client.go @@ -6,14 +6,14 @@ package tests import ( "context" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/utils/features" ) // ClientToClient sends an ICMP packet from each client Pod // to each client Pod in the test context. -func ClientToClient() check2.Scenario { +func ClientToClient() check.Scenario { return &clientToClient{} } @@ -24,7 +24,7 @@ func (s *clientToClient) Name() string { return "client-to-client" } -func (s *clientToClient) Run(ctx context.Context, t *check2.Test) { +func (s *clientToClient) Run(ctx context.Context, t *check.Test) { var i int ct := t.Context() @@ -41,15 +41,15 @@ func (s *clientToClient) Run(ctx context.Context, t *check2.Test) { dst := dst // copy to avoid memory aliasing when using reference t.ForEachIPFamily(func(ipFam features.IPFamily) { - t.NewAction(s, fmt.Sprintf("ping-%s-%d", ipFam, i), &src, &dst, ipFam).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("ping-%s-%d", ipFam, i), &src, &dst, ipFam).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.PingCommand(dst, ipFam)) - a.ValidateFlows(ctx, src, a.GetEgressRequirements(check2.FlowParameters{ - Protocol: check2.ICMP, + a.ValidateFlows(ctx, src, a.GetEgressRequirements(check.FlowParameters{ + Protocol: check.ICMP, })) - a.ValidateFlows(ctx, dst, a.GetIngressRequirements(check2.FlowParameters{ - Protocol: check2.ICMP, + a.ValidateFlows(ctx, dst, a.GetIngressRequirements(check.FlowParameters{ + Protocol: check.ICMP, })) a.ValidateMetrics(ctx, src, a.GetEgressMetricsRequirements()) diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/common.go b/connectivity/tests/common.go similarity index 93% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/common.go rename to connectivity/tests/common.go index ee13371e90..cd53510208 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/common.go +++ b/connectivity/tests/common.go @@ -4,9 +4,9 @@ package tests import ( - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" "strconv" + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/utils/features" ) @@ -64,7 +64,7 @@ type retryCondition struct { } // CurlOptions returns curl retry option or empty slice depending on retry conditions -func (rc *retryCondition) CurlOptions(peer check2.TestPeer, ipFam features.IPFamily, pod check2.Pod, params check2.Parameters) []string { +func (rc *retryCondition) CurlOptions(peer check.TestPeer, ipFam features.IPFamily, pod check.Pod, params check.Parameters) []string { if params.Retry == 0 { return []string{} } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/dummy.go b/connectivity/tests/dummy.go similarity index 76% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/dummy.go rename to connectivity/tests/dummy.go index dbc2ba3357..79f2f936a8 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/dummy.go +++ b/connectivity/tests/dummy.go @@ -6,8 +6,8 @@ package tests import ( "context" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/utils/features" ) @@ -16,7 +16,7 @@ type dummy struct { name string } -func Dummy(name string) check2.Scenario { +func Dummy(name string) check.Scenario { return &dummy{ name: name, } @@ -30,14 +30,14 @@ func (s *dummy) Name() string { return fmt.Sprintf("%s:%s", tn, s.name) } -func (s *dummy) Run(_ context.Context, t *check2.Test) { - t.NewAction(s, "action-1", nil, nil, features.IPFamilyAny).Run(func(a *check2.Action) { +func (s *dummy) Run(_ context.Context, t *check.Test) { + t.NewAction(s, "action-1", nil, nil, features.IPFamilyAny).Run(func(a *check.Action) { a.Log("logging") a.Debug("debugging") a.Info("informing") }) - t.NewAction(s, "action-2", nil, nil, features.IPFamilyAny).Run(func(a *check2.Action) { + t.NewAction(s, "action-2", nil, nil, features.IPFamilyAny).Run(func(a *check.Action) { a.Log("logging") a.Fatal("killing :(") a.Fail("failing (this should not be printed)") diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/egressgateway.go b/connectivity/tests/egressgateway.go similarity index 92% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/egressgateway.go rename to connectivity/tests/egressgateway.go index 73c9db2d7e..fbd1cb97d9 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/egressgateway.go +++ b/connectivity/tests/egressgateway.go @@ -7,18 +7,18 @@ import ( "context" "encoding/json" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" "net" "strings" + "time" + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/defaults" "github.com/cilium/cilium-cli/utils/features" "github.com/cilium/cilium-cli/utils/wait" + v1 "k8s.io/api/core/v1" k8sErrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/cilium/cilium/pkg/time" ) // bpfEgressGatewayPolicyEntry represents an entry in the BPF egress gateway policy map @@ -39,8 +39,8 @@ func (e *bpfEgressGatewayPolicyEntry) matches(t bpfEgressGatewayPolicyEntry) boo // WaitForEgressGatewayBpfPolicyEntries waits for the egress gateway policy maps on each node to WaitForEgressGatewayBpfPolicyEntries // with the entries returned by the targetEntriesCallback -func WaitForEgressGatewayBpfPolicyEntries(ctx context.Context, t *check2.Test, - targetEntriesCallback func(ciliumPod check2.Pod) []bpfEgressGatewayPolicyEntry, +func WaitForEgressGatewayBpfPolicyEntries(ctx context.Context, t *check.Test, + targetEntriesCallback func(ciliumPod check.Pod) []bpfEgressGatewayPolicyEntry, ) { ct := t.Context() @@ -100,7 +100,7 @@ func WaitForEgressGatewayBpfPolicyEntries(ctx context.Context, t *check2.Test, } // getGatewayNodeInternalIP returns the k8s internal IP of the node acting as gateway for this test -func getGatewayNodeInternalIP(ct *check2.ConnectivityTest, egressGatewayNode string) net.IP { +func getGatewayNodeInternalIP(ct *check.ConnectivityTest, egressGatewayNode string) net.IP { gatewayNode, ok := ct.Nodes()[egressGatewayNode] if !ok { return nil @@ -149,7 +149,7 @@ func extractClientIPFromResponse(res string) net.IP { // - pod to external IP traffic // - reply traffic for services // - reply traffic for pods -func EgressGateway() check2.Scenario { +func EgressGateway() check.Scenario { return &egressGateway{} } @@ -159,7 +159,7 @@ func (s *egressGateway) Name() string { return "egress-gateway" } -func (s *egressGateway) Run(ctx context.Context, t *check2.Test) { +func (s *egressGateway) Run(ctx context.Context, t *check.Test) { ct := t.Context() egressGatewayNode := t.EgressGatewayNode() @@ -172,7 +172,7 @@ func (s *egressGateway) Run(ctx context.Context, t *check2.Test) { t.Fatal("Cannot get egress gateway node internal IP") } - WaitForEgressGatewayBpfPolicyEntries(ctx, t, func(ciliumPod check2.Pod) []bpfEgressGatewayPolicyEntry { + WaitForEgressGatewayBpfPolicyEntries(ctx, t, func(ciliumPod check.Pod) []bpfEgressGatewayPolicyEntry { targetEntries := []bpfEgressGatewayPolicyEntry{} egressIP := "0.0.0.0" @@ -211,7 +211,7 @@ func (s *egressGateway) Run(ctx context.Context, t *check2.Test) { for _, dst := range ct.HostNetNSPodsByNode() { dst := dst - t.NewAction(s, fmt.Sprintf("ping-%d", i), &client, &dst, features.IPFamilyV4).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("ping-%d", i), &client, &dst, features.IPFamilyV4).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.PingCommand(dst, features.IPFamilyV4)) }) i++ @@ -227,9 +227,9 @@ func (s *egressGateway) Run(ctx context.Context, t *check2.Test) { if err != nil { t.Fatal("Cannot get kube-dns service") } - kubeDNSServicePeer := check2.Service{Service: kubeDNSService} + kubeDNSServicePeer := check.Service{Service: kubeDNSService} - t.NewAction(s, fmt.Sprintf("dig-%d", i), &client, kubeDNSServicePeer, features.IPFamilyV4).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("dig-%d", i), &client, kubeDNSServicePeer, features.IPFamilyV4).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.DigCommand(kubeDNSServicePeer, features.IPFamilyV4)) }) i++ @@ -243,7 +243,7 @@ func (s *egressGateway) Run(ctx context.Context, t *check2.Test) { for _, externalEcho := range ct.ExternalEchoPods() { externalEcho := externalEcho.ToEchoIPPod() - t.NewAction(s, fmt.Sprintf("curl-external-echo-pod-%d", i), &client, externalEcho, features.IPFamilyV4).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("curl-external-echo-pod-%d", i), &client, externalEcho, features.IPFamilyV4).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.CurlCommandWithOutput(externalEcho, features.IPFamilyV4)) clientIP := extractClientIPFromResponse(a.CmdOutput()) @@ -266,7 +266,7 @@ func (s *egressGateway) Run(ctx context.Context, t *check2.Test) { // convert the service to a ServiceExternalIP as we want to access it through its external IP echo := echo.ToNodeportService(node) - t.NewAction(s, fmt.Sprintf("curl-echo-service-%d", i), &client, echo, features.IPFamilyV4).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("curl-echo-service-%d", i), &client, echo, features.IPFamilyV4).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.CurlCommand(echo, features.IPFamilyV4)) }) i++ @@ -287,7 +287,7 @@ func (s *egressGateway) Run(ctx context.Context, t *check2.Test) { client := client for _, echo := range ct.EchoPods() { - t.NewAction(s, fmt.Sprintf("curl-echo-pod-%d", i), &client, echo, features.IPFamilyV4).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("curl-echo-pod-%d", i), &client, echo, features.IPFamilyV4).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.CurlCommand(echo, features.IPFamilyV4)) }) i++ @@ -304,7 +304,7 @@ func (s *egressGateway) Run(ctx context.Context, t *check2.Test) { // - kind-worker2 as gateway node // // This suite tests the excludedCIDRs property and ensure traffic matching an excluded CIDR does not get masqueraded with the egress IP -func EgressGatewayExcludedCIDRs() check2.Scenario { +func EgressGatewayExcludedCIDRs() check.Scenario { return &egressGatewayExcludedCIDRs{} } @@ -314,7 +314,7 @@ func (s *egressGatewayExcludedCIDRs) Name() string { return "egress-gateway-excluded-cidrs" } -func (s *egressGatewayExcludedCIDRs) Run(ctx context.Context, t *check2.Test) { +func (s *egressGatewayExcludedCIDRs) Run(ctx context.Context, t *check.Test) { ct := t.Context() egressGatewayNode := t.EgressGatewayNode() @@ -327,7 +327,7 @@ func (s *egressGatewayExcludedCIDRs) Run(ctx context.Context, t *check2.Test) { t.Fatal("Cannot get egress gateway node internal IP") } - WaitForEgressGatewayBpfPolicyEntries(ctx, t, func(ciliumPod check2.Pod) []bpfEgressGatewayPolicyEntry { + WaitForEgressGatewayBpfPolicyEntries(ctx, t, func(ciliumPod check.Pod) []bpfEgressGatewayPolicyEntry { targetEntries := []bpfEgressGatewayPolicyEntry{} egressIP := "0.0.0.0" @@ -376,7 +376,7 @@ func (s *egressGatewayExcludedCIDRs) Run(ctx context.Context, t *check2.Test) { for _, externalEcho := range ct.ExternalEchoPods() { externalEcho := externalEcho.ToEchoIPPod() - t.NewAction(s, fmt.Sprintf("curl-%d", i), &client, externalEcho, features.IPFamilyV4).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("curl-%d", i), &client, externalEcho, features.IPFamilyV4).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.CurlCommandWithOutput(externalEcho, features.IPFamilyV4)) clientIP := extractClientIPFromResponse(a.CmdOutput()) diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/encryption.go b/connectivity/tests/encryption.go similarity index 90% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/encryption.go rename to connectivity/tests/encryption.go index 747cce9662..95cc00f7c6 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/encryption.go +++ b/connectivity/tests/encryption.go @@ -6,14 +6,14 @@ package tests import ( "context" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - sniff2 "github.com/cilium/cilium/cilium-cli/connectivity/sniff" "strings" - "github.com/cilium/cilium-cli/utils/features" - "github.com/cilium/cilium/pkg/defaults" "github.com/cilium/cilium/pkg/versioncheck" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/sniff" + "github.com/cilium/cilium-cli/utils/features" ) type requestType int @@ -33,8 +33,8 @@ const ( // We cannot listen on the tunneling netdev, because the datapath first passes // a packet to the tunnel netdev, and only afterwards redirects to the WG netdev // for the encryption. -func getInterNodeIface(ctx context.Context, t *check2.Test, - client, clientHost, server, serverHost *check2.Pod, ipFam features.IPFamily, +func getInterNodeIface(ctx context.Context, t *check.Test, + client, clientHost, server, serverHost *check.Pod, ipFam features.IPFamily, wgEncap bool) string { tunnelEnabled := false @@ -102,8 +102,8 @@ func getInterNodeIface(ctx context.Context, t *check2.Test, // // WireGuard w/ tunnel: this is a special case. We are interested to see whether // any unencrypted VXLAN pkt is leaked on a native device. -func getFilter(ctx context.Context, t *check2.Test, client, clientHost *check2.Pod, - server, serverHost *check2.Pod, +func getFilter(ctx context.Context, t *check.Test, client, clientHost *check.Pod, + server, serverHost *check.Pod, ipFam features.IPFamily, reqType requestType, wgEncap bool) string { tunnelEnabled := false @@ -137,7 +137,7 @@ func getFilter(ctx context.Context, t *check2.Test, client, clientHost *check2.P // to catch any regression in the DP which makes the pkt to bypass // the VXLAN tunnel. filter := fmt.Sprintf("(%s and host %s and host %s) or (host %s and host %s and %s)", - sniff2.TunnelFilter, + sniff.TunnelFilter, clientHost.Address(features.IPFamilyV4), serverHost.Address(features.IPFamilyV4), client.Address(ipFam), server.Address(ipFam), protoFilter) @@ -181,7 +181,7 @@ func getFilter(ctx context.Context, t *check2.Test, client, clientHost *check2.P // // In v1.14, it's an opt-in, and controlled by --wireguard-encapsulate. // In v1.15, it's enabled, and it's not possible to opt-out. -func isWgEncap(t *check2.Test) bool { +func isWgEncap(t *check.Test) bool { if e, ok := t.Context().Feature(features.EncryptionPod); !(ok && e.Enabled && e.Mode == "wireguard") { return false } @@ -207,7 +207,7 @@ func isWgEncap(t *check2.Test) bool { // // The checks are implemented by curl'ing a server pod from a client pod, and // then inspecting tcpdump captures from the client pod's node. -func PodToPodEncryption(reqs ...features.Requirement) check2.Scenario { +func PodToPodEncryption(reqs ...features.Requirement) check.Scenario { return &podToPodEncryption{reqs} } @@ -217,11 +217,11 @@ func (s *podToPodEncryption) Name() string { return "pod-to-pod-encryption" } -func (s *podToPodEncryption) Run(ctx context.Context, t *check2.Test) { +func (s *podToPodEncryption) Run(ctx context.Context, t *check.Test) { ct := t.Context() client := ct.RandomClientPod() - var server check2.Pod + var server check.Pod for _, pod := range ct.EchoPods() { // Make sure that the server pod is on another node than client if pod.Pod.Status.HostIP != client.Pod.Status.HostIP { @@ -251,29 +251,29 @@ func (s *podToPodEncryption) Run(ctx context.Context, t *check2.Test) { }) } -func testNoTrafficLeak(ctx context.Context, t *check2.Test, s check2.Scenario, - client, server, clientHost *check2.Pod, serverHost *check2.Pod, +func testNoTrafficLeak(ctx context.Context, t *check.Test, s check.Scenario, + client, server, clientHost *check.Pod, serverHost *check.Pod, reqType requestType, ipFam features.IPFamily, assertNoLeaks, biDirCheck, wgEncap bool, ) { srcFilter := getFilter(ctx, t, client, clientHost, server, serverHost, ipFam, reqType, wgEncap) srcIface := getInterNodeIface(ctx, t, client, clientHost, server, serverHost, ipFam, wgEncap) - snifferMode := sniff2.ModeAssert + snifferMode := sniff.ModeAssert if !assertNoLeaks { - snifferMode = sniff2.ModeSanity + snifferMode = sniff.ModeSanity } - srcSniffer, err := sniff2.Sniff(ctx, s.Name(), clientHost, srcIface, srcFilter, snifferMode, t) + srcSniffer, err := sniff.Sniff(ctx, s.Name(), clientHost, srcIface, srcFilter, snifferMode, t) if err != nil { t.Fatal(err) } - var dstSniffer *sniff2.Sniffer + var dstSniffer *sniff.Sniffer if biDirCheck { dstFilter := getFilter(ctx, t, server, serverHost, client, clientHost, ipFam, reqType, wgEncap) dstIface := getInterNodeIface(ctx, t, server, serverHost, client, clientHost, ipFam, wgEncap) - dstSniffer, err = sniff2.Sniff(ctx, s.Name(), serverHost, dstIface, dstFilter, snifferMode, t) + dstSniffer, err = sniff.Sniff(ctx, s.Name(), serverHost, dstIface, dstFilter, snifferMode, t) if err != nil { t.Fatal(err) } @@ -282,7 +282,7 @@ func testNoTrafficLeak(ctx context.Context, t *check2.Test, s check2.Scenario, switch reqType { case requestHTTP: // Curl the server from the client to generate some traffic - t.NewAction(s, fmt.Sprintf("curl-%s", ipFam), client, server, ipFam).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("curl-%s", ipFam), client, server, ipFam).Run(func(a *check.Action) { a.ExecInPod(ctx, t.Context().CurlCommand(server, ipFam)) srcSniffer.Validate(ctx, a) if dstSniffer != nil { @@ -291,7 +291,7 @@ func testNoTrafficLeak(ctx context.Context, t *check2.Test, s check2.Scenario, }) case requestICMPEcho: // Ping the server from the client to generate some traffic - t.NewAction(s, fmt.Sprintf("ping-%s", ipFam), client, server, ipFam).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("ping-%s", ipFam), client, server, ipFam).Run(func(a *check.Action) { a.ExecInPod(ctx, t.Context().PingCommand(server, ipFam)) srcSniffer.Validate(ctx, a) if dstSniffer != nil { @@ -301,7 +301,7 @@ func testNoTrafficLeak(ctx context.Context, t *check2.Test, s check2.Scenario, } } -func NodeToNodeEncryption(reqs ...features.Requirement) check2.Scenario { +func NodeToNodeEncryption(reqs ...features.Requirement) check.Scenario { return &nodeToNodeEncryption{reqs} } @@ -311,10 +311,10 @@ func (s *nodeToNodeEncryption) Name() string { return "node-to-node-encryption" } -func (s *nodeToNodeEncryption) Run(ctx context.Context, t *check2.Test) { +func (s *nodeToNodeEncryption) Run(ctx context.Context, t *check.Test) { client := t.Context().RandomClientPod() - var server check2.Pod + var server check.Pod for _, pod := range t.Context().EchoPods() { // Make sure that the server pod is on another node than client if pod.Pod.Status.HostIP != client.Pod.Status.HostIP { diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/errors.go b/connectivity/tests/errors.go similarity index 95% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/errors.go rename to connectivity/tests/errors.go index 4e302e7f72..d599923361 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/errors.go +++ b/connectivity/tests/errors.go @@ -6,18 +6,19 @@ package tests import ( "context" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" "regexp" "strings" "github.com/blang/semver/v4" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/ptr" + + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/defaults" "github.com/cilium/cilium-cli/k8s" "github.com/cilium/cilium-cli/sysdump" "github.com/cilium/cilium-cli/utils/features" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" ) type logMatcher interface { @@ -41,7 +42,7 @@ func (r regexMatcher) IsMatch(log string) bool { // NoErrorsInLogs checks whether there are no error messages in cilium-agent // logs. The error messages are defined in badLogMsgsWithExceptions, which key // is an error message, while values is a list of ignored messages. -func NoErrorsInLogs(ciliumVersion semver.Version) check2.Scenario { +func NoErrorsInLogs(ciliumVersion semver.Version) check.Scenario { // Exceptions for level=error should only be added as a last resort, if the // error cannot be fixed in Cilium or in the test. errorLogExceptions := []logMatcher{ @@ -92,7 +93,7 @@ type podInfo struct { client *k8s.Client } -func (n *noErrorsInLogs) Run(ctx context.Context, t *check2.Test) { +func (n *noErrorsInLogs) Run(ctx context.Context, t *check.Test) { pods, err := n.allCiliumPods(ctx, t.Context()) if err != nil { t.Fatalf("Error retrieving Cilium pods: %s", err) @@ -103,7 +104,7 @@ func (n *noErrorsInLogs) Run(ctx context.Context, t *check2.Test) { client := info.client for _, container := range info.containers { id := fmt.Sprintf("%s/%s/%s (%s)", pod.Cluster, pod.Namespace, pod.Name, container) - t.NewGenericAction(n, id).Run(func(a *check2.Action) { + t.NewGenericAction(n, id).Run(func(a *check.Action) { logs, err := client.GetLogs(ctx, pod.Namespace, pod.Name, container, opts) if err != nil { a.Fatalf("Error reading Cilium logs: %s", err) @@ -117,7 +118,7 @@ func (n *noErrorsInLogs) Run(ctx context.Context, t *check2.Test) { // NoUnexpectedPacketDrops checks whether there were no drops due to expected // packet drops. -func NoUnexpectedPacketDrops(expectedDrops []string) check2.Scenario { +func NoUnexpectedPacketDrops(expectedDrops []string) check.Scenario { return &noUnexpectedPacketDrops{expectedDrops} } @@ -129,7 +130,7 @@ func (n *noUnexpectedPacketDrops) Name() string { return "no-unexpected-packet-drops" } -func (n *noUnexpectedPacketDrops) Run(ctx context.Context, t *check2.Test) { +func (n *noUnexpectedPacketDrops) Run(ctx context.Context, t *check.Test) { ct := t.Context() filter := computeExpectedDropReasons(defaults.ExpectedDropReasons, n.expectedDrops) @@ -140,7 +141,7 @@ func (n *noUnexpectedPacketDrops) Run(ctx context.Context, t *check2.Test) { for _, pod := range ct.CiliumPods() { pod := pod - t.NewGenericAction(n, fmt.Sprintf("%s/%s", pod.K8sClient.ClusterName(), pod.NodeName())).Run(func(a *check2.Action) { + t.NewGenericAction(n, fmt.Sprintf("%s/%s", pod.K8sClient.ClusterName(), pod.NodeName())).Run(func(a *check.Action) { stdout, err := pod.K8sClient.ExecInPod(ctx, pod.Pod.Namespace, pod.Pod.Name, defaults.AgentContainerName, cmd) if err != nil { a.Fatalf("Error fetching packet drop counts: %s", err) @@ -167,7 +168,7 @@ func computeExpectedDropReasons(defaultReasons, inputReasons []string) string { return filter } -func (n *noErrorsInLogs) allCiliumPods(ctx context.Context, ct *check2.ConnectivityTest) (map[podID]podInfo, error) { +func (n *noErrorsInLogs) allCiliumPods(ctx context.Context, ct *check.ConnectivityTest) (map[podID]podInfo, error) { output := make(map[podID]podInfo) // List all Cilium-related pods @@ -234,7 +235,7 @@ func (n *noErrorsInLogs) findUniqueFailures(logs string) map[string]int { return uniqueFailures } -func (n *noErrorsInLogs) checkErrorsInLogs(id string, logs string, a *check2.Action) { +func (n *noErrorsInLogs) checkErrorsInLogs(id string, logs string, a *check.Action) { uniqueFailures := n.findUniqueFailures(logs) if len(uniqueFailures) > 0 { var failures strings.Builder diff --git a/connectivity/tests/errors_test.go b/connectivity/tests/errors_test.go new file mode 100644 index 0000000000..938fd6528c --- /dev/null +++ b/connectivity/tests/errors_test.go @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Authors of Cilium + +package tests + +import ( + "fmt" + "strings" + "testing" + + "github.com/blang/semver/v4" + "github.com/stretchr/testify/assert" +) + +func TestErrorExceptionMatching(t *testing.T) { + s := NoErrorsInLogs(semver.MustParse("1.15.0")).(*noErrorsInLogs) + fails := s.findUniqueFailures( + `level=error msg="Cannot forward proxied DNS lookup" DNSRequestID=11649 dnsName=google.com.cluster.local. endpointID=3911 error="failed to dial connection to 10.242.1.245:53: dial udp 10.242.1.208:51871->10.242.1.245:53: bind: address already in use" identity=57932 ipAddr="10.242.1.208:51871" subsys=fqdn/dnsproxy (1 occurrences) + level=info msg="Cannot forward proxied DNS lookup" DNSRequestID=11649 dnsName=google.com.cluster.local. endpointID=3911 error="failed to dial connection to 10.242.1.245:53: dial udp 10.242.1.208:51871->10.242.1.245:53: bind: address already in use" identity=57932 ipAddr="10.242.1.208:51871" subsys=fqdn/dnsproxy (1 occurrences) +level=info msg="foo" +level=error msg="bar" +level=error error="Failed to update lock:..." +level=error msg="bar" + `) + assert.Equal(t, len(fails), 1) + assert.Contains(t, fails, "level=error msg=\"bar\"") + assert.Equal(t, fails["level=error msg=\"bar\""], 2) +} + +func TestComputeExpectedDropReasons(t *testing.T) { + defaultReasons := []string{"reason0", "reason1"} + tests := []struct { + inputReasons []string + expectedReasons []string + }{ + // Empty list of reasons. + { + inputReasons: []string{}, + expectedReasons: []string{}, + }, + // Add a reason to default list. + { + inputReasons: []string{"+reason2"}, + expectedReasons: []string{"reason0", "reason1", "reason2"}, + }, + // Remove a reason from default list. + { + inputReasons: []string{"-reason1"}, + expectedReasons: []string{"reason0"}, + }, + // Add a reason then remove it. + { + inputReasons: []string{"+reason2", "-reason2"}, + expectedReasons: []string{"reason0", "reason1"}, + }, + // Remove a reason then add it back. + { + inputReasons: []string{"-reason1", "+reason1"}, + expectedReasons: []string{"reason0", "reason1"}, + }, + } + + for _, test := range tests { + t.Run(fmt.Sprintf("InputReasons: %v", test.inputReasons), func(t *testing.T) { + result := computeExpectedDropReasons(defaultReasons, test.inputReasons) + + // computeExpectedDropReasons doesn't guarantee the order of the + // emitted string so instead we check the length and that all + // expected elements are listed. + + for _, expReason := range test.expectedReasons { + if !strings.Contains(result, fmt.Sprintf("%q", expReason)) { + t.Errorf("Expected filter to contain %q, but got: %v", expReason, result) + } + } + + // We know the expected length because all our test reasons are the same length. + expectedLength := len(test.expectedReasons) * 9 + if len(test.expectedReasons) > 1 { + expectedLength += (len(test.expectedReasons) - 1) * 2 + } + if len(result) != expectedLength { + t.Errorf("Expected filter of length %d, but got: %v", expectedLength, result) + } + }) + } +} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/externalworkload.go b/connectivity/tests/externalworkload.go similarity index 66% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/externalworkload.go rename to connectivity/tests/externalworkload.go index 8c6d5825b5..560c672295 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/externalworkload.go +++ b/connectivity/tests/externalworkload.go @@ -6,12 +6,12 @@ package tests import ( "context" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/utils/features" ) -func PodToExternalWorkload() check2.Scenario { +func PodToExternalWorkload() check.Scenario { return &podToExternalWorkload{} } @@ -21,7 +21,7 @@ func (s *podToExternalWorkload) Name() string { return "pod-to-external-workload" } -func (s *podToExternalWorkload) Run(ctx context.Context, t *check2.Test) { +func (s *podToExternalWorkload) Run(ctx context.Context, t *check.Test) { var i int ct := t.Context() @@ -29,15 +29,15 @@ func (s *podToExternalWorkload) Run(ctx context.Context, t *check2.Test) { pod := pod // copy to avoid memory aliasing when using reference for _, wl := range ct.ExternalWorkloads() { - t.NewAction(s, fmt.Sprintf("ping-%d", i), &pod, wl, features.IPFamilyV4).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("ping-%d", i), &pod, wl, features.IPFamilyV4).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.PingCommand(wl, features.IPFamilyV4)) - a.ValidateFlows(ctx, pod, a.GetEgressRequirements(check2.FlowParameters{ - Protocol: check2.ICMP, + a.ValidateFlows(ctx, pod, a.GetEgressRequirements(check.FlowParameters{ + Protocol: check.ICMP, })) - a.ValidateFlows(ctx, wl, a.GetIngressRequirements(check2.FlowParameters{ - Protocol: check2.ICMP, + a.ValidateFlows(ctx, wl, a.GetIngressRequirements(check.FlowParameters{ + Protocol: check.ICMP, })) }) diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/from-cidr.go b/connectivity/tests/from-cidr.go similarity index 80% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/from-cidr.go rename to connectivity/tests/from-cidr.go index 006eb55098..e6fae05662 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/from-cidr.go +++ b/connectivity/tests/from-cidr.go @@ -5,16 +5,16 @@ package tests import ( "context" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" "net" "strconv" + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/utils/features" ) // FromCIDRToPod generates HTTP request from each node without Cilium to the // echo pods within the Cilium / K8s cluster. -func FromCIDRToPod() check2.Scenario { +func FromCIDRToPod() check.Scenario { return &fromCIDRToPod{} } @@ -25,19 +25,19 @@ func (f *fromCIDRToPod) Name() string { return "from-cidr-to-pod" } -func (f *fromCIDRToPod) Run(ctx context.Context, t *check2.Test) { +func (f *fromCIDRToPod) Run(ctx context.Context, t *check.Test) { clientPod := t.Context().HostNetNSPodsByNode()[t.NodesWithoutCilium()[0]] i := 0 for _, pod := range t.Context().EchoPods() { t.ForEachIPFamily(func(ipFam features.IPFamily) { - ep := check2.HTTPEndpoint( + ep := check.HTTPEndpoint( "http-endpoint", // scheme://[ip:port]/path pod.Scheme()+"://"+net.JoinHostPort(pod.Address(ipFam), strconv.FormatUint(uint64(pod.Port()), 10))+pod.Path(), ) - t.NewAction(f, "host-netns-to-pod", &clientPod, pod, ipFam).Run(func(a *check2.Action) { + t.NewAction(f, "host-netns-to-pod", &clientPod, pod, ipFam).Run(func(a *check.Action) { a.ExecInPod(ctx, t.Context().CurlCommand(ep, ipFam)) }) i++ diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/health.go b/connectivity/tests/health.go similarity index 88% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/health.go rename to connectivity/tests/health.go index e9be91d849..1337b825da 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/health.go +++ b/connectivity/tests/health.go @@ -8,19 +8,18 @@ import ( "context" "encoding/json" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" "strings" + "time" - "github.com/cilium/cilium-cli/defaults" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/util/jsonpath" - "github.com/cilium/cilium/pkg/inctimer" - "github.com/cilium/cilium/pkg/time" + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/defaults" ) -func CiliumHealth() check2.Scenario { +func CiliumHealth() check.Scenario { return &ciliumHealth{} } @@ -30,22 +29,22 @@ func (s *ciliumHealth) Name() string { return "cilium-health" } -func (s *ciliumHealth) Run(ctx context.Context, t *check2.Test) { +func (s *ciliumHealth) Run(ctx context.Context, t *check.Test) { for name, pod := range t.Context().CiliumPods() { pod := pod - t.NewGenericAction(s, name).Run(func(_ *check2.Action) { + t.NewGenericAction(s, name).Run(func(_ *check.Action) { runHealthProbe(ctx, t, &pod) }) } } -func runHealthProbe(ctx context.Context, t *check2.Test, pod *check2.Pod) { +func runHealthProbe(ctx context.Context, t *check.Test, pod *check.Pod) { cmd := []string{"cilium-health", "status", "--probe", "-o=json"} done := ctx.Done() // Probe health status until it passes checks or timeout is reached. for { - retryTimer := inctimer.After(time.Second) + retryTimer := time.After(time.Second) if _, err := pod.K8sClient.GetPod(ctx, pod.Pod.Namespace, pod.Pod.Name, metav1.GetOptions{}); k8serrors.IsNotFound(err) { t.Failf("cilium-health validation failed. Cilium Agent Pod %s/%s no longer exists", pod.Pod.Namespace, pod.Pod.Name) @@ -72,7 +71,7 @@ func runHealthProbe(ctx context.Context, t *check2.Test, pod *check2.Pod) { } } -func validateHealthStatus(t *check2.ConnectivityTest, pod *check2.Pod, out bytes.Buffer) error { +func validateHealthStatus(t *check.ConnectivityTest, pod *check.Pod, out bytes.Buffer) error { var ( nodesFilter = `{.nodes[*].name}` statusPaths = []string{ diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/host.go b/connectivity/tests/host.go similarity index 80% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/host.go rename to connectivity/tests/host.go index 8960a68363..63ecab4628 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/host.go +++ b/connectivity/tests/host.go @@ -6,15 +6,16 @@ package tests import ( "context" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium-cli/utils/features" corev1 "k8s.io/api/core/v1" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/utils/features" ) // PodToHost sends an ICMP ping from all client Pods to all nodes // in the test context. -func PodToHost() check2.Scenario { +func PodToHost() check.Scenario { return &podToHost{} } @@ -25,7 +26,7 @@ func (s *podToHost) Name() string { return "pod-to-host" } -func (s *podToHost) Run(ctx context.Context, t *check2.Test) { +func (s *podToHost) Run(ctx context.Context, t *check.Test) { ct := t.Context() // Construct a unique list of all nodes in the cluster running workloads. @@ -52,14 +53,14 @@ func (s *podToHost) Run(ctx context.Context, t *check2.Test) { addrType = "hostname" } - dst := check2.ICMPEndpoint("", addr.Address) + dst := check.ICMPEndpoint("", addr.Address) ipFam := features.GetIPFamily(addr.Address) - t.NewAction(s, fmt.Sprintf("ping-%s-%s", ipFam, addrType), &pod, dst, ipFam).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("ping-%s-%s", ipFam, addrType), &pod, dst, ipFam).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.PingCommand(dst, ipFam)) - a.ValidateFlows(ctx, pod, a.GetEgressRequirements(check2.FlowParameters{ - Protocol: check2.ICMP, + a.ValidateFlows(ctx, pod, a.GetEgressRequirements(check.FlowParameters{ + Protocol: check.ICMP, })) a.ValidateMetrics(ctx, pod, a.GetEgressMetricsRequirements()) @@ -72,7 +73,7 @@ func (s *podToHost) Run(ctx context.Context, t *check2.Test) { // PodToControlPlaneHost sends an ICMP ping from the controlPlaneclient Pod to all nodes // in the test context. -func PodToControlPlaneHost() check2.Scenario { +func PodToControlPlaneHost() check.Scenario { return &podToControlPlaneHost{} } @@ -83,7 +84,7 @@ func (s *podToControlPlaneHost) Name() string { return "pod-to-controlplane-host" } -func (s *podToControlPlaneHost) Run(ctx context.Context, t *check2.Test) { +func (s *podToControlPlaneHost) Run(ctx context.Context, t *check.Test) { ct := t.Context() for _, pod := range ct.ControlPlaneClientPods() { pod := pod @@ -93,14 +94,14 @@ func (s *podToControlPlaneHost) Run(ctx context.Context, t *check2.Test) { if features.GetIPFamily(addr.Address) != ipFam { continue } - dst := check2.ICMPEndpoint("", addr.Address) + dst := check.ICMPEndpoint("", addr.Address) ipFam := features.GetIPFamily(addr.Address) - t.NewAction(s, fmt.Sprintf("ping-%s-node-%s-from-pod-%s", ipFam, node.Name, pod.Name()), &pod, dst, ipFam).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("ping-%s-node-%s-from-pod-%s", ipFam, node.Name, pod.Name()), &pod, dst, ipFam).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.PingCommand(dst, ipFam)) - a.ValidateFlows(ctx, pod, a.GetEgressRequirements(check2.FlowParameters{ - Protocol: check2.ICMP, + a.ValidateFlows(ctx, pod, a.GetEgressRequirements(check.FlowParameters{ + Protocol: check.ICMP, })) a.ValidateMetrics(ctx, pod, a.GetEgressMetricsRequirements()) @@ -113,7 +114,7 @@ func (s *podToControlPlaneHost) Run(ctx context.Context, t *check2.Test) { // PodToHostPort sends an HTTP request from all client Pods // to all echo Services' HostPorts. -func PodToHostPort() check2.Scenario { +func PodToHostPort() check.Scenario { return &podToHostPort{} } @@ -130,7 +131,7 @@ func (s *podToHostPort) Requirements() []features.Requirement { } } -func (s *podToHostPort) Run(ctx context.Context, t *check2.Test) { +func (s *podToHostPort) Run(ctx context.Context, t *check.Test) { var i int ct := t.Context() @@ -140,12 +141,12 @@ func (s *podToHostPort) Run(ctx context.Context, t *check2.Test) { for _, echo := range ct.EchoPods() { echo := echo // copy to avoid memory aliasing when using reference - baseURL := fmt.Sprintf("%s://%s:%d%s", echo.Scheme(), echo.Pod.Status.HostIP, check2.EchoServerHostPort, echo.Path()) - ep := check2.HTTPEndpoint(echo.Name(), baseURL) - t.NewAction(s, fmt.Sprintf("curl-%d", i), &client, ep, features.IPFamilyAny).Run(func(a *check2.Action) { + baseURL := fmt.Sprintf("%s://%s:%d%s", echo.Scheme(), echo.Pod.Status.HostIP, check.EchoServerHostPort, echo.Path()) + ep := check.HTTPEndpoint(echo.Name(), baseURL) + t.NewAction(s, fmt.Sprintf("curl-%d", i), &client, ep, features.IPFamilyAny).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.CurlCommand(ep, features.IPFamilyAny)) - a.ValidateFlows(ctx, client, a.GetEgressRequirements(check2.FlowParameters{ + a.ValidateFlows(ctx, client, a.GetEgressRequirements(check.FlowParameters{ // Because the HostPort request is NATed, we might only // observe flows after DNAT has been applied (e.g. by // HostReachableServices), @@ -161,7 +162,7 @@ func (s *podToHostPort) Run(ctx context.Context, t *check2.Test) { // HostToPod generates one HTTP request from each node inside the cluster to // each echo (server) pod in the test context. -func HostToPod() check2.Scenario { +func HostToPod() check.Scenario { return &hostToPod{} } @@ -171,7 +172,7 @@ func (s *hostToPod) Name() string { return "host-to-pod" } -func (s *hostToPod) Run(ctx context.Context, t *check2.Test) { +func (s *hostToPod) Run(ctx context.Context, t *check.Test) { var i int ct := t.Context() @@ -183,7 +184,7 @@ func (s *hostToPod) Run(ctx context.Context, t *check2.Test) { src := src // copy to avoid memory aliasing when using reference for _, dst := range ct.EchoPods() { t.ForEachIPFamily(func(ipFam features.IPFamily) { - t.NewAction(s, fmt.Sprintf("curl-%s-%d", ipFam, i), &src, dst, ipFam).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("curl-%s-%d", ipFam, i), &src, dst, ipFam).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.CurlCommand(dst, ipFam)) }) }) diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/ipsec_xfrm.go b/connectivity/tests/ipsec_xfrm.go similarity index 88% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/ipsec_xfrm.go rename to connectivity/tests/ipsec_xfrm.go index d641cee6a8..be8fd7b769 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/ipsec_xfrm.go +++ b/connectivity/tests/ipsec_xfrm.go @@ -7,12 +7,12 @@ import ( "context" "encoding/json" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" "os" "slices" "sort" "strings" + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/defaults" "github.com/cilium/cilium-cli/utils/features" ) @@ -30,7 +30,7 @@ type ciliumMetricsXfrmError struct { Value uint64 `json:"value"` } -func NoIPsecXfrmErrors(expectedErrors []string) check2.Scenario { +func NoIPsecXfrmErrors(expectedErrors []string) check.Scenario { return &noIPsecXfrmErrors{ features.ComputeFailureExceptions(defaults.ExpectedXFRMErrors, expectedErrors), } @@ -44,7 +44,7 @@ func (n *noIPsecXfrmErrors) Name() string { return "no-ipsec-xfrm-error" } -func (n *noIPsecXfrmErrors) Run(ctx context.Context, t *check2.Test) { +func (n *noIPsecXfrmErrors) Run(ctx context.Context, t *check.Test) { ct := t.Context() crtXfrmErrors := n.collectXfrmErrors(ctx, t) @@ -64,7 +64,7 @@ func (n *noIPsecXfrmErrors) Run(ctx context.Context, t *check2.Test) { } } -func (n *noIPsecXfrmErrors) collectXfrmErrors(ctx context.Context, t *check2.Test) map[string]string { +func (n *noIPsecXfrmErrors) collectXfrmErrors(ctx context.Context, t *check.Test) map[string]string { ct := t.Context() xfrmErrors := map[string]string{} cmd := []string{"cilium", "metrics", "list", "-ojson", "-pcilium_ipsec_xfrm_error"} @@ -98,7 +98,7 @@ func (n *noIPsecXfrmErrors) collectXfrmErrors(ctx context.Context, t *check2.Tes return xfrmErrors } -func (n *noIPsecXfrmErrors) storeIPsecXfrmErrors(t *check2.Test, xfrmErrors map[string]string) { +func (n *noIPsecXfrmErrors) storeIPsecXfrmErrors(t *check.Test, xfrmErrors map[string]string) { ct := t.Context() file, err := os.Create(ct.Params().ConnDisruptTestXfrmErrorsPath) if err != nil { @@ -117,7 +117,7 @@ func (n *noIPsecXfrmErrors) storeIPsecXfrmErrors(t *check2.Test, xfrmErrors map[ } } -func (n *noIPsecXfrmErrors) loadIPsecXfrmErrors(t *check2.Test) map[string]string { +func (n *noIPsecXfrmErrors) loadIPsecXfrmErrors(t *check.Test) map[string]string { b, err := os.ReadFile(t.Context().Params().ConnDisruptTestXfrmErrorsPath) if err != nil { t.Fatalf("Failed to read conn disrupt test result files: %s", err) diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/k8s.go b/connectivity/tests/k8s.go similarity index 73% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/k8s.go rename to connectivity/tests/k8s.go index cdacc58f17..ad52e4f376 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/k8s.go +++ b/connectivity/tests/k8s.go @@ -6,14 +6,14 @@ package tests import ( "context" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/utils/features" ) // PodToK8sLocal sends a curl from all control plane client Pods // to all control-plane nodes. -func PodToK8sLocal() check2.Scenario { +func PodToK8sLocal() check.Scenario { return &podToK8sLocal{} } @@ -24,14 +24,14 @@ func (s *podToK8sLocal) Name() string { return "pod-to-k8s-local" } -func (s *podToK8sLocal) Run(ctx context.Context, t *check2.Test) { +func (s *podToK8sLocal) Run(ctx context.Context, t *check.Test) { ct := t.Context() k8sSvc := ct.K8sService() for _, pod := range ct.ControlPlaneClientPods() { pod := pod // copy to avoid memory aliasing when using reference - t.NewAction(s, fmt.Sprintf("curl-k8s-from-pod-%s", pod.Name()), &pod, k8sSvc, features.IPFamilyAny).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("curl-k8s-from-pod-%s", pod.Name()), &pod, k8sSvc, features.IPFamilyAny).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.CurlCommand(k8sSvc, features.IPFamilyAny)) - a.ValidateFlows(ctx, pod, a.GetEgressRequirements(check2.FlowParameters{ + a.ValidateFlows(ctx, pod, a.GetEgressRequirements(check.FlowParameters{ DNSRequired: true, AltDstPort: k8sSvc.Port(), })) diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/pod.go b/connectivity/tests/pod.go similarity index 77% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/pod.go rename to connectivity/tests/pod.go index 1473e5a946..bec2b5fcc0 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/pod.go +++ b/connectivity/tests/pod.go @@ -6,15 +6,15 @@ package tests import ( "context" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/utils/features" ) // PodToPod generates one HTTP request from each client pod // to each echo (server) pod in the test context. The remote Pod is contacted // directly, no DNS is involved. -func PodToPod(opts ...Option) check2.Scenario { +func PodToPod(opts ...Option) check.Scenario { options := &labelsOption{} for _, opt := range opts { opt(options) @@ -37,7 +37,7 @@ func (s *podToPod) Name() string { return "pod-to-pod" } -func (s *podToPod) Run(ctx context.Context, t *check2.Test) { +func (s *podToPod) Run(ctx context.Context, t *check.Test) { var i int ct := t.Context() @@ -51,15 +51,15 @@ func (s *podToPod) Run(ctx context.Context, t *check2.Test) { continue } t.ForEachIPFamily(func(ipFam features.IPFamily) { - t.NewAction(s, fmt.Sprintf("curl-%s-%d", ipFam, i), &client, echo, ipFam).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("curl-%s-%d", ipFam, i), &client, echo, ipFam).Run(func(a *check.Action) { if s.method == "" { a.ExecInPod(ctx, ct.CurlCommand(echo, ipFam)) } else { a.ExecInPod(ctx, ct.CurlCommand(echo, ipFam, "-X", s.method)) } - a.ValidateFlows(ctx, client, a.GetEgressRequirements(check2.FlowParameters{})) - a.ValidateFlows(ctx, echo, a.GetIngressRequirements(check2.FlowParameters{})) + a.ValidateFlows(ctx, client, a.GetEgressRequirements(check.FlowParameters{})) + a.ValidateFlows(ctx, echo, a.GetIngressRequirements(check.FlowParameters{})) a.ValidateMetrics(ctx, echo, a.GetIngressMetricsRequirements()) a.ValidateMetrics(ctx, echo, a.GetEgressMetricsRequirements()) @@ -71,7 +71,7 @@ func (s *podToPod) Run(ctx context.Context, t *check2.Test) { } } -func PodToPodWithEndpoints(opts ...Option) check2.Scenario { +func PodToPodWithEndpoints(opts ...Option) check.Scenario { options := &labelsOption{} for _, opt := range opts { opt(options) @@ -96,7 +96,7 @@ func (s *podToPodWithEndpoints) Name() string { return "pod-to-pod-with-endpoints" } -func (s *podToPodWithEndpoints) Run(ctx context.Context, t *check2.Test) { +func (s *podToPodWithEndpoints) Run(ctx context.Context, t *check.Test) { var i int ct := t.Context() @@ -119,8 +119,8 @@ func (s *podToPodWithEndpoints) Run(ctx context.Context, t *check2.Test) { } } -func (s *podToPodWithEndpoints) curlEndpoints(ctx context.Context, t *check2.Test, name string, - client *check2.Pod, echo check2.TestPeer, ipFam features.IPFamily) { +func (s *podToPodWithEndpoints) curlEndpoints(ctx context.Context, t *check.Test, name string, + client *check.Pod, echo check.TestPeer, ipFam features.IPFamily) { ct := t.Context() baseURL := fmt.Sprintf("%s://%s:%d", echo.Scheme(), echo.Address(ipFam), echo.Port()) var curlOpts []string @@ -137,13 +137,13 @@ func (s *podToPodWithEndpoints) curlEndpoints(ctx context.Context, t *check2.Tes for _, path := range paths { epName := fmt.Sprintf("%s-%s", name, path) url := fmt.Sprintf("%s/%s", baseURL, path) - ep := check2.HTTPEndpointWithLabels(epName, url, echo.Labels()) + ep := check.HTTPEndpointWithLabels(epName, url, echo.Labels()) - t.NewAction(s, epName, client, ep, ipFam).Run(func(a *check2.Action) { + t.NewAction(s, epName, client, ep, ipFam).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.CurlCommand(ep, ipFam, curlOpts...)) - a.ValidateFlows(ctx, client, a.GetEgressRequirements(check2.FlowParameters{})) - a.ValidateFlows(ctx, ep, a.GetIngressRequirements(check2.FlowParameters{})) + a.ValidateFlows(ctx, client, a.GetEgressRequirements(check.FlowParameters{})) + a.ValidateFlows(ctx, ep, a.GetIngressRequirements(check.FlowParameters{})) }) // Additionally test private endpoint access with HTTP header expected by policy. @@ -151,16 +151,16 @@ func (s *podToPodWithEndpoints) curlEndpoints(ctx context.Context, t *check2.Tes epName += "with-header" labels := echo.Labels() labels["X-Very-Secret-Token"] = "42" - ep = check2.HTTPEndpointWithLabels(epName, url, labels) - t.NewAction(s, epName, client, ep, ipFam).Run(func(a *check2.Action) { + ep = check.HTTPEndpointWithLabels(epName, url, labels) + t.NewAction(s, epName, client, ep, ipFam).Run(func(a *check.Action) { opts := make([]string, 0, len(curlOpts)+2) opts = append(opts, curlOpts...) opts = append(opts, "-H", "X-Very-Secret-Token: 42") a.ExecInPod(ctx, ct.CurlCommand(ep, ipFam, opts...)) - a.ValidateFlows(ctx, client, a.GetEgressRequirements(check2.FlowParameters{})) - a.ValidateFlows(ctx, ep, a.GetIngressRequirements(check2.FlowParameters{})) + a.ValidateFlows(ctx, client, a.GetEgressRequirements(check.FlowParameters{})) + a.ValidateFlows(ctx, ep, a.GetIngressRequirements(check.FlowParameters{})) }) } } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/service.go b/connectivity/tests/service.go similarity index 85% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/service.go rename to connectivity/tests/service.go index 26a5ce5d49..d7b0b10043 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/service.go +++ b/connectivity/tests/service.go @@ -6,18 +6,19 @@ package tests import ( "context" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium-cli/utils/features" "golang.org/x/exp/slices" corev1 "k8s.io/api/core/v1" "github.com/cilium/cilium/pkg/versioncheck" + + "github.com/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/utils/features" ) // PodToService sends an HTTP request from all client Pods // to all Services in the test context. -func PodToService(opts ...Option) check2.Scenario { +func PodToService(opts ...Option) check.Scenario { options := &labelsOption{} for _, opt := range opts { opt(options) @@ -38,7 +39,7 @@ func (s *podToService) Name() string { return "pod-to-service" } -func (s *podToService) Run(ctx context.Context, t *check2.Test) { +func (s *podToService) Run(ctx context.Context, t *check.Test) { var i int ct := t.Context() @@ -52,10 +53,10 @@ func (s *podToService) Run(ctx context.Context, t *check2.Test) { continue } - t.NewAction(s, fmt.Sprintf("curl-%d", i), &pod, svc, features.IPFamilyAny).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("curl-%d", i), &pod, svc, features.IPFamilyAny).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.CurlCommand(svc, features.IPFamilyAny)) - a.ValidateFlows(ctx, pod, a.GetEgressRequirements(check2.FlowParameters{ + a.ValidateFlows(ctx, pod, a.GetEgressRequirements(check.FlowParameters{ DNSRequired: true, AltDstPort: svc.Port(), })) @@ -70,7 +71,7 @@ func (s *podToService) Run(ctx context.Context, t *check2.Test) { // PodToIngress sends an HTTP request from all client Pods // to all Ingress service in the test context. -func PodToIngress(opts ...Option) check2.Scenario { +func PodToIngress(opts ...Option) check.Scenario { options := &labelsOption{} for _, opt := range opts { opt(options) @@ -91,7 +92,7 @@ func (s *podToIngress) Name() string { return "pod-to-ingress-service" } -func (s *podToIngress) Run(ctx context.Context, t *check2.Test) { +func (s *podToIngress) Run(ctx context.Context, t *check.Test) { var i int ct := t.Context() @@ -105,10 +106,10 @@ func (s *podToIngress) Run(ctx context.Context, t *check2.Test) { continue } - t.NewAction(s, fmt.Sprintf("curl-%d", i), &pod, svc, features.IPFamilyAny).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("curl-%d", i), &pod, svc, features.IPFamilyAny).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.CurlCommand(svc, features.IPFamilyAny)) - a.ValidateFlows(ctx, pod, a.GetEgressRequirements(check2.FlowParameters{ + a.ValidateFlows(ctx, pod, a.GetEgressRequirements(check.FlowParameters{ DNSRequired: true, AltDstPort: svc.Port(), })) @@ -120,7 +121,7 @@ func (s *podToIngress) Run(ctx context.Context, t *check2.Test) { // PodToRemoteNodePort sends an HTTP request from all client Pods // to all echo Services' NodePorts, but only to other nodes. -func PodToRemoteNodePort() check2.Scenario { +func PodToRemoteNodePort() check.Scenario { return &podToRemoteNodePort{} } @@ -131,7 +132,7 @@ func (s *podToRemoteNodePort) Name() string { return "pod-to-remote-nodeport" } -func (s *podToRemoteNodePort) Run(ctx context.Context, t *check2.Test) { +func (s *podToRemoteNodePort) Run(ctx context.Context, t *check.Test) { var i int for _, pod := range t.Context().ClientPods() { @@ -164,7 +165,7 @@ func (s *podToRemoteNodePort) Run(ctx context.Context, t *check2.Test) { // PodToLocalNodePort sends an HTTP request from all client Pods // to all echo Services' NodePorts, but only on the same node as // the client Pods. -func PodToLocalNodePort() check2.Scenario { +func PodToLocalNodePort() check.Scenario { return &podToLocalNodePort{} } @@ -175,7 +176,7 @@ func (s *podToLocalNodePort) Name() string { return "pod-to-local-nodeport" } -func (s *podToLocalNodePort) Run(ctx context.Context, t *check2.Test) { +func (s *podToLocalNodePort) Run(ctx context.Context, t *check.Test) { var i int for _, pod := range t.Context().ClientPods() { @@ -199,8 +200,8 @@ func (s *podToLocalNodePort) Run(ctx context.Context, t *check2.Test) { } } -func curlNodePort(ctx context.Context, s check2.Scenario, t *check2.Test, - name string, pod *check2.Pod, svc check2.Service, node *corev1.Node, +func curlNodePort(ctx context.Context, s check.Scenario, t *check.Test, + name string, pod *check.Pod, svc check.Service, node *corev1.Node, validateFlows bool, secondaryNetwork bool) { // Get the NodePort allocated to the Service. @@ -246,15 +247,15 @@ func curlNodePort(ctx context.Context, s check2.Scenario, t *check2.Test, // Manually construct an HTTP endpoint to override the destination IP // and port of the request. - ep := check2.HTTPEndpoint(name, fmt.Sprintf("%s://%s:%d%s", svc.Scheme(), addr.Address, np, svc.Path())) + ep := check.HTTPEndpoint(name, fmt.Sprintf("%s://%s:%d%s", svc.Scheme(), addr.Address, np, svc.Path())) // Create the Action with the original svc as this will influence what the // flow matcher looks for in the flow logs. - t.NewAction(s, name, pod, svc, features.IPFamilyAny).Run(func(a *check2.Action) { + t.NewAction(s, name, pod, svc, features.IPFamilyAny).Run(func(a *check.Action) { a.ExecInPod(ctx, t.Context().CurlCommand(ep, features.IPFamilyAny)) if validateFlows { - a.ValidateFlows(ctx, pod, a.GetEgressRequirements(check2.FlowParameters{ + a.ValidateFlows(ctx, pod, a.GetEgressRequirements(check.FlowParameters{ // The fact that curl is hitting the NodePort instead of the // backend Pod's port is specified here. This will cause the matcher // to accept both the NodePort and the ClusterIP (container) port. @@ -268,7 +269,7 @@ func curlNodePort(ctx context.Context, s check2.Scenario, t *check2.Test, // OutsideToNodePort sends an HTTP request from client pod running on a node w/o // Cilium to NodePort services. -func OutsideToNodePort() check2.Scenario { +func OutsideToNodePort() check.Scenario { return &outsideToNodePort{} } @@ -278,7 +279,7 @@ func (s *outsideToNodePort) Name() string { return "outside-to-nodeport" } -func (s *outsideToNodePort) Run(ctx context.Context, t *check2.Test) { +func (s *outsideToNodePort) Run(ctx context.Context, t *check.Test) { clientPod := t.Context().HostNetNSPodsByNode()[t.NodesWithoutCilium()[0]] i := 0 @@ -300,7 +301,7 @@ func (s *outsideToNodePort) Run(ctx context.Context, t *check2.Test) { // OutsideToIngressService sends an HTTP request from client pod running on a node w/o // Cilium to NodePort services. -func OutsideToIngressService() check2.Scenario { +func OutsideToIngressService() check.Scenario { return &outsideToIngressService{} } @@ -310,17 +311,17 @@ func (s *outsideToIngressService) Name() string { return "outside-to-ingress-service" } -func (s *outsideToIngressService) Run(ctx context.Context, t *check2.Test) { +func (s *outsideToIngressService) Run(ctx context.Context, t *check.Test) { clientPod := t.Context().HostNetNSPodsByNode()[t.NodesWithoutCilium()[0]] i := 0 for _, svc := range t.Context().IngressService() { - t.NewAction(s, fmt.Sprintf("curl-ingress-service-%d", i), &clientPod, svc, features.IPFamilyAny).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("curl-ingress-service-%d", i), &clientPod, svc, features.IPFamilyAny).Run(func(a *check.Action) { for _, node := range t.Context().Nodes() { node := node a.ExecInPod(ctx, t.Context().CurlCommand(svc.ToNodeportService(node), features.IPFamilyAny)) - a.ValidateFlows(ctx, clientPod, a.GetEgressRequirements(check2.FlowParameters{ + a.ValidateFlows(ctx, clientPod, a.GetEgressRequirements(check.FlowParameters{ DNSRequired: true, AltDstPort: svc.Port(), })) diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/testloop.sh b/connectivity/tests/testloop.sh similarity index 100% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/testloop.sh rename to connectivity/tests/testloop.sh diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/to-cidr.go b/connectivity/tests/to-cidr.go similarity index 70% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/to-cidr.go rename to connectivity/tests/to-cidr.go index 91ce6daaa9..ad4a6b057f 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/to-cidr.go +++ b/connectivity/tests/to-cidr.go @@ -6,15 +6,15 @@ package tests import ( "context" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" "strings" + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/utils/features" ) // PodToCIDR sends an HTTPS request from each client Pod // to ExternalIP and ExternalOtherIP -func PodToCIDR(opts ...RetryOption) check2.Scenario { +func PodToCIDR(opts ...RetryOption) check.Scenario { cond := &retryCondition{} for _, op := range opts { op(cond) @@ -31,21 +31,21 @@ func (s *podToCIDR) Name() string { return "pod-to-cidr" } -func (s *podToCIDR) Run(ctx context.Context, t *check2.Test) { +func (s *podToCIDR) Run(ctx context.Context, t *check.Test) { ct := t.Context() for _, ip := range []string{ct.Params().ExternalIP, ct.Params().ExternalOtherIP} { - ep := check2.HTTPEndpoint(fmt.Sprintf("external-%s", strings.ReplaceAll(ip, ".", "")), "https://"+ip) + ep := check.HTTPEndpoint(fmt.Sprintf("external-%s", strings.ReplaceAll(ip, ".", "")), "https://"+ip) var i int for _, src := range ct.ClientPods() { src := src // copy to avoid memory aliasing when using reference - t.NewAction(s, fmt.Sprintf("%s-%d", ep.Name(), i), &src, ep, features.IPFamilyAny).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("%s-%d", ep.Name(), i), &src, ep, features.IPFamilyAny).Run(func(a *check.Action) { opts := s.rc.CurlOptions(ep, features.IPFamilyAny, src, ct.Params()) a.ExecInPod(ctx, ct.CurlCommand(ep, features.IPFamilyAny, opts...)) - a.ValidateFlows(ctx, src, a.GetEgressRequirements(check2.FlowParameters{ + a.ValidateFlows(ctx, src, a.GetEgressRequirements(check.FlowParameters{ RSTAllowed: true, })) }) diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/upgrade.go b/connectivity/tests/upgrade.go similarity index 94% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/upgrade.go rename to connectivity/tests/upgrade.go index 5870471114..646eb69485 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/upgrade.go +++ b/connectivity/tests/upgrade.go @@ -6,10 +6,11 @@ package tests import ( "context" gojson "encoding/json" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" "os" "strconv" + "github.com/cilium/cilium-cli/connectivity/check" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -29,7 +30,7 @@ import ( // 3. Run the test ("--include-conn-disrupt-test"). The test checks the restart // counters, and compares them against the previously stored ones. A mismatch // indicates that a connection was interrupted. -func NoInterruptedConnections() check2.Scenario { +func NoInterruptedConnections() check.Scenario { return &noInterruptedConnections{} } @@ -39,12 +40,12 @@ func (n *noInterruptedConnections) Name() string { return "no-interrupted-connections" } -func (n *noInterruptedConnections) Run(ctx context.Context, t *check2.Test) { +func (n *noInterruptedConnections) Run(ctx context.Context, t *check.Test) { ct := t.Context() restartCount := make(map[string]string) for _, client := range ct.Clients() { - pods, err := client.ListPods(ctx, ct.Params().TestNamespace, metav1.ListOptions{LabelSelector: "kind=" + check2.KindTestConnDisrupt}) + pods, err := client.ListPods(ctx, ct.Params().TestNamespace, metav1.ListOptions{LabelSelector: "kind=" + check.KindTestConnDisrupt}) if err != nil { t.Fatalf("Unable to list test-conn-disrupt pods: %s", err) } diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/world.go b/connectivity/tests/world.go similarity index 77% rename from vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/world.go rename to connectivity/tests/world.go index d1c0f36e8f..23be721433 100644 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/tests/world.go +++ b/connectivity/tests/world.go @@ -6,14 +6,14 @@ package tests import ( "context" "fmt" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" + "github.com/cilium/cilium-cli/connectivity/check" "github.com/cilium/cilium-cli/utils/features" ) // PodToWorld sends multiple HTTP(S) requests to ExternalTarget // from each client Pods. -func PodToWorld(opts ...RetryOption) check2.Scenario { +func PodToWorld(opts ...RetryOption) check.Scenario { cond := &retryCondition{} for _, op := range opts { op(cond) @@ -30,13 +30,13 @@ func (s *podToWorld) Name() string { return "pod-to-world" } -func (s *podToWorld) Run(ctx context.Context, t *check2.Test) { +func (s *podToWorld) Run(ctx context.Context, t *check.Test) { extTarget := t.Context().Params().ExternalTarget - http := check2.HTTPEndpoint(extTarget+"-http", "http://"+extTarget) - https := check2.HTTPEndpoint(extTarget+"-https", "https://"+extTarget) - httpsindex := check2.HTTPEndpoint(extTarget+"-https-index", fmt.Sprintf("https://%s/index.html", extTarget)) + http := check.HTTPEndpoint(extTarget+"-http", "http://"+extTarget) + https := check.HTTPEndpoint(extTarget+"-https", "https://"+extTarget) + httpsindex := check.HTTPEndpoint(extTarget+"-https-index", fmt.Sprintf("https://%s/index.html", extTarget)) - fp := check2.FlowParameters{ + fp := check.FlowParameters{ DNSRequired: true, RSTAllowed: true, } @@ -49,21 +49,21 @@ func (s *podToWorld) Run(ctx context.Context, t *check2.Test) { // With http, over port 80. httpOpts := s.rc.CurlOptions(http, features.IPFamilyAny, client, ct.Params()) - t.NewAction(s, fmt.Sprintf("http-to-%s-%d", extTarget, i), &client, http, features.IPFamilyAny).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("http-to-%s-%d", extTarget, i), &client, http, features.IPFamilyAny).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.CurlCommand(http, features.IPFamilyAny, httpOpts...)) a.ValidateFlows(ctx, client, a.GetEgressRequirements(fp)) }) // With https, over port 443. httpsOpts := s.rc.CurlOptions(https, features.IPFamilyAny, client, ct.Params()) - t.NewAction(s, fmt.Sprintf("https-to-%s-%d", extTarget, i), &client, https, features.IPFamilyAny).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("https-to-%s-%d", extTarget, i), &client, https, features.IPFamilyAny).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.CurlCommand(https, features.IPFamilyAny, httpsOpts...)) a.ValidateFlows(ctx, client, a.GetEgressRequirements(fp)) }) // With https, over port 443, index.html. httpsindexOpts := s.rc.CurlOptions(httpsindex, features.IPFamilyAny, client, ct.Params()) - t.NewAction(s, fmt.Sprintf("https-to-%s-index-%d", extTarget, i), &client, httpsindex, features.IPFamilyAny).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("https-to-%s-index-%d", extTarget, i), &client, httpsindex, features.IPFamilyAny).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.CurlCommand(httpsindex, features.IPFamilyAny, httpsindexOpts...)) a.ValidateFlows(ctx, client, a.GetEgressRequirements(fp)) }) @@ -74,7 +74,7 @@ func (s *podToWorld) Run(ctx context.Context, t *check2.Test) { // PodToWorld2 sends an HTTPS request to cilium.io from from random client // Pods. -func PodToWorld2() check2.Scenario { +func PodToWorld2() check.Scenario { return &podToWorld2{} } @@ -85,10 +85,10 @@ func (s *podToWorld2) Name() string { return "pod-to-world-2" } -func (s *podToWorld2) Run(ctx context.Context, t *check2.Test) { - https := check2.HTTPEndpoint("cilium-io-https", "https://cilium.io.") +func (s *podToWorld2) Run(ctx context.Context, t *check.Test) { + https := check.HTTPEndpoint("cilium-io-https", "https://cilium.io.") - fp := check2.FlowParameters{ + fp := check.FlowParameters{ DNSRequired: true, RSTAllowed: true, } @@ -100,7 +100,7 @@ func (s *podToWorld2) Run(ctx context.Context, t *check2.Test) { client := client // copy to avoid memory aliasing when using reference // With https, over port 443. - t.NewAction(s, fmt.Sprintf("https-cilium-io-%d", i), &client, https, features.IPFamilyAny).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("https-cilium-io-%d", i), &client, https, features.IPFamilyAny).Run(func(a *check.Action) { a.ExecInPod(ctx, ct.CurlCommand(https, features.IPFamilyAny)) a.ValidateFlows(ctx, client, a.GetEgressRequirements(fp)) a.ValidateMetrics(ctx, client, a.GetEgressMetricsRequirements()) @@ -111,7 +111,7 @@ func (s *podToWorld2) Run(ctx context.Context, t *check2.Test) { } // PodToWorldWithTLSIntercept sends an HTTPS request to one.one.one.one (default value of ExternalTarget) from from random client -func PodToWorldWithTLSIntercept(curlOpts ...string) check2.Scenario { +func PodToWorldWithTLSIntercept(curlOpts ...string) check.Scenario { s := &podToWorldWithTLSIntercept{ curlOpts: []string{"--cacert", "/tmp/test-ca.crt"}, // skip TLS verification as it will be our internal cert } @@ -130,12 +130,12 @@ func (s *podToWorldWithTLSIntercept) Name() string { return "pod-to-world-with-tls-intercept" } -func (s *podToWorldWithTLSIntercept) Run(ctx context.Context, t *check2.Test) { +func (s *podToWorldWithTLSIntercept) Run(ctx context.Context, t *check.Test) { extTarget := t.Context().Params().ExternalTarget - https := check2.HTTPEndpoint(extTarget+"-https", "https://"+extTarget) + https := check.HTTPEndpoint(extTarget+"-https", "https://"+extTarget) - fp := check2.FlowParameters{ + fp := check.FlowParameters{ DNSRequired: true, RSTAllowed: true, } @@ -154,7 +154,7 @@ func (s *podToWorldWithTLSIntercept) Run(ctx context.Context, t *check2.Test) { client := client // copy to avoid memory aliasing when using reference // With https, over port 443. - t.NewAction(s, fmt.Sprintf("https-to-%s-%d", extTarget, i), &client, https, features.IPFamilyAny).Run(func(a *check2.Action) { + t.NewAction(s, fmt.Sprintf("https-to-%s-%d", extTarget, i), &client, https, features.IPFamilyAny).Run(func(a *check.Action) { a.WriteDataToPod(ctx, "/tmp/test-ca.crt", caBundle) a.ExecInPod(ctx, ct.CurlCommand(https, features.IPFamilyAny, s.curlOpts...)) a.ValidateFlows(ctx, client, a.GetEgressRequirements(fp)) diff --git a/go.mod b/go.mod index fb766708d9..fcb3b300aa 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,8 @@ replace ( require ( github.com/blang/semver/v4 v4.0.0 github.com/cilium/charts v0.0.0-20240403030229-7815d9933404 - github.com/cilium/cilium v1.16.0-pre.0.0.20240331012019-3f1e7de62dd9 + github.com/cilium/cilium v1.16.0-pre.1 + github.com/cilium/hubble v0.13.2 github.com/cilium/workerpool v1.2.0 github.com/cloudflare/cfssl v1.6.5 github.com/go-openapi/strfmt v0.23.0 @@ -25,6 +26,7 @@ require ( github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 + google.golang.org/grpc v1.62.1 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c helm.sh/helm/v3 v3.14.3 k8s.io/api v0.29.2 @@ -39,7 +41,6 @@ require ( github.com/Microsoft/hcsshim v0.11.4 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/cilium/ebpf v0.13.2 // indirect - github.com/cilium/hubble v0.13.2 // indirect github.com/cilium/proxy v0.0.0-20231031145409-f19708f3d018 // indirect github.com/cilium/stream v0.0.0-20240226091623-f979d32855f8 // indirect github.com/containerd/log v0.1.0 // indirect @@ -80,7 +81,6 @@ require ( google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect - google.golang.org/grpc v1.62.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect sigs.k8s.io/controller-runtime v0.16.3 // indirect ) @@ -103,7 +103,7 @@ require ( github.com/containerd/containerd v1.7.14 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/docker/cli v25.0.3+incompatible // indirect + github.com/docker/cli v25.0.1+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker v25.0.5+incompatible // indirect github.com/docker/docker-credential-helpers v0.7.0 // indirect @@ -181,8 +181,8 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.51.0 // indirect + github.com/prometheus/client_model v0.6.0 + github.com/prometheus/common v0.51.1 github.com/prometheus/procfs v0.13.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect @@ -227,7 +227,7 @@ require ( k8s.io/component-base v0.29.2 // indirect k8s.io/kube-openapi v0.0.0-20240105020646-a37d4de58910 // indirect k8s.io/kubectl v0.29.0 // indirect - k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect + k8s.io/utils v0.0.0-20240102154912-e7106e64919e oras.land/oras-go v1.2.5 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 // indirect diff --git a/go.sum b/go.sum index 33bd1faebf..b9f2bcccba 100644 --- a/go.sum +++ b/go.sum @@ -70,8 +70,8 @@ github.com/cilium/charts v0.0.0-20240403030229-7815d9933404 h1:x1YP/GjhuvKA6wV0C github.com/cilium/charts v0.0.0-20240403030229-7815d9933404/go.mod h1:M3C9VOlFvRzuV+a01t07Tw4uFLSfkCH3L542IWjf6BU= github.com/cilium/checkmate v1.0.3 h1:CQC5eOmlAZeEjPrVZY3ZwEBH64lHlx9mXYdUehEwI5w= github.com/cilium/checkmate v1.0.3/go.mod h1:KiBTasf39/F2hf2yAmHw21YFl3hcEyP4Yk6filxc12A= -github.com/cilium/cilium v1.16.0-pre.0.0.20240331012019-3f1e7de62dd9 h1:gxw73fy208yGpo+b72sdf+nGO0lxdhCVw19WR6cG/t4= -github.com/cilium/cilium v1.16.0-pre.0.0.20240331012019-3f1e7de62dd9/go.mod h1:Set3ENBJSc1tdzNXrT7a4pw631KzzcifZGqa2xTcjwk= +github.com/cilium/cilium v1.16.0-pre.1 h1:I4UQ694tw6Fb5NYzyFEF7fN1txocUPxUsvLhrYSV7/g= +github.com/cilium/cilium v1.16.0-pre.1/go.mod h1:VUOQG/wojRePU8s4Xzd7KmS/vu2HE0jv/GjiwuFZzPM= github.com/cilium/ebpf v0.13.2 h1:uhLimLX+jF9BTPPvoCUYh/mBeoONkjgaJ9w9fn0mRj4= github.com/cilium/ebpf v0.13.2/go.mod h1:DHp1WyrLeiBh19Cf/tfiSMhqheEiK8fXFZ4No0P1Hso= github.com/cilium/hubble v0.13.2 h1:WecdQMW+Iz0+mQ56uLYmbfI6bnW0o0PZzmYl18ppd9E= @@ -117,8 +117,8 @@ github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2 h1:aB github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2/go.mod h1:WHNsWjnIn2V1LYOrME7e8KxSeKunYHsxEm4am0BUtcI= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v25.0.3+incompatible h1:KLeNs7zws74oFuVhgZQ5ONGZiXUUdgsdy6/EsX/6284= -github.com/docker/cli v25.0.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v25.0.1+incompatible h1:mFpqnrS6Hsm3v1k7Wa/BO23oz0k121MTbTO1lpcGSkU= +github.com/docker/cli v25.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaPeFIeP5C4W+DE= @@ -508,8 +508,8 @@ github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOA github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.51.0 h1:vT5R9NAlW4V6k8Wruk7ikrHaHRsrPbduM/cKTOdQM/k= -github.com/prometheus/common v0.51.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.51.1 h1:eIjN50Bwglz6a/c3hAgSMcofL3nD+nFQkV6Dd4DsQCw= +github.com/prometheus/common v0.51.1/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= diff --git a/vendor/github.com/cilium/cilium/AUTHORS b/vendor/github.com/cilium/cilium/AUTHORS index f081c191bc..e5646f2cf9 100644 --- a/vendor/github.com/cilium/cilium/AUTHORS +++ b/vendor/github.com/cilium/cilium/AUTHORS @@ -48,7 +48,7 @@ Andrew Titmuss iandrewt@icloud.com Andrey Devyatkin andrey.devyatkin@fivexl.io Andrey Klimentyev andrey.klimentyev@flant.com Andrey Voronkov voronkovaa@gmail.com -Andrii Iuspin yuspin@gmail.com +Andrii Iuspin andrii.iuspin@isovalent.com Andrzej Mamak nqaegg@gmail.com Andy Allred andy@punasusi.com andychuang andy.chuang@shoplineapp.com @@ -107,6 +107,7 @@ Boran Car boran.car@gmail.com Boris Petrovic carnerito.b@gmail.com Brad Whitfield bradswhitfield@gmail.com Brandon McNama brandonmcnama@outlook.com +Brian Payne payne.in.the.brian@gmail.com Brian Topping brian@coglative.com Bruno Miguel Custódio brunomcustodio@gmail.com Bryan Stenson bryan.stenson@okta.com @@ -144,6 +145,7 @@ Chris Werner Rau cwrau@cwrau.info ChrsMark chrismarkou92@gmail.com Cilium Imagebot noreply@cilium.io Cintia Sanchez Garcia cynthiasg@icloud.com +CJ Virtucio cjv287@gmail.com Claudia J. Kang claudiajkang@gmail.com Clément Delzotti elk1ns@outlook.fr cleverhu shouping.hu@daocloud.io @@ -181,7 +183,7 @@ David Bimmler david.bimmler@isovalent.com David Birks davidebirks@gmail.com David Bouchare david.bouchare@datadoghq.com David Calvert david@0xdc.me -David Chen davidchen94@outlook.com +David Cheng david.cheng@shopline.com David Donchez donch@dailymotion.com David Korczynski david@adalogics.com David Leadbeater dgl@dgl.cx @@ -196,6 +198,7 @@ Denis GERMAIN dgermain@deezer.com Denis Khachyan khachyanda.gmail.com Derek Gaffney 17263955+gaffneyd4@users.noreply.github.com Deshi Xiao xiaods@gmail.com +deterclosed fliter@outlook.com Devarshi Sathiya devarshisathiya5@gmail.com Dharma Bellamkonda dharma.bellamkonda@gmail.com Didier Durand durand.didier@gmail.com @@ -267,6 +270,7 @@ Gaurav Yadav gaurav.dev.iiitm@gmail.com Gavin McNair gavin.mcnair@kaluza.com George Gaál gb12335@gmail.com George Kontridze gkontridze@plaid.com +Gerald Pape gerald@giantswarm.io Geyslan G. Bem geyslan@gmail.com GH action ghabot@does.not.exist.cilium.org Gianluca Arbezzano gianarb92@gmail.com @@ -395,6 +399,7 @@ Kornilios Kourtis kornilios@isovalent.com kwakubiney kebiney@hotmail.com Laurent Bernaille laurent.bernaille@datadoghq.com Lawrence Gadban lawrence.gadban@solo.io +ldelossa louis.delos@gmail.com Lehner Florian dev@der-flo.net Leiw steven.l.wang@linux.intel.com Leonard Cohnen lc@edgeless.systems @@ -414,14 +419,15 @@ Liz Rice liz@lizrice.com log1cb0mb nabeelnrana@gmail.com Loïc Blot nerzhul@users.noreply.github.com LongHui Li longhui.li@woqutech.com +loomkoom 29258685+loomkoom@users.noreply.github.com Lorenz Bauer lmb@isovalent.com Lorenzo Fundaró lorenzofundaro@gmail.com -Louis DeLosSantos louis@isovalent.com +Louis DeLosSantos louis.delos@isovalent.com lou-lan loulan@loulan.me Lucas Leblow lucasleblow@mailbox.org lucming 2876757716@qq.com Ludovic Ortega ludovic.ortega@adminafk.fr -Maartje Eyskens maartje.eyskens@isovalent.com +Maartje Eyskens maartje@eyskens.me Maciej Fijalkowski maciej.fijalkowski@intel.com Maciej Kwiek maciej@isovalent.com Maciej Skrocki maciejskrocki@google.com @@ -477,6 +483,7 @@ Maximilian Bischoff maximilian.bischoff@inovex.de Maximilian Mack max@mack.io Maxim Mikityanskiy maxim@isovalent.com Max Körbächer 16919345+mkorbi@users.noreply.github.com +MeherRushi sudharushi0@gmail.com Melissa Peiffer mbp83@nau.edu Michael Aspinwall maspinwall@google.com Michael Fischer fiscmi@amazon.com @@ -503,6 +510,7 @@ Mohit Marathe mohitmarathe23@gmail.com Moritz Eckert m1gh7ym0@gmail.com Moritz Johner beller.moritz@googlemail.com Moshe Immerman moshe.immerman@vitalitygroup.com +naoki-take naoki-take@cybozu.co.jp Nate Sweet nathanjsweet@pm.me Nate Taylor ntaylor1781@gmail.com Nathan Bird njbird@infiniteenergy.com @@ -524,7 +532,7 @@ Nico Vibert nicolas.vibert@isovalent.com Nikhil Jha nikhiljha@users.noreply.github.com Nikhil Sharma nikhilsharma230303@gmail.com Nikolay Aleksandrov nikolay@isovalent.com -Nikolay Nikolaev nicknickolaev@gmail.com +Nikolay Nikolaev nikolay.nikolaev@isovalent.com Nirmoy Das ndas@suse.de Nishant Burte nburte@google.com Nitish Malhotra nitishm@microsoft.com @@ -542,6 +550,8 @@ Oliver Ni oliver.ni@gmail.com Oliver Wang a0924100192@gmail.com Omar Aloraini ooraini.dev@gmail.com Ondrej Blazek ondrej.blazek@firma.seznam.cz +Ondrej Sika ondrej@ondrejsika.com +Oshan Galwaduge oshan304@gmail.com Osthues osthues.matthias@gmail.com Pablo Ruiz pablo.ruiz@gmail.com Paco Xu paco.xu@daocloud.io @@ -575,7 +585,7 @@ Priya Sharma Priya.Sharma6693@gmail.com Qasim Sarfraz qasim.sarfraz@esailors.de Qifeng Guo qifeng.guo@daocloud.io Qingchuan Hao qinhao@microsoft.com -Quentin Monnet quentin@isovalent.com +Quentin Monnet qmo@qmon.net Raam ram29@bskyb.com Rachid Zarouali rachid.zarouali@sevensphere.io Rafael da Fonseca rafael.fonseca@wildlifestudios.com @@ -650,6 +660,7 @@ Shantanu Deshpande shantanud106@gmail.com Shunpoco tkngsnsk313320@gmail.com Sigurd Spieckermann sigurd.spieckermann@gmail.com Simone Sciarrati s.sciarrati@gmail.com +Simon Felding 45149055+simonfelding@users.noreply.github.com Simon Pasquier spasquier@mirantis.com sknop 118932232+sknop-cgn@users.noreply.github.com Smaine Kahlouch smainklh@gmail.com @@ -722,7 +733,7 @@ Viktor Kuzmin kvaster@gmail.com Viktor Oreshkin imselfish@stek29.rocks Ville Ojamo bluikko@users.noreply.github.com Vincent Li vincent.mc.li@gmail.com -Vipul Singh singhvipul@microsoft.com +Vipul Singh vipul21sept@gmail.com Vishal Choudhary sendtovishalchoudhary@gmail.com Vishnu Soman K vishnusomank05@gmail.com Vlad Artamonov 742047+vladdy@users.noreply.github.com @@ -733,6 +744,7 @@ Vlad Ungureanu vladu@palantir.com Wang Dong xdragon007@gmail.com Wang Li wangli09@kuaishou.com Wang Zhen lazybetrayer@gmail.com +Wanlin Du wanlindu@google.com Wayne Haber whaber@gitlab.com Wazir Ahmed wazir@accuknox.com Weilong Cui cuiwl@google.com diff --git a/vendor/github.com/cilium/cilium/api/v1/client/bgp/get_bgp_peers_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/bgp/get_bgp_peers_responses.go index a1ed8d93ca..ca1dfe0c66 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/bgp/get_bgp_peers_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/bgp/get_bgp_peers_responses.go @@ -45,7 +45,7 @@ func (o *GetBgpPeersReader) ReadResponse(response runtime.ClientResponse, consum } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /bgp/peers] GetBgpPeers", response, response.Code()) } } @@ -88,6 +88,11 @@ func (o *GetBgpPeersOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get bgp peers o k response +func (o *GetBgpPeersOK) Code() int { + return 200 +} + func (o *GetBgpPeersOK) Error() string { return fmt.Sprintf("[GET /bgp/peers][%d] getBgpPeersOK %+v", 200, o.Payload) } @@ -149,6 +154,11 @@ func (o *GetBgpPeersInternalServerError) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the get bgp peers internal server error response +func (o *GetBgpPeersInternalServerError) Code() int { + return 500 +} + func (o *GetBgpPeersInternalServerError) Error() string { return fmt.Sprintf("[GET /bgp/peers][%d] getBgpPeersInternalServerError %+v", 500, o.Payload) } @@ -210,6 +220,11 @@ func (o *GetBgpPeersDisabled) IsCode(code int) bool { return code == 501 } +// Code gets the status code for the get bgp peers disabled response +func (o *GetBgpPeersDisabled) Code() int { + return 501 +} + func (o *GetBgpPeersDisabled) Error() string { return fmt.Sprintf("[GET /bgp/peers][%d] getBgpPeersDisabled %+v", 501, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/bgp/get_bgp_route_policies_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/bgp/get_bgp_route_policies_responses.go index fe25bc9d63..e5f5bc74f3 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/bgp/get_bgp_route_policies_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/bgp/get_bgp_route_policies_responses.go @@ -45,7 +45,7 @@ func (o *GetBgpRoutePoliciesReader) ReadResponse(response runtime.ClientResponse } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /bgp/route-policies] GetBgpRoutePolicies", response, response.Code()) } } @@ -88,6 +88,11 @@ func (o *GetBgpRoutePoliciesOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get bgp route policies o k response +func (o *GetBgpRoutePoliciesOK) Code() int { + return 200 +} + func (o *GetBgpRoutePoliciesOK) Error() string { return fmt.Sprintf("[GET /bgp/route-policies][%d] getBgpRoutePoliciesOK %+v", 200, o.Payload) } @@ -149,6 +154,11 @@ func (o *GetBgpRoutePoliciesInternalServerError) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the get bgp route policies internal server error response +func (o *GetBgpRoutePoliciesInternalServerError) Code() int { + return 500 +} + func (o *GetBgpRoutePoliciesInternalServerError) Error() string { return fmt.Sprintf("[GET /bgp/route-policies][%d] getBgpRoutePoliciesInternalServerError %+v", 500, o.Payload) } @@ -210,6 +220,11 @@ func (o *GetBgpRoutePoliciesDisabled) IsCode(code int) bool { return code == 501 } +// Code gets the status code for the get bgp route policies disabled response +func (o *GetBgpRoutePoliciesDisabled) Code() int { + return 501 +} + func (o *GetBgpRoutePoliciesDisabled) Error() string { return fmt.Sprintf("[GET /bgp/route-policies][%d] getBgpRoutePoliciesDisabled %+v", 501, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/bgp/get_bgp_routes_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/bgp/get_bgp_routes_responses.go index f7211a4679..9391a46f6a 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/bgp/get_bgp_routes_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/bgp/get_bgp_routes_responses.go @@ -45,7 +45,7 @@ func (o *GetBgpRoutesReader) ReadResponse(response runtime.ClientResponse, consu } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /bgp/routes] GetBgpRoutes", response, response.Code()) } } @@ -88,6 +88,11 @@ func (o *GetBgpRoutesOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get bgp routes o k response +func (o *GetBgpRoutesOK) Code() int { + return 200 +} + func (o *GetBgpRoutesOK) Error() string { return fmt.Sprintf("[GET /bgp/routes][%d] getBgpRoutesOK %+v", 200, o.Payload) } @@ -149,6 +154,11 @@ func (o *GetBgpRoutesInternalServerError) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the get bgp routes internal server error response +func (o *GetBgpRoutesInternalServerError) Code() int { + return 500 +} + func (o *GetBgpRoutesInternalServerError) Error() string { return fmt.Sprintf("[GET /bgp/routes][%d] getBgpRoutesInternalServerError %+v", 500, o.Payload) } @@ -210,6 +220,11 @@ func (o *GetBgpRoutesDisabled) IsCode(code int) bool { return code == 501 } +// Code gets the status code for the get bgp routes disabled response +func (o *GetBgpRoutesDisabled) Code() int { + return 501 +} + func (o *GetBgpRoutesDisabled) Error() string { return fmt.Sprintf("[GET /bgp/routes][%d] getBgpRoutesDisabled %+v", 501, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_cgroup_dump_metadata_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_cgroup_dump_metadata_responses.go index 3c16b36970..3130b50ff4 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_cgroup_dump_metadata_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_cgroup_dump_metadata_responses.go @@ -39,7 +39,7 @@ func (o *GetCgroupDumpMetadataReader) ReadResponse(response runtime.ClientRespon } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /cgroup-dump-metadata] GetCgroupDumpMetadata", response, response.Code()) } } @@ -82,6 +82,11 @@ func (o *GetCgroupDumpMetadataOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get cgroup dump metadata o k response +func (o *GetCgroupDumpMetadataOK) Code() int { + return 200 +} + func (o *GetCgroupDumpMetadataOK) Error() string { return fmt.Sprintf("[GET /cgroup-dump-metadata][%d] getCgroupDumpMetadataOK %+v", 200, o.Payload) } @@ -145,6 +150,11 @@ func (o *GetCgroupDumpMetadataFailure) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the get cgroup dump metadata failure response +func (o *GetCgroupDumpMetadataFailure) Code() int { + return 500 +} + func (o *GetCgroupDumpMetadataFailure) Error() string { return fmt.Sprintf("[GET /cgroup-dump-metadata][%d] getCgroupDumpMetadataFailure %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_cluster_nodes_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_cluster_nodes_responses.go index 2f767bbf53..76e715fef8 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_cluster_nodes_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_cluster_nodes_responses.go @@ -33,7 +33,7 @@ func (o *GetClusterNodesReader) ReadResponse(response runtime.ClientResponse, co } return result, nil default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /cluster/nodes] GetClusterNodes", response, response.Code()) } } @@ -76,6 +76,11 @@ func (o *GetClusterNodesOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get cluster nodes o k response +func (o *GetClusterNodesOK) Code() int { + return 200 +} + func (o *GetClusterNodesOK) Error() string { return fmt.Sprintf("[GET /cluster/nodes][%d] getClusterNodesOK %+v", 200, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_config_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_config_responses.go index 10da9ace52..310e80e205 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_config_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_config_responses.go @@ -33,7 +33,7 @@ func (o *GetConfigReader) ReadResponse(response runtime.ClientResponse, consumer } return result, nil default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /config] GetConfig", response, response.Code()) } } @@ -76,6 +76,11 @@ func (o *GetConfigOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get config o k response +func (o *GetConfigOK) Code() int { + return 200 +} + func (o *GetConfigOK) Error() string { return fmt.Sprintf("[GET /config][%d] getConfigOK %+v", 200, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_debuginfo_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_debuginfo_responses.go index a7fa07a316..e781ad47ac 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_debuginfo_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_debuginfo_responses.go @@ -39,7 +39,7 @@ func (o *GetDebuginfoReader) ReadResponse(response runtime.ClientResponse, consu } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /debuginfo] GetDebuginfo", response, response.Code()) } } @@ -82,6 +82,11 @@ func (o *GetDebuginfoOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get debuginfo o k response +func (o *GetDebuginfoOK) Code() int { + return 200 +} + func (o *GetDebuginfoOK) Error() string { return fmt.Sprintf("[GET /debuginfo][%d] getDebuginfoOK %+v", 200, o.Payload) } @@ -145,6 +150,11 @@ func (o *GetDebuginfoFailure) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the get debuginfo failure response +func (o *GetDebuginfoFailure) Code() int { + return 500 +} + func (o *GetDebuginfoFailure) Error() string { return fmt.Sprintf("[GET /debuginfo][%d] getDebuginfoFailure %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_health_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_health_responses.go index 17a878fa16..37ca48bc37 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_health_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_health_responses.go @@ -33,7 +33,7 @@ func (o *GetHealthReader) ReadResponse(response runtime.ClientResponse, consumer } return result, nil default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /health] GetHealth", response, response.Code()) } } @@ -76,6 +76,11 @@ func (o *GetHealthOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get health o k response +func (o *GetHealthOK) Code() int { + return 200 +} + func (o *GetHealthOK) Error() string { return fmt.Sprintf("[GET /health][%d] getHealthOK %+v", 200, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_healthz_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_healthz_responses.go index c3b73feea0..ae234754ff 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_healthz_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_healthz_responses.go @@ -33,7 +33,7 @@ func (o *GetHealthzReader) ReadResponse(response runtime.ClientResponse, consume } return result, nil default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /healthz] GetHealthz", response, response.Code()) } } @@ -76,6 +76,11 @@ func (o *GetHealthzOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get healthz o k response +func (o *GetHealthzOK) Code() int { + return 200 +} + func (o *GetHealthzOK) Error() string { return fmt.Sprintf("[GET /healthz][%d] getHealthzOK %+v", 200, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_map_name_events_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_map_name_events_responses.go index 6dc187478a..39a9423b7a 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_map_name_events_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_map_name_events_responses.go @@ -38,7 +38,7 @@ func (o *GetMapNameEventsReader) ReadResponse(response runtime.ClientResponse, c } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /map/{name}/events] GetMapNameEvents", response, response.Code()) } } @@ -84,6 +84,11 @@ func (o *GetMapNameEventsOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get map name events o k response +func (o *GetMapNameEventsOK) Code() int { + return 200 +} + func (o *GetMapNameEventsOK) Error() string { return fmt.Sprintf("[GET /map/{name}/events][%d] getMapNameEventsOK %+v", 200, o.Payload) } @@ -144,6 +149,11 @@ func (o *GetMapNameEventsNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get map name events not found response +func (o *GetMapNameEventsNotFound) Code() int { + return 404 +} + func (o *GetMapNameEventsNotFound) Error() string { return fmt.Sprintf("[GET /map/{name}/events][%d] getMapNameEventsNotFound ", 404) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_map_name_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_map_name_responses.go index f03de4ce30..553290f236 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_map_name_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_map_name_responses.go @@ -39,7 +39,7 @@ func (o *GetMapNameReader) ReadResponse(response runtime.ClientResponse, consume } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /map/{name}] GetMapName", response, response.Code()) } } @@ -82,6 +82,11 @@ func (o *GetMapNameOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get map name o k response +func (o *GetMapNameOK) Code() int { + return 200 +} + func (o *GetMapNameOK) Error() string { return fmt.Sprintf("[GET /map/{name}][%d] getMapNameOK %+v", 200, o.Payload) } @@ -144,6 +149,11 @@ func (o *GetMapNameNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get map name not found response +func (o *GetMapNameNotFound) Code() int { + return 404 +} + func (o *GetMapNameNotFound) Error() string { return fmt.Sprintf("[GET /map/{name}][%d] getMapNameNotFound ", 404) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_map_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_map_responses.go index dae2f2cf52..98bf166c9f 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_map_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_map_responses.go @@ -33,7 +33,7 @@ func (o *GetMapReader) ReadResponse(response runtime.ClientResponse, consumer ru } return result, nil default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /map] GetMap", response, response.Code()) } } @@ -76,6 +76,11 @@ func (o *GetMapOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get map o k response +func (o *GetMapOK) Code() int { + return 200 +} + func (o *GetMapOK) Error() string { return fmt.Sprintf("[GET /map][%d] getMapOK %+v", 200, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_node_ids_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_node_ids_responses.go index 1b4131485a..6a7d0735e9 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_node_ids_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/daemon/get_node_ids_responses.go @@ -33,7 +33,7 @@ func (o *GetNodeIdsReader) ReadResponse(response runtime.ClientResponse, consume } return result, nil default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /node/ids] GetNodeIds", response, response.Code()) } } @@ -76,6 +76,11 @@ func (o *GetNodeIdsOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get node ids o k response +func (o *GetNodeIdsOK) Code() int { + return 200 +} + func (o *GetNodeIdsOK) Error() string { return fmt.Sprintf("[GET /node/ids][%d] getNodeIdsOK %+v", 200, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/daemon/patch_config_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/daemon/patch_config_responses.go index 87397f6750..601049818d 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/daemon/patch_config_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/daemon/patch_config_responses.go @@ -51,7 +51,7 @@ func (o *PatchConfigReader) ReadResponse(response runtime.ClientResponse, consum } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[PATCH /config] PatchConfig", response, response.Code()) } } @@ -93,6 +93,11 @@ func (o *PatchConfigOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the patch config o k response +func (o *PatchConfigOK) Code() int { + return 200 +} + func (o *PatchConfigOK) Error() string { return fmt.Sprintf("[PATCH /config][%d] patchConfigOK ", 200) } @@ -145,6 +150,11 @@ func (o *PatchConfigBadRequest) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the patch config bad request response +func (o *PatchConfigBadRequest) Code() int { + return 400 +} + func (o *PatchConfigBadRequest) Error() string { return fmt.Sprintf("[PATCH /config][%d] patchConfigBadRequest %+v", 400, o.Payload) } @@ -205,6 +215,11 @@ func (o *PatchConfigForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the patch config forbidden response +func (o *PatchConfigForbidden) Code() int { + return 403 +} + func (o *PatchConfigForbidden) Error() string { return fmt.Sprintf("[PATCH /config][%d] patchConfigForbidden ", 403) } @@ -257,6 +272,11 @@ func (o *PatchConfigFailure) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the patch config failure response +func (o *PatchConfigFailure) Code() int { + return 500 +} + func (o *PatchConfigFailure) Error() string { return fmt.Sprintf("[PATCH /config][%d] patchConfigFailure %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/delete_endpoint_id_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/delete_endpoint_id_responses.go index b99123fecb..861e32d4e6 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/delete_endpoint_id_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/delete_endpoint_id_responses.go @@ -63,7 +63,7 @@ func (o *DeleteEndpointIDReader) ReadResponse(response runtime.ClientResponse, c } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[DELETE /endpoint/{id}] DeleteEndpointID", response, response.Code()) } } @@ -105,6 +105,11 @@ func (o *DeleteEndpointIDOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the delete endpoint Id o k response +func (o *DeleteEndpointIDOK) Code() int { + return 200 +} + func (o *DeleteEndpointIDOK) Error() string { return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdOK ", 200) } @@ -157,6 +162,11 @@ func (o *DeleteEndpointIDErrors) IsCode(code int) bool { return code == 206 } +// Code gets the status code for the delete endpoint Id errors response +func (o *DeleteEndpointIDErrors) Code() int { + return 206 +} + func (o *DeleteEndpointIDErrors) Error() string { return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdErrors %+v", 206, o.Payload) } @@ -220,6 +230,11 @@ func (o *DeleteEndpointIDInvalid) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the delete endpoint Id invalid response +func (o *DeleteEndpointIDInvalid) Code() int { + return 400 +} + func (o *DeleteEndpointIDInvalid) Error() string { return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdInvalid %+v", 400, o.Payload) } @@ -280,6 +295,11 @@ func (o *DeleteEndpointIDForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the delete endpoint Id forbidden response +func (o *DeleteEndpointIDForbidden) Code() int { + return 403 +} + func (o *DeleteEndpointIDForbidden) Error() string { return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdForbidden ", 403) } @@ -331,6 +351,11 @@ func (o *DeleteEndpointIDNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the delete endpoint Id not found response +func (o *DeleteEndpointIDNotFound) Code() int { + return 404 +} + func (o *DeleteEndpointIDNotFound) Error() string { return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdNotFound ", 404) } @@ -382,6 +407,11 @@ func (o *DeleteEndpointIDTooManyRequests) IsCode(code int) bool { return code == 429 } +// Code gets the status code for the delete endpoint Id too many requests response +func (o *DeleteEndpointIDTooManyRequests) Code() int { + return 429 +} + func (o *DeleteEndpointIDTooManyRequests) Error() string { return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdTooManyRequests ", 429) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/delete_endpoint_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/delete_endpoint_responses.go index 36842a86c8..ee5c87f409 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/delete_endpoint_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/delete_endpoint_responses.go @@ -55,7 +55,7 @@ func (o *DeleteEndpointReader) ReadResponse(response runtime.ClientResponse, con } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[DELETE /endpoint] DeleteEndpoint", response, response.Code()) } } @@ -97,6 +97,11 @@ func (o *DeleteEndpointOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the delete endpoint o k response +func (o *DeleteEndpointOK) Code() int { + return 200 +} + func (o *DeleteEndpointOK) Error() string { return fmt.Sprintf("[DELETE /endpoint][%d] deleteEndpointOK ", 200) } @@ -149,6 +154,11 @@ func (o *DeleteEndpointErrors) IsCode(code int) bool { return code == 206 } +// Code gets the status code for the delete endpoint errors response +func (o *DeleteEndpointErrors) Code() int { + return 206 +} + func (o *DeleteEndpointErrors) Error() string { return fmt.Sprintf("[DELETE /endpoint][%d] deleteEndpointErrors %+v", 206, o.Payload) } @@ -209,6 +219,11 @@ func (o *DeleteEndpointInvalid) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the delete endpoint invalid response +func (o *DeleteEndpointInvalid) Code() int { + return 400 +} + func (o *DeleteEndpointInvalid) Error() string { return fmt.Sprintf("[DELETE /endpoint][%d] deleteEndpointInvalid ", 400) } @@ -260,6 +275,11 @@ func (o *DeleteEndpointNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the delete endpoint not found response +func (o *DeleteEndpointNotFound) Code() int { + return 404 +} + func (o *DeleteEndpointNotFound) Error() string { return fmt.Sprintf("[DELETE /endpoint][%d] deleteEndpointNotFound ", 404) } @@ -311,6 +331,11 @@ func (o *DeleteEndpointTooManyRequests) IsCode(code int) bool { return code == 429 } +// Code gets the status code for the delete endpoint too many requests response +func (o *DeleteEndpointTooManyRequests) Code() int { + return 429 +} + func (o *DeleteEndpointTooManyRequests) Error() string { return fmt.Sprintf("[DELETE /endpoint][%d] deleteEndpointTooManyRequests ", 429) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_config_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_config_responses.go index e16cdfbf56..41148f08f6 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_config_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_config_responses.go @@ -45,7 +45,7 @@ func (o *GetEndpointIDConfigReader) ReadResponse(response runtime.ClientResponse } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /endpoint/{id}/config] GetEndpointIDConfig", response, response.Code()) } } @@ -88,6 +88,11 @@ func (o *GetEndpointIDConfigOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get endpoint Id config o k response +func (o *GetEndpointIDConfigOK) Code() int { + return 200 +} + func (o *GetEndpointIDConfigOK) Error() string { return fmt.Sprintf("[GET /endpoint/{id}/config][%d] getEndpointIdConfigOK %+v", 200, o.Payload) } @@ -150,6 +155,11 @@ func (o *GetEndpointIDConfigNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get endpoint Id config not found response +func (o *GetEndpointIDConfigNotFound) Code() int { + return 404 +} + func (o *GetEndpointIDConfigNotFound) Error() string { return fmt.Sprintf("[GET /endpoint/{id}/config][%d] getEndpointIdConfigNotFound ", 404) } @@ -201,6 +211,11 @@ func (o *GetEndpointIDConfigTooManyRequests) IsCode(code int) bool { return code == 429 } +// Code gets the status code for the get endpoint Id config too many requests response +func (o *GetEndpointIDConfigTooManyRequests) Code() int { + return 429 +} + func (o *GetEndpointIDConfigTooManyRequests) Error() string { return fmt.Sprintf("[GET /endpoint/{id}/config][%d] getEndpointIdConfigTooManyRequests ", 429) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_healthz_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_healthz_responses.go index a7e976534c..1b15782c6f 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_healthz_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_healthz_responses.go @@ -51,7 +51,7 @@ func (o *GetEndpointIDHealthzReader) ReadResponse(response runtime.ClientRespons } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /endpoint/{id}/healthz] GetEndpointIDHealthz", response, response.Code()) } } @@ -94,6 +94,11 @@ func (o *GetEndpointIDHealthzOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get endpoint Id healthz o k response +func (o *GetEndpointIDHealthzOK) Code() int { + return 200 +} + func (o *GetEndpointIDHealthzOK) Error() string { return fmt.Sprintf("[GET /endpoint/{id}/healthz][%d] getEndpointIdHealthzOK %+v", 200, o.Payload) } @@ -156,6 +161,11 @@ func (o *GetEndpointIDHealthzInvalid) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the get endpoint Id healthz invalid response +func (o *GetEndpointIDHealthzInvalid) Code() int { + return 400 +} + func (o *GetEndpointIDHealthzInvalid) Error() string { return fmt.Sprintf("[GET /endpoint/{id}/healthz][%d] getEndpointIdHealthzInvalid ", 400) } @@ -207,6 +217,11 @@ func (o *GetEndpointIDHealthzNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get endpoint Id healthz not found response +func (o *GetEndpointIDHealthzNotFound) Code() int { + return 404 +} + func (o *GetEndpointIDHealthzNotFound) Error() string { return fmt.Sprintf("[GET /endpoint/{id}/healthz][%d] getEndpointIdHealthzNotFound ", 404) } @@ -258,6 +273,11 @@ func (o *GetEndpointIDHealthzTooManyRequests) IsCode(code int) bool { return code == 429 } +// Code gets the status code for the get endpoint Id healthz too many requests response +func (o *GetEndpointIDHealthzTooManyRequests) Code() int { + return 429 +} + func (o *GetEndpointIDHealthzTooManyRequests) Error() string { return fmt.Sprintf("[GET /endpoint/{id}/healthz][%d] getEndpointIdHealthzTooManyRequests ", 429) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_labels_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_labels_responses.go index 3f4e5138d9..73d8001641 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_labels_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_labels_responses.go @@ -45,7 +45,7 @@ func (o *GetEndpointIDLabelsReader) ReadResponse(response runtime.ClientResponse } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /endpoint/{id}/labels] GetEndpointIDLabels", response, response.Code()) } } @@ -88,6 +88,11 @@ func (o *GetEndpointIDLabelsOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get endpoint Id labels o k response +func (o *GetEndpointIDLabelsOK) Code() int { + return 200 +} + func (o *GetEndpointIDLabelsOK) Error() string { return fmt.Sprintf("[GET /endpoint/{id}/labels][%d] getEndpointIdLabelsOK %+v", 200, o.Payload) } @@ -150,6 +155,11 @@ func (o *GetEndpointIDLabelsNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get endpoint Id labels not found response +func (o *GetEndpointIDLabelsNotFound) Code() int { + return 404 +} + func (o *GetEndpointIDLabelsNotFound) Error() string { return fmt.Sprintf("[GET /endpoint/{id}/labels][%d] getEndpointIdLabelsNotFound ", 404) } @@ -201,6 +211,11 @@ func (o *GetEndpointIDLabelsTooManyRequests) IsCode(code int) bool { return code == 429 } +// Code gets the status code for the get endpoint Id labels too many requests response +func (o *GetEndpointIDLabelsTooManyRequests) Code() int { + return 429 +} + func (o *GetEndpointIDLabelsTooManyRequests) Error() string { return fmt.Sprintf("[GET /endpoint/{id}/labels][%d] getEndpointIdLabelsTooManyRequests ", 429) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_log_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_log_responses.go index db7227d1dd..9ee4dd5f6c 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_log_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_log_responses.go @@ -51,7 +51,7 @@ func (o *GetEndpointIDLogReader) ReadResponse(response runtime.ClientResponse, c } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /endpoint/{id}/log] GetEndpointIDLog", response, response.Code()) } } @@ -94,6 +94,11 @@ func (o *GetEndpointIDLogOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get endpoint Id log o k response +func (o *GetEndpointIDLogOK) Code() int { + return 200 +} + func (o *GetEndpointIDLogOK) Error() string { return fmt.Sprintf("[GET /endpoint/{id}/log][%d] getEndpointIdLogOK %+v", 200, o.Payload) } @@ -154,6 +159,11 @@ func (o *GetEndpointIDLogInvalid) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the get endpoint Id log invalid response +func (o *GetEndpointIDLogInvalid) Code() int { + return 400 +} + func (o *GetEndpointIDLogInvalid) Error() string { return fmt.Sprintf("[GET /endpoint/{id}/log][%d] getEndpointIdLogInvalid ", 400) } @@ -205,6 +215,11 @@ func (o *GetEndpointIDLogNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get endpoint Id log not found response +func (o *GetEndpointIDLogNotFound) Code() int { + return 404 +} + func (o *GetEndpointIDLogNotFound) Error() string { return fmt.Sprintf("[GET /endpoint/{id}/log][%d] getEndpointIdLogNotFound ", 404) } @@ -256,6 +271,11 @@ func (o *GetEndpointIDLogTooManyRequests) IsCode(code int) bool { return code == 429 } +// Code gets the status code for the get endpoint Id log too many requests response +func (o *GetEndpointIDLogTooManyRequests) Code() int { + return 429 +} + func (o *GetEndpointIDLogTooManyRequests) Error() string { return fmt.Sprintf("[GET /endpoint/{id}/log][%d] getEndpointIdLogTooManyRequests ", 429) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_responses.go index 4d07e3aa4d..e2e9a0955b 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_id_responses.go @@ -51,7 +51,7 @@ func (o *GetEndpointIDReader) ReadResponse(response runtime.ClientResponse, cons } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /endpoint/{id}] GetEndpointID", response, response.Code()) } } @@ -94,6 +94,11 @@ func (o *GetEndpointIDOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get endpoint Id o k response +func (o *GetEndpointIDOK) Code() int { + return 200 +} + func (o *GetEndpointIDOK) Error() string { return fmt.Sprintf("[GET /endpoint/{id}][%d] getEndpointIdOK %+v", 200, o.Payload) } @@ -157,6 +162,11 @@ func (o *GetEndpointIDInvalid) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the get endpoint Id invalid response +func (o *GetEndpointIDInvalid) Code() int { + return 400 +} + func (o *GetEndpointIDInvalid) Error() string { return fmt.Sprintf("[GET /endpoint/{id}][%d] getEndpointIdInvalid %+v", 400, o.Payload) } @@ -217,6 +227,11 @@ func (o *GetEndpointIDNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get endpoint Id not found response +func (o *GetEndpointIDNotFound) Code() int { + return 404 +} + func (o *GetEndpointIDNotFound) Error() string { return fmt.Sprintf("[GET /endpoint/{id}][%d] getEndpointIdNotFound ", 404) } @@ -268,6 +283,11 @@ func (o *GetEndpointIDTooManyRequests) IsCode(code int) bool { return code == 429 } +// Code gets the status code for the get endpoint Id too many requests response +func (o *GetEndpointIDTooManyRequests) Code() int { + return 429 +} + func (o *GetEndpointIDTooManyRequests) Error() string { return fmt.Sprintf("[GET /endpoint/{id}][%d] getEndpointIdTooManyRequests ", 429) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_responses.go index 5193537ea8..dae5541d42 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/get_endpoint_responses.go @@ -45,7 +45,7 @@ func (o *GetEndpointReader) ReadResponse(response runtime.ClientResponse, consum } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /endpoint] GetEndpoint", response, response.Code()) } } @@ -88,6 +88,11 @@ func (o *GetEndpointOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get endpoint o k response +func (o *GetEndpointOK) Code() int { + return 200 +} + func (o *GetEndpointOK) Error() string { return fmt.Sprintf("[GET /endpoint][%d] getEndpointOK %+v", 200, o.Payload) } @@ -148,6 +153,11 @@ func (o *GetEndpointNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get endpoint not found response +func (o *GetEndpointNotFound) Code() int { + return 404 +} + func (o *GetEndpointNotFound) Error() string { return fmt.Sprintf("[GET /endpoint][%d] getEndpointNotFound ", 404) } @@ -199,6 +209,11 @@ func (o *GetEndpointTooManyRequests) IsCode(code int) bool { return code == 429 } +// Code gets the status code for the get endpoint too many requests response +func (o *GetEndpointTooManyRequests) Code() int { + return 429 +} + func (o *GetEndpointTooManyRequests) Error() string { return fmt.Sprintf("[GET /endpoint][%d] getEndpointTooManyRequests ", 429) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/patch_endpoint_id_config_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/patch_endpoint_id_config_responses.go index fc2c4883a5..993fc07efd 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/patch_endpoint_id_config_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/patch_endpoint_id_config_responses.go @@ -63,7 +63,7 @@ func (o *PatchEndpointIDConfigReader) ReadResponse(response runtime.ClientRespon } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[PATCH /endpoint/{id}/config] PatchEndpointIDConfig", response, response.Code()) } } @@ -105,6 +105,11 @@ func (o *PatchEndpointIDConfigOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the patch endpoint Id config o k response +func (o *PatchEndpointIDConfigOK) Code() int { + return 200 +} + func (o *PatchEndpointIDConfigOK) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigOK ", 200) } @@ -156,6 +161,11 @@ func (o *PatchEndpointIDConfigInvalid) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the patch endpoint Id config invalid response +func (o *PatchEndpointIDConfigInvalid) Code() int { + return 400 +} + func (o *PatchEndpointIDConfigInvalid) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigInvalid ", 400) } @@ -207,6 +217,11 @@ func (o *PatchEndpointIDConfigForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the patch endpoint Id config forbidden response +func (o *PatchEndpointIDConfigForbidden) Code() int { + return 403 +} + func (o *PatchEndpointIDConfigForbidden) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigForbidden ", 403) } @@ -258,6 +273,11 @@ func (o *PatchEndpointIDConfigNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the patch endpoint Id config not found response +func (o *PatchEndpointIDConfigNotFound) Code() int { + return 404 +} + func (o *PatchEndpointIDConfigNotFound) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigNotFound ", 404) } @@ -309,6 +329,11 @@ func (o *PatchEndpointIDConfigTooManyRequests) IsCode(code int) bool { return code == 429 } +// Code gets the status code for the patch endpoint Id config too many requests response +func (o *PatchEndpointIDConfigTooManyRequests) Code() int { + return 429 +} + func (o *PatchEndpointIDConfigTooManyRequests) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigTooManyRequests ", 429) } @@ -361,6 +386,11 @@ func (o *PatchEndpointIDConfigFailed) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the patch endpoint Id config failed response +func (o *PatchEndpointIDConfigFailed) Code() int { + return 500 +} + func (o *PatchEndpointIDConfigFailed) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigFailed %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/patch_endpoint_id_labels_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/patch_endpoint_id_labels_responses.go index d16eec5c36..5341a3055f 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/patch_endpoint_id_labels_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/patch_endpoint_id_labels_responses.go @@ -57,7 +57,7 @@ func (o *PatchEndpointIDLabelsReader) ReadResponse(response runtime.ClientRespon } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[PATCH /endpoint/{id}/labels] PatchEndpointIDLabels", response, response.Code()) } } @@ -99,6 +99,11 @@ func (o *PatchEndpointIDLabelsOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the patch endpoint Id labels o k response +func (o *PatchEndpointIDLabelsOK) Code() int { + return 200 +} + func (o *PatchEndpointIDLabelsOK) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsOK ", 200) } @@ -150,6 +155,11 @@ func (o *PatchEndpointIDLabelsForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the patch endpoint Id labels forbidden response +func (o *PatchEndpointIDLabelsForbidden) Code() int { + return 403 +} + func (o *PatchEndpointIDLabelsForbidden) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsForbidden ", 403) } @@ -201,6 +211,11 @@ func (o *PatchEndpointIDLabelsNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the patch endpoint Id labels not found response +func (o *PatchEndpointIDLabelsNotFound) Code() int { + return 404 +} + func (o *PatchEndpointIDLabelsNotFound) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsNotFound ", 404) } @@ -252,6 +267,11 @@ func (o *PatchEndpointIDLabelsTooManyRequests) IsCode(code int) bool { return code == 429 } +// Code gets the status code for the patch endpoint Id labels too many requests response +func (o *PatchEndpointIDLabelsTooManyRequests) Code() int { + return 429 +} + func (o *PatchEndpointIDLabelsTooManyRequests) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsTooManyRequests ", 429) } @@ -304,6 +324,11 @@ func (o *PatchEndpointIDLabelsUpdateFailed) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the patch endpoint Id labels update failed response +func (o *PatchEndpointIDLabelsUpdateFailed) Code() int { + return 500 +} + func (o *PatchEndpointIDLabelsUpdateFailed) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsUpdateFailed %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/patch_endpoint_id_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/patch_endpoint_id_responses.go index 7b28de272a..f957c1ca6f 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/patch_endpoint_id_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/patch_endpoint_id_responses.go @@ -63,7 +63,7 @@ func (o *PatchEndpointIDReader) ReadResponse(response runtime.ClientResponse, co } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[PATCH /endpoint/{id}] PatchEndpointID", response, response.Code()) } } @@ -105,6 +105,11 @@ func (o *PatchEndpointIDOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the patch endpoint Id o k response +func (o *PatchEndpointIDOK) Code() int { + return 200 +} + func (o *PatchEndpointIDOK) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}][%d] patchEndpointIdOK ", 200) } @@ -157,6 +162,11 @@ func (o *PatchEndpointIDInvalid) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the patch endpoint Id invalid response +func (o *PatchEndpointIDInvalid) Code() int { + return 400 +} + func (o *PatchEndpointIDInvalid) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}][%d] patchEndpointIdInvalid %+v", 400, o.Payload) } @@ -217,6 +227,11 @@ func (o *PatchEndpointIDForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the patch endpoint Id forbidden response +func (o *PatchEndpointIDForbidden) Code() int { + return 403 +} + func (o *PatchEndpointIDForbidden) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}][%d] patchEndpointIdForbidden ", 403) } @@ -268,6 +283,11 @@ func (o *PatchEndpointIDNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the patch endpoint Id not found response +func (o *PatchEndpointIDNotFound) Code() int { + return 404 +} + func (o *PatchEndpointIDNotFound) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}][%d] patchEndpointIdNotFound ", 404) } @@ -319,6 +339,11 @@ func (o *PatchEndpointIDTooManyRequests) IsCode(code int) bool { return code == 429 } +// Code gets the status code for the patch endpoint Id too many requests response +func (o *PatchEndpointIDTooManyRequests) Code() int { + return 429 +} + func (o *PatchEndpointIDTooManyRequests) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}][%d] patchEndpointIdTooManyRequests ", 429) } @@ -371,6 +396,11 @@ func (o *PatchEndpointIDFailed) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the patch endpoint Id failed response +func (o *PatchEndpointIDFailed) Code() int { + return 500 +} + func (o *PatchEndpointIDFailed) Error() string { return fmt.Sprintf("[PATCH /endpoint/{id}][%d] patchEndpointIdFailed %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/put_endpoint_id_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/put_endpoint_id_responses.go index 95a73d73b6..231ef62b50 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/endpoint/put_endpoint_id_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/endpoint/put_endpoint_id_responses.go @@ -63,7 +63,7 @@ func (o *PutEndpointIDReader) ReadResponse(response runtime.ClientResponse, cons } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[PUT /endpoint/{id}] PutEndpointID", response, response.Code()) } } @@ -106,6 +106,11 @@ func (o *PutEndpointIDCreated) IsCode(code int) bool { return code == 201 } +// Code gets the status code for the put endpoint Id created response +func (o *PutEndpointIDCreated) Code() int { + return 201 +} + func (o *PutEndpointIDCreated) Error() string { return fmt.Sprintf("[PUT /endpoint/{id}][%d] putEndpointIdCreated %+v", 201, o.Payload) } @@ -169,6 +174,11 @@ func (o *PutEndpointIDInvalid) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the put endpoint Id invalid response +func (o *PutEndpointIDInvalid) Code() int { + return 400 +} + func (o *PutEndpointIDInvalid) Error() string { return fmt.Sprintf("[PUT /endpoint/{id}][%d] putEndpointIdInvalid %+v", 400, o.Payload) } @@ -229,6 +239,11 @@ func (o *PutEndpointIDForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the put endpoint Id forbidden response +func (o *PutEndpointIDForbidden) Code() int { + return 403 +} + func (o *PutEndpointIDForbidden) Error() string { return fmt.Sprintf("[PUT /endpoint/{id}][%d] putEndpointIdForbidden ", 403) } @@ -280,6 +295,11 @@ func (o *PutEndpointIDExists) IsCode(code int) bool { return code == 409 } +// Code gets the status code for the put endpoint Id exists response +func (o *PutEndpointIDExists) Code() int { + return 409 +} + func (o *PutEndpointIDExists) Error() string { return fmt.Sprintf("[PUT /endpoint/{id}][%d] putEndpointIdExists ", 409) } @@ -331,6 +351,11 @@ func (o *PutEndpointIDTooManyRequests) IsCode(code int) bool { return code == 429 } +// Code gets the status code for the put endpoint Id too many requests response +func (o *PutEndpointIDTooManyRequests) Code() int { + return 429 +} + func (o *PutEndpointIDTooManyRequests) Error() string { return fmt.Sprintf("[PUT /endpoint/{id}][%d] putEndpointIdTooManyRequests ", 429) } @@ -383,6 +408,11 @@ func (o *PutEndpointIDFailed) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the put endpoint Id failed response +func (o *PutEndpointIDFailed) Code() int { + return 500 +} + func (o *PutEndpointIDFailed) Error() string { return fmt.Sprintf("[PUT /endpoint/{id}][%d] putEndpointIdFailed %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/ipam/delete_ipam_ip_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/ipam/delete_ipam_ip_responses.go index ae095b6799..c05dd86d29 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/ipam/delete_ipam_ip_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/ipam/delete_ipam_ip_responses.go @@ -63,7 +63,7 @@ func (o *DeleteIpamIPReader) ReadResponse(response runtime.ClientResponse, consu } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[DELETE /ipam/{ip}] DeleteIpamIP", response, response.Code()) } } @@ -105,6 +105,11 @@ func (o *DeleteIpamIPOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the delete ipam Ip o k response +func (o *DeleteIpamIPOK) Code() int { + return 200 +} + func (o *DeleteIpamIPOK) Error() string { return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpOK ", 200) } @@ -156,6 +161,11 @@ func (o *DeleteIpamIPInvalid) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the delete ipam Ip invalid response +func (o *DeleteIpamIPInvalid) Code() int { + return 400 +} + func (o *DeleteIpamIPInvalid) Error() string { return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpInvalid ", 400) } @@ -207,6 +217,11 @@ func (o *DeleteIpamIPForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the delete ipam Ip forbidden response +func (o *DeleteIpamIPForbidden) Code() int { + return 403 +} + func (o *DeleteIpamIPForbidden) Error() string { return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpForbidden ", 403) } @@ -258,6 +273,11 @@ func (o *DeleteIpamIPNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the delete ipam Ip not found response +func (o *DeleteIpamIPNotFound) Code() int { + return 404 +} + func (o *DeleteIpamIPNotFound) Error() string { return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpNotFound ", 404) } @@ -310,6 +330,11 @@ func (o *DeleteIpamIPFailure) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the delete ipam Ip failure response +func (o *DeleteIpamIPFailure) Code() int { + return 500 +} + func (o *DeleteIpamIPFailure) Error() string { return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpFailure %+v", 500, o.Payload) } @@ -370,6 +395,11 @@ func (o *DeleteIpamIPDisabled) IsCode(code int) bool { return code == 501 } +// Code gets the status code for the delete ipam Ip disabled response +func (o *DeleteIpamIPDisabled) Code() int { + return 501 +} + func (o *DeleteIpamIPDisabled) Error() string { return fmt.Sprintf("[DELETE /ipam/{ip}][%d] deleteIpamIpDisabled ", 501) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/ipam/post_ipam_ip_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/ipam/post_ipam_ip_responses.go index 1c8cff834f..f858257f1e 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/ipam/post_ipam_ip_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/ipam/post_ipam_ip_responses.go @@ -63,7 +63,7 @@ func (o *PostIpamIPReader) ReadResponse(response runtime.ClientResponse, consume } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[POST /ipam/{ip}] PostIpamIP", response, response.Code()) } } @@ -105,6 +105,11 @@ func (o *PostIpamIPOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the post ipam Ip o k response +func (o *PostIpamIPOK) Code() int { + return 200 +} + func (o *PostIpamIPOK) Error() string { return fmt.Sprintf("[POST /ipam/{ip}][%d] postIpamIpOK ", 200) } @@ -156,6 +161,11 @@ func (o *PostIpamIPInvalid) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the post ipam Ip invalid response +func (o *PostIpamIPInvalid) Code() int { + return 400 +} + func (o *PostIpamIPInvalid) Error() string { return fmt.Sprintf("[POST /ipam/{ip}][%d] postIpamIpInvalid ", 400) } @@ -207,6 +217,11 @@ func (o *PostIpamIPForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the post ipam Ip forbidden response +func (o *PostIpamIPForbidden) Code() int { + return 403 +} + func (o *PostIpamIPForbidden) Error() string { return fmt.Sprintf("[POST /ipam/{ip}][%d] postIpamIpForbidden ", 403) } @@ -258,6 +273,11 @@ func (o *PostIpamIPExists) IsCode(code int) bool { return code == 409 } +// Code gets the status code for the post ipam Ip exists response +func (o *PostIpamIPExists) Code() int { + return 409 +} + func (o *PostIpamIPExists) Error() string { return fmt.Sprintf("[POST /ipam/{ip}][%d] postIpamIpExists ", 409) } @@ -310,6 +330,11 @@ func (o *PostIpamIPFailure) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the post ipam Ip failure response +func (o *PostIpamIPFailure) Code() int { + return 500 +} + func (o *PostIpamIPFailure) Error() string { return fmt.Sprintf("[POST /ipam/{ip}][%d] postIpamIpFailure %+v", 500, o.Payload) } @@ -370,6 +395,11 @@ func (o *PostIpamIPDisabled) IsCode(code int) bool { return code == 501 } +// Code gets the status code for the post ipam Ip disabled response +func (o *PostIpamIPDisabled) Code() int { + return 501 +} + func (o *PostIpamIPDisabled) Error() string { return fmt.Sprintf("[POST /ipam/{ip}][%d] postIpamIpDisabled ", 501) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/ipam/post_ipam_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/ipam/post_ipam_responses.go index 2f13cc2945..01eb516cc2 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/ipam/post_ipam_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/ipam/post_ipam_responses.go @@ -45,7 +45,7 @@ func (o *PostIpamReader) ReadResponse(response runtime.ClientResponse, consumer } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[POST /ipam] PostIpam", response, response.Code()) } } @@ -88,6 +88,11 @@ func (o *PostIpamCreated) IsCode(code int) bool { return code == 201 } +// Code gets the status code for the post ipam created response +func (o *PostIpamCreated) Code() int { + return 201 +} + func (o *PostIpamCreated) Error() string { return fmt.Sprintf("[POST /ipam][%d] postIpamCreated %+v", 201, o.Payload) } @@ -150,6 +155,11 @@ func (o *PostIpamForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the post ipam forbidden response +func (o *PostIpamForbidden) Code() int { + return 403 +} + func (o *PostIpamForbidden) Error() string { return fmt.Sprintf("[POST /ipam][%d] postIpamForbidden ", 403) } @@ -202,6 +212,11 @@ func (o *PostIpamFailure) IsCode(code int) bool { return code == 502 } +// Code gets the status code for the post ipam failure response +func (o *PostIpamFailure) Code() int { + return 502 +} + func (o *PostIpamFailure) Error() string { return fmt.Sprintf("[POST /ipam][%d] postIpamFailure %+v", 502, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/metrics/get_metrics_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/metrics/get_metrics_responses.go index 766782c92a..92601d4006 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/metrics/get_metrics_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/metrics/get_metrics_responses.go @@ -39,7 +39,7 @@ func (o *GetMetricsReader) ReadResponse(response runtime.ClientResponse, consume } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /metrics/] GetMetrics", response, response.Code()) } } @@ -82,6 +82,11 @@ func (o *GetMetricsOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get metrics o k response +func (o *GetMetricsOK) Code() int { + return 200 +} + func (o *GetMetricsOK) Error() string { return fmt.Sprintf("[GET /metrics/][%d] getMetricsOK %+v", 200, o.Payload) } @@ -142,6 +147,11 @@ func (o *GetMetricsInternalServerError) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the get metrics internal server error response +func (o *GetMetricsInternalServerError) Code() int { + return 500 +} + func (o *GetMetricsInternalServerError) Error() string { return fmt.Sprintf("[GET /metrics/][%d] getMetricsInternalServerError ", 500) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/policy/delete_fqdn_cache_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/policy/delete_fqdn_cache_responses.go index 10def651e0..69bcaa9475 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/policy/delete_fqdn_cache_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/policy/delete_fqdn_cache_responses.go @@ -45,7 +45,7 @@ func (o *DeleteFqdnCacheReader) ReadResponse(response runtime.ClientResponse, co } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[DELETE /fqdn/cache] DeleteFqdnCache", response, response.Code()) } } @@ -87,6 +87,11 @@ func (o *DeleteFqdnCacheOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the delete fqdn cache o k response +func (o *DeleteFqdnCacheOK) Code() int { + return 200 +} + func (o *DeleteFqdnCacheOK) Error() string { return fmt.Sprintf("[DELETE /fqdn/cache][%d] deleteFqdnCacheOK ", 200) } @@ -139,6 +144,11 @@ func (o *DeleteFqdnCacheBadRequest) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the delete fqdn cache bad request response +func (o *DeleteFqdnCacheBadRequest) Code() int { + return 400 +} + func (o *DeleteFqdnCacheBadRequest) Error() string { return fmt.Sprintf("[DELETE /fqdn/cache][%d] deleteFqdnCacheBadRequest %+v", 400, o.Payload) } @@ -199,6 +209,11 @@ func (o *DeleteFqdnCacheForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the delete fqdn cache forbidden response +func (o *DeleteFqdnCacheForbidden) Code() int { + return 403 +} + func (o *DeleteFqdnCacheForbidden) Error() string { return fmt.Sprintf("[DELETE /fqdn/cache][%d] deleteFqdnCacheForbidden ", 403) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/policy/delete_policy_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/policy/delete_policy_responses.go index 538a831e3b..338dc21e69 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/policy/delete_policy_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/policy/delete_policy_responses.go @@ -57,7 +57,7 @@ func (o *DeletePolicyReader) ReadResponse(response runtime.ClientResponse, consu } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[DELETE /policy] DeletePolicy", response, response.Code()) } } @@ -100,6 +100,11 @@ func (o *DeletePolicyOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the delete policy o k response +func (o *DeletePolicyOK) Code() int { + return 200 +} + func (o *DeletePolicyOK) Error() string { return fmt.Sprintf("[DELETE /policy][%d] deletePolicyOK %+v", 200, o.Payload) } @@ -163,6 +168,11 @@ func (o *DeletePolicyInvalid) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the delete policy invalid response +func (o *DeletePolicyInvalid) Code() int { + return 400 +} + func (o *DeletePolicyInvalid) Error() string { return fmt.Sprintf("[DELETE /policy][%d] deletePolicyInvalid %+v", 400, o.Payload) } @@ -223,6 +233,11 @@ func (o *DeletePolicyForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the delete policy forbidden response +func (o *DeletePolicyForbidden) Code() int { + return 403 +} + func (o *DeletePolicyForbidden) Error() string { return fmt.Sprintf("[DELETE /policy][%d] deletePolicyForbidden ", 403) } @@ -274,6 +289,11 @@ func (o *DeletePolicyNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the delete policy not found response +func (o *DeletePolicyNotFound) Code() int { + return 404 +} + func (o *DeletePolicyNotFound) Error() string { return fmt.Sprintf("[DELETE /policy][%d] deletePolicyNotFound ", 404) } @@ -326,6 +346,11 @@ func (o *DeletePolicyFailure) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the delete policy failure response +func (o *DeletePolicyFailure) Code() int { + return 500 +} + func (o *DeletePolicyFailure) Error() string { return fmt.Sprintf("[DELETE /policy][%d] deletePolicyFailure %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_fqdn_cache_id_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_fqdn_cache_id_responses.go index 7d42975239..57ce63088b 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_fqdn_cache_id_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_fqdn_cache_id_responses.go @@ -45,7 +45,7 @@ func (o *GetFqdnCacheIDReader) ReadResponse(response runtime.ClientResponse, con } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /fqdn/cache/{id}] GetFqdnCacheID", response, response.Code()) } } @@ -88,6 +88,11 @@ func (o *GetFqdnCacheIDOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get fqdn cache Id o k response +func (o *GetFqdnCacheIDOK) Code() int { + return 200 +} + func (o *GetFqdnCacheIDOK) Error() string { return fmt.Sprintf("[GET /fqdn/cache/{id}][%d] getFqdnCacheIdOK %+v", 200, o.Payload) } @@ -149,6 +154,11 @@ func (o *GetFqdnCacheIDBadRequest) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the get fqdn cache Id bad request response +func (o *GetFqdnCacheIDBadRequest) Code() int { + return 400 +} + func (o *GetFqdnCacheIDBadRequest) Error() string { return fmt.Sprintf("[GET /fqdn/cache/{id}][%d] getFqdnCacheIdBadRequest %+v", 400, o.Payload) } @@ -209,6 +219,11 @@ func (o *GetFqdnCacheIDNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get fqdn cache Id not found response +func (o *GetFqdnCacheIDNotFound) Code() int { + return 404 +} + func (o *GetFqdnCacheIDNotFound) Error() string { return fmt.Sprintf("[GET /fqdn/cache/{id}][%d] getFqdnCacheIdNotFound ", 404) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_fqdn_cache_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_fqdn_cache_responses.go index 775a0fc201..fc655cb4ca 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_fqdn_cache_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_fqdn_cache_responses.go @@ -45,7 +45,7 @@ func (o *GetFqdnCacheReader) ReadResponse(response runtime.ClientResponse, consu } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /fqdn/cache] GetFqdnCache", response, response.Code()) } } @@ -88,6 +88,11 @@ func (o *GetFqdnCacheOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get fqdn cache o k response +func (o *GetFqdnCacheOK) Code() int { + return 200 +} + func (o *GetFqdnCacheOK) Error() string { return fmt.Sprintf("[GET /fqdn/cache][%d] getFqdnCacheOK %+v", 200, o.Payload) } @@ -149,6 +154,11 @@ func (o *GetFqdnCacheBadRequest) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the get fqdn cache bad request response +func (o *GetFqdnCacheBadRequest) Code() int { + return 400 +} + func (o *GetFqdnCacheBadRequest) Error() string { return fmt.Sprintf("[GET /fqdn/cache][%d] getFqdnCacheBadRequest %+v", 400, o.Payload) } @@ -209,6 +219,11 @@ func (o *GetFqdnCacheNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get fqdn cache not found response +func (o *GetFqdnCacheNotFound) Code() int { + return 404 +} + func (o *GetFqdnCacheNotFound) Error() string { return fmt.Sprintf("[GET /fqdn/cache][%d] getFqdnCacheNotFound ", 404) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_fqdn_names_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_fqdn_names_responses.go index b2b160db66..502a9afbd8 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_fqdn_names_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_fqdn_names_responses.go @@ -39,7 +39,7 @@ func (o *GetFqdnNamesReader) ReadResponse(response runtime.ClientResponse, consu } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /fqdn/names] GetFqdnNames", response, response.Code()) } } @@ -82,6 +82,11 @@ func (o *GetFqdnNamesOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get fqdn names o k response +func (o *GetFqdnNamesOK) Code() int { + return 200 +} + func (o *GetFqdnNamesOK) Error() string { return fmt.Sprintf("[GET /fqdn/names][%d] getFqdnNamesOK %+v", 200, o.Payload) } @@ -145,6 +150,11 @@ func (o *GetFqdnNamesBadRequest) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the get fqdn names bad request response +func (o *GetFqdnNamesBadRequest) Code() int { + return 400 +} + func (o *GetFqdnNamesBadRequest) Error() string { return fmt.Sprintf("[GET /fqdn/names][%d] getFqdnNamesBadRequest %+v", 400, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_identity_endpoints_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_identity_endpoints_responses.go index 0608766c8d..2f079618e1 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_identity_endpoints_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_identity_endpoints_responses.go @@ -39,7 +39,7 @@ func (o *GetIdentityEndpointsReader) ReadResponse(response runtime.ClientRespons } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /identity/endpoints] GetIdentityEndpoints", response, response.Code()) } } @@ -82,6 +82,11 @@ func (o *GetIdentityEndpointsOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get identity endpoints o k response +func (o *GetIdentityEndpointsOK) Code() int { + return 200 +} + func (o *GetIdentityEndpointsOK) Error() string { return fmt.Sprintf("[GET /identity/endpoints][%d] getIdentityEndpointsOK %+v", 200, o.Payload) } @@ -142,6 +147,11 @@ func (o *GetIdentityEndpointsNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get identity endpoints not found response +func (o *GetIdentityEndpointsNotFound) Code() int { + return 404 +} + func (o *GetIdentityEndpointsNotFound) Error() string { return fmt.Sprintf("[GET /identity/endpoints][%d] getIdentityEndpointsNotFound ", 404) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_identity_id_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_identity_id_responses.go index c6d55d0cac..80a71d7300 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_identity_id_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_identity_id_responses.go @@ -57,7 +57,7 @@ func (o *GetIdentityIDReader) ReadResponse(response runtime.ClientResponse, cons } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /identity/{id}] GetIdentityID", response, response.Code()) } } @@ -100,6 +100,11 @@ func (o *GetIdentityIDOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get identity Id o k response +func (o *GetIdentityIDOK) Code() int { + return 200 +} + func (o *GetIdentityIDOK) Error() string { return fmt.Sprintf("[GET /identity/{id}][%d] getIdentityIdOK %+v", 200, o.Payload) } @@ -162,6 +167,11 @@ func (o *GetIdentityIDBadRequest) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the get identity Id bad request response +func (o *GetIdentityIDBadRequest) Code() int { + return 400 +} + func (o *GetIdentityIDBadRequest) Error() string { return fmt.Sprintf("[GET /identity/{id}][%d] getIdentityIdBadRequest ", 400) } @@ -213,6 +223,11 @@ func (o *GetIdentityIDNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get identity Id not found response +func (o *GetIdentityIDNotFound) Code() int { + return 404 +} + func (o *GetIdentityIDNotFound) Error() string { return fmt.Sprintf("[GET /identity/{id}][%d] getIdentityIdNotFound ", 404) } @@ -265,6 +280,11 @@ func (o *GetIdentityIDUnreachable) IsCode(code int) bool { return code == 520 } +// Code gets the status code for the get identity Id unreachable response +func (o *GetIdentityIDUnreachable) Code() int { + return 520 +} + func (o *GetIdentityIDUnreachable) Error() string { return fmt.Sprintf("[GET /identity/{id}][%d] getIdentityIdUnreachable %+v", 520, o.Payload) } @@ -326,6 +346,11 @@ func (o *GetIdentityIDInvalidStorageFormat) IsCode(code int) bool { return code == 521 } +// Code gets the status code for the get identity Id invalid storage format response +func (o *GetIdentityIDInvalidStorageFormat) Code() int { + return 521 +} + func (o *GetIdentityIDInvalidStorageFormat) Error() string { return fmt.Sprintf("[GET /identity/{id}][%d] getIdentityIdInvalidStorageFormat %+v", 521, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_identity_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_identity_responses.go index 64ea45296d..23fc0a8458 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_identity_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_identity_responses.go @@ -51,7 +51,7 @@ func (o *GetIdentityReader) ReadResponse(response runtime.ClientResponse, consum } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /identity] GetIdentity", response, response.Code()) } } @@ -94,6 +94,11 @@ func (o *GetIdentityOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get identity o k response +func (o *GetIdentityOK) Code() int { + return 200 +} + func (o *GetIdentityOK) Error() string { return fmt.Sprintf("[GET /identity][%d] getIdentityOK %+v", 200, o.Payload) } @@ -154,6 +159,11 @@ func (o *GetIdentityNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get identity not found response +func (o *GetIdentityNotFound) Code() int { + return 404 +} + func (o *GetIdentityNotFound) Error() string { return fmt.Sprintf("[GET /identity][%d] getIdentityNotFound ", 404) } @@ -206,6 +216,11 @@ func (o *GetIdentityUnreachable) IsCode(code int) bool { return code == 520 } +// Code gets the status code for the get identity unreachable response +func (o *GetIdentityUnreachable) Code() int { + return 520 +} + func (o *GetIdentityUnreachable) Error() string { return fmt.Sprintf("[GET /identity][%d] getIdentityUnreachable %+v", 520, o.Payload) } @@ -267,6 +282,11 @@ func (o *GetIdentityInvalidStorageFormat) IsCode(code int) bool { return code == 521 } +// Code gets the status code for the get identity invalid storage format response +func (o *GetIdentityInvalidStorageFormat) Code() int { + return 521 +} + func (o *GetIdentityInvalidStorageFormat) Error() string { return fmt.Sprintf("[GET /identity][%d] getIdentityInvalidStorageFormat %+v", 521, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_ip_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_ip_responses.go index 37db9ccd25..0f9ca3a89a 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_ip_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_ip_responses.go @@ -45,7 +45,7 @@ func (o *GetIPReader) ReadResponse(response runtime.ClientResponse, consumer run } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /ip] GetIP", response, response.Code()) } } @@ -88,6 +88,11 @@ func (o *GetIPOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get Ip o k response +func (o *GetIPOK) Code() int { + return 200 +} + func (o *GetIPOK) Error() string { return fmt.Sprintf("[GET /ip][%d] getIpOK %+v", 200, o.Payload) } @@ -149,6 +154,11 @@ func (o *GetIPBadRequest) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the get Ip bad request response +func (o *GetIPBadRequest) Code() int { + return 400 +} + func (o *GetIPBadRequest) Error() string { return fmt.Sprintf("[GET /ip][%d] getIpBadRequest %+v", 400, o.Payload) } @@ -209,6 +219,11 @@ func (o *GetIPNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get Ip not found response +func (o *GetIPNotFound) Code() int { + return 404 +} + func (o *GetIPNotFound) Error() string { return fmt.Sprintf("[GET /ip][%d] getIpNotFound ", 404) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_policy_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_policy_responses.go index cba45439de..da464ed214 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_policy_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_policy_responses.go @@ -39,7 +39,7 @@ func (o *GetPolicyReader) ReadResponse(response runtime.ClientResponse, consumer } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /policy] GetPolicy", response, response.Code()) } } @@ -82,6 +82,11 @@ func (o *GetPolicyOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get policy o k response +func (o *GetPolicyOK) Code() int { + return 200 +} + func (o *GetPolicyOK) Error() string { return fmt.Sprintf("[GET /policy][%d] getPolicyOK %+v", 200, o.Payload) } @@ -144,6 +149,11 @@ func (o *GetPolicyNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get policy not found response +func (o *GetPolicyNotFound) Code() int { + return 404 +} + func (o *GetPolicyNotFound) Error() string { return fmt.Sprintf("[GET /policy][%d] getPolicyNotFound ", 404) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_policy_selectors_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_policy_selectors_responses.go index a1cbec4a32..633d4d1e73 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/policy/get_policy_selectors_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/policy/get_policy_selectors_responses.go @@ -33,7 +33,7 @@ func (o *GetPolicySelectorsReader) ReadResponse(response runtime.ClientResponse, } return result, nil default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /policy/selectors] GetPolicySelectors", response, response.Code()) } } @@ -76,6 +76,11 @@ func (o *GetPolicySelectorsOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get policy selectors o k response +func (o *GetPolicySelectorsOK) Code() int { + return 200 +} + func (o *GetPolicySelectorsOK) Error() string { return fmt.Sprintf("[GET /policy/selectors][%d] getPolicySelectorsOK %+v", 200, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/policy/put_policy_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/policy/put_policy_responses.go index f1104c418a..2d3246899b 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/policy/put_policy_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/policy/put_policy_responses.go @@ -57,7 +57,7 @@ func (o *PutPolicyReader) ReadResponse(response runtime.ClientResponse, consumer } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[PUT /policy] PutPolicy", response, response.Code()) } } @@ -100,6 +100,11 @@ func (o *PutPolicyOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the put policy o k response +func (o *PutPolicyOK) Code() int { + return 200 +} + func (o *PutPolicyOK) Error() string { return fmt.Sprintf("[PUT /policy][%d] putPolicyOK %+v", 200, o.Payload) } @@ -163,6 +168,11 @@ func (o *PutPolicyInvalidPolicy) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the put policy invalid policy response +func (o *PutPolicyInvalidPolicy) Code() int { + return 400 +} + func (o *PutPolicyInvalidPolicy) Error() string { return fmt.Sprintf("[PUT /policy][%d] putPolicyInvalidPolicy %+v", 400, o.Payload) } @@ -223,6 +233,11 @@ func (o *PutPolicyForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the put policy forbidden response +func (o *PutPolicyForbidden) Code() int { + return 403 +} + func (o *PutPolicyForbidden) Error() string { return fmt.Sprintf("[PUT /policy][%d] putPolicyForbidden ", 403) } @@ -275,6 +290,11 @@ func (o *PutPolicyInvalidPath) IsCode(code int) bool { return code == 460 } +// Code gets the status code for the put policy invalid path response +func (o *PutPolicyInvalidPath) Code() int { + return 460 +} + func (o *PutPolicyInvalidPath) Error() string { return fmt.Sprintf("[PUT /policy][%d] putPolicyInvalidPath %+v", 460, o.Payload) } @@ -336,6 +356,11 @@ func (o *PutPolicyFailure) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the put policy failure response +func (o *PutPolicyFailure) Code() int { + return 500 +} + func (o *PutPolicyFailure) Error() string { return fmt.Sprintf("[PUT /policy][%d] putPolicyFailure %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/prefilter/delete_prefilter_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/prefilter/delete_prefilter_responses.go index 0d5aea637d..9a7b228f60 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/prefilter/delete_prefilter_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/prefilter/delete_prefilter_responses.go @@ -51,7 +51,7 @@ func (o *DeletePrefilterReader) ReadResponse(response runtime.ClientResponse, co } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[DELETE /prefilter] DeletePrefilter", response, response.Code()) } } @@ -94,6 +94,11 @@ func (o *DeletePrefilterOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the delete prefilter o k response +func (o *DeletePrefilterOK) Code() int { + return 200 +} + func (o *DeletePrefilterOK) Error() string { return fmt.Sprintf("[DELETE /prefilter][%d] deletePrefilterOK %+v", 200, o.Payload) } @@ -156,6 +161,11 @@ func (o *DeletePrefilterForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the delete prefilter forbidden response +func (o *DeletePrefilterForbidden) Code() int { + return 403 +} + func (o *DeletePrefilterForbidden) Error() string { return fmt.Sprintf("[DELETE /prefilter][%d] deletePrefilterForbidden ", 403) } @@ -208,6 +218,11 @@ func (o *DeletePrefilterInvalidCIDR) IsCode(code int) bool { return code == 461 } +// Code gets the status code for the delete prefilter invalid c Id r response +func (o *DeletePrefilterInvalidCIDR) Code() int { + return 461 +} + func (o *DeletePrefilterInvalidCIDR) Error() string { return fmt.Sprintf("[DELETE /prefilter][%d] deletePrefilterInvalidCIdR %+v", 461, o.Payload) } @@ -269,6 +284,11 @@ func (o *DeletePrefilterFailure) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the delete prefilter failure response +func (o *DeletePrefilterFailure) Code() int { + return 500 +} + func (o *DeletePrefilterFailure) Error() string { return fmt.Sprintf("[DELETE /prefilter][%d] deletePrefilterFailure %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/prefilter/get_prefilter_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/prefilter/get_prefilter_responses.go index 63e051e3ac..a9cbacb7c6 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/prefilter/get_prefilter_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/prefilter/get_prefilter_responses.go @@ -39,7 +39,7 @@ func (o *GetPrefilterReader) ReadResponse(response runtime.ClientResponse, consu } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /prefilter] GetPrefilter", response, response.Code()) } } @@ -82,6 +82,11 @@ func (o *GetPrefilterOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get prefilter o k response +func (o *GetPrefilterOK) Code() int { + return 200 +} + func (o *GetPrefilterOK) Error() string { return fmt.Sprintf("[GET /prefilter][%d] getPrefilterOK %+v", 200, o.Payload) } @@ -145,6 +150,11 @@ func (o *GetPrefilterFailure) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the get prefilter failure response +func (o *GetPrefilterFailure) Code() int { + return 500 +} + func (o *GetPrefilterFailure) Error() string { return fmt.Sprintf("[GET /prefilter][%d] getPrefilterFailure %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/prefilter/patch_prefilter_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/prefilter/patch_prefilter_responses.go index 56db490a65..d275a4c2e8 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/prefilter/patch_prefilter_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/prefilter/patch_prefilter_responses.go @@ -51,7 +51,7 @@ func (o *PatchPrefilterReader) ReadResponse(response runtime.ClientResponse, con } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[PATCH /prefilter] PatchPrefilter", response, response.Code()) } } @@ -94,6 +94,11 @@ func (o *PatchPrefilterOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the patch prefilter o k response +func (o *PatchPrefilterOK) Code() int { + return 200 +} + func (o *PatchPrefilterOK) Error() string { return fmt.Sprintf("[PATCH /prefilter][%d] patchPrefilterOK %+v", 200, o.Payload) } @@ -156,6 +161,11 @@ func (o *PatchPrefilterForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the patch prefilter forbidden response +func (o *PatchPrefilterForbidden) Code() int { + return 403 +} + func (o *PatchPrefilterForbidden) Error() string { return fmt.Sprintf("[PATCH /prefilter][%d] patchPrefilterForbidden ", 403) } @@ -208,6 +218,11 @@ func (o *PatchPrefilterInvalidCIDR) IsCode(code int) bool { return code == 461 } +// Code gets the status code for the patch prefilter invalid c Id r response +func (o *PatchPrefilterInvalidCIDR) Code() int { + return 461 +} + func (o *PatchPrefilterInvalidCIDR) Error() string { return fmt.Sprintf("[PATCH /prefilter][%d] patchPrefilterInvalidCIdR %+v", 461, o.Payload) } @@ -269,6 +284,11 @@ func (o *PatchPrefilterFailure) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the patch prefilter failure response +func (o *PatchPrefilterFailure) Code() int { + return 500 +} + func (o *PatchPrefilterFailure) Error() string { return fmt.Sprintf("[PATCH /prefilter][%d] patchPrefilterFailure %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/recorder/delete_recorder_id_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/recorder/delete_recorder_id_responses.go index cf7ab77a23..d4b7773ce1 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/recorder/delete_recorder_id_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/recorder/delete_recorder_id_responses.go @@ -51,7 +51,7 @@ func (o *DeleteRecorderIDReader) ReadResponse(response runtime.ClientResponse, c } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[DELETE /recorder/{id}] DeleteRecorderID", response, response.Code()) } } @@ -93,6 +93,11 @@ func (o *DeleteRecorderIDOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the delete recorder Id o k response +func (o *DeleteRecorderIDOK) Code() int { + return 200 +} + func (o *DeleteRecorderIDOK) Error() string { return fmt.Sprintf("[DELETE /recorder/{id}][%d] deleteRecorderIdOK ", 200) } @@ -144,6 +149,11 @@ func (o *DeleteRecorderIDForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the delete recorder Id forbidden response +func (o *DeleteRecorderIDForbidden) Code() int { + return 403 +} + func (o *DeleteRecorderIDForbidden) Error() string { return fmt.Sprintf("[DELETE /recorder/{id}][%d] deleteRecorderIdForbidden ", 403) } @@ -195,6 +205,11 @@ func (o *DeleteRecorderIDNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the delete recorder Id not found response +func (o *DeleteRecorderIDNotFound) Code() int { + return 404 +} + func (o *DeleteRecorderIDNotFound) Error() string { return fmt.Sprintf("[DELETE /recorder/{id}][%d] deleteRecorderIdNotFound ", 404) } @@ -247,6 +262,11 @@ func (o *DeleteRecorderIDFailure) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the delete recorder Id failure response +func (o *DeleteRecorderIDFailure) Code() int { + return 500 +} + func (o *DeleteRecorderIDFailure) Error() string { return fmt.Sprintf("[DELETE /recorder/{id}][%d] deleteRecorderIdFailure %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/recorder/get_recorder_id_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/recorder/get_recorder_id_responses.go index 07f4e60cdc..f688a90994 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/recorder/get_recorder_id_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/recorder/get_recorder_id_responses.go @@ -39,7 +39,7 @@ func (o *GetRecorderIDReader) ReadResponse(response runtime.ClientResponse, cons } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /recorder/{id}] GetRecorderID", response, response.Code()) } } @@ -82,6 +82,11 @@ func (o *GetRecorderIDOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get recorder Id o k response +func (o *GetRecorderIDOK) Code() int { + return 200 +} + func (o *GetRecorderIDOK) Error() string { return fmt.Sprintf("[GET /recorder/{id}][%d] getRecorderIdOK %+v", 200, o.Payload) } @@ -144,6 +149,11 @@ func (o *GetRecorderIDNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get recorder Id not found response +func (o *GetRecorderIDNotFound) Code() int { + return 404 +} + func (o *GetRecorderIDNotFound) Error() string { return fmt.Sprintf("[GET /recorder/{id}][%d] getRecorderIdNotFound ", 404) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/recorder/get_recorder_masks_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/recorder/get_recorder_masks_responses.go index 06b8555968..bfcc29a64a 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/recorder/get_recorder_masks_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/recorder/get_recorder_masks_responses.go @@ -33,7 +33,7 @@ func (o *GetRecorderMasksReader) ReadResponse(response runtime.ClientResponse, c } return result, nil default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /recorder/masks] GetRecorderMasks", response, response.Code()) } } @@ -76,6 +76,11 @@ func (o *GetRecorderMasksOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get recorder masks o k response +func (o *GetRecorderMasksOK) Code() int { + return 200 +} + func (o *GetRecorderMasksOK) Error() string { return fmt.Sprintf("[GET /recorder/masks][%d] getRecorderMasksOK %+v", 200, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/recorder/get_recorder_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/recorder/get_recorder_responses.go index f45762c308..0d64926660 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/recorder/get_recorder_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/recorder/get_recorder_responses.go @@ -33,7 +33,7 @@ func (o *GetRecorderReader) ReadResponse(response runtime.ClientResponse, consum } return result, nil default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /recorder] GetRecorder", response, response.Code()) } } @@ -76,6 +76,11 @@ func (o *GetRecorderOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get recorder o k response +func (o *GetRecorderOK) Code() int { + return 200 +} + func (o *GetRecorderOK) Error() string { return fmt.Sprintf("[GET /recorder][%d] getRecorderOK %+v", 200, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/recorder/put_recorder_id_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/recorder/put_recorder_id_responses.go index 996c87026d..f3947985a9 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/recorder/put_recorder_id_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/recorder/put_recorder_id_responses.go @@ -51,7 +51,7 @@ func (o *PutRecorderIDReader) ReadResponse(response runtime.ClientResponse, cons } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[PUT /recorder/{id}] PutRecorderID", response, response.Code()) } } @@ -93,6 +93,11 @@ func (o *PutRecorderIDOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the put recorder Id o k response +func (o *PutRecorderIDOK) Code() int { + return 200 +} + func (o *PutRecorderIDOK) Error() string { return fmt.Sprintf("[PUT /recorder/{id}][%d] putRecorderIdOK ", 200) } @@ -144,6 +149,11 @@ func (o *PutRecorderIDCreated) IsCode(code int) bool { return code == 201 } +// Code gets the status code for the put recorder Id created response +func (o *PutRecorderIDCreated) Code() int { + return 201 +} + func (o *PutRecorderIDCreated) Error() string { return fmt.Sprintf("[PUT /recorder/{id}][%d] putRecorderIdCreated ", 201) } @@ -195,6 +205,11 @@ func (o *PutRecorderIDForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the put recorder Id forbidden response +func (o *PutRecorderIDForbidden) Code() int { + return 403 +} + func (o *PutRecorderIDForbidden) Error() string { return fmt.Sprintf("[PUT /recorder/{id}][%d] putRecorderIdForbidden ", 403) } @@ -247,6 +262,11 @@ func (o *PutRecorderIDFailure) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the put recorder Id failure response +func (o *PutRecorderIDFailure) Code() int { + return 500 +} + func (o *PutRecorderIDFailure) Error() string { return fmt.Sprintf("[PUT /recorder/{id}][%d] putRecorderIdFailure %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/service/delete_service_id_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/service/delete_service_id_responses.go index 21926d9c47..a5008e23dd 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/service/delete_service_id_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/service/delete_service_id_responses.go @@ -51,7 +51,7 @@ func (o *DeleteServiceIDReader) ReadResponse(response runtime.ClientResponse, co } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[DELETE /service/{id}] DeleteServiceID", response, response.Code()) } } @@ -93,6 +93,11 @@ func (o *DeleteServiceIDOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the delete service Id o k response +func (o *DeleteServiceIDOK) Code() int { + return 200 +} + func (o *DeleteServiceIDOK) Error() string { return fmt.Sprintf("[DELETE /service/{id}][%d] deleteServiceIdOK ", 200) } @@ -144,6 +149,11 @@ func (o *DeleteServiceIDForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the delete service Id forbidden response +func (o *DeleteServiceIDForbidden) Code() int { + return 403 +} + func (o *DeleteServiceIDForbidden) Error() string { return fmt.Sprintf("[DELETE /service/{id}][%d] deleteServiceIdForbidden ", 403) } @@ -195,6 +205,11 @@ func (o *DeleteServiceIDNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the delete service Id not found response +func (o *DeleteServiceIDNotFound) Code() int { + return 404 +} + func (o *DeleteServiceIDNotFound) Error() string { return fmt.Sprintf("[DELETE /service/{id}][%d] deleteServiceIdNotFound ", 404) } @@ -247,6 +262,11 @@ func (o *DeleteServiceIDFailure) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the delete service Id failure response +func (o *DeleteServiceIDFailure) Code() int { + return 500 +} + func (o *DeleteServiceIDFailure) Error() string { return fmt.Sprintf("[DELETE /service/{id}][%d] deleteServiceIdFailure %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/service/get_lrp_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/service/get_lrp_responses.go index ac5974ce51..60d0f19964 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/service/get_lrp_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/service/get_lrp_responses.go @@ -33,7 +33,7 @@ func (o *GetLrpReader) ReadResponse(response runtime.ClientResponse, consumer ru } return result, nil default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /lrp] GetLrp", response, response.Code()) } } @@ -76,6 +76,11 @@ func (o *GetLrpOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get lrp o k response +func (o *GetLrpOK) Code() int { + return 200 +} + func (o *GetLrpOK) Error() string { return fmt.Sprintf("[GET /lrp][%d] getLrpOK %+v", 200, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/service/get_service_id_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/service/get_service_id_responses.go index 4b198ced9d..a5f81c101c 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/service/get_service_id_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/service/get_service_id_responses.go @@ -39,7 +39,7 @@ func (o *GetServiceIDReader) ReadResponse(response runtime.ClientResponse, consu } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /service/{id}] GetServiceID", response, response.Code()) } } @@ -82,6 +82,11 @@ func (o *GetServiceIDOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get service Id o k response +func (o *GetServiceIDOK) Code() int { + return 200 +} + func (o *GetServiceIDOK) Error() string { return fmt.Sprintf("[GET /service/{id}][%d] getServiceIdOK %+v", 200, o.Payload) } @@ -144,6 +149,11 @@ func (o *GetServiceIDNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get service Id not found response +func (o *GetServiceIDNotFound) Code() int { + return 404 +} + func (o *GetServiceIDNotFound) Error() string { return fmt.Sprintf("[GET /service/{id}][%d] getServiceIdNotFound ", 404) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/service/get_service_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/service/get_service_responses.go index dbf75ba847..5a6bd669ca 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/service/get_service_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/service/get_service_responses.go @@ -33,7 +33,7 @@ func (o *GetServiceReader) ReadResponse(response runtime.ClientResponse, consume } return result, nil default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /service] GetService", response, response.Code()) } } @@ -76,6 +76,11 @@ func (o *GetServiceOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get service o k response +func (o *GetServiceOK) Code() int { + return 200 +} + func (o *GetServiceOK) Error() string { return fmt.Sprintf("[GET /service][%d] getServiceOK %+v", 200, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/service/put_service_id_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/service/put_service_id_responses.go index af85fa32a6..a2a4e006c0 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/service/put_service_id_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/service/put_service_id_responses.go @@ -69,7 +69,7 @@ func (o *PutServiceIDReader) ReadResponse(response runtime.ClientResponse, consu } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[PUT /service/{id}] PutServiceID", response, response.Code()) } } @@ -111,6 +111,11 @@ func (o *PutServiceIDOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the put service Id o k response +func (o *PutServiceIDOK) Code() int { + return 200 +} + func (o *PutServiceIDOK) Error() string { return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdOK ", 200) } @@ -162,6 +167,11 @@ func (o *PutServiceIDCreated) IsCode(code int) bool { return code == 201 } +// Code gets the status code for the put service Id created response +func (o *PutServiceIDCreated) Code() int { + return 201 +} + func (o *PutServiceIDCreated) Error() string { return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdCreated ", 201) } @@ -213,6 +223,11 @@ func (o *PutServiceIDForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the put service Id forbidden response +func (o *PutServiceIDForbidden) Code() int { + return 403 +} + func (o *PutServiceIDForbidden) Error() string { return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdForbidden ", 403) } @@ -265,6 +280,11 @@ func (o *PutServiceIDInvalidFrontend) IsCode(code int) bool { return code == 460 } +// Code gets the status code for the put service Id invalid frontend response +func (o *PutServiceIDInvalidFrontend) Code() int { + return 460 +} + func (o *PutServiceIDInvalidFrontend) Error() string { return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdInvalidFrontend %+v", 460, o.Payload) } @@ -326,6 +346,11 @@ func (o *PutServiceIDInvalidBackend) IsCode(code int) bool { return code == 461 } +// Code gets the status code for the put service Id invalid backend response +func (o *PutServiceIDInvalidBackend) Code() int { + return 461 +} + func (o *PutServiceIDInvalidBackend) Error() string { return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdInvalidBackend %+v", 461, o.Payload) } @@ -387,6 +412,11 @@ func (o *PutServiceIDFailure) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the put service Id failure response +func (o *PutServiceIDFailure) Code() int { + return 500 +} + func (o *PutServiceIDFailure) Error() string { return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdFailure %+v", 500, o.Payload) } @@ -448,6 +478,11 @@ func (o *PutServiceIDUpdateBackendFailure) IsCode(code int) bool { return code == 501 } +// Code gets the status code for the put service Id update backend failure response +func (o *PutServiceIDUpdateBackendFailure) Code() int { + return 501 +} + func (o *PutServiceIDUpdateBackendFailure) Error() string { return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdUpdateBackendFailure %+v", 501, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/statedb/get_statedb_dump_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/statedb/get_statedb_dump_responses.go index 3577f9c3b7..6434ceb10a 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/statedb/get_statedb_dump_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/statedb/get_statedb_dump_responses.go @@ -32,7 +32,7 @@ func (o *GetStatedbDumpReader) ReadResponse(response runtime.ClientResponse, con } return result, nil default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /statedb/dump] GetStatedbDump", response, response.Code()) } } @@ -78,6 +78,11 @@ func (o *GetStatedbDumpOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get statedb dump o k response +func (o *GetStatedbDumpOK) Code() int { + return 200 +} + func (o *GetStatedbDumpOK) Error() string { return fmt.Sprintf("[GET /statedb/dump][%d] getStatedbDumpOK %+v", 200, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/client/statedb/get_statedb_query_table_responses.go b/vendor/github.com/cilium/cilium/api/v1/client/statedb/get_statedb_query_table_responses.go index 74bfe66f7f..7c0df347ef 100644 --- a/vendor/github.com/cilium/cilium/api/v1/client/statedb/get_statedb_query_table_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/client/statedb/get_statedb_query_table_responses.go @@ -46,7 +46,7 @@ func (o *GetStatedbQueryTableReader) ReadResponse(response runtime.ClientRespons } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /statedb/query/{table}] GetStatedbQueryTable", response, response.Code()) } } @@ -92,6 +92,11 @@ func (o *GetStatedbQueryTableOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get statedb query table o k response +func (o *GetStatedbQueryTableOK) Code() int { + return 200 +} + func (o *GetStatedbQueryTableOK) Error() string { return fmt.Sprintf("[GET /statedb/query/{table}][%d] getStatedbQueryTableOK %+v", 200, o.Payload) } @@ -153,6 +158,11 @@ func (o *GetStatedbQueryTableBadRequest) IsCode(code int) bool { return code == 400 } +// Code gets the status code for the get statedb query table bad request response +func (o *GetStatedbQueryTableBadRequest) Code() int { + return 400 +} + func (o *GetStatedbQueryTableBadRequest) Error() string { return fmt.Sprintf("[GET /statedb/query/{table}][%d] getStatedbQueryTableBadRequest %+v", 400, o.Payload) } @@ -213,6 +223,11 @@ func (o *GetStatedbQueryTableNotFound) IsCode(code int) bool { return code == 404 } +// Code gets the status code for the get statedb query table not found response +func (o *GetStatedbQueryTableNotFound) Code() int { + return 404 +} + func (o *GetStatedbQueryTableNotFound) Error() string { return fmt.Sprintf("[GET /statedb/query/{table}][%d] getStatedbQueryTableNotFound ", 404) } diff --git a/vendor/github.com/cilium/cilium/api/v1/health/client/connectivity/get_status_responses.go b/vendor/github.com/cilium/cilium/api/v1/health/client/connectivity/get_status_responses.go index cf977a0df5..a839504c5c 100644 --- a/vendor/github.com/cilium/cilium/api/v1/health/client/connectivity/get_status_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/health/client/connectivity/get_status_responses.go @@ -33,7 +33,7 @@ func (o *GetStatusReader) ReadResponse(response runtime.ClientResponse, consumer } return result, nil default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /status] GetStatus", response, response.Code()) } } @@ -76,6 +76,11 @@ func (o *GetStatusOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get status o k response +func (o *GetStatusOK) Code() int { + return 200 +} + func (o *GetStatusOK) Error() string { return fmt.Sprintf("[GET /status][%d] getStatusOK %+v", 200, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/health/client/connectivity/put_status_probe_responses.go b/vendor/github.com/cilium/cilium/api/v1/health/client/connectivity/put_status_probe_responses.go index 68d6dadbd3..2c392753f8 100644 --- a/vendor/github.com/cilium/cilium/api/v1/health/client/connectivity/put_status_probe_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/health/client/connectivity/put_status_probe_responses.go @@ -45,7 +45,7 @@ func (o *PutStatusProbeReader) ReadResponse(response runtime.ClientResponse, con } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[PUT /status/probe] PutStatusProbe", response, response.Code()) } } @@ -88,6 +88,11 @@ func (o *PutStatusProbeOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the put status probe o k response +func (o *PutStatusProbeOK) Code() int { + return 200 +} + func (o *PutStatusProbeOK) Error() string { return fmt.Sprintf("[PUT /status/probe][%d] putStatusProbeOK %+v", 200, o.Payload) } @@ -150,6 +155,11 @@ func (o *PutStatusProbeForbidden) IsCode(code int) bool { return code == 403 } +// Code gets the status code for the put status probe forbidden response +func (o *PutStatusProbeForbidden) Code() int { + return 403 +} + func (o *PutStatusProbeForbidden) Error() string { return fmt.Sprintf("[PUT /status/probe][%d] putStatusProbeForbidden ", 403) } @@ -202,6 +212,11 @@ func (o *PutStatusProbeFailed) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the put status probe failed response +func (o *PutStatusProbeFailed) Code() int { + return 500 +} + func (o *PutStatusProbeFailed) Error() string { return fmt.Sprintf("[PUT /status/probe][%d] putStatusProbeFailed %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/health/client/restapi/get_healthz_responses.go b/vendor/github.com/cilium/cilium/api/v1/health/client/restapi/get_healthz_responses.go index c30a211861..938cfc356d 100644 --- a/vendor/github.com/cilium/cilium/api/v1/health/client/restapi/get_healthz_responses.go +++ b/vendor/github.com/cilium/cilium/api/v1/health/client/restapi/get_healthz_responses.go @@ -39,7 +39,7 @@ func (o *GetHealthzReader) ReadResponse(response runtime.ClientResponse, consume } return nil, result default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + return nil, runtime.NewAPIError("[GET /healthz] GetHealthz", response, response.Code()) } } @@ -82,6 +82,11 @@ func (o *GetHealthzOK) IsCode(code int) bool { return code == 200 } +// Code gets the status code for the get healthz o k response +func (o *GetHealthzOK) Code() int { + return 200 +} + func (o *GetHealthzOK) Error() string { return fmt.Sprintf("[GET /healthz][%d] getHealthzOK %+v", 200, o.Payload) } @@ -145,6 +150,11 @@ func (o *GetHealthzFailed) IsCode(code int) bool { return code == 500 } +// Code gets the status code for the get healthz failed response +func (o *GetHealthzFailed) Code() int { + return 500 +} + func (o *GetHealthzFailed) Error() string { return fmt.Sprintf("[GET /healthz][%d] getHealthzFailed %+v", 500, o.Payload) } diff --git a/vendor/github.com/cilium/cilium/api/v1/health/models/endpoint_status.go b/vendor/github.com/cilium/cilium/api/v1/health/models/endpoint_status.go index 4b8c9daa2a..b46fe8cdce 100644 --- a/vendor/github.com/cilium/cilium/api/v1/health/models/endpoint_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/health/models/endpoint_status.go @@ -113,6 +113,11 @@ func (m *EndpointStatus) ContextValidate(ctx context.Context, formats strfmt.Reg func (m *EndpointStatus) contextValidatePrimaryAddress(ctx context.Context, formats strfmt.Registry) error { if m.PrimaryAddress != nil { + + if swag.IsZero(m.PrimaryAddress) { // not required + return nil + } + if err := m.PrimaryAddress.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("primary-address") @@ -131,6 +136,11 @@ func (m *EndpointStatus) contextValidateSecondaryAddresses(ctx context.Context, for i := 0; i < len(m.SecondaryAddresses); i++ { if m.SecondaryAddresses[i] != nil { + + if swag.IsZero(m.SecondaryAddresses[i]) { // not required + return nil + } + if err := m.SecondaryAddresses[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("secondary-addresses" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/health/models/health_response.go b/vendor/github.com/cilium/cilium/api/v1/health/models/health_response.go index d74c7044e8..b6108f41bd 100644 --- a/vendor/github.com/cilium/cilium/api/v1/health/models/health_response.go +++ b/vendor/github.com/cilium/cilium/api/v1/health/models/health_response.go @@ -106,6 +106,10 @@ func (m *HealthResponse) ContextValidate(ctx context.Context, formats strfmt.Reg func (m *HealthResponse) contextValidateCilium(ctx context.Context, formats strfmt.Registry) error { + if swag.IsZero(m.Cilium) { // not required + return nil + } + if err := m.Cilium.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cilium") @@ -121,6 +125,11 @@ func (m *HealthResponse) contextValidateCilium(ctx context.Context, formats strf func (m *HealthResponse) contextValidateSystemLoad(ctx context.Context, formats strfmt.Registry) error { if m.SystemLoad != nil { + + if swag.IsZero(m.SystemLoad) { // not required + return nil + } + if err := m.SystemLoad.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("system-load") diff --git a/vendor/github.com/cilium/cilium/api/v1/health/models/health_status_response.go b/vendor/github.com/cilium/cilium/api/v1/health/models/health_status_response.go index 9f4a29d783..4b189c09cb 100644 --- a/vendor/github.com/cilium/cilium/api/v1/health/models/health_status_response.go +++ b/vendor/github.com/cilium/cilium/api/v1/health/models/health_status_response.go @@ -116,6 +116,11 @@ func (m *HealthStatusResponse) ContextValidate(ctx context.Context, formats strf func (m *HealthStatusResponse) contextValidateLocal(ctx context.Context, formats strfmt.Registry) error { if m.Local != nil { + + if swag.IsZero(m.Local) { // not required + return nil + } + if err := m.Local.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("local") @@ -134,6 +139,11 @@ func (m *HealthStatusResponse) contextValidateNodes(ctx context.Context, formats for i := 0; i < len(m.Nodes); i++ { if m.Nodes[i] != nil { + + if swag.IsZero(m.Nodes[i]) { // not required + return nil + } + if err := m.Nodes[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("nodes" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/health/models/host_status.go b/vendor/github.com/cilium/cilium/api/v1/health/models/host_status.go index da114cf19a..c40da6d4ab 100644 --- a/vendor/github.com/cilium/cilium/api/v1/health/models/host_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/health/models/host_status.go @@ -114,6 +114,11 @@ func (m *HostStatus) ContextValidate(ctx context.Context, formats strfmt.Registr func (m *HostStatus) contextValidatePrimaryAddress(ctx context.Context, formats strfmt.Registry) error { if m.PrimaryAddress != nil { + + if swag.IsZero(m.PrimaryAddress) { // not required + return nil + } + if err := m.PrimaryAddress.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("primary-address") @@ -132,6 +137,11 @@ func (m *HostStatus) contextValidateSecondaryAddresses(ctx context.Context, form for i := 0; i < len(m.SecondaryAddresses); i++ { if m.SecondaryAddresses[i] != nil { + + if swag.IsZero(m.SecondaryAddresses[i]) { // not required + return nil + } + if err := m.SecondaryAddresses[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("secondary-addresses" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/health/models/node_status.go b/vendor/github.com/cilium/cilium/api/v1/health/models/node_status.go index 1bbd995338..82f2b33fee 100644 --- a/vendor/github.com/cilium/cilium/api/v1/health/models/node_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/health/models/node_status.go @@ -140,6 +140,11 @@ func (m *NodeStatus) ContextValidate(ctx context.Context, formats strfmt.Registr func (m *NodeStatus) contextValidateEndpoint(ctx context.Context, formats strfmt.Registry) error { if m.Endpoint != nil { + + if swag.IsZero(m.Endpoint) { // not required + return nil + } + if err := m.Endpoint.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("endpoint") @@ -156,6 +161,11 @@ func (m *NodeStatus) contextValidateEndpoint(ctx context.Context, formats strfmt func (m *NodeStatus) contextValidateHealthEndpoint(ctx context.Context, formats strfmt.Registry) error { if m.HealthEndpoint != nil { + + if swag.IsZero(m.HealthEndpoint) { // not required + return nil + } + if err := m.HealthEndpoint.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("health-endpoint") @@ -172,6 +182,11 @@ func (m *NodeStatus) contextValidateHealthEndpoint(ctx context.Context, formats func (m *NodeStatus) contextValidateHost(ctx context.Context, formats strfmt.Registry) error { if m.Host != nil { + + if swag.IsZero(m.Host) { // not required + return nil + } + if err := m.Host.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("host") diff --git a/vendor/github.com/cilium/cilium/api/v1/health/models/path_status.go b/vendor/github.com/cilium/cilium/api/v1/health/models/path_status.go index 3a8669f3c6..b9b6fc7d0f 100644 --- a/vendor/github.com/cilium/cilium/api/v1/health/models/path_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/health/models/path_status.go @@ -109,6 +109,11 @@ func (m *PathStatus) ContextValidate(ctx context.Context, formats strfmt.Registr func (m *PathStatus) contextValidateHTTP(ctx context.Context, formats strfmt.Registry) error { if m.HTTP != nil { + + if swag.IsZero(m.HTTP) { // not required + return nil + } + if err := m.HTTP.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("http") @@ -125,6 +130,11 @@ func (m *PathStatus) contextValidateHTTP(ctx context.Context, formats strfmt.Reg func (m *PathStatus) contextValidateIcmp(ctx context.Context, formats strfmt.Registry) error { if m.Icmp != nil { + + if swag.IsZero(m.Icmp) { // not required + return nil + } + if err := m.Icmp.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("icmp") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/b_p_f_map.go b/vendor/github.com/cilium/cilium/api/v1/models/b_p_f_map.go index 2d3366ebac..3516aa913b 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/b_p_f_map.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/b_p_f_map.go @@ -88,6 +88,11 @@ func (m *BPFMap) contextValidateCache(ctx context.Context, formats strfmt.Regist for i := 0; i < len(m.Cache); i++ { if m.Cache[i] != nil { + + if swag.IsZero(m.Cache[i]) { // not required + return nil + } + if err := m.Cache[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cache" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/b_p_f_map_list.go b/vendor/github.com/cilium/cilium/api/v1/models/b_p_f_map_list.go index a42c67b80f..f916187f6e 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/b_p_f_map_list.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/b_p_f_map_list.go @@ -85,6 +85,11 @@ func (m *BPFMapList) contextValidateMaps(ctx context.Context, formats strfmt.Reg for i := 0; i < len(m.Maps); i++ { if m.Maps[i] != nil { + + if swag.IsZero(m.Maps[i]) { // not required + return nil + } + if err := m.Maps[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("maps" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/b_p_f_map_status.go b/vendor/github.com/cilium/cilium/api/v1/models/b_p_f_map_status.go index f48508e90c..a5c0813701 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/b_p_f_map_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/b_p_f_map_status.go @@ -90,6 +90,11 @@ func (m *BPFMapStatus) contextValidateMaps(ctx context.Context, formats strfmt.R for i := 0; i < len(m.Maps); i++ { if m.Maps[i] != nil { + + if swag.IsZero(m.Maps[i]) { // not required + return nil + } + if err := m.Maps[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("maps" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/bgp_path.go b/vendor/github.com/cilium/cilium/api/v1/models/bgp_path.go index 6a8f49befc..2ac2c19401 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/bgp_path.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/bgp_path.go @@ -152,6 +152,11 @@ func (m *BgpPath) ContextValidate(ctx context.Context, formats strfmt.Registry) func (m *BgpPath) contextValidateFamily(ctx context.Context, formats strfmt.Registry) error { if m.Family != nil { + + if swag.IsZero(m.Family) { // not required + return nil + } + if err := m.Family.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("family") @@ -168,6 +173,11 @@ func (m *BgpPath) contextValidateFamily(ctx context.Context, formats strfmt.Regi func (m *BgpPath) contextValidateNlri(ctx context.Context, formats strfmt.Registry) error { if m.Nlri != nil { + + if swag.IsZero(m.Nlri) { // not required + return nil + } + if err := m.Nlri.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("nlri") @@ -186,6 +196,11 @@ func (m *BgpPath) contextValidatePathAttributes(ctx context.Context, formats str for i := 0; i < len(m.PathAttributes); i++ { if m.PathAttributes[i] != nil { + + if swag.IsZero(m.PathAttributes[i]) { // not required + return nil + } + if err := m.PathAttributes[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("path-attributes" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/bgp_peer.go b/vendor/github.com/cilium/cilium/api/v1/models/bgp_peer.go index 59a63154ca..0604c75c72 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/bgp_peer.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/bgp_peer.go @@ -191,6 +191,11 @@ func (m *BgpPeer) contextValidateFamilies(ctx context.Context, formats strfmt.Re for i := 0; i < len(m.Families); i++ { if m.Families[i] != nil { + + if swag.IsZero(m.Families[i]) { // not required + return nil + } + if err := m.Families[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("families" + "." + strconv.Itoa(i)) @@ -209,6 +214,11 @@ func (m *BgpPeer) contextValidateFamilies(ctx context.Context, formats strfmt.Re func (m *BgpPeer) contextValidateGracefulRestart(ctx context.Context, formats strfmt.Registry) error { if m.GracefulRestart != nil { + + if swag.IsZero(m.GracefulRestart) { // not required + return nil + } + if err := m.GracefulRestart.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("graceful-restart") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/bgp_route.go b/vendor/github.com/cilium/cilium/api/v1/models/bgp_route.go index 0c301f815f..f054267549 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/bgp_route.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/bgp_route.go @@ -94,6 +94,11 @@ func (m *BgpRoute) contextValidatePaths(ctx context.Context, formats strfmt.Regi for i := 0; i < len(m.Paths); i++ { if m.Paths[i] != nil { + + if swag.IsZero(m.Paths[i]) { // not required + return nil + } + if err := m.Paths[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("paths" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/bgp_route_policy.go b/vendor/github.com/cilium/cilium/api/v1/models/bgp_route_policy.go index d5d484d10c..756d9c3352 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/bgp_route_policy.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/bgp_route_policy.go @@ -143,6 +143,11 @@ func (m *BgpRoutePolicy) contextValidateStatements(ctx context.Context, formats for i := 0; i < len(m.Statements); i++ { if m.Statements[i] != nil { + + if swag.IsZero(m.Statements[i]) { // not required + return nil + } + if err := m.Statements[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("statements" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/bgp_route_policy_statement.go b/vendor/github.com/cilium/cilium/api/v1/models/bgp_route_policy_statement.go index 09cdbd47e9..00f0c0678e 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/bgp_route_policy_statement.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/bgp_route_policy_statement.go @@ -152,6 +152,11 @@ func (m *BgpRoutePolicyStatement) contextValidateMatchPrefixes(ctx context.Conte for i := 0; i < len(m.MatchPrefixes); i++ { if m.MatchPrefixes[i] != nil { + + if swag.IsZero(m.MatchPrefixes[i]) { // not required + return nil + } + if err := m.MatchPrefixes[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("match-prefixes" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/c_id_r_policy.go b/vendor/github.com/cilium/cilium/api/v1/models/c_id_r_policy.go index 20befd1a05..b98e611a6a 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/c_id_r_policy.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/c_id_r_policy.go @@ -124,6 +124,11 @@ func (m *CIDRPolicy) contextValidateEgress(ctx context.Context, formats strfmt.R for i := 0; i < len(m.Egress); i++ { if m.Egress[i] != nil { + + if swag.IsZero(m.Egress[i]) { // not required + return nil + } + if err := m.Egress[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("egress" + "." + strconv.Itoa(i)) @@ -144,6 +149,11 @@ func (m *CIDRPolicy) contextValidateIngress(ctx context.Context, formats strfmt. for i := 0; i < len(m.Ingress); i++ { if m.Ingress[i] != nil { + + if swag.IsZero(m.Ingress[i]) { // not required + return nil + } + if err := m.Ingress[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ingress" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/cgroup_dump_metadata.go b/vendor/github.com/cilium/cilium/api/v1/models/cgroup_dump_metadata.go index 535eb54231..c4e34a976d 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/cgroup_dump_metadata.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/cgroup_dump_metadata.go @@ -85,6 +85,11 @@ func (m *CgroupDumpMetadata) contextValidatePodMetadatas(ctx context.Context, fo for i := 0; i < len(m.PodMetadatas); i++ { if m.PodMetadatas[i] != nil { + + if swag.IsZero(m.PodMetadatas[i]) { // not required + return nil + } + if err := m.PodMetadatas[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("pod-metadatas" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/cgroup_pod_metadata.go b/vendor/github.com/cilium/cilium/api/v1/models/cgroup_pod_metadata.go index 74fb793657..13011e88a6 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/cgroup_pod_metadata.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/cgroup_pod_metadata.go @@ -94,6 +94,11 @@ func (m *CgroupPodMetadata) contextValidateContainers(ctx context.Context, forma for i := 0; i < len(m.Containers); i++ { if m.Containers[i] != nil { + + if swag.IsZero(m.Containers[i]) { // not required + return nil + } + if err := m.Containers[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("containers" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/cluster_mesh_status.go b/vendor/github.com/cilium/cilium/api/v1/models/cluster_mesh_status.go index c95c006350..3835bbbf56 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/cluster_mesh_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/cluster_mesh_status.go @@ -90,6 +90,11 @@ func (m *ClusterMeshStatus) contextValidateClusters(ctx context.Context, formats for i := 0; i < len(m.Clusters); i++ { if m.Clusters[i] != nil { + + if swag.IsZero(m.Clusters[i]) { // not required + return nil + } + if err := m.Clusters[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("clusters" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/cluster_node_status.go b/vendor/github.com/cilium/cilium/api/v1/models/cluster_node_status.go index 810c8a340d..6824ddb196 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/cluster_node_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/cluster_node_status.go @@ -128,6 +128,11 @@ func (m *ClusterNodeStatus) contextValidateNodesAdded(ctx context.Context, forma for i := 0; i < len(m.NodesAdded); i++ { if m.NodesAdded[i] != nil { + + if swag.IsZero(m.NodesAdded[i]) { // not required + return nil + } + if err := m.NodesAdded[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("nodes-added" + "." + strconv.Itoa(i)) @@ -148,6 +153,11 @@ func (m *ClusterNodeStatus) contextValidateNodesRemoved(ctx context.Context, for for i := 0; i < len(m.NodesRemoved); i++ { if m.NodesRemoved[i] != nil { + + if swag.IsZero(m.NodesRemoved[i]) { // not required + return nil + } + if err := m.NodesRemoved[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("nodes-removed" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/cluster_nodes_response.go b/vendor/github.com/cilium/cilium/api/v1/models/cluster_nodes_response.go index 7acf26fab0..232abceb39 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/cluster_nodes_response.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/cluster_nodes_response.go @@ -88,6 +88,11 @@ func (m *ClusterNodesResponse) contextValidateNodes(ctx context.Context, formats for i := 0; i < len(m.Nodes); i++ { if m.Nodes[i] != nil { + + if swag.IsZero(m.Nodes[i]) { // not required + return nil + } + if err := m.Nodes[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("nodes" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/cluster_status.go b/vendor/github.com/cilium/cilium/api/v1/models/cluster_status.go index edac3d8110..6f1ca97cff 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/cluster_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/cluster_status.go @@ -118,6 +118,11 @@ func (m *ClusterStatus) ContextValidate(ctx context.Context, formats strfmt.Regi func (m *ClusterStatus) contextValidateCiliumHealth(ctx context.Context, formats strfmt.Registry) error { if m.CiliumHealth != nil { + + if swag.IsZero(m.CiliumHealth) { // not required + return nil + } + if err := m.CiliumHealth.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ciliumHealth") @@ -136,6 +141,11 @@ func (m *ClusterStatus) contextValidateNodes(ctx context.Context, formats strfmt for i := 0; i < len(m.Nodes); i++ { if m.Nodes[i] != nil { + + if swag.IsZero(m.Nodes[i]) { // not required + return nil + } + if err := m.Nodes[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("nodes" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/controller_status.go b/vendor/github.com/cilium/cilium/api/v1/models/controller_status.go index 565da6f4a8..2b591bd3e4 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/controller_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/controller_status.go @@ -131,6 +131,11 @@ func (m *ControllerStatus) ContextValidate(ctx context.Context, formats strfmt.R func (m *ControllerStatus) contextValidateConfiguration(ctx context.Context, formats strfmt.Registry) error { if m.Configuration != nil { + + if swag.IsZero(m.Configuration) { // not required + return nil + } + if err := m.Configuration.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("configuration") @@ -147,6 +152,11 @@ func (m *ControllerStatus) contextValidateConfiguration(ctx context.Context, for func (m *ControllerStatus) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + if err := m.Status.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/controller_statuses.go b/vendor/github.com/cilium/cilium/api/v1/models/controller_statuses.go index cd482b70e4..3b02a21622 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/controller_statuses.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/controller_statuses.go @@ -57,6 +57,11 @@ func (m ControllerStatuses) ContextValidate(ctx context.Context, formats strfmt. for i := 0; i < len(m); i++ { if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + if err := m[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/daemon_configuration.go b/vendor/github.com/cilium/cilium/api/v1/models/daemon_configuration.go index 5c004dcf58..b7e5cf1959 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/daemon_configuration.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/daemon_configuration.go @@ -108,6 +108,11 @@ func (m *DaemonConfiguration) ContextValidate(ctx context.Context, formats strfm func (m *DaemonConfiguration) contextValidateSpec(ctx context.Context, formats strfmt.Registry) error { if m.Spec != nil { + + if swag.IsZero(m.Spec) { // not required + return nil + } + if err := m.Spec.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("spec") @@ -124,6 +129,11 @@ func (m *DaemonConfiguration) contextValidateSpec(ctx context.Context, formats s func (m *DaemonConfiguration) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + if err := m.Status.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/daemon_configuration_spec.go b/vendor/github.com/cilium/cilium/api/v1/models/daemon_configuration_spec.go index d44a5481b5..1cd8b1e9b6 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/daemon_configuration_spec.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/daemon_configuration_spec.go @@ -129,6 +129,10 @@ func (m *DaemonConfigurationSpec) ContextValidate(ctx context.Context, formats s func (m *DaemonConfigurationSpec) contextValidateOptions(ctx context.Context, formats strfmt.Registry) error { + if swag.IsZero(m.Options) { // not required + return nil + } + if err := m.Options.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("options") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/daemon_configuration_status.go b/vendor/github.com/cilium/cilium/api/v1/models/daemon_configuration_status.go index f55612181d..8e6d846c58 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/daemon_configuration_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/daemon_configuration_status.go @@ -291,6 +291,11 @@ func (m *DaemonConfigurationStatus) ContextValidate(ctx context.Context, formats func (m *DaemonConfigurationStatus) contextValidateAddressing(ctx context.Context, formats strfmt.Registry) error { if m.Addressing != nil { + + if swag.IsZero(m.Addressing) { // not required + return nil + } + if err := m.Addressing.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addressing") @@ -306,6 +311,10 @@ func (m *DaemonConfigurationStatus) contextValidateAddressing(ctx context.Contex func (m *DaemonConfigurationStatus) contextValidateDatapathMode(ctx context.Context, formats strfmt.Registry) error { + if swag.IsZero(m.DatapathMode) { // not required + return nil + } + if err := m.DatapathMode.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("datapathMode") @@ -320,6 +329,10 @@ func (m *DaemonConfigurationStatus) contextValidateDatapathMode(ctx context.Cont func (m *DaemonConfigurationStatus) contextValidateImmutable(ctx context.Context, formats strfmt.Registry) error { + if swag.IsZero(m.Immutable) { // not required + return nil + } + if err := m.Immutable.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("immutable") @@ -335,6 +348,11 @@ func (m *DaemonConfigurationStatus) contextValidateImmutable(ctx context.Context func (m *DaemonConfigurationStatus) contextValidateKvstoreConfiguration(ctx context.Context, formats strfmt.Registry) error { if m.KvstoreConfiguration != nil { + + if swag.IsZero(m.KvstoreConfiguration) { // not required + return nil + } + if err := m.KvstoreConfiguration.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("kvstoreConfiguration") @@ -351,6 +369,11 @@ func (m *DaemonConfigurationStatus) contextValidateKvstoreConfiguration(ctx cont func (m *DaemonConfigurationStatus) contextValidateMasqueradeProtocols(ctx context.Context, formats strfmt.Registry) error { if m.MasqueradeProtocols != nil { + + if swag.IsZero(m.MasqueradeProtocols) { // not required + return nil + } + if err := m.MasqueradeProtocols.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("masqueradeProtocols") @@ -367,6 +390,11 @@ func (m *DaemonConfigurationStatus) contextValidateMasqueradeProtocols(ctx conte func (m *DaemonConfigurationStatus) contextValidateNodeMonitor(ctx context.Context, formats strfmt.Registry) error { if m.NodeMonitor != nil { + + if swag.IsZero(m.NodeMonitor) { // not required + return nil + } + if err := m.NodeMonitor.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("nodeMonitor") @@ -383,6 +411,11 @@ func (m *DaemonConfigurationStatus) contextValidateNodeMonitor(ctx context.Conte func (m *DaemonConfigurationStatus) contextValidateRealized(ctx context.Context, formats strfmt.Registry) error { if m.Realized != nil { + + if swag.IsZero(m.Realized) { // not required + return nil + } + if err := m.Realized.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("realized") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/debug_info.go b/vendor/github.com/cilium/cilium/api/v1/models/debug_info.go index db539d021d..0504e09c6e 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/debug_info.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/debug_info.go @@ -228,6 +228,11 @@ func (m *DebugInfo) ContextValidate(ctx context.Context, formats strfmt.Registry func (m *DebugInfo) contextValidateCiliumStatus(ctx context.Context, formats strfmt.Registry) error { if m.CiliumStatus != nil { + + if swag.IsZero(m.CiliumStatus) { // not required + return nil + } + if err := m.CiliumStatus.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cilium-status") @@ -244,6 +249,11 @@ func (m *DebugInfo) contextValidateCiliumStatus(ctx context.Context, formats str func (m *DebugInfo) contextValidateEncryption(ctx context.Context, formats strfmt.Registry) error { if m.Encryption != nil { + + if swag.IsZero(m.Encryption) { // not required + return nil + } + if err := m.Encryption.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("encryption") @@ -262,6 +272,11 @@ func (m *DebugInfo) contextValidateEndpointList(ctx context.Context, formats str for i := 0; i < len(m.EndpointList); i++ { if m.EndpointList[i] != nil { + + if swag.IsZero(m.EndpointList[i]) { // not required + return nil + } + if err := m.EndpointList[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("endpoint-list" + "." + strconv.Itoa(i)) @@ -280,6 +295,11 @@ func (m *DebugInfo) contextValidateEndpointList(ctx context.Context, formats str func (m *DebugInfo) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error { if m.Policy != nil { + + if swag.IsZero(m.Policy) { // not required + return nil + } + if err := m.Policy.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("policy") @@ -298,6 +318,11 @@ func (m *DebugInfo) contextValidateServiceList(ctx context.Context, formats strf for i := 0; i < len(m.ServiceList); i++ { if m.ServiceList[i] != nil { + + if swag.IsZero(m.ServiceList[i]) { // not required + return nil + } + if err := m.ServiceList[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("service-list" + "." + strconv.Itoa(i)) @@ -390,6 +415,11 @@ func (m *DebugInfoEncryption) ContextValidate(ctx context.Context, formats strfm func (m *DebugInfoEncryption) contextValidateWireguard(ctx context.Context, formats strfmt.Registry) error { if m.Wireguard != nil { + + if swag.IsZero(m.Wireguard) { // not required + return nil + } + if err := m.Wireguard.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("encryption" + "." + "wireguard") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/encryption_status.go b/vendor/github.com/cilium/cilium/api/v1/models/encryption_status.go index 0cf25f3b8d..1a4fb0b25a 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/encryption_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/encryption_status.go @@ -165,6 +165,11 @@ func (m *EncryptionStatus) ContextValidate(ctx context.Context, formats strfmt.R func (m *EncryptionStatus) contextValidateIpsec(ctx context.Context, formats strfmt.Registry) error { if m.Ipsec != nil { + + if swag.IsZero(m.Ipsec) { // not required + return nil + } + if err := m.Ipsec.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipsec") @@ -181,6 +186,11 @@ func (m *EncryptionStatus) contextValidateIpsec(ctx context.Context, formats str func (m *EncryptionStatus) contextValidateWireguard(ctx context.Context, formats strfmt.Registry) error { if m.Wireguard != nil { + + if swag.IsZero(m.Wireguard) { // not required + return nil + } + if err := m.Wireguard.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("wireguard") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/endpoint.go b/vendor/github.com/cilium/cilium/api/v1/models/endpoint.go index 4773733214..cb9a7e943e 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/endpoint.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/endpoint.go @@ -108,6 +108,11 @@ func (m *Endpoint) ContextValidate(ctx context.Context, formats strfmt.Registry) func (m *Endpoint) contextValidateSpec(ctx context.Context, formats strfmt.Registry) error { if m.Spec != nil { + + if swag.IsZero(m.Spec) { // not required + return nil + } + if err := m.Spec.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("spec") @@ -124,6 +129,11 @@ func (m *Endpoint) contextValidateSpec(ctx context.Context, formats strfmt.Regis func (m *Endpoint) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + if err := m.Status.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_change_request.go b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_change_request.go index 6d1edfa593..4b516cb128 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_change_request.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_change_request.go @@ -225,6 +225,11 @@ func (m *EndpointChangeRequest) ContextValidate(ctx context.Context, formats str func (m *EndpointChangeRequest) contextValidateAddressing(ctx context.Context, formats strfmt.Registry) error { if m.Addressing != nil { + + if swag.IsZero(m.Addressing) { // not required + return nil + } + if err := m.Addressing.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addressing") @@ -241,6 +246,11 @@ func (m *EndpointChangeRequest) contextValidateAddressing(ctx context.Context, f func (m *EndpointChangeRequest) contextValidateDatapathConfiguration(ctx context.Context, formats strfmt.Registry) error { if m.DatapathConfiguration != nil { + + if swag.IsZero(m.DatapathConfiguration) { // not required + return nil + } + if err := m.DatapathConfiguration.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("datapath-configuration") @@ -271,6 +281,7 @@ func (m *EndpointChangeRequest) contextValidateLabels(ctx context.Context, forma func (m *EndpointChangeRequest) contextValidateState(ctx context.Context, formats strfmt.Registry) error { if m.State != nil { + if err := m.State.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("state") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_configuration_spec.go b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_configuration_spec.go index 6c6a75c9c9..2032d7f26f 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_configuration_spec.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_configuration_spec.go @@ -105,6 +105,11 @@ func (m *EndpointConfigurationSpec) ContextValidate(ctx context.Context, formats func (m *EndpointConfigurationSpec) contextValidateLabelConfiguration(ctx context.Context, formats strfmt.Registry) error { if m.LabelConfiguration != nil { + + if swag.IsZero(m.LabelConfiguration) { // not required + return nil + } + if err := m.LabelConfiguration.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("label-configuration") @@ -120,6 +125,10 @@ func (m *EndpointConfigurationSpec) contextValidateLabelConfiguration(ctx contex func (m *EndpointConfigurationSpec) contextValidateOptions(ctx context.Context, formats strfmt.Registry) error { + if swag.IsZero(m.Options) { // not required + return nil + } + if err := m.Options.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("options") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_configuration_status.go b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_configuration_status.go index de4a9e8301..36b077465a 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_configuration_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_configuration_status.go @@ -132,6 +132,10 @@ func (m *EndpointConfigurationStatus) ContextValidate(ctx context.Context, forma func (m *EndpointConfigurationStatus) contextValidateError(ctx context.Context, formats strfmt.Registry) error { + if swag.IsZero(m.Error) { // not required + return nil + } + if err := m.Error.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("error") @@ -146,6 +150,10 @@ func (m *EndpointConfigurationStatus) contextValidateError(ctx context.Context, func (m *EndpointConfigurationStatus) contextValidateImmutable(ctx context.Context, formats strfmt.Registry) error { + if swag.IsZero(m.Immutable) { // not required + return nil + } + if err := m.Immutable.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("immutable") @@ -161,6 +169,11 @@ func (m *EndpointConfigurationStatus) contextValidateImmutable(ctx context.Conte func (m *EndpointConfigurationStatus) contextValidateRealized(ctx context.Context, formats strfmt.Registry) error { if m.Realized != nil { + + if swag.IsZero(m.Realized) { // not required + return nil + } + if err := m.Realized.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("realized") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_health.go b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_health.go index 1aa10adbd6..8eda1e5dfd 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_health.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_health.go @@ -133,6 +133,10 @@ func (m *EndpointHealth) ContextValidate(ctx context.Context, formats strfmt.Reg func (m *EndpointHealth) contextValidateBpf(ctx context.Context, formats strfmt.Registry) error { + if swag.IsZero(m.Bpf) { // not required + return nil + } + if err := m.Bpf.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("bpf") @@ -147,6 +151,10 @@ func (m *EndpointHealth) contextValidateBpf(ctx context.Context, formats strfmt. func (m *EndpointHealth) contextValidateOverallHealth(ctx context.Context, formats strfmt.Registry) error { + if swag.IsZero(m.OverallHealth) { // not required + return nil + } + if err := m.OverallHealth.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("overallHealth") @@ -161,6 +169,10 @@ func (m *EndpointHealth) contextValidateOverallHealth(ctx context.Context, forma func (m *EndpointHealth) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error { + if swag.IsZero(m.Policy) { // not required + return nil + } + if err := m.Policy.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("policy") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_networking.go b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_networking.go index 893edd3019..1335ab47f0 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_networking.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_networking.go @@ -130,6 +130,11 @@ func (m *EndpointNetworking) contextValidateAddressing(ctx context.Context, form for i := 0; i < len(m.Addressing); i++ { if m.Addressing[i] != nil { + + if swag.IsZero(m.Addressing[i]) { // not required + return nil + } + if err := m.Addressing[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("addressing" + "." + strconv.Itoa(i)) @@ -148,6 +153,11 @@ func (m *EndpointNetworking) contextValidateAddressing(ctx context.Context, form func (m *EndpointNetworking) contextValidateHostAddressing(ctx context.Context, formats strfmt.Registry) error { if m.HostAddressing != nil { + + if swag.IsZero(m.HostAddressing) { // not required + return nil + } + if err := m.HostAddressing.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("host-addressing") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_policy.go b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_policy.go index 53e36f9729..5f6150600a 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_policy.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_policy.go @@ -160,6 +160,11 @@ func (m *EndpointPolicy) ContextValidate(ctx context.Context, formats strfmt.Reg func (m *EndpointPolicy) contextValidateCidrPolicy(ctx context.Context, formats strfmt.Registry) error { if m.CidrPolicy != nil { + + if swag.IsZero(m.CidrPolicy) { // not required + return nil + } + if err := m.CidrPolicy.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cidr-policy") @@ -176,6 +181,11 @@ func (m *EndpointPolicy) contextValidateCidrPolicy(ctx context.Context, formats func (m *EndpointPolicy) contextValidateL4(ctx context.Context, formats strfmt.Registry) error { if m.L4 != nil { + + if swag.IsZero(m.L4) { // not required + return nil + } + if err := m.L4.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("l4") @@ -191,6 +201,10 @@ func (m *EndpointPolicy) contextValidateL4(ctx context.Context, formats strfmt.R func (m *EndpointPolicy) contextValidatePolicyEnabled(ctx context.Context, formats strfmt.Registry) error { + if swag.IsZero(m.PolicyEnabled) { // not required + return nil + } + if err := m.PolicyEnabled.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("policy-enabled") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_policy_status.go b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_policy_status.go index 70341a30ed..d4a8b179af 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_policy_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_policy_status.go @@ -148,6 +148,11 @@ func (m *EndpointPolicyStatus) contextValidateProxyStatistics(ctx context.Contex for i := 0; i < len(m.ProxyStatistics); i++ { if m.ProxyStatistics[i] != nil { + + if swag.IsZero(m.ProxyStatistics[i]) { // not required + return nil + } + if err := m.ProxyStatistics[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("proxy-statistics" + "." + strconv.Itoa(i)) @@ -166,6 +171,11 @@ func (m *EndpointPolicyStatus) contextValidateProxyStatistics(ctx context.Contex func (m *EndpointPolicyStatus) contextValidateRealized(ctx context.Context, formats strfmt.Registry) error { if m.Realized != nil { + + if swag.IsZero(m.Realized) { // not required + return nil + } + if err := m.Realized.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("realized") @@ -182,6 +192,11 @@ func (m *EndpointPolicyStatus) contextValidateRealized(ctx context.Context, form func (m *EndpointPolicyStatus) contextValidateSpec(ctx context.Context, formats strfmt.Registry) error { if m.Spec != nil { + + if swag.IsZero(m.Spec) { // not required + return nil + } + if err := m.Spec.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("spec") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_status.go b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_status.go index 546a7f2445..8ff62e19ae 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_status.go @@ -390,6 +390,11 @@ func (m *EndpointStatus) contextValidateControllers(ctx context.Context, formats func (m *EndpointStatus) contextValidateExternalIdentifiers(ctx context.Context, formats strfmt.Registry) error { if m.ExternalIdentifiers != nil { + + if swag.IsZero(m.ExternalIdentifiers) { // not required + return nil + } + if err := m.ExternalIdentifiers.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("external-identifiers") @@ -406,6 +411,11 @@ func (m *EndpointStatus) contextValidateExternalIdentifiers(ctx context.Context, func (m *EndpointStatus) contextValidateHealth(ctx context.Context, formats strfmt.Registry) error { if m.Health != nil { + + if swag.IsZero(m.Health) { // not required + return nil + } + if err := m.Health.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("health") @@ -422,6 +432,11 @@ func (m *EndpointStatus) contextValidateHealth(ctx context.Context, formats strf func (m *EndpointStatus) contextValidateIdentity(ctx context.Context, formats strfmt.Registry) error { if m.Identity != nil { + + if swag.IsZero(m.Identity) { // not required + return nil + } + if err := m.Identity.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("identity") @@ -438,6 +453,11 @@ func (m *EndpointStatus) contextValidateIdentity(ctx context.Context, formats st func (m *EndpointStatus) contextValidateLabels(ctx context.Context, formats strfmt.Registry) error { if m.Labels != nil { + + if swag.IsZero(m.Labels) { // not required + return nil + } + if err := m.Labels.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("labels") @@ -482,6 +502,11 @@ func (m *EndpointStatus) contextValidateNamedPorts(ctx context.Context, formats func (m *EndpointStatus) contextValidateNetworking(ctx context.Context, formats strfmt.Registry) error { if m.Networking != nil { + + if swag.IsZero(m.Networking) { // not required + return nil + } + if err := m.Networking.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("networking") @@ -498,6 +523,11 @@ func (m *EndpointStatus) contextValidateNetworking(ctx context.Context, formats func (m *EndpointStatus) contextValidatePolicy(ctx context.Context, formats strfmt.Registry) error { if m.Policy != nil { + + if swag.IsZero(m.Policy) { // not required + return nil + } + if err := m.Policy.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("policy") @@ -514,6 +544,11 @@ func (m *EndpointStatus) contextValidatePolicy(ctx context.Context, formats strf func (m *EndpointStatus) contextValidateRealized(ctx context.Context, formats strfmt.Registry) error { if m.Realized != nil { + + if swag.IsZero(m.Realized) { // not required + return nil + } + if err := m.Realized.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("realized") @@ -530,6 +565,7 @@ func (m *EndpointStatus) contextValidateRealized(ctx context.Context, formats st func (m *EndpointStatus) contextValidateState(ctx context.Context, formats strfmt.Registry) error { if m.State != nil { + if err := m.State.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("state") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_status_change.go b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_status_change.go index e347f28896..783f39dcb3 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_status_change.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_status_change.go @@ -132,6 +132,10 @@ func (m *EndpointStatusChange) ContextValidate(ctx context.Context, formats strf func (m *EndpointStatusChange) contextValidateState(ctx context.Context, formats strfmt.Registry) error { + if swag.IsZero(m.State) { // not required + return nil + } + if err := m.State.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("state") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_status_log.go b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_status_log.go index de32548bd6..a6ba5d38c5 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/endpoint_status_log.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/endpoint_status_log.go @@ -57,6 +57,11 @@ func (m EndpointStatusLog) ContextValidate(ctx context.Context, formats strfmt.R for i := 0; i < len(m); i++ { if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + if err := m[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/frontend_mapping.go b/vendor/github.com/cilium/cilium/api/v1/models/frontend_mapping.go index ac26d0c444..7bab4735a4 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/frontend_mapping.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/frontend_mapping.go @@ -115,6 +115,11 @@ func (m *FrontendMapping) contextValidateBackends(ctx context.Context, formats s for i := 0; i < len(m.Backends); i++ { if m.Backends[i] != nil { + + if swag.IsZero(m.Backends[i]) { // not required + return nil + } + if err := m.Backends[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("backends" + "." + strconv.Itoa(i)) @@ -133,6 +138,11 @@ func (m *FrontendMapping) contextValidateBackends(ctx context.Context, formats s func (m *FrontendMapping) contextValidateFrontendAddress(ctx context.Context, formats strfmt.Registry) error { if m.FrontendAddress != nil { + + if swag.IsZero(m.FrontendAddress) { // not required + return nil + } + if err := m.FrontendAddress.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("frontend-address") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/hubble_status.go b/vendor/github.com/cilium/cilium/api/v1/models/hubble_status.go index 49754f9995..065c3e2d1b 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/hubble_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/hubble_status.go @@ -168,6 +168,11 @@ func (m *HubbleStatus) ContextValidate(ctx context.Context, formats strfmt.Regis func (m *HubbleStatus) contextValidateMetrics(ctx context.Context, formats strfmt.Registry) error { if m.Metrics != nil { + + if swag.IsZero(m.Metrics) { // not required + return nil + } + if err := m.Metrics.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("metrics") @@ -184,6 +189,11 @@ func (m *HubbleStatus) contextValidateMetrics(ctx context.Context, formats strfm func (m *HubbleStatus) contextValidateObserver(ctx context.Context, formats strfmt.Registry) error { if m.Observer != nil { + + if swag.IsZero(m.Observer) { // not required + return nil + } + if err := m.Observer.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("observer") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/identity_endpoints.go b/vendor/github.com/cilium/cilium/api/v1/models/identity_endpoints.go index 438f443ff8..1a2a94b33b 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/identity_endpoints.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/identity_endpoints.go @@ -78,6 +78,11 @@ func (m *IdentityEndpoints) ContextValidate(ctx context.Context, formats strfmt. func (m *IdentityEndpoints) contextValidateIdentity(ctx context.Context, formats strfmt.Registry) error { if m.Identity != nil { + + if swag.IsZero(m.Identity) { // not required + return nil + } + if err := m.Identity.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("identity") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/ip_a_m_response.go b/vendor/github.com/cilium/cilium/api/v1/models/ip_a_m_response.go index bf08751d56..25c729cac7 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/ip_a_m_response.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/ip_a_m_response.go @@ -170,6 +170,7 @@ func (m *IPAMResponse) ContextValidate(ctx context.Context, formats strfmt.Regis func (m *IPAMResponse) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { if m.Address != nil { + if err := m.Address.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("address") @@ -186,6 +187,7 @@ func (m *IPAMResponse) contextValidateAddress(ctx context.Context, formats strfm func (m *IPAMResponse) contextValidateHostAddressing(ctx context.Context, formats strfmt.Registry) error { if m.HostAddressing != nil { + if err := m.HostAddressing.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("host-addressing") @@ -202,6 +204,11 @@ func (m *IPAMResponse) contextValidateHostAddressing(ctx context.Context, format func (m *IPAMResponse) contextValidateIPV4(ctx context.Context, formats strfmt.Registry) error { if m.IPV4 != nil { + + if swag.IsZero(m.IPV4) { // not required + return nil + } + if err := m.IPV4.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipv4") @@ -218,6 +225,11 @@ func (m *IPAMResponse) contextValidateIPV4(ctx context.Context, formats strfmt.R func (m *IPAMResponse) contextValidateIPV6(ctx context.Context, formats strfmt.Registry) error { if m.IPV6 != nil { + + if swag.IsZero(m.IPV6) { // not required + return nil + } + if err := m.IPV6.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipv6") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/ip_a_m_status.go b/vendor/github.com/cilium/cilium/api/v1/models/ip_a_m_status.go index 0ae76cf6a0..a50f03c718 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/ip_a_m_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/ip_a_m_status.go @@ -85,6 +85,10 @@ func (m *IPAMStatus) ContextValidate(ctx context.Context, formats strfmt.Registr func (m *IPAMStatus) contextValidateAllocations(ctx context.Context, formats strfmt.Registry) error { + if swag.IsZero(m.Allocations) { // not required + return nil + } + if err := m.Allocations.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("allocations") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/ip_list_entry.go b/vendor/github.com/cilium/cilium/api/v1/models/ip_list_entry.go index 55def940ff..df8a2009cf 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/ip_list_entry.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/ip_list_entry.go @@ -116,6 +116,11 @@ func (m *IPListEntry) ContextValidate(ctx context.Context, formats strfmt.Regist func (m *IPListEntry) contextValidateMetadata(ctx context.Context, formats strfmt.Registry) error { if m.Metadata != nil { + + if swag.IsZero(m.Metadata) { // not required + return nil + } + if err := m.Metadata.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("metadata") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/kube_proxy_replacement.go b/vendor/github.com/cilium/cilium/api/v1/models/kube_proxy_replacement.go index cf6416cd78..0af3b6134e 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/kube_proxy_replacement.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/kube_proxy_replacement.go @@ -177,6 +177,11 @@ func (m *KubeProxyReplacement) contextValidateDeviceList(ctx context.Context, fo for i := 0; i < len(m.DeviceList); i++ { if m.DeviceList[i] != nil { + + if swag.IsZero(m.DeviceList[i]) { // not required + return nil + } + if err := m.DeviceList[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("deviceList" + "." + strconv.Itoa(i)) @@ -195,6 +200,11 @@ func (m *KubeProxyReplacement) contextValidateDeviceList(ctx context.Context, fo func (m *KubeProxyReplacement) contextValidateFeatures(ctx context.Context, formats strfmt.Registry) error { if m.Features != nil { + + if swag.IsZero(m.Features) { // not required + return nil + } + if err := m.Features.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("features") @@ -574,6 +584,11 @@ func (m *KubeProxyReplacementFeatures) ContextValidate(ctx context.Context, form func (m *KubeProxyReplacementFeatures) contextValidateExternalIPs(ctx context.Context, formats strfmt.Registry) error { if m.ExternalIPs != nil { + + if swag.IsZero(m.ExternalIPs) { // not required + return nil + } + if err := m.ExternalIPs.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("features" + "." + "externalIPs") @@ -590,6 +605,11 @@ func (m *KubeProxyReplacementFeatures) contextValidateExternalIPs(ctx context.Co func (m *KubeProxyReplacementFeatures) contextValidateGracefulTermination(ctx context.Context, formats strfmt.Registry) error { if m.GracefulTermination != nil { + + if swag.IsZero(m.GracefulTermination) { // not required + return nil + } + if err := m.GracefulTermination.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("features" + "." + "gracefulTermination") @@ -606,6 +626,11 @@ func (m *KubeProxyReplacementFeatures) contextValidateGracefulTermination(ctx co func (m *KubeProxyReplacementFeatures) contextValidateHostPort(ctx context.Context, formats strfmt.Registry) error { if m.HostPort != nil { + + if swag.IsZero(m.HostPort) { // not required + return nil + } + if err := m.HostPort.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("features" + "." + "hostPort") @@ -622,6 +647,11 @@ func (m *KubeProxyReplacementFeatures) contextValidateHostPort(ctx context.Conte func (m *KubeProxyReplacementFeatures) contextValidateHostReachableServices(ctx context.Context, formats strfmt.Registry) error { if m.HostReachableServices != nil { + + if swag.IsZero(m.HostReachableServices) { // not required + return nil + } + if err := m.HostReachableServices.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("features" + "." + "hostReachableServices") @@ -638,6 +668,11 @@ func (m *KubeProxyReplacementFeatures) contextValidateHostReachableServices(ctx func (m *KubeProxyReplacementFeatures) contextValidateNat46X64(ctx context.Context, formats strfmt.Registry) error { if m.Nat46X64 != nil { + + if swag.IsZero(m.Nat46X64) { // not required + return nil + } + if err := m.Nat46X64.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("features" + "." + "nat46X64") @@ -654,6 +689,11 @@ func (m *KubeProxyReplacementFeatures) contextValidateNat46X64(ctx context.Conte func (m *KubeProxyReplacementFeatures) contextValidateNodePort(ctx context.Context, formats strfmt.Registry) error { if m.NodePort != nil { + + if swag.IsZero(m.NodePort) { // not required + return nil + } + if err := m.NodePort.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("features" + "." + "nodePort") @@ -670,6 +710,11 @@ func (m *KubeProxyReplacementFeatures) contextValidateNodePort(ctx context.Conte func (m *KubeProxyReplacementFeatures) contextValidateSessionAffinity(ctx context.Context, formats strfmt.Registry) error { if m.SessionAffinity != nil { + + if swag.IsZero(m.SessionAffinity) { // not required + return nil + } + if err := m.SessionAffinity.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("features" + "." + "sessionAffinity") @@ -686,6 +731,11 @@ func (m *KubeProxyReplacementFeatures) contextValidateSessionAffinity(ctx contex func (m *KubeProxyReplacementFeatures) contextValidateSocketLB(ctx context.Context, formats strfmt.Registry) error { if m.SocketLB != nil { + + if swag.IsZero(m.SocketLB) { // not required + return nil + } + if err := m.SocketLB.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("features" + "." + "socketLB") @@ -702,6 +752,11 @@ func (m *KubeProxyReplacementFeatures) contextValidateSocketLB(ctx context.Conte func (m *KubeProxyReplacementFeatures) contextValidateSocketLBTracing(ctx context.Context, formats strfmt.Registry) error { if m.SocketLBTracing != nil { + + if swag.IsZero(m.SocketLBTracing) { // not required + return nil + } + if err := m.SocketLBTracing.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("features" + "." + "socketLBTracing") @@ -986,6 +1041,11 @@ func (m *KubeProxyReplacementFeaturesNat46X64) ContextValidate(ctx context.Conte func (m *KubeProxyReplacementFeaturesNat46X64) contextValidateGateway(ctx context.Context, formats strfmt.Registry) error { if m.Gateway != nil { + + if swag.IsZero(m.Gateway) { // not required + return nil + } + if err := m.Gateway.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("features" + "." + "nat46X64" + "." + "gateway") @@ -1002,6 +1062,11 @@ func (m *KubeProxyReplacementFeaturesNat46X64) contextValidateGateway(ctx contex func (m *KubeProxyReplacementFeaturesNat46X64) contextValidateService(ctx context.Context, formats strfmt.Registry) error { if m.Service != nil { + + if swag.IsZero(m.Service) { // not required + return nil + } + if err := m.Service.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("features" + "." + "nat46X64" + "." + "service") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/l4_policy.go b/vendor/github.com/cilium/cilium/api/v1/models/l4_policy.go index 12b837d84a..b6c4c198b1 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/l4_policy.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/l4_policy.go @@ -124,6 +124,11 @@ func (m *L4Policy) contextValidateEgress(ctx context.Context, formats strfmt.Reg for i := 0; i < len(m.Egress); i++ { if m.Egress[i] != nil { + + if swag.IsZero(m.Egress[i]) { // not required + return nil + } + if err := m.Egress[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("egress" + "." + strconv.Itoa(i)) @@ -144,6 +149,11 @@ func (m *L4Policy) contextValidateIngress(ctx context.Context, formats strfmt.Re for i := 0; i < len(m.Ingress); i++ { if m.Ingress[i] != nil { + + if swag.IsZero(m.Ingress[i]) { // not required + return nil + } + if err := m.Ingress[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ingress" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/l_r_p_backend.go b/vendor/github.com/cilium/cilium/api/v1/models/l_r_p_backend.go index 3e844fefa2..5603f5191d 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/l_r_p_backend.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/l_r_p_backend.go @@ -78,6 +78,11 @@ func (m *LRPBackend) ContextValidate(ctx context.Context, formats strfmt.Registr func (m *LRPBackend) contextValidateBackendAddress(ctx context.Context, formats strfmt.Registry) error { if m.BackendAddress != nil { + + if swag.IsZero(m.BackendAddress) { // not required + return nil + } + if err := m.BackendAddress.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("backend-address") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/l_r_p_spec.go b/vendor/github.com/cilium/cilium/api/v1/models/l_r_p_spec.go index 8d65810342..99a5387c46 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/l_r_p_spec.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/l_r_p_spec.go @@ -103,6 +103,11 @@ func (m *LRPSpec) contextValidateFrontendMappings(ctx context.Context, formats s for i := 0; i < len(m.FrontendMappings); i++ { if m.FrontendMappings[i] != nil { + + if swag.IsZero(m.FrontendMappings[i]) { // not required + return nil + } + if err := m.FrontendMappings[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("frontend-mappings" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/label_array.go b/vendor/github.com/cilium/cilium/api/v1/models/label_array.go index ca052c05f0..120753fdcb 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/label_array.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/label_array.go @@ -57,6 +57,11 @@ func (m LabelArray) ContextValidate(ctx context.Context, formats strfmt.Registry for i := 0; i < len(m); i++ { if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + if err := m[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/label_configuration.go b/vendor/github.com/cilium/cilium/api/v1/models/label_configuration.go index 7ca55a2233..f90386596a 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/label_configuration.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/label_configuration.go @@ -105,6 +105,11 @@ func (m *LabelConfiguration) ContextValidate(ctx context.Context, formats strfmt func (m *LabelConfiguration) contextValidateSpec(ctx context.Context, formats strfmt.Registry) error { if m.Spec != nil { + + if swag.IsZero(m.Spec) { // not required + return nil + } + if err := m.Spec.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("spec") @@ -121,6 +126,11 @@ func (m *LabelConfiguration) contextValidateSpec(ctx context.Context, formats st func (m *LabelConfiguration) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + if err := m.Status.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/label_configuration_status.go b/vendor/github.com/cilium/cilium/api/v1/models/label_configuration_status.go index b89fb4df09..07a199787f 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/label_configuration_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/label_configuration_status.go @@ -187,6 +187,11 @@ func (m *LabelConfigurationStatus) contextValidateDisabled(ctx context.Context, func (m *LabelConfigurationStatus) contextValidateRealized(ctx context.Context, formats strfmt.Registry) error { if m.Realized != nil { + + if swag.IsZero(m.Realized) { // not required + return nil + } + if err := m.Realized.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("realized") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/masquerading.go b/vendor/github.com/cilium/cilium/api/v1/models/masquerading.go index 80395c5b2b..def5d72581 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/masquerading.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/masquerading.go @@ -147,6 +147,11 @@ func (m *Masquerading) ContextValidate(ctx context.Context, formats strfmt.Regis func (m *Masquerading) contextValidateEnabledProtocols(ctx context.Context, formats strfmt.Registry) error { if m.EnabledProtocols != nil { + + if swag.IsZero(m.EnabledProtocols) { // not required + return nil + } + if err := m.EnabledProtocols.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("enabledProtocols") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/modules_health.go b/vendor/github.com/cilium/cilium/api/v1/models/modules_health.go index de7d224a1b..2c40c5cd03 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/modules_health.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/modules_health.go @@ -85,6 +85,11 @@ func (m *ModulesHealth) contextValidateModules(ctx context.Context, formats strf for i := 0; i < len(m.Modules); i++ { if m.Modules[i] != nil { + + if swag.IsZero(m.Modules[i]) { // not required + return nil + } + if err := m.Modules[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("modules" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/name_manager.go b/vendor/github.com/cilium/cilium/api/v1/models/name_manager.go index 3140d01d13..0a1fbfb34d 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/name_manager.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/name_manager.go @@ -88,6 +88,11 @@ func (m *NameManager) contextValidateFQDNPolicySelectors(ctx context.Context, fo for i := 0; i < len(m.FQDNPolicySelectors); i++ { if m.FQDNPolicySelectors[i] != nil { + + if swag.IsZero(m.FQDNPolicySelectors[i]) { // not required + return nil + } + if err := m.FQDNPolicySelectors[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("FQDNPolicySelectors" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/named_ports.go b/vendor/github.com/cilium/cilium/api/v1/models/named_ports.go index 89df87409b..7a22f0f08e 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/named_ports.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/named_ports.go @@ -61,6 +61,11 @@ func (m NamedPorts) ContextValidate(ctx context.Context, formats strfmt.Registry for i := 0; i < len(m); i++ { if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + if err := m[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/node_addressing.go b/vendor/github.com/cilium/cilium/api/v1/models/node_addressing.go index 1dc57a4ede..5c10e4e92a 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/node_addressing.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/node_addressing.go @@ -107,6 +107,11 @@ func (m *NodeAddressing) ContextValidate(ctx context.Context, formats strfmt.Reg func (m *NodeAddressing) contextValidateIPV4(ctx context.Context, formats strfmt.Registry) error { if m.IPV4 != nil { + + if swag.IsZero(m.IPV4) { // not required + return nil + } + if err := m.IPV4.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipv4") @@ -123,6 +128,11 @@ func (m *NodeAddressing) contextValidateIPV4(ctx context.Context, formats strfmt func (m *NodeAddressing) contextValidateIPV6(ctx context.Context, formats strfmt.Registry) error { if m.IPV6 != nil { + + if swag.IsZero(m.IPV6) { // not required + return nil + } + if err := m.IPV6.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipv6") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/node_element.go b/vendor/github.com/cilium/cilium/api/v1/models/node_element.go index 7f0ce2c6be..c4ccfb7e7a 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/node_element.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/node_element.go @@ -183,6 +183,11 @@ func (m *NodeElement) ContextValidate(ctx context.Context, formats strfmt.Regist func (m *NodeElement) contextValidateHealthEndpointAddress(ctx context.Context, formats strfmt.Registry) error { if m.HealthEndpointAddress != nil { + + if swag.IsZero(m.HealthEndpointAddress) { // not required + return nil + } + if err := m.HealthEndpointAddress.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("health-endpoint-address") @@ -199,6 +204,11 @@ func (m *NodeElement) contextValidateHealthEndpointAddress(ctx context.Context, func (m *NodeElement) contextValidateIngressAddress(ctx context.Context, formats strfmt.Registry) error { if m.IngressAddress != nil { + + if swag.IsZero(m.IngressAddress) { // not required + return nil + } + if err := m.IngressAddress.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ingress-address") @@ -215,6 +225,11 @@ func (m *NodeElement) contextValidateIngressAddress(ctx context.Context, formats func (m *NodeElement) contextValidatePrimaryAddress(ctx context.Context, formats strfmt.Registry) error { if m.PrimaryAddress != nil { + + if swag.IsZero(m.PrimaryAddress) { // not required + return nil + } + if err := m.PrimaryAddress.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("primary-address") @@ -233,6 +248,11 @@ func (m *NodeElement) contextValidateSecondaryAddresses(ctx context.Context, for for i := 0; i < len(m.SecondaryAddresses); i++ { if m.SecondaryAddresses[i] != nil { + + if swag.IsZero(m.SecondaryAddresses[i]) { // not required + return nil + } + if err := m.SecondaryAddresses[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("secondary-addresses" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/prefilter.go b/vendor/github.com/cilium/cilium/api/v1/models/prefilter.go index dac7fbcbac..6488a18c55 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/prefilter.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/prefilter.go @@ -105,6 +105,11 @@ func (m *Prefilter) ContextValidate(ctx context.Context, formats strfmt.Registry func (m *Prefilter) contextValidateSpec(ctx context.Context, formats strfmt.Registry) error { if m.Spec != nil { + + if swag.IsZero(m.Spec) { // not required + return nil + } + if err := m.Spec.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("spec") @@ -121,6 +126,11 @@ func (m *Prefilter) contextValidateSpec(ctx context.Context, formats strfmt.Regi func (m *Prefilter) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + if err := m.Status.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/prefilter_status.go b/vendor/github.com/cilium/cilium/api/v1/models/prefilter_status.go index 1f285a343d..b64c33e63b 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/prefilter_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/prefilter_status.go @@ -75,6 +75,11 @@ func (m *PrefilterStatus) ContextValidate(ctx context.Context, formats strfmt.Re func (m *PrefilterStatus) contextValidateRealized(ctx context.Context, formats strfmt.Registry) error { if m.Realized != nil { + + if swag.IsZero(m.Realized) { // not required + return nil + } + if err := m.Realized.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("realized") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/proxy_statistics.go b/vendor/github.com/cilium/cilium/api/v1/models/proxy_statistics.go index 98dc9d17ef..bd5b1119b4 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/proxy_statistics.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/proxy_statistics.go @@ -138,6 +138,11 @@ func (m *ProxyStatistics) ContextValidate(ctx context.Context, formats strfmt.Re func (m *ProxyStatistics) contextValidateStatistics(ctx context.Context, formats strfmt.Registry) error { if m.Statistics != nil { + + if swag.IsZero(m.Statistics) { // not required + return nil + } + if err := m.Statistics.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("statistics") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/proxy_status.go b/vendor/github.com/cilium/cilium/api/v1/models/proxy_status.go index d3283687d1..3f37688f44 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/proxy_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/proxy_status.go @@ -151,6 +151,11 @@ func (m *ProxyStatus) contextValidateRedirects(ctx context.Context, formats strf for i := 0; i < len(m.Redirects); i++ { if m.Redirects[i] != nil { + + if swag.IsZero(m.Redirects[i]) { // not required + return nil + } + if err := m.Redirects[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("redirects" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/recorder.go b/vendor/github.com/cilium/cilium/api/v1/models/recorder.go index 36d41dc0ce..4656e9856c 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/recorder.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/recorder.go @@ -105,6 +105,11 @@ func (m *Recorder) ContextValidate(ctx context.Context, formats strfmt.Registry) func (m *Recorder) contextValidateSpec(ctx context.Context, formats strfmt.Registry) error { if m.Spec != nil { + + if swag.IsZero(m.Spec) { // not required + return nil + } + if err := m.Spec.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("spec") @@ -121,6 +126,11 @@ func (m *Recorder) contextValidateSpec(ctx context.Context, formats strfmt.Regis func (m *Recorder) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + if err := m.Status.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/recorder_mask.go b/vendor/github.com/cilium/cilium/api/v1/models/recorder_mask.go index dec0cd20ba..b98d74a95e 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/recorder_mask.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/recorder_mask.go @@ -75,6 +75,11 @@ func (m *RecorderMask) ContextValidate(ctx context.Context, formats strfmt.Regis func (m *RecorderMask) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + if err := m.Status.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/recorder_mask_status.go b/vendor/github.com/cilium/cilium/api/v1/models/recorder_mask_status.go index e79be59f13..1ad4f7422a 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/recorder_mask_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/recorder_mask_status.go @@ -75,6 +75,11 @@ func (m *RecorderMaskStatus) ContextValidate(ctx context.Context, formats strfmt func (m *RecorderMaskStatus) contextValidateRealized(ctx context.Context, formats strfmt.Registry) error { if m.Realized != nil { + + if swag.IsZero(m.Realized) { // not required + return nil + } + if err := m.Realized.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("realized") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/recorder_spec.go b/vendor/github.com/cilium/cilium/api/v1/models/recorder_spec.go index 362ee50e2a..95eb7aead9 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/recorder_spec.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/recorder_spec.go @@ -108,6 +108,11 @@ func (m *RecorderSpec) contextValidateFilters(ctx context.Context, formats strfm for i := 0; i < len(m.Filters); i++ { if m.Filters[i] != nil { + + if swag.IsZero(m.Filters[i]) { // not required + return nil + } + if err := m.Filters[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("filters" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/recorder_status.go b/vendor/github.com/cilium/cilium/api/v1/models/recorder_status.go index 5476b606fd..38749325c7 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/recorder_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/recorder_status.go @@ -75,6 +75,11 @@ func (m *RecorderStatus) ContextValidate(ctx context.Context, formats strfmt.Reg func (m *RecorderStatus) contextValidateRealized(ctx context.Context, formats strfmt.Registry) error { if m.Realized != nil { + + if swag.IsZero(m.Realized) { // not required + return nil + } + if err := m.Realized.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("realized") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/remote_cluster.go b/vendor/github.com/cilium/cilium/api/v1/models/remote_cluster.go index a8d8c2be95..ca73d65567 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/remote_cluster.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/remote_cluster.go @@ -155,6 +155,11 @@ func (m *RemoteCluster) ContextValidate(ctx context.Context, formats strfmt.Regi func (m *RemoteCluster) contextValidateConfig(ctx context.Context, formats strfmt.Registry) error { if m.Config != nil { + + if swag.IsZero(m.Config) { // not required + return nil + } + if err := m.Config.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("config") @@ -171,6 +176,11 @@ func (m *RemoteCluster) contextValidateConfig(ctx context.Context, formats strfm func (m *RemoteCluster) contextValidateSynced(ctx context.Context, formats strfmt.Registry) error { if m.Synced != nil { + + if swag.IsZero(m.Synced) { // not required + return nil + } + if err := m.Synced.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("synced") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/request_response_statistics.go b/vendor/github.com/cilium/cilium/api/v1/models/request_response_statistics.go index 8b3a5574eb..f6d5b96bde 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/request_response_statistics.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/request_response_statistics.go @@ -107,6 +107,11 @@ func (m *RequestResponseStatistics) ContextValidate(ctx context.Context, formats func (m *RequestResponseStatistics) contextValidateRequests(ctx context.Context, formats strfmt.Registry) error { if m.Requests != nil { + + if swag.IsZero(m.Requests) { // not required + return nil + } + if err := m.Requests.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("requests") @@ -123,6 +128,11 @@ func (m *RequestResponseStatistics) contextValidateRequests(ctx context.Context, func (m *RequestResponseStatistics) contextValidateResponses(ctx context.Context, formats strfmt.Registry) error { if m.Responses != nil { + + if swag.IsZero(m.Responses) { // not required + return nil + } + if err := m.Responses.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("responses") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/selector_cache.go b/vendor/github.com/cilium/cilium/api/v1/models/selector_cache.go index 3f941871e5..0fd85f207c 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/selector_cache.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/selector_cache.go @@ -57,6 +57,11 @@ func (m SelectorCache) ContextValidate(ctx context.Context, formats strfmt.Regis for i := 0; i < len(m); i++ { if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + if err := m[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName(strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/service.go b/vendor/github.com/cilium/cilium/api/v1/models/service.go index cef8a924a4..8c38db3fbc 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/service.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/service.go @@ -105,6 +105,11 @@ func (m *Service) ContextValidate(ctx context.Context, formats strfmt.Registry) func (m *Service) contextValidateSpec(ctx context.Context, formats strfmt.Registry) error { if m.Spec != nil { + + if swag.IsZero(m.Spec) { // not required + return nil + } + if err := m.Spec.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("spec") @@ -121,6 +126,11 @@ func (m *Service) contextValidateSpec(ctx context.Context, formats strfmt.Regist func (m *Service) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + if err := m.Status.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/service_spec.go b/vendor/github.com/cilium/cilium/api/v1/models/service_spec.go index eae7726a6a..a7b761aed9 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/service_spec.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/service_spec.go @@ -157,6 +157,11 @@ func (m *ServiceSpec) contextValidateBackendAddresses(ctx context.Context, forma for i := 0; i < len(m.BackendAddresses); i++ { if m.BackendAddresses[i] != nil { + + if swag.IsZero(m.BackendAddresses[i]) { // not required + return nil + } + if err := m.BackendAddresses[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("backend-addresses" + "." + strconv.Itoa(i)) @@ -175,6 +180,11 @@ func (m *ServiceSpec) contextValidateBackendAddresses(ctx context.Context, forma func (m *ServiceSpec) contextValidateFlags(ctx context.Context, formats strfmt.Registry) error { if m.Flags != nil { + + if swag.IsZero(m.Flags) { // not required + return nil + } + if err := m.Flags.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("flags") @@ -191,6 +201,7 @@ func (m *ServiceSpec) contextValidateFlags(ctx context.Context, formats strfmt.R func (m *ServiceSpec) contextValidateFrontendAddress(ctx context.Context, formats strfmt.Registry) error { if m.FrontendAddress != nil { + if err := m.FrontendAddress.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("frontend-address") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/service_status.go b/vendor/github.com/cilium/cilium/api/v1/models/service_status.go index c9bc87b196..32c65f32d5 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/service_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/service_status.go @@ -75,6 +75,11 @@ func (m *ServiceStatus) ContextValidate(ctx context.Context, formats strfmt.Regi func (m *ServiceStatus) contextValidateRealized(ctx context.Context, formats strfmt.Registry) error { if m.Realized != nil { + + if swag.IsZero(m.Realized) { // not required + return nil + } + if err := m.Realized.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("realized") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/status_response.go b/vendor/github.com/cilium/cilium/api/v1/models/status_response.go index 52b18d92f3..198c279d86 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/status_response.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/status_response.go @@ -855,6 +855,11 @@ func (m *StatusResponse) ContextValidate(ctx context.Context, formats strfmt.Reg func (m *StatusResponse) contextValidateAuthCertificateProvider(ctx context.Context, formats strfmt.Registry) error { if m.AuthCertificateProvider != nil { + + if swag.IsZero(m.AuthCertificateProvider) { // not required + return nil + } + if err := m.AuthCertificateProvider.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("auth-certificate-provider") @@ -871,6 +876,11 @@ func (m *StatusResponse) contextValidateAuthCertificateProvider(ctx context.Cont func (m *StatusResponse) contextValidateBandwidthManager(ctx context.Context, formats strfmt.Registry) error { if m.BandwidthManager != nil { + + if swag.IsZero(m.BandwidthManager) { // not required + return nil + } + if err := m.BandwidthManager.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("bandwidth-manager") @@ -887,6 +897,11 @@ func (m *StatusResponse) contextValidateBandwidthManager(ctx context.Context, fo func (m *StatusResponse) contextValidateBpfMaps(ctx context.Context, formats strfmt.Registry) error { if m.BpfMaps != nil { + + if swag.IsZero(m.BpfMaps) { // not required + return nil + } + if err := m.BpfMaps.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("bpf-maps") @@ -903,6 +918,11 @@ func (m *StatusResponse) contextValidateBpfMaps(ctx context.Context, formats str func (m *StatusResponse) contextValidateCilium(ctx context.Context, formats strfmt.Registry) error { if m.Cilium != nil { + + if swag.IsZero(m.Cilium) { // not required + return nil + } + if err := m.Cilium.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cilium") @@ -919,6 +939,11 @@ func (m *StatusResponse) contextValidateCilium(ctx context.Context, formats strf func (m *StatusResponse) contextValidateClockSource(ctx context.Context, formats strfmt.Registry) error { if m.ClockSource != nil { + + if swag.IsZero(m.ClockSource) { // not required + return nil + } + if err := m.ClockSource.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("clock-source") @@ -935,6 +960,11 @@ func (m *StatusResponse) contextValidateClockSource(ctx context.Context, formats func (m *StatusResponse) contextValidateCluster(ctx context.Context, formats strfmt.Registry) error { if m.Cluster != nil { + + if swag.IsZero(m.Cluster) { // not required + return nil + } + if err := m.Cluster.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cluster") @@ -951,6 +981,11 @@ func (m *StatusResponse) contextValidateCluster(ctx context.Context, formats str func (m *StatusResponse) contextValidateClusterMesh(ctx context.Context, formats strfmt.Registry) error { if m.ClusterMesh != nil { + + if swag.IsZero(m.ClusterMesh) { // not required + return nil + } + if err := m.ClusterMesh.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cluster-mesh") @@ -967,6 +1002,11 @@ func (m *StatusResponse) contextValidateClusterMesh(ctx context.Context, formats func (m *StatusResponse) contextValidateCniChaining(ctx context.Context, formats strfmt.Registry) error { if m.CniChaining != nil { + + if swag.IsZero(m.CniChaining) { // not required + return nil + } + if err := m.CniChaining.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cni-chaining") @@ -983,6 +1023,11 @@ func (m *StatusResponse) contextValidateCniChaining(ctx context.Context, formats func (m *StatusResponse) contextValidateCniFile(ctx context.Context, formats strfmt.Registry) error { if m.CniFile != nil { + + if swag.IsZero(m.CniFile) { // not required + return nil + } + if err := m.CniFile.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cni-file") @@ -999,6 +1044,11 @@ func (m *StatusResponse) contextValidateCniFile(ctx context.Context, formats str func (m *StatusResponse) contextValidateContainerRuntime(ctx context.Context, formats strfmt.Registry) error { if m.ContainerRuntime != nil { + + if swag.IsZero(m.ContainerRuntime) { // not required + return nil + } + if err := m.ContainerRuntime.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("container-runtime") @@ -1029,6 +1079,11 @@ func (m *StatusResponse) contextValidateControllers(ctx context.Context, formats func (m *StatusResponse) contextValidateEncryption(ctx context.Context, formats strfmt.Registry) error { if m.Encryption != nil { + + if swag.IsZero(m.Encryption) { // not required + return nil + } + if err := m.Encryption.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("encryption") @@ -1045,6 +1100,11 @@ func (m *StatusResponse) contextValidateEncryption(ctx context.Context, formats func (m *StatusResponse) contextValidateHostFirewall(ctx context.Context, formats strfmt.Registry) error { if m.HostFirewall != nil { + + if swag.IsZero(m.HostFirewall) { // not required + return nil + } + if err := m.HostFirewall.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("host-firewall") @@ -1061,6 +1121,11 @@ func (m *StatusResponse) contextValidateHostFirewall(ctx context.Context, format func (m *StatusResponse) contextValidateHostRouting(ctx context.Context, formats strfmt.Registry) error { if m.HostRouting != nil { + + if swag.IsZero(m.HostRouting) { // not required + return nil + } + if err := m.HostRouting.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("host-routing") @@ -1077,6 +1142,11 @@ func (m *StatusResponse) contextValidateHostRouting(ctx context.Context, formats func (m *StatusResponse) contextValidateHubble(ctx context.Context, formats strfmt.Registry) error { if m.Hubble != nil { + + if swag.IsZero(m.Hubble) { // not required + return nil + } + if err := m.Hubble.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("hubble") @@ -1093,6 +1163,11 @@ func (m *StatusResponse) contextValidateHubble(ctx context.Context, formats strf func (m *StatusResponse) contextValidateIdentityRange(ctx context.Context, formats strfmt.Registry) error { if m.IdentityRange != nil { + + if swag.IsZero(m.IdentityRange) { // not required + return nil + } + if err := m.IdentityRange.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("identity-range") @@ -1109,6 +1184,11 @@ func (m *StatusResponse) contextValidateIdentityRange(ctx context.Context, forma func (m *StatusResponse) contextValidateIpam(ctx context.Context, formats strfmt.Registry) error { if m.Ipam != nil { + + if swag.IsZero(m.Ipam) { // not required + return nil + } + if err := m.Ipam.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipam") @@ -1125,6 +1205,11 @@ func (m *StatusResponse) contextValidateIpam(ctx context.Context, formats strfmt func (m *StatusResponse) contextValidateIPV4BigTCP(ctx context.Context, formats strfmt.Registry) error { if m.IPV4BigTCP != nil { + + if swag.IsZero(m.IPV4BigTCP) { // not required + return nil + } + if err := m.IPV4BigTCP.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipv4-big-tcp") @@ -1141,6 +1226,11 @@ func (m *StatusResponse) contextValidateIPV4BigTCP(ctx context.Context, formats func (m *StatusResponse) contextValidateIPV6BigTCP(ctx context.Context, formats strfmt.Registry) error { if m.IPV6BigTCP != nil { + + if swag.IsZero(m.IPV6BigTCP) { // not required + return nil + } + if err := m.IPV6BigTCP.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("ipv6-big-tcp") @@ -1157,6 +1247,11 @@ func (m *StatusResponse) contextValidateIPV6BigTCP(ctx context.Context, formats func (m *StatusResponse) contextValidateKubeProxyReplacement(ctx context.Context, formats strfmt.Registry) error { if m.KubeProxyReplacement != nil { + + if swag.IsZero(m.KubeProxyReplacement) { // not required + return nil + } + if err := m.KubeProxyReplacement.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("kube-proxy-replacement") @@ -1173,6 +1268,11 @@ func (m *StatusResponse) contextValidateKubeProxyReplacement(ctx context.Context func (m *StatusResponse) contextValidateKubernetes(ctx context.Context, formats strfmt.Registry) error { if m.Kubernetes != nil { + + if swag.IsZero(m.Kubernetes) { // not required + return nil + } + if err := m.Kubernetes.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("kubernetes") @@ -1189,6 +1289,11 @@ func (m *StatusResponse) contextValidateKubernetes(ctx context.Context, formats func (m *StatusResponse) contextValidateKvstore(ctx context.Context, formats strfmt.Registry) error { if m.Kvstore != nil { + + if swag.IsZero(m.Kvstore) { // not required + return nil + } + if err := m.Kvstore.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("kvstore") @@ -1205,6 +1310,11 @@ func (m *StatusResponse) contextValidateKvstore(ctx context.Context, formats str func (m *StatusResponse) contextValidateMasquerading(ctx context.Context, formats strfmt.Registry) error { if m.Masquerading != nil { + + if swag.IsZero(m.Masquerading) { // not required + return nil + } + if err := m.Masquerading.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("masquerading") @@ -1221,6 +1331,11 @@ func (m *StatusResponse) contextValidateMasquerading(ctx context.Context, format func (m *StatusResponse) contextValidateNodeMonitor(ctx context.Context, formats strfmt.Registry) error { if m.NodeMonitor != nil { + + if swag.IsZero(m.NodeMonitor) { // not required + return nil + } + if err := m.NodeMonitor.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("nodeMonitor") @@ -1237,6 +1352,11 @@ func (m *StatusResponse) contextValidateNodeMonitor(ctx context.Context, formats func (m *StatusResponse) contextValidateProxy(ctx context.Context, formats strfmt.Registry) error { if m.Proxy != nil { + + if swag.IsZero(m.Proxy) { // not required + return nil + } + if err := m.Proxy.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("proxy") @@ -1253,6 +1373,11 @@ func (m *StatusResponse) contextValidateProxy(ctx context.Context, formats strfm func (m *StatusResponse) contextValidateSrv6(ctx context.Context, formats strfmt.Registry) error { if m.Srv6 != nil { + + if swag.IsZero(m.Srv6) { // not required + return nil + } + if err := m.Srv6.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("srv6") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/trace_selector.go b/vendor/github.com/cilium/cilium/api/v1/models/trace_selector.go index 6ecd360326..4c1b514f52 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/trace_selector.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/trace_selector.go @@ -109,6 +109,11 @@ func (m *TraceSelector) ContextValidate(ctx context.Context, formats strfmt.Regi func (m *TraceSelector) contextValidateFrom(ctx context.Context, formats strfmt.Registry) error { if m.From != nil { + + if swag.IsZero(m.From) { // not required + return nil + } + if err := m.From.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("from") @@ -125,6 +130,11 @@ func (m *TraceSelector) contextValidateFrom(ctx context.Context, formats strfmt. func (m *TraceSelector) contextValidateTo(ctx context.Context, formats strfmt.Registry) error { if m.To != nil { + + if swag.IsZero(m.To) { // not required + return nil + } + if err := m.To.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("to") diff --git a/vendor/github.com/cilium/cilium/api/v1/models/trace_to.go b/vendor/github.com/cilium/cilium/api/v1/models/trace_to.go index 6455e21073..e1dcc453f6 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/trace_to.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/trace_to.go @@ -115,6 +115,11 @@ func (m *TraceTo) contextValidateDports(ctx context.Context, formats strfmt.Regi for i := 0; i < len(m.Dports); i++ { if m.Dports[i] != nil { + + if swag.IsZero(m.Dports[i]) { // not required + return nil + } + if err := m.Dports[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("dports" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/wireguard_interface.go b/vendor/github.com/cilium/cilium/api/v1/models/wireguard_interface.go index d78acc53d0..0325eba0a9 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/wireguard_interface.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/wireguard_interface.go @@ -99,6 +99,11 @@ func (m *WireguardInterface) contextValidatePeers(ctx context.Context, formats s for i := 0; i < len(m.Peers); i++ { if m.Peers[i] != nil { + + if swag.IsZero(m.Peers[i]) { // not required + return nil + } + if err := m.Peers[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("peers" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/api/v1/models/wireguard_status.go b/vendor/github.com/cilium/cilium/api/v1/models/wireguard_status.go index 041a2d3361..753ad1754e 100644 --- a/vendor/github.com/cilium/cilium/api/v1/models/wireguard_status.go +++ b/vendor/github.com/cilium/cilium/api/v1/models/wireguard_status.go @@ -90,6 +90,11 @@ func (m *WireguardStatus) contextValidateInterfaces(ctx context.Context, formats for i := 0; i < len(m.Interfaces); i++ { if m.Interfaces[i] != nil { + + if swag.IsZero(m.Interfaces[i]) { // not required + return nil + } + if err := m.Interfaces[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("interfaces" + "." + strconv.Itoa(i)) diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_entities_deny.go b/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_entities_deny.go deleted file mode 100644 index ed8583d326..0000000000 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/all_entities_deny.go +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of Cilium - -package builder - -import ( - _ "embed" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" -) - -//go:embed manifests/deny-all-entities.yaml -var denyAllEntitiesPolicyYAML string - -type allEntitiesDeny struct{} - -func (t allEntitiesDeny) build(ct *check2.ConnectivityTest, _ map[string]string) { - // This policy denies all entities by default - newTest("all-entities-deny", ct). - WithCiliumPolicy(denyAllEntitiesPolicyYAML). - WithScenarios( - tests2.PodToPod(), - tests2.PodToCIDR(), - ). - WithExpectations(func(_ *check2.Action) (egress, ingress check2.Result) { - return check2.ResultPolicyDenyEgressDrop, check2.ResultNone - }) -} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/allow_all_with_metrics_check.go b/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/allow_all_with_metrics_check.go deleted file mode 100644 index be545ad0e9..0000000000 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/allow_all_with_metrics_check.go +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of Cilium - -package builder - -import ( - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - "github.com/cilium/cilium/cilium-cli/connectivity/tests" -) - -type allowAllWithMetricsCheck struct{} - -func (t allowAllWithMetricsCheck) build(ct *check2.ConnectivityTest, _ map[string]string) { - // This policy allows traffic pod to pod and checks if the metric cilium_forward_count_total increases on cilium agent. - newTest("allow-all-with-metrics-check", ct). - WithScenarios(tests.PodToPod()). - WithExpectations(func(_ *check2.Action) (egress, ingress check2.Result) { - return check2.ResultOK.ExpectMetricsIncrease(ct.CiliumAgentMetrics(), "cilium_forward_count_total"), - check2.ResultOK.ExpectMetricsIncrease(ct.CiliumAgentMetrics(), "cilium_forward_count_total") - }) -} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/cluster_entity_multi_cluster.go b/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/cluster_entity_multi_cluster.go deleted file mode 100644 index 475935ca8d..0000000000 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/cluster_entity_multi_cluster.go +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of Cilium - -package builder - -import ( - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" -) - -type clusterEntityMultiCluster struct{} - -func (t clusterEntityMultiCluster) build(ct *check2.ConnectivityTest, _ map[string]string) { - newTest("cluster-entity-multi-cluster", ct). - WithCondition(func() bool { return ct.Params().MultiCluster != "" }). - WithCiliumPolicy(allowClusterEntityPolicyYAML). - WithScenarios( - tests2.PodToPod(tests2.WithDestinationLabelsOption(map[string]string{"name": "echo-other-node"})), - ). - WithExpectations(func(_ *check2.Action) (egress, ingress check2.Result) { - return check2.ResultDefaultDenyEgressDrop, check2.ResultNone - }) -} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/dns_only.go b/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/dns_only.go deleted file mode 100644 index 1fd41b3e5c..0000000000 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/dns_only.go +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of Cilium - -package builder - -import ( - "github.com/cilium/cilium-cli/utils/features" - check2 "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" -) - -type dnsOnly struct{} - -func (t dnsOnly) build(ct *check2.ConnectivityTest, _ map[string]string) { - // Only allow UDP:53 to kube-dns, no DNS proxy enabled. - newTest("dns-only", ct). - WithCiliumPolicy(clientEgressOnlyDNSPolicyYAML). - WithFeatureRequirements(features.RequireEnabled(features.L7Proxy)). - WithScenarios( - tests2.PodToPod(), // connects to other Pods directly, no DNS - tests2.PodToWorld(), // resolves set domain-name defaults to one.one.one.one - ). - WithExpectations(func(_ *check2.Action) (egress check2.Result, ingress check2.Result) { - return check2.ResultDropCurlTimeout, check2.ResultNone - }) -} diff --git a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_policies.go b/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_policies.go deleted file mode 100644 index ae7b9823e2..0000000000 --- a/vendor/github.com/cilium/cilium/cilium-cli/connectivity/builder/no_policies.go +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of Cilium - -package builder - -import ( - "github.com/cilium/cilium/cilium-cli/connectivity/check" - tests2 "github.com/cilium/cilium/cilium-cli/connectivity/tests" -) - -type noPolicies struct{} - -func (t noPolicies) build(ct *check.ConnectivityTest, _ map[string]string) { - newTest("no-policies", ct). - WithScenarios( - tests2.PodToPod(), - tests2.ClientToClient(), - tests2.PodToService(), - tests2.PodToHostPort(), - tests2.PodToWorld(tests2.WithRetryAll()), - tests2.PodToHost(), - tests2.HostToPod(), - tests2.PodToExternalWorkload(), - tests2.PodToCIDR(tests2.WithRetryAll()), - ) -} diff --git a/vendor/github.com/cilium/cilium/pkg/api/apierror.go b/vendor/github.com/cilium/cilium/pkg/api/apierror.go index 83c44eeba1..7ee425a22f 100644 --- a/vendor/github.com/cilium/cilium/pkg/api/apierror.go +++ b/vendor/github.com/cilium/cilium/pkg/api/apierror.go @@ -30,6 +30,11 @@ func New(code int, msg string, args ...interface{}) *APIError { return &APIError{code: code, msg: msg} } +// GetCode returns the code for the API Error. +func (a *APIError) GetCode() int { + return a.code +} + // Error creates a new API error from the code and error. func Error(code int, err error) *APIError { if err == nil { diff --git a/vendor/github.com/cilium/cilium/pkg/ip/ip.go b/vendor/github.com/cilium/cilium/pkg/ip/ip.go index fe1bb97df2..3c9adcb1fc 100644 --- a/vendor/github.com/cilium/cilium/pkg/ip/ip.go +++ b/vendor/github.com/cilium/cilium/pkg/ip/ip.go @@ -291,20 +291,27 @@ func PrefixCeil(numIPs int, multiple int) int { return quotient } -// PrefixToIps converts the given prefix to an array containing all IPs in the prefix / CIDR block. -func PrefixToIps(prefixCidr string) ([]string, error) { +// PrefixToIps converts the given prefix to an array containing IPs in the provided +// prefix/CIDR block. When maxIPs is set to 0, the returned array will contain all IPs +// in the given prefix. Otherwise, the returned array of IPs will be limited to the +// value of maxIPs starting at the first IP in the provided CIDR. For example, when +// providing 192.168.1.0/28 as a CIDR with 4 maxIPs, 192.168.1.0, 192.168.1.1, +// 192.168.1.2, 192.168.1.3 will be returned. +func PrefixToIps(prefixCidr string, maxIPs int) ([]string, error) { var prefixIps []string _, ipNet, err := net.ParseCIDR(prefixCidr) if err != nil { return prefixIps, err } netWithRange := ipNetToRange(*ipNet) - for ip := *netWithRange.First; !ip.Equal(*netWithRange.Last); ip = GetNextIP(ip) { + // Ensure last IP in the prefix is included + for ip := *netWithRange.First; len(prefixIps) < maxIPs || maxIPs == 0; ip = GetNextIP(ip) { prefixIps = append(prefixIps, ip.String()) + if ip.Equal(*netWithRange.Last) { + break + } } - // Add the last IP - prefixIps = append(prefixIps, netWithRange.Last.String()) return prefixIps, nil } diff --git a/vendor/github.com/cilium/cilium/pkg/kvstore/etcd.go b/vendor/github.com/cilium/cilium/pkg/kvstore/etcd.go index 78fa5a95be..78e02d2b11 100644 --- a/vendor/github.com/cilium/cilium/pkg/kvstore/etcd.go +++ b/vendor/github.com/cilium/cilium/pkg/kvstore/etcd.go @@ -763,7 +763,7 @@ func (e *etcdClient) DeletePrefix(ctx context.Context, path string) (err error) _, err = e.client.Delete(ctx, path, client.WithPrefix()) // Using lr.Error for convenience, as it matches lr.Done() when err is nil - lr.Error(err) + lr.Error(err, -1) if err == nil { e.leaseManager.ReleasePrefix(path) @@ -829,7 +829,7 @@ reList: } kvs, revision, err := e.paginatedList(ctx, scopedLog, w.Prefix) if err != nil { - lr.Error(err) + lr.Error(err, -1) scopedLog.WithError(Hint(err)).Warn("Unable to list keys before starting watcher") errLimiter.Wait(ctx) continue @@ -1132,7 +1132,7 @@ func (e *etcdClient) GetIfLocked(ctx context.Context, key string, lock KVLocker) } if err != nil { - lr.Error(err) + lr.Error(err, -1) return nil, Hint(err) } @@ -1160,7 +1160,7 @@ func (e *etcdClient) Get(ctx context.Context, key string) (bv []byte, err error) getR, err := e.client.Get(ctx, key) if err != nil { - lr.Error(err) + lr.Error(err, -1) return nil, Hint(err) } lr.Done() @@ -1195,7 +1195,7 @@ func (e *etcdClient) DeleteIfLocked(ctx context.Context, key string, lock KVLock } // Using lr.Error for convenience, as it matches lr.Done() when err is nil - lr.Error(err) + lr.Error(err, -1) return Hint(err) } @@ -1214,7 +1214,7 @@ func (e *etcdClient) Delete(ctx context.Context, key string) (err error) { _, err = e.client.Delete(ctx, key) // Using lr.Error for convenience, as it matches lr.Done() when err is nil - lr.Error(err) + lr.Error(err, -1) if err == nil { e.leaseManager.Release(key) @@ -1254,7 +1254,7 @@ func (e *etcdClient) UpdateIfLocked(ctx context.Context, key string, value []byt } // Using lr.Error for convenience, as it matches lr.Done() when err is nil - lr.Error(err) + lr.Error(err, -1) return Hint(err) } @@ -1282,7 +1282,7 @@ func (e *etcdClient) Update(ctx context.Context, key string, value []byte, lease e.leaseManager.CancelIfExpired(err, leaseID) // Using lr.Error for convenience, as it matches lr.Done() when err is nil - lr.Error(err) + lr.Error(err, -1) return Hint(err) } @@ -1300,7 +1300,7 @@ func (e *etcdClient) UpdateIfDifferentIfLocked(ctx context.Context, key string, cnds := lock.Comparator().(client.Cmp) txnresp, err := e.client.Txn(ctx).If(cnds).Then(client.OpGet(key)).Commit() // Using lr.Error for convenience, as it matches lr.Done() when err is nil - lr.Error(err) + lr.Error(err, -1) increaseMetric(key, metricRead, "Get", duration.EndError(err).Total(), err) // On error, attempt update blindly @@ -1341,7 +1341,7 @@ func (e *etcdClient) UpdateIfDifferent(ctx context.Context, key string, value [] getR, err := e.client.Get(ctx, key) // Using lr.Error for convenience, as it matches lr.Done() when err is nil - lr.Error(err) + lr.Error(err, -1) increaseMetric(key, metricRead, "Get", duration.EndError(err).Total(), err) // On error, attempt update blindly if err != nil || getR.Count == 0 { @@ -1390,7 +1390,7 @@ func (e *etcdClient) CreateOnlyIfLocked(ctx context.Context, key string, value [ txnresp, err := e.client.Txn(ctx).If(cnds...).Then(req).Else(opGets...).Commit() increaseMetric(key, metricSet, "CreateOnlyLocked", duration.EndError(err).Total(), err) if err != nil { - lr.Error(err) + lr.Error(err, -1) e.leaseManager.CancelIfExpired(err, leaseID) return false, Hint(err) } @@ -1449,7 +1449,7 @@ func (e *etcdClient) CreateOnly(ctx context.Context, key string, value []byte, l txnresp, err := e.client.Txn(ctx).If(cond).Then(req).Commit() if err != nil { - lr.Error(err) + lr.Error(err, -1) e.leaseManager.CancelIfExpired(err, leaseID) return false, Hint(err) } @@ -1478,7 +1478,7 @@ func (e *etcdClient) ListPrefixIfLocked(ctx context.Context, prefix string, lock err = ErrLockLeaseExpired } if err != nil { - lr.Error(err) + lr.Error(err, -1) return nil, Hint(err) } lr.Done() @@ -1511,7 +1511,7 @@ func (e *etcdClient) ListPrefix(ctx context.Context, prefix string) (v KeyValueP getR, err := e.client.Get(ctx, prefix, client.WithPrefix()) if err != nil { - lr.Error(err) + lr.Error(err, -1) return nil, Hint(err) } lr.Done() diff --git a/vendor/github.com/cilium/cilium/pkg/logging/logging.go b/vendor/github.com/cilium/cilium/pkg/logging/logging.go index c7cb630733..91dca60bcf 100644 --- a/vendor/github.com/cilium/cilium/pkg/logging/logging.go +++ b/vendor/github.com/cilium/cilium/pkg/logging/logging.go @@ -36,7 +36,7 @@ const ( // we want to use (possible values: text or json) DefaultLogFormat LogFormat = LogFormatText - // DefaultLogFormat is the string representation of the default logrus.Formatter + // DefaultLogFormatTimestamp is the string representation of the default logrus.Formatter // including timestamps. // We don't use this for general runtime logs since kubernetes log capture handles those. // This is only used for applications such as CNI which is written to disk so we have no @@ -85,7 +85,7 @@ type LogOptions map[string]string // settings. func initializeDefaultLogger() (logger *logrus.Logger) { logger = logrus.New() - logger.SetFormatter(GetFormatter(DefaultLogFormat)) + logger.SetFormatter(GetFormatter(DefaultLogFormatTimestamp)) logger.SetLevel(DefaultLogLevel) return } @@ -112,16 +112,16 @@ func (o LogOptions) GetLogLevel() (level logrus.Level) { func (o LogOptions) GetLogFormat() LogFormat { formatOpt, ok := o[FormatOpt] if !ok { - return DefaultLogFormat + return DefaultLogFormatTimestamp } formatOpt = strings.ToLower(formatOpt) - re := regexp.MustCompile(`^(text|json|json-ts)$`) + re := regexp.MustCompile(`^(text|text-ts|json|json-ts)$`) if !re.MatchString(formatOpt) { logrus.WithError( - fmt.Errorf("incorrect log format configured '%s', expected 'text', 'json' or 'json-ts'", formatOpt), + fmt.Errorf("incorrect log format configured '%s', expected 'text', 'text-ts', 'json' or 'json-ts'", formatOpt), ).Warning("Ignoring user-configured log format") - return DefaultLogFormat + return DefaultLogFormatTimestamp } return LogFormat(formatOpt) @@ -149,7 +149,7 @@ func SetLogFormat(logFormat LogFormat) { // SetDefaultLogFormat updates the DefaultLogger with the DefaultLogFormat func SetDefaultLogFormat() { - DefaultLogger.SetFormatter(GetFormatter(DefaultLogFormat)) + DefaultLogger.SetFormatter(GetFormatter(DefaultLogFormatTimestamp)) } // AddHooks adds additional logrus hook to default logger diff --git a/vendor/github.com/cilium/cilium/pkg/metrics/metrics.go b/vendor/github.com/cilium/cilium/pkg/metrics/metrics.go index 1e31d7bfc6..4f4b1b6e0e 100644 --- a/vendor/github.com/cilium/cilium/pkg/metrics/metrics.go +++ b/vendor/github.com/cilium/cilium/pkg/metrics/metrics.go @@ -1270,7 +1270,7 @@ func NewLegacyMetrics() *LegacyMetrics { Subsystem: SubsystemAPILimiter, Name: "processed_requests_total", Help: "Total number of API requests processed", - }, []string{"api_call", LabelOutcome}), + }, []string{"api_call", LabelOutcome, LabelAPIReturnCode}), EndpointPropagationDelay: metric.NewHistogramVec(metric.HistogramOpts{ ConfigName: Namespace + "_endpoint_propagation_delay_seconds", @@ -1583,6 +1583,14 @@ func Error2Outcome(err error) string { return LabelValueOutcomeSuccess } +// LabelOutcome2Code converts a label outcome to a code +func LabelOutcome2Code(outcome string) int { + if outcome == LabelValueOutcomeSuccess { + return 200 + } + return 500 +} + func BoolToFloat64(v bool) float64 { if v { return 1 diff --git a/vendor/github.com/cilium/cilium/pkg/policy/api/cidr.go b/vendor/github.com/cilium/cilium/pkg/policy/api/cidr.go index a12aa98099..80a9ae7b1c 100644 --- a/vendor/github.com/cilium/cilium/pkg/policy/api/cidr.go +++ b/vendor/github.com/cilium/cilium/pkg/policy/api/cidr.go @@ -35,7 +35,8 @@ type CIDRRule struct { // CIDRGroupRef is a reference to a CiliumCIDRGroup object. // A CiliumCIDRGroup contains a list of CIDRs that the endpoint, subject to - // the rule, can (Ingress/Egress) or cannot (IngressDeny) receive connections from. + // the rule, can (Ingress/Egress) or cannot (IngressDeny/EgressDeny) receive + // connections from. // // +kubebuilder:validation:OneOf CIDRGroupRef CIDRGroupRef `json:"cidrGroupRef,omitempty"` diff --git a/vendor/github.com/cilium/cilium/pkg/rate/api_limiter.go b/vendor/github.com/cilium/cilium/pkg/rate/api_limiter.go index c96079e8b0..8db41874de 100644 --- a/vendor/github.com/cilium/cilium/pkg/rate/api_limiter.go +++ b/vendor/github.com/cilium/cilium/pkg/rate/api_limiter.go @@ -86,6 +86,8 @@ const ( outcomeParallelMaxWait outcome = "fail-parallel-wait" outcomeLimitMaxWait outcome = "fail-limit-wait" outcomeReqCancelled outcome = "request-cancelled" + outcomeErrorCode int = 429 + outcomeSuccessCode int = 200 ) // APILimiter is an extension to x/time/rate.Limiter specifically for Cilium @@ -464,7 +466,7 @@ func (l *APILimiter) adjustedParallelRequests() int { return int(l.adjustmentLimit(newParallelRequests, float64(l.params.ParallelRequests))) } -func (l *APILimiter) requestFinished(r *limitedRequest, err error) { +func (l *APILimiter) requestFinished(r *limitedRequest, err error, code int) { if r.finished { return } @@ -546,6 +548,7 @@ func (l *APILimiter) requestFinished(r *limitedRequest, err error) { AdjustmentFactor: l.adjustmentFactor, Error: err, Outcome: string(r.outcome), + ReturnCode: code, } if l.limiter != nil { @@ -575,7 +578,7 @@ func calcMeanDuration(durations []time.Duration) float64 { // WaitDuration() concurrently. type LimitedRequest interface { Done() - Error(err error) + Error(err error, code int) WaitDuration() time.Duration } @@ -597,12 +600,12 @@ func (l *limitedRequest) WaitDuration() time.Duration { // Done must be called when the API request has been successfully processed func (l *limitedRequest) Done() { - l.limiter.requestFinished(l, nil) + l.limiter.requestFinished(l, nil, outcomeSuccessCode) } // Error must be called when the API request resulted in an error -func (l *limitedRequest) Error(err error) { - l.limiter.requestFinished(l, err) +func (l *limitedRequest) Error(err error, code int) { + l.limiter.requestFinished(l, err, code) } // Wait blocks until the next API call is allowed to be processed. If the @@ -612,7 +615,7 @@ func (l *limitedRequest) Error(err error) { func (l *APILimiter) Wait(ctx context.Context) (LimitedRequest, error) { req, err := l.wait(ctx) if err != nil { - l.requestFinished(req, err) + l.requestFinished(req, err, outcomeErrorCode) return nil, err } return req, nil @@ -841,6 +844,7 @@ type MetricsValues struct { CurrentRequestsInFlight int AdjustmentFactor float64 Error error + ReturnCode int } // MetricsObserver is the interface that must be implemented to extract metrics @@ -895,7 +899,7 @@ type dummyRequest struct{} func (d dummyRequest) WaitDuration() time.Duration { return 0 } func (d dummyRequest) Done() {} -func (d dummyRequest) Error(err error) {} +func (d dummyRequest) Error(err error, code int) {} // Wait invokes Wait() on the APILimiter with the given name. If the limiter // does not exist, a dummy limiter is used which will not impose any diff --git a/vendor/github.com/cilium/cilium/pkg/rate/metrics/metrics.go b/vendor/github.com/cilium/cilium/pkg/rate/metrics/metrics.go index 74764ed643..a3df70b206 100644 --- a/vendor/github.com/cilium/cilium/pkg/rate/metrics/metrics.go +++ b/vendor/github.com/cilium/cilium/pkg/rate/metrics/metrics.go @@ -4,6 +4,8 @@ package metrics import ( + "strconv" + "github.com/cilium/cilium/pkg/metrics" "github.com/cilium/cilium/pkg/rate" ) @@ -31,5 +33,9 @@ func (a *apiRateLimitingMetrics) ProcessedRequest(name string, v rate.MetricsVal v.Outcome = metrics.Error2Outcome(v.Error) } - metrics.APILimiterProcessedRequests.WithLabelValues(name, v.Outcome).Inc() + if v.ReturnCode == -1 { + v.ReturnCode = metrics.LabelOutcome2Code(v.Outcome) + } + + metrics.APILimiterProcessedRequests.WithLabelValues(name, v.Outcome, strconv.Itoa(v.ReturnCode)).Inc() } diff --git a/vendor/modules.txt b/vendor/modules.txt index 0bc07b375b..14965f0798 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -55,7 +55,7 @@ github.com/chai2010/gettext-go/po # github.com/cilium/charts v0.0.0-20240403030229-7815d9933404 ## explicit; go 1.17 github.com/cilium/charts -# github.com/cilium/cilium v1.16.0-pre.0.0.20240331012019-3f1e7de62dd9 +# github.com/cilium/cilium v1.16.0-pre.1 ## explicit; go 1.22.0 github.com/cilium/cilium/api/v1/client github.com/cilium/cilium/api/v1/client/bgp @@ -77,17 +77,6 @@ github.com/cilium/cilium/api/v1/models github.com/cilium/cilium/api/v1/observer github.com/cilium/cilium/api/v1/relay github.com/cilium/cilium/api/v1/server/restapi/bgp -github.com/cilium/cilium/cilium-cli/cli -github.com/cilium/cilium/cilium-cli/connectivity -github.com/cilium/cilium/cilium-cli/connectivity/builder -github.com/cilium/cilium/cilium-cli/connectivity/builder/manifests/template -github.com/cilium/cilium/cilium-cli/connectivity/check -github.com/cilium/cilium/cilium-cli/connectivity/filters -github.com/cilium/cilium/cilium-cli/connectivity/internal/junit -github.com/cilium/cilium/cilium-cli/connectivity/perf/benchmarks/netperf -github.com/cilium/cilium/cilium-cli/connectivity/perf/common -github.com/cilium/cilium/cilium-cli/connectivity/sniff -github.com/cilium/cilium/cilium-cli/connectivity/tests github.com/cilium/cilium/daemon/k8s github.com/cilium/cilium/pkg/alibabacloud/eni/types github.com/cilium/cilium/pkg/allocator @@ -567,7 +556,7 @@ github.com/davecgh/go-spew/spew # github.com/distribution/reference v0.5.0 ## explicit; go 1.20 github.com/distribution/reference -# github.com/docker/cli v25.0.3+incompatible +# github.com/docker/cli v25.0.1+incompatible ## explicit github.com/docker/cli/cli/config github.com/docker/cli/cli/config/configfile @@ -977,7 +966,7 @@ github.com/prometheus/client_golang/prometheus/promhttp # github.com/prometheus/client_model v0.6.0 ## explicit; go 1.19 github.com/prometheus/client_model/go -# github.com/prometheus/common v0.51.0 +# github.com/prometheus/common v0.51.1 ## explicit; go 1.21 github.com/prometheus/common/expfmt github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg