diff --git a/client/client.go b/client/client.go index 0bf2adb..9b7c0a8 100644 --- a/client/client.go +++ b/client/client.go @@ -1,6 +1,7 @@ package client import ( + "context" "fmt" "strings" @@ -21,7 +22,7 @@ type ClientInterface interface { Endpoints(string) v1core.EndpointsInterface DaemonSets(string) appsv1.DaemonSetInterface Services(string) v1core.ServiceInterface - CustomResource(apiVersion, namespace, resource, name string) (*unstructured.Unstructured, error) + CustomResource(ctx context.Context, apiVersion, namespace, resource, name string) (*unstructured.Unstructured, error) } type Client struct { client kubernetes.Interface @@ -47,7 +48,7 @@ func (c Client) Services(namespace string) v1core.ServiceInterface { return c.client.CoreV1().Services(namespace) } -func (c Client) CustomResource(apiVersion, kind, namespace, name string) (*unstructured.Unstructured, error) { +func (c Client) CustomResource(ctx context.Context, apiVersion, kind, namespace, name string) (*unstructured.Unstructured, error) { apiResourceList, err := c.client.Discovery().ServerResourcesForGroupVersion(apiVersion) if err != nil { return nil, err @@ -70,10 +71,10 @@ func (c Client) CustomResource(apiVersion, kind, namespace, name string) (*unstr return c.dynamicClient.Resource(gvr). Namespace(namespace). - Get(name, metav1.GetOptions{}) + Get(ctx, name, metav1.GetOptions{}) } } - return nil, fmt.Errorf("Could not find resource with with version %v, "+ + return nil, fmt.Errorf("could not find resource with with version %v, "+ "kind %v, and name %v in namespace %v", apiVersion, kind, name, namespace) } diff --git a/dependencies/config/config.go b/dependencies/config/config.go index 57861c5..6f1f816 100644 --- a/dependencies/config/config.go +++ b/dependencies/config/config.go @@ -1,6 +1,7 @@ package config import ( + "context" "fmt" "os" "path/filepath" @@ -50,12 +51,12 @@ func init() { func NewConfig(name string, prefix string) (*Config, error) { hostname, err := os.Hostname() if err != nil { - return nil, fmt.Errorf("Cannot determine hostname: %v", err) + return nil, fmt.Errorf("cannot determine hostname: %v", err) } ip, err := util.GetIp() if err != nil { - return nil, fmt.Errorf("Cannot get ip address: %v", err) + return nil, fmt.Errorf("cannot get ip address: %v", err) } return &Config{ @@ -68,13 +69,13 @@ func NewConfig(name string, prefix string) (*Config, error) { }, nil } -func (c Config) IsResolved(entrypoint entry.EntrypointInterface) (bool, error) { +func (c Config) IsResolved(ctx context.Context, entrypoint entry.EntrypointInterface) (bool, error) { //Create directory to ensure it exists if err := createDirectory(c.name); err != nil { - return false, fmt.Errorf("Couldn't create directory: %v", err) + return false, fmt.Errorf("couldn't create directory: %v", err) } if err := c.createAndTemplateConfig(); err != nil { - return false, fmt.Errorf("Cannot template %s: %v", c.name, err) + return false, fmt.Errorf("cannot template %s: %v", c.name, err) } return true, nil diff --git a/dependencies/config/config_test.go b/dependencies/config/config_test.go index 044af17..2afdf45 100644 --- a/dependencies/config/config_test.go +++ b/dependencies/config/config_test.go @@ -1,8 +1,8 @@ package config import ( + "context" "fmt" - "io/ioutil" "net" "os" "path/filepath" @@ -58,7 +58,7 @@ func setupConfigTemplate(templatePath string) error { return err } - if err := ioutil.WriteFile(templatePath, configContent, 0644); err != nil { + if err := os.WriteFile(templatePath, configContent, 0644); err != nil { return err } @@ -114,10 +114,10 @@ var _ = Describe("Config", func() { It("checks the format of a newly created config file", func() { config, _ := NewConfig(testConfigPath, templatePrefix) - _, err := config.IsResolved(testEntrypoint) + _, err := config.IsResolved(context.TODO(), testEntrypoint) Expect(err).NotTo(HaveOccurred()) - result, err := ioutil.ReadFile(fmt.Sprintf("%s/%s", testDir, testConfigName)) + result, err := os.ReadFile(fmt.Sprintf("%s/%s", testDir, testConfigName)) Expect(err).NotTo(HaveOccurred()) hostname, err := os.Hostname() @@ -132,7 +132,7 @@ var _ = Describe("Config", func() { It("checks resolution of a config", func() { config, _ := NewConfig(testConfigPath, templatePrefix) - isResolved, err := config.IsResolved(testEntrypoint) + isResolved, err := config.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(Equal(true)) Expect(err).NotTo(HaveOccurred()) diff --git a/dependencies/container/container.go b/dependencies/container/container.go index fb321fb..b1b7d1a 100644 --- a/dependencies/container/container.go +++ b/dependencies/container/container.go @@ -1,6 +1,7 @@ package container import ( + "context" "fmt" "os" "strings" @@ -14,8 +15,8 @@ import ( ) const ( - PodNameNotSetError = "Environment variable POD_NAME not set" - NamespaceNotSupported = "Container doesn't accept namespace" + PodNameNotSetError = "environment variable POD_NAME not set" + NamespaceNotSupported = "container doesn't accept namespace" ) type Container struct { @@ -43,18 +44,18 @@ func NewContainer(name string) Container { } -func (c Container) IsResolved(entrypoint entry.EntrypointInterface) (bool, error) { +func (c Container) IsResolved(ctx context.Context, entrypoint entry.EntrypointInterface) (bool, error) { myPodName := os.Getenv("POD_NAME") if myPodName == "" { return false, fmt.Errorf(PodNameNotSetError) } - pod, err := entrypoint.Client().Pods(env.GetBaseNamespace()).Get(myPodName, metav1.GetOptions{}) + pod, err := entrypoint.Client().Pods(env.GetBaseNamespace()).Get(ctx, myPodName, metav1.GetOptions{}) if err != nil { return false, err } if strings.Contains(c.name, env.Separator) { - return false, fmt.Errorf("Specifying namespace is not permitted") + return false, fmt.Errorf("specifying namespace is not permitted") } containers := pod.Status.ContainerStatuses for _, container := range containers { diff --git a/dependencies/container/container_test.go b/dependencies/container/container_test.go index d67641c..c312fe0 100644 --- a/dependencies/container/container_test.go +++ b/dependencies/container/container_test.go @@ -1,6 +1,7 @@ package container import ( + "context" "fmt" "os" @@ -36,7 +37,7 @@ var _ = Describe("Container", func() { os.Unsetenv(podEnvVariableName) container := NewContainer(mocks.MockContainerName) - isResolved, err := container.IsResolved(testEntrypoint) + isResolved, err := container.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(Equal(false)) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(Equal(PodNameNotSetError)) @@ -45,7 +46,7 @@ var _ = Describe("Container", func() { It("checks resolution of a succeeding container", func() { container := NewContainer(mocks.MockContainerName) - isResolved, err := container.IsResolved(testEntrypoint) + isResolved, err := container.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(Equal(true)) Expect(err).NotTo(HaveOccurred()) @@ -59,7 +60,7 @@ var _ = Describe("Container", func() { Expect(container).NotTo(Equal(nil)) var isResolved bool - isResolved, err = container.IsResolved(testEntrypoint) + isResolved, err = container.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(Equal(false)) Expect(err).To(BeNil()) }) diff --git a/dependencies/customresource/customresource.go b/dependencies/customresource/customresource.go index c3f72fd..ca7a86b 100644 --- a/dependencies/customresource/customresource.go +++ b/dependencies/customresource/customresource.go @@ -1,6 +1,7 @@ package customresource import ( + "context" "encoding/json" "fmt" "os" @@ -42,8 +43,8 @@ func init() { } // IsResolved will return true when the values for each key in r.Fields is the same as the resource in the cluster -func (r Resolver) IsResolved(ep entrypoint.EntrypointInterface) (bool, error) { - customResource, err := ep.Client().CustomResource(r.APIVersion, r.Kind, r.Namespace, r.Name) +func (r Resolver) IsResolved(ctx context.Context, ep entrypoint.EntrypointInterface) (bool, error) { + customResource, err := ep.Client().CustomResource(ctx, r.APIVersion, r.Kind, r.Namespace, r.Name) if err != nil { return false, err } @@ -58,10 +59,10 @@ func (r Resolver) IsResolved(ep entrypoint.EntrypointInterface) (bool, error) { return false, err } if !found { - return false, fmt.Errorf("Could not find key [%s]", key) + return false, fmt.Errorf("could not find key [%s]", key) } if actual != expected { - return false, fmt.Errorf("Expected value of [%s] to be [%s], but got [%s]", key, expected, actual) + return false, fmt.Errorf("expected value of [%s] to be [%s], but got [%s]", key, expected, actual) } } @@ -79,7 +80,7 @@ func fromEnv(jsonEnv string) ([]Resolver, error) { err := json.Unmarshal([]byte(jsonEnvVal), &resolvers) if err != nil { - return resolvers, fmt.Errorf("Unable to unmarshal variable %s with value %s: %s", + return resolvers, fmt.Errorf("unable to unmarshal variable %s with value %s: %s", jsonEnv, jsonEnvVal, err.Error()) } diff --git a/dependencies/customresource/customresource_test.go b/dependencies/customresource/customresource_test.go index b7e1550..57ea0a6 100644 --- a/dependencies/customresource/customresource_test.go +++ b/dependencies/customresource/customresource_test.go @@ -1,6 +1,7 @@ package customresource import ( + "context" "errors" "os" "reflect" @@ -288,7 +289,7 @@ func TestIsResolved(t *testing.T) { ep := mocks.NewEntrypoint() ep.MockClient.FakeCustomResource = tt.customResource ep.MockClient.Err = tt.clientErr - result, err := tt.resolver.IsResolved(ep) + result, err := tt.resolver.IsResolved(context.TODO(), ep) if err != nil { if !tt.expectErr { t.Fatalf("Unexpected error: %s", err.Error()) diff --git a/dependencies/daemonset/daemonset.go b/dependencies/daemonset/daemonset.go index 700ec1b..1ee8e63 100644 --- a/dependencies/daemonset/daemonset.go +++ b/dependencies/daemonset/daemonset.go @@ -1,6 +1,7 @@ package daemonset import ( + "context" "fmt" "os" @@ -14,7 +15,7 @@ import ( const ( PodNameEnvVar = "POD_NAME" - PodNameNotSetErrorFormat = "Env POD_NAME not set. Daemonset dependency %s in namespace %s will be ignored!" + PodNameNotSetErrorFormat = "env POD_NAME not set, daemonset dependency %s in namespace %s will be ignored" ) type Daemonset struct { @@ -47,9 +48,9 @@ func NewDaemonset(name string, namespace string) (*Daemonset, error) { }, nil } -func (d Daemonset) IsResolved(entrypoint entry.EntrypointInterface) (bool, error) { +func (d Daemonset) IsResolved(ctx context.Context, entrypoint entry.EntrypointInterface) (bool, error) { var myPodName string - daemonset, err := entrypoint.Client().DaemonSets(d.namespace).Get(d.name, metav1.GetOptions{}) + daemonset, err := entrypoint.Client().DaemonSets(d.namespace).Get(ctx, d.name, metav1.GetOptions{}) if err != nil { return false, err @@ -58,14 +59,14 @@ func (d Daemonset) IsResolved(entrypoint entry.EntrypointInterface) (bool, error label := metav1.FormatLabelSelector(daemonset.Spec.Selector) opts := metav1.ListOptions{LabelSelector: label} - daemonsetPods, err := entrypoint.Client().Pods(d.namespace).List(opts) + daemonsetPods, err := entrypoint.Client().Pods(d.namespace).List(ctx, opts) if err != nil { return false, err } - myPod, err := entrypoint.Client().Pods(env.GetBaseNamespace()).Get(d.podName, metav1.GetOptions{}) + myPod, err := entrypoint.Client().Pods(env.GetBaseNamespace()).Get(ctx, d.podName, metav1.GetOptions{}) if err != nil { - return false, fmt.Errorf("Getting POD: %v failed : %v", myPodName, err) + return false, fmt.Errorf("getting POD: %v failed : %v", myPodName, err) } myHost := myPod.Status.HostIP @@ -78,7 +79,7 @@ func (d Daemonset) IsResolved(entrypoint entry.EntrypointInterface) (bool, error if isPodReady(pod) { return true, nil } - return false, fmt.Errorf("Pod %v of daemonset %s is not ready", pod.Name, d) + return false, fmt.Errorf("pod %v of daemonset %s is not ready", pod.Name, d) } return true, nil diff --git a/dependencies/daemonset/daemonset_test.go b/dependencies/daemonset/daemonset_test.go index 837b24c..c7f64b6 100644 --- a/dependencies/daemonset/daemonset_test.go +++ b/dependencies/daemonset/daemonset_test.go @@ -1,6 +1,7 @@ package daemonset import ( + "context" "fmt" "os" @@ -47,7 +48,7 @@ var _ = Describe("Daemonset", func() { It("checks resolution of a succeeding daemonset", func() { daemonset, _ := NewDaemonset(mocks.SucceedingDaemonsetName, daemonsetNamespace) - isResolved, err := daemonset.IsResolved(testEntrypoint) + isResolved, err := daemonset.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeTrue()) Expect(err).NotTo(HaveOccurred()) @@ -56,7 +57,7 @@ var _ = Describe("Daemonset", func() { It("checks resolution failure of a daemonset with incorrect name", func() { daemonset, _ := NewDaemonset(mocks.FailingDaemonsetName, daemonsetNamespace) - isResolved, err := daemonset.IsResolved(testEntrypoint) + isResolved, err := daemonset.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeFalse()) Expect(err).To(HaveOccurred()) @@ -65,7 +66,7 @@ var _ = Describe("Daemonset", func() { It("checks resolution failure of a daemonset with incorrect match labels", func() { daemonset, _ := NewDaemonset(mocks.FailingMatchLabelsDaemonsetName, daemonsetNamespace) - isResolved, err := daemonset.IsResolved(testEntrypoint) + isResolved, err := daemonset.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeFalse()) Expect(err).To(HaveOccurred()) @@ -76,7 +77,7 @@ var _ = Describe("Daemonset", func() { os.Setenv(PodNameEnvVar, mocks.PodNotPresent) daemonset, _ := NewDaemonset(mocks.FailingMatchLabelsDaemonsetName, daemonsetNamespace) - isResolved, err := daemonset.IsResolved(testEntrypoint) + isResolved, err := daemonset.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeFalse()) Expect(err).To(HaveOccurred()) @@ -85,7 +86,7 @@ var _ = Describe("Daemonset", func() { It("checks resolution failure of a daemonset with none of the pods with Ready status", func() { daemonset, _ := NewDaemonset(mocks.NotReadyMatchLabelsDaemonsetName, daemonsetNamespace) - isResolved, err := daemonset.IsResolved(testEntrypoint) + isResolved, err := daemonset.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeFalse()) Expect(err).To(HaveOccurred()) @@ -97,7 +98,7 @@ var _ = Describe("Daemonset", func() { Expect(daemonset).NotTo(BeNil()) Expect(err).NotTo(HaveOccurred()) - isResolved, err := daemonset.IsResolved(testEntrypoint) + isResolved, err := daemonset.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeTrue()) Expect(err).NotTo(HaveOccurred()) @@ -110,7 +111,7 @@ var _ = Describe("Daemonset", func() { Expect(daemonset).NotTo(BeNil()) Expect(err).NotTo(HaveOccurred()) - isResolved, err := daemonset.IsResolved(testEntrypoint) + isResolved, err := daemonset.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeFalse()) Expect(err).To(HaveOccurred()) @@ -123,7 +124,7 @@ var _ = Describe("Daemonset", func() { err = os.Setenv(PodNameEnvVar, "shouldwork") Expect(err).NotTo(HaveOccurred()) - isResolved, err := daemonset.IsResolved(testEntrypoint) + isResolved, err := daemonset.IsResolved(context.TODO(), testEntrypoint) Expect(err).NotTo(HaveOccurred()) Expect(isResolved).To(BeTrue()) diff --git a/dependencies/job/job.go b/dependencies/job/job.go index a7f8c4f..34bc81e 100644 --- a/dependencies/job/job.go +++ b/dependencies/job/job.go @@ -1,6 +1,7 @@ package job import ( + "context" "fmt" v1 "k8s.io/api/batch/v1" @@ -11,7 +12,7 @@ import ( "opendev.org/airship/kubernetes-entrypoint/util/env" ) -const FailingStatusFormat = "Job %s is not completed yet" +const FailingStatusFormat = "job %s is not completed yet" type Job struct { name string @@ -46,12 +47,12 @@ func NewJob(name string, namespace string, labels map[string]string) *Job { } } -func (j Job) IsResolved(entrypoint entry.EntrypointInterface) (bool, error) { +func (j Job) IsResolved(ctx context.Context, entrypoint entry.EntrypointInterface) (bool, error) { iface := entrypoint.Client().Jobs(j.namespace) var jobs []v1.Job if j.name != "" { - job, err := iface.Get(j.name, metav1.GetOptions{}) + job, err := iface.Get(ctx, j.name, metav1.GetOptions{}) if err != nil { return false, err } @@ -60,14 +61,14 @@ func (j Job) IsResolved(entrypoint entry.EntrypointInterface) (bool, error) { labelSelector := &metav1.LabelSelector{MatchLabels: j.labels} label := metav1.FormatLabelSelector(labelSelector) opts := metav1.ListOptions{LabelSelector: label} - jobList, err := iface.List(opts) + jobList, err := iface.List(ctx, opts) if err != nil { return false, err } jobs = jobList.Items } if len(jobs) == 0 { - return false, fmt.Errorf("No matching jobs found: %v", j) + return false, fmt.Errorf("no matching jobs found: %v", j) } for _, job := range jobs { diff --git a/dependencies/job/job_test.go b/dependencies/job/job_test.go index b52a1f4..e7c3ce1 100644 --- a/dependencies/job/job_test.go +++ b/dependencies/job/job_test.go @@ -1,6 +1,7 @@ package job import ( + "context" "fmt" . "github.com/onsi/ginkgo" @@ -45,7 +46,7 @@ var _ = Describe("Job", func() { It("checks resolution of a succeeding job by name", func() { job := NewJob(mocks.SucceedingJobName, mocks.SucceedingJobName, nil) - isResolved, err := job.IsResolved(testEntrypoint) + isResolved, err := job.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(Equal(true)) Expect(err).NotTo(HaveOccurred()) @@ -54,7 +55,7 @@ var _ = Describe("Job", func() { It("checks resolution failure of a failing job by name", func() { job := NewJob(mocks.FailingJobName, mocks.FailingJobName, nil) - isResolved, err := job.IsResolved(testEntrypoint) + isResolved, err := job.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(Equal(false)) Expect(err.Error()).To(Equal(fmt.Sprintf(FailingStatusFormat, job))) @@ -63,7 +64,7 @@ var _ = Describe("Job", func() { It("checks resolution of a succeeding job by labels", func() { job := NewJob("", mocks.SucceedingJobName, map[string]string{"name": mocks.SucceedingJobLabel}) - isResolved, err := job.IsResolved(testEntrypoint) + isResolved, err := job.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(Equal(true)) Expect(err).NotTo(HaveOccurred()) @@ -72,7 +73,7 @@ var _ = Describe("Job", func() { It("checks resolution failure of a failing job by labels", func() { job := NewJob("", mocks.FailingJobName, map[string]string{"name": mocks.FailingJobLabel}) - isResolved, err := job.IsResolved(testEntrypoint) + isResolved, err := job.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(Equal(false)) Expect(err.Error()).To(Equal(fmt.Sprintf(FailingStatusFormat, job))) diff --git a/dependencies/pod/pod.go b/dependencies/pod/pod.go index 3ee6039..b41cb20 100644 --- a/dependencies/pod/pod.go +++ b/dependencies/pod/pod.go @@ -1,6 +1,7 @@ package pod import ( + "context" "fmt" "os" @@ -14,7 +15,7 @@ import ( const ( PodNameEnvVar = "POD_NAME" - PodNameNotSetErrorFormat = "Env POD_NAME not set. Pod dependency in namespace %s will be ignored!" + PodNameNotSetErrorFormat = "env POD_NAME not set, pod dependency in namespace %s will be ignored" ) type Pod struct { @@ -49,10 +50,10 @@ func NewPod(labels map[string]string, namespace string, requireSameNode bool) (* }, nil } -func (p Pod) IsResolved(entrypoint entry.EntrypointInterface) (bool, error) { - myPod, err := entrypoint.Client().Pods(env.GetBaseNamespace()).Get(p.podName, metav1.GetOptions{}) +func (p Pod) IsResolved(ctx context.Context, entrypoint entry.EntrypointInterface) (bool, error) { + myPod, err := entrypoint.Client().Pods(env.GetBaseNamespace()).Get(ctx, p.podName, metav1.GetOptions{}) if err != nil { - return false, fmt.Errorf("Getting POD: %v failed : %v", p.podName, err) + return false, fmt.Errorf("getting POD: %v failed : %v", p.podName, err) } myHost := myPod.Status.HostIP @@ -60,14 +61,14 @@ func (p Pod) IsResolved(entrypoint entry.EntrypointInterface) (bool, error) { label := metav1.FormatLabelSelector(labelSelector) opts := metav1.ListOptions{LabelSelector: label} - matchingPodList, err := entrypoint.Client().Pods(p.namespace).List(opts) + matchingPodList, err := entrypoint.Client().Pods(p.namespace).List(ctx, opts) if err != nil { return false, err } matchingPods := matchingPodList.Items if len(matchingPods) == 0 { - return false, fmt.Errorf("Found no pods matching labels: %v", p.labels) + return false, fmt.Errorf("found no pods matching labels: %v", p.labels) } podCount := 0 @@ -86,9 +87,9 @@ func (p Pod) IsResolved(entrypoint entry.EntrypointInterface) (bool, error) { onHostClause = " on host" } if podCount == 0 { - return false, fmt.Errorf("Found no pods%v matching labels: %v", onHostClause, p.labels) + return false, fmt.Errorf("found no pods%v matching labels: %v", onHostClause, p.labels) } else { - return false, fmt.Errorf("Found %v pods%v, but none ready, matching labels: %v", podCount, onHostClause, p.labels) + return false, fmt.Errorf("found %v pods%v, but none ready, matching labels: %v", podCount, onHostClause, p.labels) } } diff --git a/dependencies/pod/pod_test.go b/dependencies/pod/pod_test.go index 798a851..7a08aa7 100644 --- a/dependencies/pod/pod_test.go +++ b/dependencies/pod/pod_test.go @@ -1,6 +1,7 @@ package pod import ( + "context" "fmt" "os" @@ -48,7 +49,7 @@ var _ = Describe("Pod", func() { It("is resolved via all pods matching labels ready on same host", func() { pod, _ := NewPod(map[string]string{"name": mocks.SameHostReadyMatchLabel}, podNamespace, requireSameNode) - isResolved, err := pod.IsResolved(testEntrypoint) + isResolved, err := pod.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeTrue()) Expect(err).NotTo(HaveOccurred()) @@ -57,7 +58,7 @@ var _ = Describe("Pod", func() { It("is resolved via some pods matching labels ready on same host", func() { pod, _ := NewPod(map[string]string{"name": mocks.SameHostSomeReadyMatchLabel}, podNamespace, requireSameNode) - isResolved, err := pod.IsResolved(testEntrypoint) + isResolved, err := pod.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeTrue()) Expect(err).NotTo(HaveOccurred()) @@ -66,7 +67,7 @@ var _ = Describe("Pod", func() { It("is not resolved via a pod matching labels not ready on same host", func() { pod, _ := NewPod(map[string]string{"name": mocks.SameHostNotReadyMatchLabel}, podNamespace, requireSameNode) - isResolved, err := pod.IsResolved(testEntrypoint) + isResolved, err := pod.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeFalse()) Expect(err).To(HaveOccurred()) @@ -75,7 +76,7 @@ var _ = Describe("Pod", func() { It("is not resolved via pod matching labels ready on different host", func() { pod, _ := NewPod(map[string]string{"name": mocks.DifferentHostReadyMatchLabel}, podNamespace, requireSameNode) - isResolved, err := pod.IsResolved(testEntrypoint) + isResolved, err := pod.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeFalse()) Expect(err).To(HaveOccurred()) @@ -84,7 +85,7 @@ var _ = Describe("Pod", func() { It("is resolved via pod matching labels ready on different host when requireSameNode=false", func() { pod, _ := NewPod(map[string]string{"name": mocks.DifferentHostReadyMatchLabel}, podNamespace, false) - isResolved, err := pod.IsResolved(testEntrypoint) + isResolved, err := pod.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeTrue()) Expect(err).NotTo(HaveOccurred()) @@ -93,7 +94,7 @@ var _ = Describe("Pod", func() { It("is not resolved via pod matching labels not ready on different host when requireSameNode=false", func() { pod, _ := NewPod(map[string]string{"name": mocks.DifferentHostNotReadyMatchLabel}, podNamespace, false) - isResolved, err := pod.IsResolved(testEntrypoint) + isResolved, err := pod.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeFalse()) Expect(err).To(HaveOccurred()) @@ -102,7 +103,7 @@ var _ = Describe("Pod", func() { It("is not resolved via no pods matching labels", func() { pod, _ := NewPod(map[string]string{"name": mocks.NoPodsMatchLabel}, podNamespace, requireSameNode) - isResolved, err := pod.IsResolved(testEntrypoint) + isResolved, err := pod.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeFalse()) Expect(err).To(HaveOccurred()) @@ -111,7 +112,7 @@ var _ = Describe("Pod", func() { It("is not resolved when getting pods matching labels from api fails", func() { pod, _ := NewPod(map[string]string{"name": mocks.FailingMatchLabel}, podNamespace, requireSameNode) - isResolved, err := pod.IsResolved(testEntrypoint) + isResolved, err := pod.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeFalse()) Expect(err).To(HaveOccurred()) @@ -121,7 +122,7 @@ var _ = Describe("Pod", func() { os.Setenv(PodNameEnvVar, mocks.PodNotPresent) pod, _ := NewPod(map[string]string{"name": mocks.SameHostReadyMatchLabel}, podNamespace, requireSameNode) - isResolved, err := pod.IsResolved(testEntrypoint) + isResolved, err := pod.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(BeFalse()) Expect(err).To(HaveOccurred()) diff --git a/dependencies/service/service.go b/dependencies/service/service.go index 5cee07e..1af073b 100644 --- a/dependencies/service/service.go +++ b/dependencies/service/service.go @@ -1,6 +1,7 @@ package service import ( + "context" "fmt" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -35,8 +36,8 @@ func NewService(name string, namespace string) Service { } -func (s Service) IsResolved(entrypoint entry.EntrypointInterface) (bool, error) { - e, err := entrypoint.Client().Endpoints(s.namespace).Get(s.name, metav1.GetOptions{}) +func (s Service) IsResolved(ctx context.Context, entrypoint entry.EntrypointInterface) (bool, error) { + e, err := entrypoint.Client().Endpoints(s.namespace).Get(ctx, s.name, metav1.GetOptions{}) if err != nil { return false, err } diff --git a/dependencies/service/service_test.go b/dependencies/service/service_test.go index 7dbb85f..ff4b029 100644 --- a/dependencies/service/service_test.go +++ b/dependencies/service/service_test.go @@ -1,6 +1,7 @@ package service import ( + "context" "fmt" . "github.com/onsi/ginkgo" @@ -31,7 +32,7 @@ var _ = Describe("Service", func() { It("checks resolution of a succeeding service", func() { service := NewService(mocks.SucceedingServiceName, mocks.SucceedingServiceName) - isResolved, err := service.IsResolved(testEntrypoint) + isResolved, err := service.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(Equal(true)) Expect(err).NotTo(HaveOccurred()) @@ -40,7 +41,7 @@ var _ = Describe("Service", func() { It("checks resolution failure of a failing service", func() { service := NewService(mocks.FailingServiceName, mocks.FailingServiceName) - isResolved, err := service.IsResolved(testEntrypoint) + isResolved, err := service.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(Equal(false)) Expect(err.Error()).To(Equal(mocks.MockEndpointError)) @@ -49,7 +50,7 @@ var _ = Describe("Service", func() { It("checks resolution failure of a succeeding service with removed subsets", func() { service := NewService(mocks.EmptySubsetsServiceName, mocks.EmptySubsetsServiceName) - isResolved, err := service.IsResolved(testEntrypoint) + isResolved, err := service.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(Equal(false)) Expect(err.Error()).To(Equal(fmt.Sprintf(FailingStatusFormat, service.name))) }) diff --git a/dependencies/socket/socket.go b/dependencies/socket/socket.go index abf117d..9758c50 100644 --- a/dependencies/socket/socket.go +++ b/dependencies/socket/socket.go @@ -1,6 +1,7 @@ package socket import ( + "context" "fmt" "os" @@ -12,8 +13,8 @@ import ( const ( NonExistingErrorFormat = "%s doesn't exists" - NoPermsErrorFormat = "I have no permission to %s" - NamespaceNotSupported = "Socket doesn't accept namespace" + NoPermsErrorFormat = "no permission to %s" + NamespaceNotSupported = "socket doesn't accept namespace" ) type Socket struct { @@ -39,7 +40,7 @@ func NewSocket(name string) Socket { return Socket{name: name} } -func (s Socket) IsResolved(entrypoint entry.EntrypointInterface) (bool, error) { +func (s Socket) IsResolved(ctx context.Context, entrypoint entry.EntrypointInterface) (bool, error) { _, err := os.Stat(s.name) if err == nil { return true, nil diff --git a/dependencies/socket/socket_test.go b/dependencies/socket/socket_test.go index 3921a36..df93785 100644 --- a/dependencies/socket/socket_test.go +++ b/dependencies/socket/socket_test.go @@ -1,8 +1,8 @@ package socket import ( + "context" "fmt" - "io/ioutil" "os" "path/filepath" @@ -40,7 +40,7 @@ var _ = Describe("Socket", func() { testEntrypoint = mocks.NewEntrypoint() var err error - testDir, err = ioutil.TempDir("", tempPathSuffix) + testDir, err = os.MkdirTemp("", tempPathSuffix) Expect(err).NotTo(HaveOccurred()) existingSocketPath = filepath.Join(testDir, existingSocket) @@ -64,7 +64,7 @@ var _ = Describe("Socket", func() { It("resolves an existing socket socket", func() { socket := NewSocket(existingSocketPath) - isResolved, err := socket.IsResolved(testEntrypoint) + isResolved, err := socket.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(Equal(true)) Expect(err).NotTo(HaveOccurred()) @@ -73,7 +73,7 @@ var _ = Describe("Socket", func() { It("fails on trying to resolve a nonexisting socket", func() { socket := NewSocket(nonExistingSocketPath) - isResolved, err := socket.IsResolved(testEntrypoint) + isResolved, err := socket.IsResolved(context.TODO(), testEntrypoint) Expect(isResolved).To(Equal(false)) Expect(err).To(HaveOccurred()) diff --git a/entrypoint/entrypoint.go b/entrypoint/entrypoint.go index d2df5b1..90a5fe7 100644 --- a/entrypoint/entrypoint.go +++ b/entrypoint/entrypoint.go @@ -1,6 +1,7 @@ package entrypoint import ( + "context" "sync" "time" @@ -18,9 +19,9 @@ const ( resolverSleepInterval = 2 ) -//Resolver is an interface which all dependencies should implement +// Resolver is an interface which all dependencies should implement type Resolver interface { - IsResolved(entrypoint EntrypointInterface) (bool, error) + IsResolved(ctx context.Context, entrypoint EntrypointInterface) (bool, error) } type EntrypointInterface interface { @@ -34,7 +35,7 @@ type Entrypoint struct { namespace string } -//Register is a function which registers new dependencies +// Register is a function which registers new dependencies func Register(res Resolver) { if res == nil { panic("Entrypoint: could not register nil Resolver") @@ -42,7 +43,7 @@ func Register(res Resolver) { dependencies = append(dependencies, res) } -//New is a constructor for entrypoint +// New is a constructor for entrypoint func New(config *rest.Config) (entry *Entrypoint, err error) { entry = new(Entrypoint) client, err := client.New(config) @@ -57,8 +58,9 @@ func (e Entrypoint) Client() (client client.ClientInterface) { return e.client } -//Resolve is a main loop which iterates through all dependencies and resolves them +// Resolve is a main loop which iterates through all dependencies and resolves them func (e Entrypoint) Resolve() { + ctx := context.Background() var wg sync.WaitGroup for _, dep := range dependencies { wg.Add(1) @@ -68,7 +70,7 @@ func (e Entrypoint) Resolve() { var err error status := false for !status { - if status, err = dep.IsResolved(e); err != nil { + if status, err = dep.IsResolved(ctx, e); err != nil { logger.Warning.Printf("Resolving dependency %+v failed: %v .", dep, err) } time.Sleep(resolverSleepInterval * time.Second) diff --git a/entrypoint/entrypoint_test.go b/entrypoint/entrypoint_test.go index cf0e8c1..d090e26 100644 --- a/entrypoint/entrypoint_test.go +++ b/entrypoint/entrypoint_test.go @@ -1,8 +1,9 @@ package entrypoint import ( + "context" "fmt" - "io/ioutil" + "io" "os" "time" @@ -28,7 +29,7 @@ type dummyResolver struct { namespace string } -func (d dummyResolver) IsResolved(entry EntrypointInterface) (bool, error) { +func (d dummyResolver) IsResolved(ctx context.Context, entry EntrypointInterface) (bool, error) { return true, nil } func (d dummyResolver) GetName() (name string) { @@ -103,7 +104,7 @@ var _ = Describe("Entrypoint", func() { // Wait for resolver to finish time.Sleep(5 * time.Second) - stdout, _ := ioutil.ReadAll(r) + stdout, _ := io.ReadAll(r) resolvedString := fmt.Sprintf("%sResolving %v\n%sDependency %v is resolved.\n", loggerInfoText, dummy, loggerInfoText, dummy) Expect(string(stdout)).To(Equal(resolvedString)) diff --git a/go.mod b/go.mod index c450820..ecca560 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,113 @@ module opendev.org/airship/kubernetes-entrypoint -go 1.12 +go 1.21 require ( github.com/golangci/golangci-lint v1.18.0 github.com/onsi/ginkgo v1.10.1 - github.com/onsi/gomega v1.7.0 - golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0 // indirect - google.golang.org/appengine v1.6.1 // indirect - k8s.io/api v0.0.0-20190918155943-95b840bb6a1f - k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655 - k8s.io/client-go v0.0.0-20190918160344-1fbdaa4c8d90 + github.com/onsi/gomega v1.29.0 + k8s.io/api v0.29.0 + k8s.io/apimachinery v0.29.0 + k8s.io/client-go v0.29.0 +) + +require ( + github.com/BurntSushi/toml v0.3.1 // indirect + github.com/OpenPeeDeeP/depguard v1.0.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/fatih/color v1.6.0 // indirect + github.com/fsnotify/fsnotify v1.4.7 // indirect + github.com/go-critic/go-critic v0.3.5-0.20190526074819-1df300866540 // indirect + github.com/go-lintpack/lintpack v0.5.2 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-toolsmith/astcast v1.0.0 // indirect + github.com/go-toolsmith/astcopy v1.0.0 // indirect + github.com/go-toolsmith/astequal v1.0.0 // indirect + github.com/go-toolsmith/astfmt v1.0.0 // indirect + github.com/go-toolsmith/astp v1.0.0 // indirect + github.com/go-toolsmith/strparse v1.0.0 // indirect + github.com/go-toolsmith/typep v1.0.0 // indirect + github.com/gobwas/glob v0.2.3 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/mock v1.2.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect + github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect + github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6 // indirect + github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613 // indirect + github.com/golangci/go-tools v0.0.0-20190318055746-e32c54105b7c // indirect + github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3 // indirect + github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee // indirect + github.com/golangci/gofmt v0.0.0-20181222123516-0b8337e80d98 // indirect + github.com/golangci/gosec v0.0.0-20190211064107-66fb7fc33547 // indirect + github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc // indirect + github.com/golangci/lint-1 v0.0.0-20190420132249-ee948d087217 // indirect + github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect + github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770 // indirect + github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21 // indirect + github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0 // indirect + github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect + github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3 // indirect + github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce // indirect + github.com/hpcloud/tail v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/kisielk/gotool v1.0.0 // indirect + github.com/magiconair/properties v1.7.6 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mattn/go-colorable v0.0.9 // indirect + github.com/mattn/go-isatty v0.0.3 // indirect + github.com/mitchellh/go-homedir v1.0.0 // indirect + github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/nbutton23/zxcvbn-go v0.0.0-20171102151520-eafdab6b0663 // indirect + github.com/pelletier/go-toml v1.1.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/sirupsen/logrus v1.0.5 // indirect + github.com/sourcegraph/go-diff v0.5.1 // indirect + github.com/spf13/afero v1.2.2 // indirect + github.com/spf13/cast v1.2.0 // indirect + github.com/spf13/cobra v0.0.2 // indirect + github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.0.2 // indirect + github.com/timakin/bodyclose v0.0.0-20190721030226-87058b9bfcec // indirect + github.com/ultraware/funlen v0.0.1 // indirect + golang.org/x/crypto v0.14.0 // indirect + golang.org/x/mod v0.12.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/oauth2 v0.10.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/term v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.12.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/fsnotify.v1 v1.4.7 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/klog/v2 v2.110.1 // indirect + k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect + k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect + mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect + mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect + sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4 // indirect ) diff --git a/go.sum b/go.sum index fb167cf..73d8dc6 100644 --- a/go.sum +++ b/go.sum @@ -1,46 +1,33 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OpenPeeDeeP/depguard v1.0.0 h1:k9QF73nrHT3nPLz3lu6G5s+3Hi8Je36ODr1F5gjAXXM= github.com/OpenPeeDeeP/depguard v1.0.0/go.mod h1:7/4sitnI9YlQgTLLk734QlzXT8DuHVnAyztLplQjk+o= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/fatih/color v1.6.0 h1:66qjqZk8kalYAvDRtM1AdAJQI0tj4Wrue3Eq3B3pmFU= github.com/fatih/color v1.6.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-critic/go-critic v0.3.5-0.20190526074819-1df300866540 h1:djv/qAomOVj8voCHt0M0OYwR/4vfDq1zNKSPKjJCexs= github.com/go-critic/go-critic v0.3.5-0.20190526074819-1df300866540/go.mod h1:+sE8vrLDS2M0pZkBk0wy6+nLdKexVDrl/jBqQOTDThA= github.com/go-lintpack/lintpack v0.5.2 h1:DI5mA3+eKdWeJ40nU4d6Wc26qmdG8RCi/btYq0TuRN0= github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/go-toolsmith/astcast v1.0.0 h1:JojxlmI6STnFVG9yOImLeGREv8W2ocNUM+iOhR6jE7g= github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= github.com/go-toolsmith/astcopy v1.0.0 h1:OMgl1b1MEpjFQ1m5ztEO06rz5CUd3oBv9RF7+DyvdG8= @@ -64,23 +51,17 @@ github.com/go-toolsmith/typep v1.0.0 h1:zKymWyA1TRYvqYrYDrfEMZULyrhcnGY3x7LDKU2X github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.0.0 h1:HzcpUG60pfl43n9d2qbdi/3l1uKpAmxlfWEPWtV/QxM= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/mock v1.0.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= @@ -115,41 +96,33 @@ github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0 h1:HVfrLniijszjS1 github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367 h1:ScAXWS+TR6MZKex+7Z8rneuSJH+FSDqd6ocQyl+ZHo4= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3 h1:JVnpOZS+qxli+rgVl98ILOXVNbW+kb5wcxeGx8ShUIw= github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= -github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7 h1:6TSoaYExHper8PYsJu23GWVNOyYRCSnIFyxKgLSZ54w= -github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce h1:xdsDDbiBDQTKASoGEZ+pEmF1OnWuu8AQ9I8iNbHNeno= github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3 h1:/UewZcckqhvnnS0C6r3Sher2hSEbVmM6Ogpcjen08+Y= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v0.0.0-20161130080628-0de1eaf82fa3/go.mod h1:jxZFDH7ILpTPQTk+E2s+z4CUas9lVNjIuKR4c5/zKgM= github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -157,15 +130,19 @@ github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0 github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/magiconair/properties v1.7.6 h1:U+1DqNen04MdEPgFiIwdOUiqZ8qPa37xgogX/sd3+54= github.com/magiconair/properties v1.7.6/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI= @@ -179,39 +156,35 @@ github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:F github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da h1:ZQGIPjr1iTtUPXZFk8WShqb5G+Qg65VHFLtSvmHh+Mw= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mozilla/tls-observatory v0.0.0-20180409132520-8791a200eb40/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/nbutton23/zxcvbn-go v0.0.0-20160627004424-a22cb81b2ecd/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= github.com/nbutton23/zxcvbn-go v0.0.0-20171102151520-eafdab6b0663 h1:Ri1EhipkbhWsffPJ3IPlrb4SkTOPa2PfRXp3jchBczw= github.com/nbutton23/zxcvbn-go v0.0.0-20171102151520-eafdab6b0663/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= +github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/pelletier/go-toml v1.1.0 h1:cmiOvKzEunMsAxyhXSzpL5Q1CRKpVv0KQsnAIcSEVYM= github.com/pelletier/go-toml v1.1.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/ryanuber/go-glob v0.0.0-20170128012129-256dc444b735/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= @@ -223,7 +196,6 @@ github.com/sirupsen/logrus v1.0.5 h1:8c8b5uO0zS4X6RPl/sd1ENwSkIc0/H2PaHxE3udaE8I github.com/sirupsen/logrus v1.0.5/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sourcegraph/go-diff v0.5.1 h1:gO6i5zugwzo1RVTvgvfwCOSVegNuvnNi6bAD1QCmkHs= github.com/sourcegraph/go-diff v0.5.1/go.mod h1:j2dHj3m8aZgQO8lMTcTnBcXkRRRqi34cd2MNlA9u1mE= -github.com/spf13/afero v1.1.0 h1:bopulORc2JeYaxfHLvJa5NzxviA9PoWhpiiJkru7Ji4= github.com/spf13/afero v1.1.0/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= @@ -233,19 +205,21 @@ github.com/spf13/cobra v0.0.2 h1:NfkwRbgViGoyjBKsLI0QMDcuMnhM+SBg3T0cGfpvKDE= github.com/spf13/cobra v0.0.2/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec h1:2ZXvIUGghLpdTVHR1UfvfrzoVlZaE/yOWC5LueIHZig= github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.0.2 h1:Ncr3ZIuJn322w2k1qmzXDnkLAdQMlJqBa9kfAH+irso= github.com/spf13/viper v1.0.2/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/timakin/bodyclose v0.0.0-20190721030226-87058b9bfcec h1:AmoEvWAO3nDx1MEcMzPh+GzOOIA5Znpv6++c7bePPY0= github.com/timakin/bodyclose v0.0.0-20190721030226-87058b9bfcec/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= github.com/ultraware/funlen v0.0.1 h1:UeC9tpM4wNWzUJfan8z9sFE4QCzjjzlCZmuJN+aOkH0= @@ -254,142 +228,127 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s= github.com/valyala/quicktemplate v1.1.1/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 h1:58fnuSXlxZmFdJyvtTFVmVhcMLU6v5fEb/ok4wyqtNU= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 h1:1wopBVtVdWnn03fZelqdXTqk7U7zPQCb+T4rbU9ZEoU= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20170915142106-8351a756f30f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65 h1:+rhAzEzT3f4JtomfC371qB+0Ola2caSKcY69NUBZrRQ= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc h1:gkKoSkUmnU6bpS/VhkuO27bzQeSA51uaEfbOW5dNb68= -golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20171026204733-164713f0dfce/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e h1:o3PsSEY8E4eXWkXrIP9YJALUkVZqzHJT5DOasTyn8Vs= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c h1:+EXw7AwNOKzPFXMZ1yNjO40aWCh3PIquJB2fYlv9wcs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f h1:25KHgbfyiSm6vwQLbM3zZIe1v9p/3ea4Rz+nnM5K/i4= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.0.0-20170915090833-1cbadb444a80/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0 h1:xQwXv67TxFo9nC1GJFyab5eq/5B590r6RlnL/G8Sz7w= -golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20170915040203-e531a2a1c15f/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190121143147-24cd39ecf745/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b h1:mSUCVIwDx4hfXJfWsOPfdzEHxzb2Xjl6BQ8YgPnazQA= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190909030654-5b82db07426d h1:PhtdWYteEBebOX7KXm4qkIAVSUTHQ883/2hRB92r9lk= golang.org/x/tools v0.0.0-20190909030654-5b82db07426d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= +golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/airbrake/gobrake.v2 v2.0.9 h1:7z2uVWwn7oVeeugY1DtlPAy5H+KYgB1KeKTnqjNatLo= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 h1:OAj3g0cR6Dx/R07QgQe8wkA9RNjB2u4i700xBkIT4e0= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= -gopkg.in/inf.v0 v0.9.0 h1:3zYtXIO92bvsdS3ggAdA8Gb4Azj0YU+TVY1uGYNFA8o= -gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.0.0-20190918155943-95b840bb6a1f h1:8FRUST8oUkEI45WYKyD8ed7Ad0Kg5v11zHyPkEVb2xo= -k8s.io/api v0.0.0-20190918155943-95b840bb6a1f/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48= -k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655 h1:CS1tBQz3HOXiseWZu6ZicKX361CZLT97UFnnPx0aqBw= -k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655/go.mod h1:nL6pwRT8NgfF8TT68DBI8uEePRt89cSvoXUVqbkWHq4= -k8s.io/client-go v0.0.0-20190918160344-1fbdaa4c8d90 h1:mLmhKUm1X+pXu0zXMEzNsOF5E2kKFGe5o6BZBIIqA6A= -k8s.io/client-go v0.0.0-20190918160344-1fbdaa4c8d90/go.mod h1:J69/JveO6XESwVgG53q3Uz5OSfgsv4uxpScmmyYOOlk= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.4.0 h1:lCJCxf/LIowc2IGS9TPjWDyXY4nOmdGdfcwwDQCOURQ= -k8s.io/klog v0.4.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20190801114015-581e00157fb1 h1:+ySTxfHnfzZb9ys375PXNlLhkJPLKgHajBU0N62BDvE= -k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/api v0.29.0 h1:NiCdQMY1QOp1H8lfRyeEf8eOwV6+0xA6XEE44ohDX2A= +k8s.io/api v0.29.0/go.mod h1:sdVmXoz2Bo/cb77Pxi71IPTSErEW32xa4aXwKH7gfBA= +k8s.io/apimachinery v0.29.0 h1:+ACVktwyicPz0oc6MTMLwa2Pw3ouLAfAon1wPLtG48o= +k8s.io/apimachinery v0.29.0/go.mod h1:eVBxQ/cwiJxH58eK/jd/vAk4mrxmVlnpBH5J2GbMeis= +k8s.io/client-go v0.29.0 h1:KmlDtFcrdUzOYrBhXHgKw5ycWzc3ryPX5mQe0SkG3y8= +k8s.io/client-go v0.29.0/go.mod h1:yLkXH4HKMAywcrD82KMSmfYg2DlE8mepPR4JGSo5n38= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34 h1:duVSyluuJA+u0BnkcLR01smoLrGgDTfWt5c8ODYG8fU= mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34/go.mod h1:H6SUd1XjIs+qQCyskXg5OFSrilMRUkD8ePJpHKDPaeY= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4 h1:JPJh2pk3+X4lXAkZIk2RuE/7/FoK9maXw+TNPJhVS/c= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= diff --git a/images/Dockerfile.ubuntu_focal b/images/Dockerfile.ubuntu_focal index 06b39a3..522d48f 100644 --- a/images/Dockerfile.ubuntu_focal +++ b/images/Dockerfile.ubuntu_focal @@ -1,6 +1,6 @@ ARG FROM=ubuntu:20.04 # Build the manager binary -FROM golang:1.12.6-stretch as builder +FROM golang:1.21-bullseye as builder ARG TARGETOS ARG TARGETARCH diff --git a/mocks/client.go b/mocks/client.go index 049d6a4..7da7c7d 100644 --- a/mocks/client.go +++ b/mocks/client.go @@ -1,6 +1,8 @@ package mocks import ( + "context" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" v1apps "k8s.io/client-go/kubernetes/typed/apps/v1" v1batch "k8s.io/client-go/kubernetes/typed/batch/v1" @@ -38,7 +40,7 @@ func (c Client) Jobs(namespace string) v1batch.JobInterface { return c.JobInterface } -func (c Client) CustomResource(apiVersion, namespace, resource, name string) (*unstructured.Unstructured, error) { +func (c Client) CustomResource(ctx context.Context, apiVersion, namespace, resource, name string) (*unstructured.Unstructured, error) { return c.FakeCustomResource, c.Err } diff --git a/mocks/daemonset.go b/mocks/daemonset.go index e794dbb..1127aea 100644 --- a/mocks/daemonset.go +++ b/mocks/daemonset.go @@ -1,12 +1,14 @@ package mocks import ( + "context" "fmt" v1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" + appsv1applyconfigurations "k8s.io/client-go/applyconfigurations/apps/v1" appsv1 "k8s.io/client-go/kubernetes/typed/apps/v1" ) @@ -24,9 +26,29 @@ const ( NotReadyMatchLabelsDaemonsetName = "DAEMONSET_NOT_READY_MATCH_LABELS" ) -func (d dClient) Get(name string, opts metav1.GetOptions) (*v1.DaemonSet, error) { +func (d dClient) Create(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.CreateOptions) (*v1.DaemonSet, error) { + return nil, fmt.Errorf("not implemented") +} + +func (d dClient) Update(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (*v1.DaemonSet, error) { + return nil, fmt.Errorf("not implemented") +} + +func (d dClient) UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (*v1.DaemonSet, error) { + return nil, fmt.Errorf("not implemented") +} + +func (d dClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return fmt.Errorf("not implemented") +} + +func (d dClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return fmt.Errorf("not implemented") +} + +func (d dClient) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DaemonSet, error) { if name == FailingDaemonsetName || name == IncorrectNamespaceDaemonsetName { - return nil, fmt.Errorf("Mock daemonset didn't work") + return nil, fmt.Errorf("mock daemonset didn't work") } matchLabelName := MockContainerName @@ -52,36 +74,25 @@ func (d dClient) Get(name string, opts metav1.GetOptions) (*v1.DaemonSet, error) return ds, nil } -func (d dClient) Create(*v1.DaemonSet) (*v1.DaemonSet, error) { - return nil, fmt.Errorf("Not implemented") + +func (d dClient) List(ctx context.Context, opts metav1.ListOptions) (*v1.DaemonSetList, error) { + return nil, fmt.Errorf("not implemented") } -func (d dClient) Delete(name string, options *metav1.DeleteOptions) error { - return fmt.Errorf("Not implemented") -} -func (d dClient) List(options metav1.ListOptions) (*v1.DaemonSetList, error) { - return nil, fmt.Errorf("Not implemented") +func (d dClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, fmt.Errorf("not implemented") } -func (d dClient) Update(ds *v1.DaemonSet) (*v1.DaemonSet, error) { - return nil, fmt.Errorf("Not implemented") +func (d dClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DaemonSet, err error) { + return nil, fmt.Errorf("not implemented") } -func (d dClient) UpdateStatus(ds *v1.DaemonSet) (*v1.DaemonSet, error) { - return nil, fmt.Errorf("Not implemented") +func (d dClient) Apply(ctx context.Context, daemonSet *appsv1applyconfigurations.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DaemonSet, err error) { + return nil, fmt.Errorf("not implemented") } -func (d dClient) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { - return fmt.Errorf("Not implemented") -} - -func (d dClient) Watch(options metav1.ListOptions) (watch.Interface, error) { - return nil, fmt.Errorf("Not implemented") -} - -func (d dClient) Patch(name string, pt types.PatchType, data []byte, - subresources ...string) (result *v1.DaemonSet, err error) { - return nil, fmt.Errorf("Not implemented") +func (d dClient) ApplyStatus(ctx context.Context, daemonSet *appsv1applyconfigurations.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DaemonSet, err error) { + return nil, fmt.Errorf("not implemented") } func NewDSClient() appsv1.DaemonSetInterface { diff --git a/mocks/endpoints.go b/mocks/endpoints.go index bf118f0..6acf52c 100644 --- a/mocks/endpoints.go +++ b/mocks/endpoints.go @@ -1,24 +1,41 @@ package mocks import ( + "context" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - v1core "k8s.io/client-go/kubernetes/typed/core/v1" - rest "k8s.io/client-go/rest" + corev1applyconfigurations "k8s.io/client-go/applyconfigurations/core/v1" + corev1 "k8s.io/client-go/kubernetes/typed/core/v1" ) type eClient struct { } const ( - MockEndpointError = "Mock endpoint didnt work" + MockEndpointError = "mock endpoint didnt work" ) -func (e eClient) Get(name string, opts metav1.GetOptions) (*v1.Endpoints, error) { +func (e eClient) Create(ctx context.Context, endpoints *v1.Endpoints, opts metav1.CreateOptions) (*v1.Endpoints, error) { + return nil, fmt.Errorf("not implemented") +} + +func (e eClient) Update(ctx context.Context, endpoints *v1.Endpoints, opts metav1.UpdateOptions) (*v1.Endpoints, error) { + return nil, fmt.Errorf("not implemented") +} + +func (e eClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return fmt.Errorf("not implemented") +} + +func (e eClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return fmt.Errorf("not implemented") +} + +func (e eClient) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Endpoints, error) { if name == FailingServiceName { return nil, fmt.Errorf(MockEndpointError) } @@ -42,44 +59,23 @@ func (e eClient) Get(name string, opts metav1.GetOptions) (*v1.Endpoints, error) return endpoint, nil } -func (e eClient) Create(ds *v1.Endpoints) (*v1.Endpoints, error) { - return nil, fmt.Errorf("Not implemented") + +func (e eClient) List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointsList, error) { + return nil, fmt.Errorf("not implemented") } -func (e eClient) Delete(name string, options *metav1.DeleteOptions) error { - return fmt.Errorf("Not implemented") +func (e eClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, fmt.Errorf("not implemented") } -func (e eClient) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { - return fmt.Errorf("Not implemented") +func (e eClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Endpoints, err error) { + return nil, fmt.Errorf("not implemented") } -func (e eClient) List(options metav1.ListOptions) (*v1.EndpointsList, error) { - return nil, fmt.Errorf("Not implemented") +func (e eClient) Apply(ctx context.Context, endpoints *corev1applyconfigurations.EndpointsApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Endpoints, err error) { + return nil, fmt.Errorf("not implemented") } -func (e eClient) Update(ds *v1.Endpoints) (*v1.Endpoints, error) { - return nil, fmt.Errorf("Not implemented") -} - -func (s eClient) UpdateStatus(ds *v1.Endpoints) (*v1.Endpoints, error) { - return nil, fmt.Errorf("Not implemented") -} - -func (e eClient) Watch(options metav1.ListOptions) (watch.Interface, error) { - return nil, fmt.Errorf("Not implemented") -} - -func (e eClient) ProxyGet(scheme string, name string, port string, path string, - params map[string]string) rest.ResponseWrapper { - return nil -} - -func (e eClient) Patch(name string, pt types.PatchType, data []byte, - subresources ...string) (result *v1.Endpoints, err error) { - return nil, fmt.Errorf("Not implemented") -} - -func NewEClient() v1core.EndpointsInterface { +func NewEClient() corev1.EndpointsInterface { return eClient{} } diff --git a/mocks/job.go b/mocks/job.go index bd15ca9..8baeb19 100644 --- a/mocks/job.go +++ b/mocks/job.go @@ -1,12 +1,14 @@ package mocks import ( + "context" "fmt" v1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" + batchv1applyconfigurations "k8s.io/client-go/applyconfigurations/batch/v1" v1batch "k8s.io/client-go/kubernetes/typed/batch/v1" ) @@ -20,7 +22,27 @@ const ( type jClient struct { } -func (j jClient) Get(name string, opts metav1.GetOptions) (*v1.Job, error) { +func (j jClient) Create(ctx context.Context, job *v1.Job, opts metav1.CreateOptions) (*v1.Job, error) { + return nil, fmt.Errorf("not implemented") +} + +func (j jClient) Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (*v1.Job, error) { + return nil, fmt.Errorf("not implemented") +} + +func (j jClient) UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (*v1.Job, error) { + return nil, fmt.Errorf("not implemented") +} + +func (j jClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return fmt.Errorf("not implemented") +} + +func (j jClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return fmt.Errorf("not implemented") +} + +func (j jClient) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Job, error) { if name == SucceedingJobName { return &v1.Job{ Status: v1.JobStatus{Succeeded: 1}, @@ -31,28 +53,19 @@ func (j jClient) Get(name string, opts metav1.GetOptions) (*v1.Job, error) { Status: v1.JobStatus{Succeeded: 0}, }, nil } - return nil, fmt.Errorf("Mock job didnt work") -} -func (j jClient) Create(job *v1.Job) (*v1.Job, error) { - return nil, fmt.Errorf("Not implemented") + return nil, fmt.Errorf("mock job didnt work") } -func (j jClient) Delete(name string, opts *metav1.DeleteOptions) error { - return fmt.Errorf("Not implemented") -} -func (j jClient) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { - return fmt.Errorf("Not implemented") -} -func (j jClient) List(options metav1.ListOptions) (*v1.JobList, error) { +func (j jClient) List(ctx context.Context, opts metav1.ListOptions) (*v1.JobList, error) { var jobs []v1.Job - switch options.LabelSelector { + switch opts.LabelSelector { case fmt.Sprintf("name=%s", SucceedingJobLabel): jobs = []v1.Job{NewJob(1)} case fmt.Sprintf("name=%s", FailingJobLabel): jobs = []v1.Job{NewJob(1), NewJob(0)} default: - return nil, fmt.Errorf("Mock job didnt work") + return nil, fmt.Errorf("mock job didnt work") } return &v1.JobList{ @@ -60,22 +73,22 @@ func (j jClient) List(options metav1.ListOptions) (*v1.JobList, error) { }, nil } -func (j jClient) Update(job *v1.Job) (*v1.Job, error) { - return nil, fmt.Errorf("Not implemented") +func (j jClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, fmt.Errorf("not implemented") } -func (j jClient) UpdateStatus(job *v1.Job) (*v1.Job, error) { - return nil, fmt.Errorf("Not implemented") +func (j jClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Job, err error) { + return nil, fmt.Errorf("not implemented") } -func (j jClient) Watch(options metav1.ListOptions) (watch.Interface, error) { - return nil, fmt.Errorf("Not implemented") +func (j jClient) Apply(ctx context.Context, job *batchv1applyconfigurations.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error) { + return nil, fmt.Errorf("not implemented") } -func (j jClient) Patch(name string, pt types.PatchType, data []byte, - subresources ...string) (result *v1.Job, err error) { - return nil, fmt.Errorf("Not implemented") +func (j jClient) ApplyStatus(ctx context.Context, job *batchv1applyconfigurations.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error) { + return nil, fmt.Errorf("not implemented") } + func NewJClient() v1batch.JobInterface { return jClient{} } diff --git a/mocks/pod.go b/mocks/pod.go index ea52370..02523c7 100644 --- a/mocks/pod.go +++ b/mocks/pod.go @@ -1,15 +1,18 @@ package mocks import ( + "context" "fmt" v1 "k8s.io/api/core/v1" - policy "k8s.io/api/policy/v1beta1" + policyv1 "k8s.io/api/policy/v1" + policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" + corev1applyconfigurations "k8s.io/client-go/applyconfigurations/core/v1" v1core "k8s.io/client-go/kubernetes/typed/core/v1" - rest "k8s.io/client-go/rest" + restclient "k8s.io/client-go/rest" ) const MockContainerName = "TEST_CONTAINER" @@ -29,9 +32,29 @@ const ( NoPodsMatchLabel = "NO_PODS" ) -func (p pClient) Get(name string, opts metav1.GetOptions) (*v1.Pod, error) { +func (p pClient) Create(ctx context.Context, pod *v1.Pod, opts metav1.CreateOptions) (*v1.Pod, error) { + return nil, fmt.Errorf("not implemented") +} + +func (p pClient) Update(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) { + return nil, fmt.Errorf("not implemented") +} + +func (p pClient) UpdateStatus(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) { + return nil, fmt.Errorf("not implemented") +} + +func (p pClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return fmt.Errorf("not implemented") +} + +func (p pClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return fmt.Errorf("not implemented") +} + +func (p pClient) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Pod, error) { if name == PodNotPresent { - return nil, fmt.Errorf("Could not get pod with the name %s", name) + return nil, fmt.Errorf("could not get pod with the name %s", name) } return &v1.Pod{ @@ -46,22 +69,10 @@ func (p pClient) Get(name string, opts metav1.GetOptions) (*v1.Pod, error) { HostIP: "127.0.0.1", }, }, nil - -} -func (p pClient) Create(pod *v1.Pod) (*v1.Pod, error) { - return nil, fmt.Errorf("Not implemented") } -func (p pClient) Delete(name string, options *metav1.DeleteOptions) error { - return fmt.Errorf("Not implemented") -} - -func (p pClient) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { - return fmt.Errorf("Not implemented") -} - -func (p pClient) List(options metav1.ListOptions) (*v1.PodList, error) { - if options.LabelSelector == fmt.Sprintf("name=%s", FailingMatchLabel) { +func (p pClient) List(ctx context.Context, opts metav1.ListOptions) (*v1.PodList, error) { + if opts.LabelSelector == fmt.Sprintf("name=%s", FailingMatchLabel) { return nil, fmt.Errorf("Client received incorrect pod label names") } @@ -72,22 +83,22 @@ func (p pClient) List(options metav1.ListOptions) (*v1.PodList, error) { var pods []v1.Pod - if options.LabelSelector == fmt.Sprintf("name=%s", SameHostNotReadyMatchLabel) { + if opts.LabelSelector == fmt.Sprintf("name=%s", SameHostNotReadyMatchLabel) { pods = []v1.Pod{notReadyPodSameHost} } - if options.LabelSelector == fmt.Sprintf("name=%s", SameHostReadyMatchLabel) { + if opts.LabelSelector == fmt.Sprintf("name=%s", SameHostReadyMatchLabel) { pods = []v1.Pod{readyPodSameHost, notReadyPodDifferentHost} } - if options.LabelSelector == fmt.Sprintf("name=%s", SameHostSomeReadyMatchLabel) { + if opts.LabelSelector == fmt.Sprintf("name=%s", SameHostSomeReadyMatchLabel) { pods = []v1.Pod{readyPodSameHost, notReadyPodSameHost} } - if options.LabelSelector == fmt.Sprintf("name=%s", DifferentHostReadyMatchLabel) { + if opts.LabelSelector == fmt.Sprintf("name=%s", DifferentHostReadyMatchLabel) { pods = []v1.Pod{notReadyPodSameHost, readyPodDifferentHost} } - if options.LabelSelector == fmt.Sprintf("name=%s", DifferentHostNotReadyMatchLabel) { + if opts.LabelSelector == fmt.Sprintf("name=%s", DifferentHostNotReadyMatchLabel) { pods = []v1.Pod{notReadyPodDifferentHost} } - if options.LabelSelector == fmt.Sprintf("name=%s", NoPodsMatchLabel) { + if opts.LabelSelector == fmt.Sprintf("name=%s", NoPodsMatchLabel) { pods = []v1.Pod{} } @@ -96,43 +107,48 @@ func (p pClient) List(options metav1.ListOptions) (*v1.PodList, error) { }, nil } -func (p pClient) Update(pod *v1.Pod) (*v1.Pod, error) { - return nil, fmt.Errorf("Not implemented") +func (p pClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, fmt.Errorf("not implemented") } -func (p pClient) UpdateStatus(pod *v1.Pod) (*v1.Pod, error) { - return nil, fmt.Errorf("Not implemented") +func (p pClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Pod, err error) { + return nil, fmt.Errorf("not implemented") } -func (p pClient) Watch(options metav1.ListOptions) (watch.Interface, error) { - return nil, fmt.Errorf("Not implemented") +func (p pClient) Apply(ctx context.Context, pod *corev1applyconfigurations.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) { + return nil, fmt.Errorf("not implemented") } -func (p pClient) Bind(binding *v1.Binding) error { - return fmt.Errorf("Not implemented") +func (p pClient) ApplyStatus(ctx context.Context, pod *corev1applyconfigurations.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) { + return nil, fmt.Errorf("not implemented") } -func (p pClient) Evict(eviction *policy.Eviction) error { - return fmt.Errorf("Not implemented") +func (p pClient) UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) { + return nil, fmt.Errorf("not implemented") } -func (p pClient) GetLogs(name string, opts *v1.PodLogOptions) *rest.Request { +func (p pClient) Bind(ctx context.Context, binding *v1.Binding, opts metav1.CreateOptions) error { + return fmt.Errorf("not implemented") +} + +func (p pClient) Evict(ctx context.Context, eviction *policyv1beta1.Eviction) error { + return fmt.Errorf("not implemented") +} + +func (p pClient) EvictV1(ctx context.Context, eviction *policyv1.Eviction) error { + return fmt.Errorf("not implemented") +} + +func (p pClient) EvictV1beta1(ctx context.Context, eviction *policyv1beta1.Eviction) error { + return fmt.Errorf("not implemented") +} + +func (p pClient) GetLogs(name string, opts *v1.PodLogOptions) *restclient.Request { return nil } -func (p pClient) Patch(name string, pt types.PatchType, data []byte, - subresources ...string) (result *v1.Pod, err error) { - return nil, fmt.Errorf("Not implemented") -} - -func (p pClient) GetEphemeralContainers(podName string, - options metav1.GetOptions) (*v1.EphemeralContainers, error) { - return nil, fmt.Errorf("Not implemented") -} - -func (p pClient) UpdateEphemeralContainers(podName string, - ephemeralContainers *v1.EphemeralContainers) (*v1.EphemeralContainers, error) { - return nil, fmt.Errorf("Not implemented") +func (p pClient) ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper { + return nil } func NewPClient() v1core.PodInterface { diff --git a/mocks/service.go b/mocks/service.go index 81bb9b6..53ab7a6 100644 --- a/mocks/service.go +++ b/mocks/service.go @@ -1,27 +1,45 @@ package mocks import ( + "context" "fmt" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" + corev1applyconfigurations "k8s.io/client-go/applyconfigurations/core/v1" v1core "k8s.io/client-go/kubernetes/typed/core/v1" - rest "k8s.io/client-go/rest" + restclient "k8s.io/client-go/rest" ) type sClient struct { } const ( - MockServiceError = "Mock service didnt work" + MockServiceError = "mock service didnt work" SucceedingServiceName = "succeed" EmptySubsetsServiceName = "empty-subsets" FailingServiceName = "fail" ) -func (s sClient) Get(name string, opts metav1.GetOptions) (*v1.Service, error) { +func (s sClient) Create(ctx context.Context, service *v1.Service, opts metav1.CreateOptions) (*v1.Service, error) { + return nil, fmt.Errorf("not implemented") +} + +func (s sClient) Update(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (*v1.Service, error) { + return nil, fmt.Errorf("not implemented") +} + +func (s sClient) UpdateStatus(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (*v1.Service, error) { + return nil, fmt.Errorf("not implemented") +} + +func (s sClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return fmt.Errorf("not implemented") +} + +func (s sClient) Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Service, error) { if name == FailingServiceName { return nil, fmt.Errorf(MockServiceError) } @@ -29,44 +47,31 @@ func (s sClient) Get(name string, opts metav1.GetOptions) (*v1.Service, error) { ObjectMeta: metav1.ObjectMeta{Name: name}, }, nil } -func (s sClient) Create(ds *v1.Service) (*v1.Service, error) { - return nil, fmt.Errorf("Not implemented") + +func (s sClient) List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceList, error) { + return nil, fmt.Errorf("not implemented") } -func (s sClient) Delete(name string, options *metav1.DeleteOptions) error { - return fmt.Errorf("Not implemented") +func (s sClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return nil, fmt.Errorf("not implemented") } -func (s sClient) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { - return fmt.Errorf("Not implemented") +func (s sClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Service, err error) { + return nil, fmt.Errorf("not implemented") } -func (s sClient) List(options metav1.ListOptions) (*v1.ServiceList, error) { - return nil, fmt.Errorf("Not implemented") +func (s sClient) Apply(ctx context.Context, service *corev1applyconfigurations.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error) { + return nil, fmt.Errorf("not implemented") } -func (s sClient) Update(ds *v1.Service) (*v1.Service, error) { - return nil, fmt.Errorf("Not implemented") +func (s sClient) ApplyStatus(ctx context.Context, service *corev1applyconfigurations.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error) { + return nil, fmt.Errorf("not implemented") } -func (s sClient) UpdateStatus(ds *v1.Service) (*v1.Service, error) { - return nil, fmt.Errorf("Not implemented") -} - -func (s sClient) Watch(options metav1.ListOptions) (watch.Interface, error) { - return nil, fmt.Errorf("Not implemented") -} - -func (s sClient) ProxyGet(scheme string, name string, port string, path string, - params map[string]string) rest.ResponseWrapper { +func (s sClient) ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper { return nil } -func (s sClient) Patch(name string, pt types.PatchType, data []byte, - subresources ...string) (result *v1.Service, err error) { - return nil, fmt.Errorf("Not implemented") -} - func NewSClient() v1core.ServiceInterface { return sClient{} } diff --git a/util/env/env.go b/util/env/env.go index 116b46a..333a7e1 100644 --- a/util/env/env.go +++ b/util/env/env.go @@ -46,7 +46,7 @@ func SplitCommand() []string { return commandList } -//SplitEnvToDeps returns list of namespaces and names pairs +// SplitEnvToDeps returns list of namespaces and names pairs func SplitEnvToDeps(env string) (envList []Dependency) { separator := "," @@ -79,7 +79,7 @@ func SplitEnvToDeps(env string) (envList []Dependency) { return envList } -//SplitPodEnvToDeps returns list of PodDependency +// SplitPodEnvToDeps returns list of PodDependency func SplitPodEnvToDeps(env string) []PodDependency { deps := []PodDependency{} @@ -106,7 +106,7 @@ func SplitPodEnvToDeps(env string) []PodDependency { return deps } -//SplitJobEnvToDeps returns list of JobDependency +// SplitJobEnvToDeps returns list of JobDependency func SplitJobEnvToDeps(env string, jsonEnv string) []JobDependency { deps := []JobDependency{} @@ -150,7 +150,7 @@ func SplitJobEnvToDeps(env string, jsonEnv string) []JobDependency { return deps } -//GetBaseNamespace returns default namespace when user set empty one +// GetBaseNamespace returns default namespace when user set empty one func GetBaseNamespace() string { namespace, isSet := os.LookupEnv("NAMESPACE") if !isSet || namespace == "" { diff --git a/util/util.go b/util/util.go index 5fba979..7ac00b6 100644 --- a/util/util.go +++ b/util/util.go @@ -13,16 +13,16 @@ import ( func GetIp() (string, error) { var iface string if iface = os.Getenv("INTERFACE_NAME"); iface == "" { - return "", fmt.Errorf("Environment variable INTERFACE_NAME not set") + return "", fmt.Errorf("environment variable INTERFACE_NAME not set") } i, err := net.InterfaceByName(iface) if err != nil { - return "", fmt.Errorf("Cannot get iface: %v", err) + return "", fmt.Errorf("cannot get iface: %v", err) } address, err := i.Addrs() if err != nil || len(address) == 0 { - return "", fmt.Errorf("Cannot get ip: %v", err) + return "", fmt.Errorf("cannot get ip: %v", err) } //Take first element to get rid of subnet ip := strings.Split(address[0].String(), "/")[0]