From e7a2085cd18017038fc3f34090e2afa5eb248a18 Mon Sep 17 00:00:00 2001 From: Aliaksandr Panasiuk Date: Wed, 23 Oct 2024 13:29:04 +0200 Subject: [PATCH] #29 - implement support Azure provider for Cluster API --- cmd/cluster.go | 405 ++++++++++++++++++++++++++++-- cmd/cluster_capa.go | 38 +++ cmd/cluster_capz.go | 155 ++++++++++++ cmd/commands.go | 36 ++- cmd/config.go | 91 +++++-- cmd/flags.go | 41 ++- cmd/k3d.go | 36 ++- cmd/project.go | 2 + cmd/release.go | 150 +---------- cmd/secret.go | 13 +- config/config.go | 38 +-- go.mod | 117 ++++++--- go.sum | 252 +++++++++++++------ providers/aws_provider/aws.go | 4 + providers/azure_provider/azure.go | 152 +++++++++++ util/dictionary.go | 3 +- 16 files changed, 1203 insertions(+), 330 deletions(-) create mode 100644 cmd/cluster_capa.go create mode 100644 cmd/cluster_capz.go diff --git a/cmd/cluster.go b/cmd/cluster.go index 5a53a63..2c0e282 100644 --- a/cmd/cluster.go +++ b/cmd/cluster.go @@ -1,55 +1,412 @@ package cmd import ( + "fmt" + "os" + "regexp" "strings" + yaml2 "github.com/ghodss/yaml" "github.com/urfave/cli/v2" + "gopkg.in/yaml.v3" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/tools/clientcmd" + clientcmdlatest "k8s.io/client-go/tools/clientcmd/api/latest" "rmk/config" + "rmk/providers/aws_provider" + "rmk/providers/azure_provider" "rmk/util" ) +type clusterRunner interface { + getKubeContext() (string, string, error) + switchKubeContext() error +} + type ClusterCommands struct { *ReleaseCommands } +type ClusterCTLConfig struct { + ApiVersion string + Kind string + Metadata map[string]string + Spec interface{} +} + func newClusterCommands(conf *config.Config, ctx *cli.Context, workDir string) *ClusterCommands { return &ClusterCommands{&ReleaseCommands{Conf: conf, Ctx: ctx, WorkDir: workDir}} } -func (cc *ClusterCommands) awsEks() *util.SpecCMD { +func (cc *ClusterCommands) clusterCTL(args ...string) *util.SpecCMD { + var envs []string + + switch { + case cc.Conf.ClusterProvider == azure_provider.AzureClusterProvider: + envs = []string{ + "EXP_AKS=true", + "EXP_MACHINE_POOL=true", + "EXP_CLUSTER_RESOURCE_SET=false", + } + } + return &util.SpecCMD{ - Envs: []string{ - "AWS_PROFILE=" + cc.Conf.Profile, - "AWS_CONFIG_FILE=" + strings.Join(cc.Conf.AWSSharedConfigFile(cc.Conf.Profile), ""), - "AWS_SHARED_CREDENTIALS_FILE=" + strings.Join(cc.Conf.AWSSharedCredentialsFile(cc.Conf.Profile), ""), - }, - Args: []string{"eks", "--region", - cc.Conf.Region, - "update-kubeconfig", - "--name", - cc.Conf.Name + "-eks", - "--profile", - cc.Conf.Profile, - }, - Command: "aws", + Args: args, + Command: "clusterctl", Ctx: cc.Ctx.Context, Dir: cc.WorkDir, Debug: true, + Envs: envs, + } +} + +func (cc *ClusterCommands) kubectl(args ...string) *util.SpecCMD { + return &util.SpecCMD{ + Args: args, + Command: "kubectl", + Ctx: cc.Ctx.Context, + Dir: cc.WorkDir, + DisableStdOut: false, + Debug: true, + } +} + +func createClusterCTLConfigFile(output []byte) (string, error) { + clusterCTL := &ClusterCTLConfig{} + if err := yaml.Unmarshal(output, &clusterCTL); err != nil { + return "", err + } + + data, err := yaml.Marshal(clusterCTL.Spec) + if err != nil { + return "", err + } + + return util.CreateTempYAMLFile("/tmp", clusterCTL.Metadata["name"], data) +} + +func (cc *ClusterCommands) getClusterCTLConfig() (string, string, error) { + if cc.Ctx.Command.Category == util.CAPI { + cc.APICluster = true + } + + _, currentContextName, err := cc.getKubeContext() + if err != nil { + return "", "", err + } + + cc.SpecCMD = cc.prepareHelmfile("--log-level", "error", "-l", "config=clusterctl", "template") + cc.SpecCMD.DisableStdOut = true + if err := releaseRunner(cc).runCMD(); err != nil { + return "", "", fmt.Errorf("Helmfile failed to render template by label release: config=clusterctl\n%s", + cc.SpecCMD.StderrBuf.String()) + } + + fileName, err := createClusterCTLConfigFile(cc.SpecCMD.StdoutBuf.Bytes()) + if err != nil { + return "", "", err + } + + return currentContextName, fileName, nil +} + +func (cc *ClusterCommands) initClusterCTLConfig() error { + contextName, clusterCTLConfig, err := cc.getClusterCTLConfig() + if err != nil { + return err + } + + cc.SpecCMD = cc.clusterCTL("init", "--infrastructure", cc.Conf.ClusterProvider, + "--wait-providers", "--kubeconfig-context", contextName, "--config", clusterCTLConfig) + + if err := releaseRunner(cc).runCMD(); err != nil { + if err := os.RemoveAll(clusterCTLConfig); err != nil { + return err + } + + return err + } + + return os.RemoveAll(clusterCTLConfig) +} + +func (cc *ClusterCommands) mergeKubeConfig(clusterContext []byte) error { + var object interface{} + + if err := yaml.Unmarshal(clusterContext, &object); err != nil { + return err + } + + file, err := createManifestFile(object, "/tmp", cc.Conf.Name+"-"+cc.Conf.ClusterProvider+"-kubeconfig") + if err != nil { + return err + } + + loadingRules := clientcmd.NewDefaultClientConfigLoadingRules() + loadingRules.Precedence = append(loadingRules.Precedence, file) + + mergeConfig, err := loadingRules.Load() + if err != nil { + if err := os.RemoveAll(file); err != nil { + return err + } + + return err + } + + if err := os.RemoveAll(file); err != nil { + return err + } + + json, err := runtime.Encode(clientcmdlatest.Codec, mergeConfig) + if err != nil { + return err + } + + kubeConfig, err := yaml2.JSONToYAML(json) + if err != nil { + return err + } + + if err := os.WriteFile(clientcmd.NewDefaultPathOptions().GlobalFile, kubeConfig, 0644); err != nil { + return err + } + + cc.SpecCMD = cc.kubectl("config", "use-context", cc.Conf.Name) + + return releaseRunner(cc).runCMD() +} + +func (cc *ClusterCommands) getKubeContext() (string, string, error) { + var ( + contextNames []string + contextName string + ) + + kubeConfig, err := clientcmd.NewNonInteractiveDeferredLoadingClientConfig( + clientcmd.NewDefaultClientConfigLoadingRules(), &clientcmd.ConfigOverrides{}).RawConfig() + if err != nil { + return "", "", err + } + + re, err := regexp.Compile(`(?i)\b` + cc.Conf.Name + `\b`) + if err != nil { + return "", "", err + } + + for key := range kubeConfig.Contexts { + if re.MatchString(key) { + contextNames = append(contextNames, key) + } + } + + switch { + case len(contextNames) > 1: + return "", "", + fmt.Errorf("detected more than one Kubernetes context with names %s leading to conflict, "+ + "please delete or rename all contexts except one", strings.Join(contextNames, ", ")) + case len(contextNames) > 0: + contextName = contextNames[0] + default: + contextName = "" + } + + if cc.K3DCluster && len(contextName) > 0 && !strings.Contains(contextName, util.K3DPrefix) { + return "", "", fmt.Errorf("remote Kubernetes context already exists %s for this branch", contextName) + } + + return contextName, kubeConfig.CurrentContext, nil +} + +func (cc *ClusterCommands) switchKubeContext() error { + contextName, currentContextName, err := cc.getKubeContext() + if err != nil { + return err + } + + if cc.Ctx.Command.Category == util.CAPI { + kubeConfig, err := clientcmd.NewNonInteractiveDeferredLoadingClientConfig( + clientcmd.NewDefaultClientConfigLoadingRules(), &clientcmd.ConfigOverrides{}).RawConfig() + if err != nil { + return err + } + + if _, ok := kubeConfig.Contexts[util.CAPIContextName]; ok && currentContextName != util.CAPIContextName { + cc.SpecCMD = cc.kubectl("config", "use-context", util.CAPIContextName) + return releaseRunner(cc).runCMD() + } else if ok && currentContextName == util.CAPIContextName { + return nil + } } + + if len(contextName) > 0 && !cc.UpdateContext { + if contextName != currentContextName { + cc.SpecCMD = cc.kubectl("config", "use-context", contextName) + return releaseRunner(cc).runCMD() + } + + return nil + } + + if strings.Contains(contextName, util.K3DPrefix) && cc.UpdateContext { + return fmt.Errorf("current context %s already used for K3D cluster, --force flag cannot be used", contextName) + } + + switch cc.Conf.ClusterProvider { + case azure_provider.AzureClusterProvider: + clusterContext, err := cc.azureClusterContext() + if err != nil { + return err + } + + if err := cc.mergeKubeConfig(clusterContext); err != nil { + return err + } + case aws_provider.AWSClusterProvider: + if err := cc.awsClusterContext(); err != nil { + return err + } + + _, currentContext, err := cc.getKubeContext() + if err != nil { + return err + } + + cc.SpecCMD = cc.kubectl("config", "set-credentials", currentContext, + "--exec-env", "AWS_CONFIG_FILE="+strings.Join(cc.Conf.AWSSharedConfigFile(cc.Conf.Profile), ""), + "--exec-env", "AWS_SHARED_CREDENTIALS_FILE="+strings.Join(cc.Conf.AWSSharedCredentialsFile(cc.Conf.Profile), ""), + ) + cc.SpecCMD.DisableStdOut = true + cc.SpecCMD.Debug = true + return releaseRunner(cc).runCMD() + } + + return nil } -func (cc *ClusterCommands) awsClusterContext() error { - cc.SpecCMD = cc.awsEks() - return runner(cc).runCMD() +func (cc *ClusterCommands) provisionDestroyTargetCluster() error { + if cc.Ctx.Command.Category == util.CAPI { + cc.APICluster = true + } + + _, _, err := cc.getKubeContext() + if err != nil { + return err + } + + switch cc.Ctx.Command.Name { + case "provision": + cc.SpecCMD = cc.prepareHelmfile("--log-level", "error", "-l", "cluster="+cc.Conf.ClusterProvider, "sync") + if err := releaseRunner(cc).runCMD(); err != nil { + return err + } + + switch cc.Conf.ClusterProvider { + case azure_provider.AzureClusterProvider: + clusterContext, err := cc.azureClusterContext() + if err != nil { + return err + } + + if err := cc.mergeKubeConfig(clusterContext); err != nil { + return err + } + } + case "destroy": + cc.SpecCMD = cc.prepareHelmfile("--log-level", "error", "-l", "cluster="+cc.Conf.ClusterProvider, "destroy") + if err := releaseRunner(cc).runCMD(); err != nil { + return err + } + + kubeConfig, err := clientcmd.NewNonInteractiveDeferredLoadingClientConfig( + clientcmd.NewDefaultClientConfigLoadingRules(), &clientcmd.ConfigOverrides{}).RawConfig() + if err != nil { + return err + } + + if context, ok := kubeConfig.Contexts[cc.Conf.Name]; ok { + cc.SpecCMD = cc.kubectl("config", "delete-context", cc.Conf.Name) + if err := releaseRunner(cc).runCMD(); err != nil { + return err + } + + cc.SpecCMD = cc.kubectl("config", "delete-cluster", context.Cluster) + if err := releaseRunner(cc).runCMD(); err != nil { + return err + } + + cc.SpecCMD = cc.kubectl("config", "delete-user", context.AuthInfo) + if err := releaseRunner(cc).runCMD(); err != nil { + return err + } + } + } + + return nil } func clusterSwitchAction(conf *config.Config) cli.ActionFunc { return func(c *cli.Context) error { - if err := util.ValidateGitHubToken(c, ""); err != nil { + if err := util.ValidateNArg(c, 0); err != nil { return err } + if err := resolveDependencies(conf.InitConfig(), c, false); err != nil { + return err + } + + cc := newClusterCommands(conf, c, util.GetPwdPath("")) + cc.UpdateContext = c.Bool("force") + + return cc.switchKubeContext() + } +} + +func CAPIInitAction(conf *config.Config) cli.AfterFunc { + return func(c *cli.Context) error { + if err := util.ValidateNArg(c, 0); err != nil { + return err + } + + cc := newClusterCommands(conf, c, util.GetPwdPath()) + if err := cc.switchKubeContext(); err != nil { + return err + } + + if err := cc.initClusterCTLConfig(); err != nil { + return err + } + + return cc.applyAzureClusterIdentity() + } +} + +func CAPIUpdateAction(conf *config.Config) cli.ActionFunc { + return func(c *cli.Context) error { + if err := util.ValidateNArg(c, 0); err != nil { + return err + } + + if err := resolveDependencies(conf.InitConfig(), c, false); err != nil { + return err + } + + cc := newClusterCommands(conf, c, util.GetPwdPath()) + if err := cc.switchKubeContext(); err != nil { + return err + } + + if err := cc.initClusterCTLConfig(); err != nil { + return err + } + + return cc.applyAzureClusterIdentity() + } +} + +func CAPIProvisionDestroyAction(conf *config.Config) cli.ActionFunc { + return func(c *cli.Context) error { if err := util.ValidateNArg(c, 0); err != nil { return err } @@ -58,13 +415,11 @@ func clusterSwitchAction(conf *config.Config) cli.ActionFunc { return err } - rc := &ReleaseCommands{ - Conf: conf, - Ctx: c, - WorkDir: util.GetPwdPath(""), - UpdateContext: c.Bool("force"), + cc := newClusterCommands(conf, c, util.GetPwdPath()) + if err := cc.switchKubeContext(); err != nil { + return err } - return rc.releaseKubeContext() + return cc.provisionDestroyTargetCluster() } } diff --git a/cmd/cluster_capa.go b/cmd/cluster_capa.go new file mode 100644 index 0000000..6cfdc1b --- /dev/null +++ b/cmd/cluster_capa.go @@ -0,0 +1,38 @@ +package cmd + +import ( + "strings" + + "rmk/util" +) + +const ( + awsFlagsCategory = "AWS authentication" +) + +func (cc *ClusterCommands) getAWSEksKubeConfig() *util.SpecCMD { + return &util.SpecCMD{ + Envs: []string{ + "AWS_PROFILE=" + cc.Conf.Profile, + "AWS_CONFIG_FILE=" + strings.Join(cc.Conf.AWSSharedConfigFile(cc.Conf.Profile), ""), + "AWS_SHARED_CREDENTIALS_FILE=" + strings.Join(cc.Conf.AWSSharedCredentialsFile(cc.Conf.Profile), ""), + }, + Args: []string{"eks", "--region", + cc.Conf.Region, + "update-kubeconfig", + "--name", + cc.Conf.Name + "-eks", + "--profile", + cc.Conf.Profile, + }, + Command: "aws", + Ctx: cc.Ctx.Context, + Dir: cc.WorkDir, + Debug: true, + } +} + +func (cc *ClusterCommands) awsClusterContext() error { + cc.SpecCMD = cc.getAWSEksKubeConfig() + return releaseRunner(cc).runCMD() +} diff --git a/cmd/cluster_capz.go b/cmd/cluster_capz.go new file mode 100644 index 0000000..5bc1aa4 --- /dev/null +++ b/cmd/cluster_capz.go @@ -0,0 +1,155 @@ +package cmd + +import ( + "os" + "path/filepath" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/json" + v1 "k8s.io/client-go/applyconfigurations/core/v1" + + "rmk/providers/azure_provider" + "rmk/util" +) + +const ( + azureClusterIdentityName = "azure-cluster-identity" + azureClusterIdentityNamespace = "capz-system" + azureClusterIdentitySecret = "azure-cluster-identity-secret" + azureFlagsCategory = "Azure authentication" +) + +var azureClusterIdentitySecretType = corev1.SecretTypeOpaque + +type AzureClusterIdentityConfig struct { + *AzureClusterIdentity + *v1.SecretApplyConfiguration + ManifestFilesDir string + ManifestFiles []string +} + +type AzureClusterIdentity struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AzureClusterIdentitySpec `json:"spec,omitempty"` +} + +type AzureClusterIdentitySpec struct { + AllowedNamespaces struct { + NamespaceList []string `json:"list"` + Selector *metav1.LabelSelector `json:"selector,omitempty"` + } `json:"allowedNamespaces,omitempty"` + ClientID string `json:"clientID"` + ClientSecret corev1.SecretReference `json:"clientSecret,omitempty"` + TenantID string `json:"tenantID"` + Type string `json:"type"` +} + +func NewAzureClusterIdentityConfig(ac *azure_provider.AzureConfigure) *AzureClusterIdentityConfig { + acic := &AzureClusterIdentityConfig{ + AzureClusterIdentity: &AzureClusterIdentity{ + TypeMeta: metav1.TypeMeta{ + Kind: "AzureClusterIdentity", + APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: azureClusterIdentityName, + Namespace: azureClusterIdentityNamespace, + Labels: map[string]string{"clusterctl.cluster.x-k8s.io/move-hierarchy": "true"}, + }, + Spec: AzureClusterIdentitySpec{ + AllowedNamespaces: struct { + NamespaceList []string `json:"list"` + Selector *metav1.LabelSelector `json:"selector,omitempty"` + }(struct { + NamespaceList []string + Selector *metav1.LabelSelector + }{ + NamespaceList: []string{azureClusterIdentityNamespace}, + }), + ClientID: ac.ClientID, + ClientSecret: corev1.SecretReference{ + Name: azureClusterIdentitySecret, + Namespace: azureClusterIdentityNamespace, + }, + TenantID: ac.TenantID, + Type: "ServicePrincipal", + }, + }, + SecretApplyConfiguration: v1.Secret(azureClusterIdentitySecret, azureClusterIdentityNamespace), + ManifestFilesDir: filepath.Join("/tmp", azureClusterIdentityName), + } + + acic.SecretApplyConfiguration.Type = &azureClusterIdentitySecretType + acic.SecretApplyConfiguration.Data = map[string][]byte{"clientSecret": []byte(ac.ClientSecret)} + + return acic +} + +func createManifestFile(object interface{}, dir, fileName string) (string, error) { + data, err := json.Marshal(object) + if err != nil { + return "", err + } + + return util.CreateTempYAMLFile(dir, fileName, data) +} + +func (acic *AzureClusterIdentityConfig) createAzureClusterIdentityManifestFiles() error { + if err := os.MkdirAll(acic.ManifestFilesDir, 0775); err != nil { + return err + } + + fileCR, err := createManifestFile(acic.AzureClusterIdentity, acic.ManifestFilesDir, azureClusterIdentityName) + if err != nil { + return err + } + + acic.ManifestFiles = append(acic.ManifestFiles, fileCR) + + fileSecret, err := createManifestFile(acic.SecretApplyConfiguration, acic.ManifestFilesDir, azureClusterIdentitySecret) + if err != nil { + return err + } + + acic.ManifestFiles = append(acic.ManifestFiles, fileSecret) + + return nil +} + +func (cc *ClusterCommands) applyAzureClusterIdentity() error { + var kubectlArgs = []string{"apply"} + + ac := azure_provider.NewAzureConfigure() + if err := ac.ReadSPCredentials(cc.Conf.Name); err != nil { + return err + } + + acic := NewAzureClusterIdentityConfig(ac) + if err := acic.createAzureClusterIdentityManifestFiles(); err != nil { + return err + } + + for _, val := range acic.ManifestFiles { + kubectlArgs = append(kubectlArgs, "-f", val) + } + + cc.SpecCMD = cc.kubectl(kubectlArgs...) + if err := releaseRunner(cc).runCMD(); err != nil { + return err + } + + return os.RemoveAll(acic.ManifestFilesDir) +} + +func (cc *ClusterCommands) azureClusterContext() ([]byte, error) { + ac := azure_provider.NewAzureConfigure() + + if err := ac.NewAzureManagedClustersClient(cc.Ctx.Context, cc.Conf.Name); err != nil { + return nil, err + } + + return ac.GetAzureClusterContext(cc.Conf.Tenant, cc.Conf.Name) +} diff --git a/cmd/commands.go b/cmd/commands.go index 850405a..09cb140 100644 --- a/cmd/commands.go +++ b/cmd/commands.go @@ -116,17 +116,18 @@ func Commands() []*cli.Command { Subcommands: []*cli.Command{ { Name: "create", - Usage: "Create CAPI cluster", + Usage: "Create CAPI management cluster", Aliases: []string{"c"}, Before: readInputSourceWithContext(gitSpec, conf, flags["clusterK3DCreate"]), Flags: flags["clusterK3DCreate"], Category: "capi", BashComplete: util.ShellCompleteCustomOutput, Action: K3DCreateAction(conf), + After: CAPIInitAction(conf), }, { Name: "delete", - Usage: "Delete CAPI cluster", + Usage: "Delete CAPI management cluster", Aliases: []string{"d"}, Before: readInputSourceWithContext(gitSpec, conf, flags["hidden"]), Flags: flags["hidden"], @@ -134,9 +135,18 @@ func Commands() []*cli.Command { BashComplete: util.ShellCompleteCustomOutput, Action: K3DAction(conf, K3DRunner.createDeleteK3DCluster), }, + { + Name: "destroy", + Usage: "Destroy K8S target (workload) cluster", + Before: readInputSourceWithContext(gitSpec, conf, flags["hidden"]), + Flags: flags["hidden"], + Category: "capi", + BashComplete: util.ShellCompleteCustomOutput, + Action: CAPIProvisionDestroyAction(conf), + }, { Name: "list", - Usage: "List CAPI clusters", + Usage: "List CAPI management clusters", Aliases: []string{"l"}, Before: readInputSourceWithContext(gitSpec, conf, flags["hidden"]), Flags: flags["hidden"], @@ -144,6 +154,26 @@ func Commands() []*cli.Command { BashComplete: util.ShellCompleteCustomOutput, Action: K3DAction(conf, K3DRunner.listK3DClusters), }, + { + Name: "provision", + Usage: "Provision K8S target (workload) cluster", + Aliases: []string{"p"}, + Before: readInputSourceWithContext(gitSpec, conf, flags["hidden"]), + Flags: flags["hidden"], + Category: "capi", + BashComplete: util.ShellCompleteCustomOutput, + Action: CAPIProvisionDestroyAction(conf), + }, + { + Name: "update", + Usage: "Update CAPI management cluster", + Aliases: []string{"u"}, + Before: readInputSourceWithContext(gitSpec, conf, flags["hidden"]), + Flags: flags["hidden"], + Category: "capi", + BashComplete: util.ShellCompleteCustomOutput, + Action: CAPIUpdateAction(conf), + }, }, }, { diff --git a/cmd/config.go b/cmd/config.go index 5fb209f..1038f38 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -16,6 +16,7 @@ import ( "rmk/config" "rmk/git_handler" "rmk/providers/aws_provider" + "rmk/providers/azure_provider" "rmk/util" ) @@ -94,12 +95,12 @@ func (c *ConfigCommands) checkAwsEnv() (map[string]string, bool) { func (c *ConfigCommands) configAws() error { if awsEnvs, ok := c.checkAwsEnv(); !ok { c.SpecCMD = c.awsConfigure(c.Conf.Profile) - return runner(c).runCMD() + return releaseRunner(c).runCMD() } else { for key, val := range awsEnvs { c.SpecCMD = c.awsConfigure(c.Conf.Profile) c.SpecCMD.Args = append(c.SpecCMD.Args, "set", key, val) - if err := runner(c).runCMD(); err != nil { + if err := releaseRunner(c).runCMD(); err != nil { return err } } @@ -165,7 +166,7 @@ func (c *ConfigCommands) configAwsMFA() error { for key, val := range MFAProfileArgs { c.SpecCMD = c.awsConfigure(c.Conf.AWSMFAProfile) c.SpecCMD.Args = append(c.SpecCMD.Args, "set", key, val) - if err := runner(c).runCMD(); err != nil { + if err := releaseRunner(c).runCMD(); err != nil { return err } } @@ -173,7 +174,7 @@ func (c *ConfigCommands) configAwsMFA() error { for key, val := range regularProfileArgs { c.SpecCMD = c.awsConfigure(regularProfile) c.SpecCMD.Args = append(c.SpecCMD.Args, "set", key, val) - if err := runner(c).runCMD(); err != nil { + if err := releaseRunner(c).runCMD(); err != nil { return err } } @@ -195,7 +196,7 @@ func (c *ConfigCommands) copyAWSProfile(profile string) error { for key, val := range profileArgs { c.SpecCMD = c.awsConfigure(profile) c.SpecCMD.Args = append(c.SpecCMD.Args, "set", key, val) - if err := runner(c).runCMD(); err != nil { + if err := releaseRunner(c).runCMD(); err != nil { return err } } @@ -206,7 +207,7 @@ func (c *ConfigCommands) copyAWSProfile(profile string) error { func (c *ConfigCommands) installHelmPlugin(plugin config.Package, args ...string) error { c.SpecCMD = c.helmPlugin() c.SpecCMD.Args = append(c.SpecCMD.Args, args...) - if err := runner(c).runCMD(); err != nil { + if err := releaseRunner(c).runCMD(); err != nil { if !strings.Contains(c.SpecCMD.StderrBuf.String(), util.HelmPluginExist) { return fmt.Errorf("Helm plugin %s installation failed: \n%s", plugin.Name, c.SpecCMD.StderrBuf.String()) } @@ -228,7 +229,7 @@ func (c *ConfigCommands) configHelmPlugins() error { c.SpecCMD = c.helmPlugin() c.SpecCMD.Args = append(c.SpecCMD.Args, "list") - if err := runner(c).runCMD(); err != nil { + if err := releaseRunner(c).runCMD(); err != nil { return fmt.Errorf("get Helm plugin list failed: %s", c.SpecCMD.StderrBuf.String()) } @@ -258,7 +259,7 @@ func (c *ConfigCommands) configHelmPlugins() error { zap.S().Infof("Helm plugin %s detect new version %s from %s", plugin.Name, plugin.Version, util.TenantProjectFile) c.SpecCMD = c.helmPlugin() c.SpecCMD.Args = append(c.SpecCMD.Args, "uninstall", plugin.Name) - if err := runner(c).runCMD(); err != nil { + if err := releaseRunner(c).runCMD(); err != nil { return fmt.Errorf("Helm plugin %s uninstallation failed: \n%s", plugin.Name, c.SpecCMD.StderrBuf.String()) } @@ -281,7 +282,7 @@ func (c *ConfigCommands) configHelmPlugins() error { func (c *ConfigCommands) rmkConfig() error { c.SpecCMD = c.rmkConfigInit() - return runner(c).runCMD() + return releaseRunner(c).runCMD() } func initAWSProfile(c *cli.Context, conf *config.Config, gitSpec *git_handler.GitSpec) error { @@ -294,7 +295,7 @@ func initAWSProfile(c *cli.Context, conf *config.Config, gitSpec *git_handler.Gi profile = conf.Profile } - if c.Bool("aws-reconfigure") { + if c.Bool("reconfigure") { if err := os.RemoveAll(strings.Join(conf.AWSSharedCredentialsFile(conf.Profile), "")); err != nil { return err } @@ -348,7 +349,7 @@ func initAWSProfile(c *cli.Context, conf *config.Config, gitSpec *git_handler.Gi if err := newConfigCommands(conf, c, util.GetPwdPath("")).configAwsMFA(); err != nil { return err } - } else if !c.Bool("aws-reconfigure") { + } else if !c.Bool("reconfigure") { if err := newConfigCommands(conf, c, util.GetPwdPath("")).configAwsMFA(); err != nil { return err } @@ -373,7 +374,7 @@ func getConfigFromEnvironment(c *cli.Context, conf *config.Config, gitSpec *git_ return err } - if c.String("cluster-provider") == util.AWSClusterProvider { + if c.String("cluster-provider") == aws_provider.AWSClusterProvider { if err := c.Set("config-name-from", conf.Name); err != nil { return err } @@ -437,6 +438,7 @@ func getConfigFromEnvironment(c *cli.Context, conf *config.Config, gitSpec *git_ return nil } + //TODO: deprecate after full list CAPI providers will be implemented if err := util.ValidateGitHubToken(c, "required parameter --github-token not set"); err != nil { return err } @@ -451,7 +453,7 @@ func getConfigFromEnvironment(c *cli.Context, conf *config.Config, gitSpec *git_ } } - if c.String("cluster-provider") == util.AWSClusterProvider { + if c.String("cluster-provider") == aws_provider.AWSClusterProvider { conf.AwsConfigure = new(aws_provider.AwsConfigure) } @@ -467,8 +469,13 @@ func configDeleteAction(conf *config.Config) cli.ActionFunc { return err } - // TODO: It is necessary to think about whether to delete unconditionally or check taking into account the AWS provider. - if c.String("cluster-provider") == util.AWSClusterProvider { + switch { + case c.String("cluster-provider") == azure_provider.AzureClusterProvider: + if err := os.RemoveAll(util.GetHomePath(azure_provider.AzureHomeDir, + azure_provider.AzurePrefix+conf.Name+".json")); err != nil { + return err + } + case c.String("cluster-provider") == aws_provider.AWSClusterProvider: // Delete MFA profile if len(conf.AWSMFAProfile) > 0 && len(conf.AWSMFATokenExpiration) > 0 { if err := os.RemoveAll(strings.Join(conf.AWSSharedConfigFile(conf.AWSMFAProfile), "")); err != nil { @@ -531,7 +538,56 @@ func configInitAction(conf *config.Config, gitSpec *git_handler.GitSpec) cli.Act } switch conf.ClusterProvider { - case util.AWSClusterProvider: + case azure_provider.AzureClusterProvider: + conf.AwsConfigure = &aws_provider.AwsConfigure{} + ac := azure_provider.NewAzureConfigure() + asp := azure_provider.NewRawSP() + + if util.IsExists( + util.GetHomePath(azure_provider.AzureHomeDir, azure_provider.AzurePrefix+gitSpec.ID+".json"), true) { + if err := ac.ReadSPCredentials(gitSpec.ID); err != nil { + return err + } + } + + if c.Bool("azure-service-principle") { + if err := json.NewDecoder(os.Stdin).Decode(&asp); err != nil { + return fmt.Errorf("unable to deserialize json from stdin: %s", err.Error()) + } + + ac.MergeAzureRawSP(asp) + } + + if c.IsSet("azure-client-id") { + ac.ClientID = c.String("azure-client-id") + } + + if c.IsSet("azure-client-secret") { + ac.ClientSecret = c.String("azure-client-secret") + } + + if c.IsSet("azure-subscription-id") { + ac.SubscriptionID = c.String("azure-subscription-id") + } + + if c.IsSet("azure-tenant-id") { + ac.TenantID = c.String("azure-tenant-id") + } + + if err := ac.CheckSPCredentials(); err != nil { + return err + } else { + conf.AzureConfigure = azure_provider.NewAzureConfigure() + conf.AzureConfigure.SubscriptionID = ac.SubscriptionID + } + + if err := ac.WriteSPCredentials(gitSpec.ID); err != nil { + return err + } + + conf.SopsAgeKeys = util.GetHomePath(util.RMKDir, util.SopsRootName, conf.Tenant+"-"+util.SopsRootName+"-"+azure_provider.AzureClusterProvider) + case aws_provider.AWSClusterProvider: + conf.AzureConfigure = &azure_provider.AzureConfigure{} conf.AwsConfigure.Profile = gitSpec.ID conf.AWSMFAProfile = c.String("aws-mfa-profile") conf.AWSMFATokenExpiration = c.String("aws-mfa-token-expiration") @@ -548,6 +604,7 @@ func configInitAction(conf *config.Config, gitSpec *git_handler.GitSpec) cli.Act conf.SopsBucketName = conf.Tenant + "-" + util.SopsRootName + "-" + awsUID case util.LocalClusterProvider: conf.AwsConfigure = &aws_provider.AwsConfigure{} + conf.AzureConfigure = &azure_provider.AzureConfigure{} conf.SopsAgeKeys = util.GetHomePath(util.RMKDir, util.SopsRootName, conf.Tenant+"-"+util.SopsRootName+"-"+util.LocalClusterProvider) } @@ -559,7 +616,7 @@ func configInitAction(conf *config.Config, gitSpec *git_handler.GitSpec) cli.Act return err } - if conf.ClusterProvider == util.AWSClusterProvider { + if conf.ClusterProvider == aws_provider.AWSClusterProvider { //create s3 bucket for sops age keys if err := conf.CreateBucket(conf.SopsBucketName); err != nil { return err diff --git a/cmd/flags.go b/cmd/flags.go index d16c531..fad404e 100644 --- a/cmd/flags.go +++ b/cmd/flags.go @@ -3,7 +3,6 @@ package cmd import ( "github.com/urfave/cli/v2" "github.com/urfave/cli/v2/altsrc" - "rmk/util" ) @@ -21,9 +20,43 @@ func flagsConfig() []cli.Flag { Hidden: true, }, ), + &cli.StringFlag{ + Category: azureFlagsCategory, + Name: "azure-client-id", + Usage: "Azure client ID for Service Principal", + Aliases: []string{"azc"}, + EnvVars: []string{"RMK_AZURE_CLIENT_ID", "AZURE_CLIENT_ID"}, + }, + &cli.StringFlag{ + Category: azureFlagsCategory, + Name: "azure-client-secret", + Usage: "Azure client secret for Service Principal", + Aliases: []string{"azp"}, + EnvVars: []string{"RMK_AZURE_CLIENT_SECRET", "AZURE_CLIENT_SECRET"}, + }, + &cli.BoolFlag{ + Category: azureFlagsCategory, + Name: "azure-service-principle", + Usage: "Azure Service Principal stdin content", + Aliases: []string{"azsp"}, + }, + &cli.StringFlag{ + Category: azureFlagsCategory, + Name: "azure-subscription-id", + Usage: "Azure subscription ID for current Azure platform domain", + Aliases: []string{"azs"}, + EnvVars: []string{"RMK_AZURE_SUBSCRIPTION_ID", "AZURE_SUBSCRIPTION_ID"}, + }, + &cli.StringFlag{ + Category: azureFlagsCategory, + Name: "azure-tenant-id", + Usage: "Azure tenant ID for Service Principal", + Aliases: []string{"azt"}, + EnvVars: []string{"RMK_AZURE_TENANT_ID", "AZURE_TENANT_ID"}, + }, &cli.BoolFlag{ - Name: "aws-reconfigure", - Usage: "force AWS profile creation", + Name: "reconfigure", + Usage: "force Cluster Providers credentials recreate", Aliases: []string{"r"}, }, &cli.StringFlag{ @@ -56,7 +89,7 @@ func flagsConfig() []cli.Flag { Usage: "select cluster provider to provision clusters", Aliases: []string{"cp"}, EnvVars: []string{"RMK_CLUSTER_PROVIDER"}, - Value: util.AWSClusterProvider, + Value: util.LocalClusterProvider, }, ), altsrc.NewBoolFlag( diff --git a/cmd/k3d.go b/cmd/k3d.go index 02833c7..f210740 100644 --- a/cmd/k3d.go +++ b/cmd/k3d.go @@ -3,6 +3,7 @@ package cmd import ( "fmt" "os" + "strings" "github.com/urfave/cli/v2" @@ -69,13 +70,13 @@ func (k *K3DCommands) selectCluster() { func (k *K3DCommands) createDeleteK3DCluster() error { k.selectCluster() - if _, _, err := k.getKubeContext(); err != nil { + if _, _, err := clusterRunner(&ClusterCommands{k.ReleaseCommands}).getKubeContext(); err != nil { return err } k.SpecCMD = k.prepareHelmfile("--log-level", "error", "-l", "cluster="+k.Ctx.Command.Category, "template") k.SpecCMD.DisableStdOut = true - if err := runner(k).runCMD(); err != nil { + if err := releaseRunner(k).runCMD(); err != nil { return fmt.Errorf("Helmfile failed to render template by label release: cluster=%s\n%s", k.Ctx.Command.Category, k.SpecCMD.StderrBuf.String()) } @@ -89,7 +90,11 @@ func (k *K3DCommands) createDeleteK3DCluster() error { return err } - if err := runner(k).runCMD(); err != nil { + if err := releaseRunner(k).runCMD(); err != nil { + if err := os.RemoveAll(k3dConfig); err != nil { + return err + } + return err } @@ -102,13 +107,13 @@ func (k *K3DCommands) importImageToK3DCluster() error { return err } - return runner(k).runCMD() + return releaseRunner(k).runCMD() } func (k *K3DCommands) listK3DClusters() error { k.selectCluster() - if _, _, err := k.getKubeContext(); err != nil { + if _, _, err := clusterRunner(&ClusterCommands{k.ReleaseCommands}).getKubeContext(); err != nil { return err } @@ -117,20 +122,31 @@ func (k *K3DCommands) listK3DClusters() error { return err } - return runner(k).runCMD() + k.SpecCMD.DisableStdOut = true + if err := releaseRunner(k).runCMD(); err != nil { + if strings.Contains(k.SpecCMD.StderrBuf.String(), "No nodes found for given cluster") { + return fmt.Errorf("cluster %s not running", util.CAPI) + } else { + return fmt.Errorf("%s", k.SpecCMD.StderrBuf.String()) + } + } + + fmt.Printf("%s", k.SpecCMD.StdoutBuf.String()) + + return nil } if err := k.prepareK3D("cluster", k.Ctx.Command.Name); err != nil { return err } - return runner(k).runCMD() + return releaseRunner(k).runCMD() } func (k *K3DCommands) startStopK3DCluster() error { k.selectCluster() - if _, _, err := k.getKubeContext(); err != nil { + if _, _, err := clusterRunner(&ClusterCommands{k.ReleaseCommands}).getKubeContext(); err != nil { return err } @@ -138,11 +154,12 @@ func (k *K3DCommands) startStopK3DCluster() error { return err } - return runner(k).runCMD() + return releaseRunner(k).runCMD() } func K3DCreateAction(conf *config.Config) cli.ActionFunc { return func(c *cli.Context) error { + //TODO: deprecate after full list CAPI providers will be implemented if err := util.ValidateGitHubToken(c, ""); err != nil { return err } @@ -161,6 +178,7 @@ func K3DCreateAction(conf *config.Config) cli.ActionFunc { func K3DAction(conf *config.Config, action func(k3dRunner K3DRunner) error) cli.ActionFunc { return func(c *cli.Context) error { + //TODO: deprecate after full list CAPI providers will be implemented if err := util.ValidateGitHubToken(c, ""); err != nil { return err } diff --git a/cmd/project.go b/cmd/project.go index df334fc..f6bc371 100644 --- a/cmd/project.go +++ b/cmd/project.go @@ -446,6 +446,7 @@ func (p *ProjectCommands) generateProject(gitSpec *git_handler.GitSpec) error { func projectGenerateAction(conf *config.Config, gitSpec *git_handler.GitSpec) cli.ActionFunc { return func(c *cli.Context) error { + //TODO: deprecate after full list CAPI providers will be implemented if err := util.ValidateGitHubToken(c, ""); err != nil { return err } @@ -460,6 +461,7 @@ func projectGenerateAction(conf *config.Config, gitSpec *git_handler.GitSpec) cl func projectUpdateAction(conf *config.Config, gitSpec *git_handler.GitSpec) cli.ActionFunc { return func(c *cli.Context) error { + //TODO: deprecate after full list CAPI providers will be implemented if err := util.ValidateGitHubToken(c, ""); err != nil { return err } diff --git a/cmd/release.go b/cmd/release.go index bb9605d..3cd91a1 100644 --- a/cmd/release.go +++ b/cmd/release.go @@ -23,7 +23,7 @@ import ( "rmk/util" ) -type runner interface { +type releaseRunner interface { runCMD() error } @@ -86,43 +86,6 @@ type HelmStatus struct { Namespace string `json:"namespace"` } -type KubeConfig struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Preferences struct { - } `json:"preferences"` - Clusters []struct { - Name string `json:"name"` - Cluster struct { - Server string `json:"server"` - CertificateAuthorityData string `json:"certificate-authority-data"` - } `json:"cluster"` - } `json:"clusters"` - Users []struct { - Name string `json:"name"` - User struct { - Exec struct { - Command string `json:"command"` - Args []string `json:"args"` - Env []struct { - Name string `json:"name"` - Value string `json:"value"` - } `json:"env"` - ApiVersion string `json:"apiVersion"` - ProvideClusterInfo bool `json:"provideClusterInfo"` - } `json:"exec"` - } `json:"user"` - } `json:"users"` - Contexts []struct { - Name string `json:"name"` - Context struct { - Cluster string `json:"cluster"` - User string `json:"user"` - } `json:"context"` - } `json:"contexts"` - CurrentContext string `json:"current-context"` -} - func (rc *ReleaseCommands) runCMD() error { if err := rc.SpecCMD.AddEnv(); err != nil { return err @@ -176,6 +139,7 @@ func (rc *ReleaseCommands) prepareHelmfile(args ...string) *util.SpecCMD { "AWS_PROFILE="+rc.Conf.Profile, "AWS_CONFIG_FILE="+strings.Join(rc.Conf.AWSSharedConfigFile(rc.Conf.Profile), ""), "AWS_SHARED_CREDENTIALS_FILE="+strings.Join(rc.Conf.AWSSharedCredentialsFile(rc.Conf.Profile), ""), + "AZURE_SUBSCRIPTION_ID="+rc.Conf.AzureConfigure.SubscriptionID, ) envs = append(envs, "ROOT_DOMAIN="+rc.Conf.RootDomain) @@ -210,17 +174,6 @@ func (rc *ReleaseCommands) prepareHelmfile(args ...string) *util.SpecCMD { } } -func (rc *ReleaseCommands) kubeConfig() *util.SpecCMD { - return &util.SpecCMD{ - Args: []string{"config"}, - Command: "kubectl", - Ctx: rc.Ctx.Context, - Dir: rc.WorkDir, - DisableStdOut: true, - Debug: false, - } -} - func (rc *ReleaseCommands) releaseMiddleware() error { if len(rc.Conf.Dependencies) == 0 { if err := os.RemoveAll(filepath.Join(rc.WorkDir, TenantPrDependenciesDir)); err != nil { @@ -232,7 +185,7 @@ func (rc *ReleaseCommands) releaseMiddleware() error { return err } - if _, currentContext, err := rc.getKubeContext(); err != nil { + if _, currentContext, err := clusterRunner(&ClusterCommands{rc}).getKubeContext(); err != nil { return err } else { switch { @@ -256,94 +209,6 @@ func (rc *ReleaseCommands) releaseHelmfile(args ...string) error { return rc.runCMD() } -func (rc *ReleaseCommands) getKubeContext() (string, string, error) { - var ( - contextNames []string - contextName string - ) - - kubeConfig := &KubeConfig{} - - rc.SpecCMD = rc.kubeConfig() - rc.SpecCMD.Args = append(rc.SpecCMD.Args, "view", "--output", "json") - if err := rc.runCMD(); err != nil { - return "", "", fmt.Errorf("Kubectl config failed to view\n%s", rc.SpecCMD.StderrBuf.String()) - } - - if err := json.Unmarshal(rc.SpecCMD.StdoutBuf.Bytes(), &kubeConfig); err != nil { - return "", "", err - } - - re, err := regexp.Compile(`(?i)\b` + rc.Conf.Name + `\b`) - if err != nil { - return "", "", err - } - - for _, val := range kubeConfig.Contexts { - if re.MatchString(val.Name) { - contextNames = append(contextNames, val.Name) - } - } - - switch { - case len(contextNames) > 1: - return "", "", - fmt.Errorf("detected more than one Kubernetes context with names %s leading to conflict, "+ - "please delete or rename all contexts except one", strings.Join(contextNames, ", ")) - case len(contextNames) > 0: - contextName = contextNames[0] - default: - contextName = "" - } - - if rc.K3DCluster && len(contextName) > 0 && !strings.Contains(contextName, util.K3DPrefix) { - return "", "", fmt.Errorf("remote Kubernetes context already exists %s for this branch", contextName) - } - - return contextName, kubeConfig.CurrentContext, nil -} - -func (rc *ReleaseCommands) releaseKubeContext() error { - contextName, currentContextName, err := rc.getKubeContext() - if err != nil { - return err - } - - if len(contextName) > 0 && !rc.UpdateContext { - if contextName != currentContextName { - rc.SpecCMD = rc.kubeConfig() - rc.SpecCMD.Args = append(rc.SpecCMD.Args, "use", contextName) - rc.SpecCMD.DisableStdOut = false - return rc.runCMD() - } - - return nil - } - - if strings.Contains(contextName, util.K3DPrefix) && rc.UpdateContext { - return fmt.Errorf("current context %s already used for K3D cluster, --force flag cannot be used", contextName) - } - - if err := newClusterCommands(rc.Conf, rc.Ctx, util.GetPwdPath("")).awsClusterContext(); err != nil { - return err - } - - _, currentContext, err := rc.getKubeContext() - if err != nil { - return err - } - - rc.SpecCMD = rc.kubeConfig() - rc.SpecCMD.Args = append(rc.SpecCMD.Args, - "set-credentials", currentContext, - "--exec-env", "AWS_CONFIG_FILE="+strings.Join(rc.Conf.AWSSharedConfigFile(rc.Conf.Profile), ""), - "--exec-env", "AWS_SHARED_CREDENTIALS_FILE="+strings.Join(rc.Conf.AWSSharedCredentialsFile(rc.Conf.Profile), ""), - ) - rc.SpecCMD.DisableStdOut = true - rc.SpecCMD.Debug = true - return rc.runCMD() -} - func (sr *SpecRelease) searchReleasesPath() error { paths, err := util.WalkInDir(util.GetPwdPath(util.TenantValuesDIR), sr.Conf.Environment, util.ReleasesFileName) if err != nil { @@ -638,6 +503,7 @@ func (sr *SpecRelease) checkStatusRelease() error { func releaseHelmfileAction(conf *config.Config) cli.ActionFunc { return func(c *cli.Context) error { + //TODO: deprecate after full list CAPI providers will be implemented if err := util.ValidateGitHubToken(c, ""); err != nil { return err } @@ -657,7 +523,7 @@ func releaseHelmfileAction(conf *config.Config) cli.ActionFunc { } if !c.Bool("skip-context-switch") { - if err := rc.releaseKubeContext(); err != nil { + if err := clusterRunner(&ClusterCommands{rc}).switchKubeContext(); err != nil { return err } } @@ -691,6 +557,7 @@ func releaseHelmfileAction(conf *config.Config) cli.ActionFunc { func releaseRollbackAction(conf *config.Config) cli.ActionFunc { return func(c *cli.Context) error { + //TODO: deprecate after full list CAPI providers will be implemented if err := util.ValidateGitHubToken(c, ""); err != nil { return err } @@ -712,7 +579,7 @@ func releaseRollbackAction(conf *config.Config) cli.ActionFunc { sr.WorkDir = util.GetPwdPath("") if !c.Bool("skip-context-switch") { - if err := sr.releaseKubeContext(); err != nil { + if err := clusterRunner(&ClusterCommands{&sr.ReleaseCommands}).switchKubeContext(); err != nil { return err } } @@ -728,6 +595,7 @@ func releaseRollbackAction(conf *config.Config) cli.ActionFunc { func releaseUpdateAction(conf *config.Config, gitSpec *git_handler.GitSpec) cli.ActionFunc { return func(c *cli.Context) error { + //TODO: deprecate after full list CAPI providers will be implemented if err := util.ValidateGitHubToken(c, ""); err != nil { return err } @@ -746,7 +614,7 @@ func releaseUpdateAction(conf *config.Config, gitSpec *git_handler.GitSpec) cli. sr.WorkDir = util.GetPwdPath("") if !c.Bool("skip-context-switch") { - if err := sr.releaseKubeContext(); err != nil { + if err := clusterRunner(&ClusterCommands{&sr.ReleaseCommands}).switchKubeContext(); err != nil { return err } } diff --git a/cmd/secret.go b/cmd/secret.go index eeb6db0..9edd670 100644 --- a/cmd/secret.go +++ b/cmd/secret.go @@ -72,13 +72,13 @@ func (sc *SecretCommands) createAgeKey(scope string) error { sc.SpecCMD = sc.ageKeygen("-o", keyPath) sc.SpecCMD.DisableStdOut = true - if err := runner(sc).runCMD(); err != nil { + if err := releaseRunner(sc).runCMD(); err != nil { return err } sc.SpecCMD = sc.ageKeygen("-y", keyPath) sc.SpecCMD.DisableStdOut = true - return runner(sc).runCMD() + return releaseRunner(sc).runCMD() } func (sc *SecretCommands) CreateKeys() error { @@ -265,7 +265,7 @@ func (sc *SecretCommands) SecretManager(option string) error { switch sc.Ctx.Command.Name { case "decrypt": sc.SpecCMD.Args = append(sc.SpecCMD.Args, sc.Ctx.Command.Name, "-i", secret) - if err := runner(sc).runCMD(); err != nil { + if err := releaseRunner(sc).runCMD(); err != nil { if strings.Contains(sc.SpecCMD.StderrBuf.String(), util.HelmSecretsIsNotEncrypted+secret) { zap.S().Warnf(strings.ToLower(util.HelmSecretsIsNotEncrypted)+"%s", secret) continue @@ -277,7 +277,7 @@ func (sc *SecretCommands) SecretManager(option string) error { zap.S().Infof("decrypting: %s", secret) case "encrypt": sc.SpecCMD.Args = append(sc.SpecCMD.Args, sc.Ctx.Command.Name, "-i", secret) - if err := runner(sc).runCMD(); err != nil { + if err := releaseRunner(sc).runCMD(); err != nil { if strings.Contains(sc.SpecCMD.StderrBuf.String(), util.HelmSecretsAlreadyEncrypted+filepath.Base(secret)) { zap.S().Warnf(strings.ToLower(util.HelmSecretsAlreadyEncrypted)+"%s", secret) continue @@ -349,7 +349,7 @@ func (sc *SecretCommands) runHelmSecretsCMD(secretFilePath string, returnCMDErro return fmt.Errorf("file does not exist: %s", secretFilePath) } - if err := runner(sc).runCMD(); err != nil { + if err := releaseRunner(sc).runCMD(); err != nil { if returnCMDError { return err } @@ -379,6 +379,7 @@ func (sc *SecretCommands) runHelmSecretsCMD(secretFilePath string, returnCMDErro func secretMgrEncryptDecryptAction(conf *config.Config) cli.ActionFunc { return func(c *cli.Context) error { + //TODO: deprecate after full list CAPI providers will be implemented if err := util.ValidateGitHubToken(c, ""); err != nil { return err } @@ -406,6 +407,7 @@ func secretMgrGenerateAction(conf *config.Config) cli.ActionFunc { } func secretKeysCreateAction(conf *config.Config) cli.ActionFunc { return func(c *cli.Context) error { + //TODO: deprecate after full list CAPI providers will be implemented if err := util.ValidateGitHubToken(c, ""); err != nil { return err } @@ -444,6 +446,7 @@ func secretKeysUploadAction(conf *config.Config) cli.ActionFunc { func secretAction(conf *config.Config, action func(secretRunner SecretRunner) error) cli.ActionFunc { return func(c *cli.Context) error { + //TODO: deprecate after full list CAPI providers will be implemented if err := util.ValidateGitHubToken(c, ""); err != nil { return err } diff --git a/config/config.go b/config/config.go index 96824f2..89c1e1d 100644 --- a/config/config.go +++ b/config/config.go @@ -18,28 +18,30 @@ import ( "rmk/git_handler" "rmk/providers/aws_provider" + "rmk/providers/azure_provider" "rmk/util" ) type Config struct { - Name string `yaml:"name,omitempty"` - Tenant string `yaml:"tenant,omitempty"` - Environment string `yaml:"environment,omitempty"` - ConfigNameFrom string `yaml:"config-name-from,omitempty"` - RootDomain string `yaml:"root-domain,omitempty"` - GitHubToken string `yaml:"github-token,omitempty"` - ClusterProvider string `yaml:"cluster-provider"` - SlackNotifications bool `yaml:"slack-notifications"` - SlackWebHook string `yaml:"slack-webhook,omitempty"` - SlackChannel string `yaml:"slack-channel,omitempty"` - SlackMsgDetails []string `yaml:"slack-message-details,omitempty"` - SopsAgeKeys string `yaml:"sops-age-keys,omitempty"` - SopsBucketName string `yaml:"sops-bucket-name,omitempty"` - AWSMFAProfile string `yaml:"aws-mfa-profile,omitempty"` - AWSMFATokenExpiration string `yaml:"aws-mfa-token-expiration,omitempty"` - *aws_provider.AwsConfigure `yaml:"aws,omitempty"` - ProgressBar bool `yaml:"progress-bar"` - ProjectFile `yaml:"project-file"` + Name string `yaml:"name,omitempty"` + Tenant string `yaml:"tenant,omitempty"` + Environment string `yaml:"environment,omitempty"` + ConfigNameFrom string `yaml:"config-name-from,omitempty"` + RootDomain string `yaml:"root-domain,omitempty"` + GitHubToken string `yaml:"github-token,omitempty"` + ClusterProvider string `yaml:"cluster-provider"` + SlackNotifications bool `yaml:"slack-notifications"` + SlackWebHook string `yaml:"slack-webhook,omitempty"` + SlackChannel string `yaml:"slack-channel,omitempty"` + SlackMsgDetails []string `yaml:"slack-message-details,omitempty"` + SopsAgeKeys string `yaml:"sops-age-keys,omitempty"` + SopsBucketName string `yaml:"sops-bucket-name,omitempty"` + AWSMFAProfile string `yaml:"aws-mfa-profile,omitempty"` + AWSMFATokenExpiration string `yaml:"aws-mfa-token-expiration,omitempty"` + *aws_provider.AwsConfigure `yaml:"aws,omitempty"` + *azure_provider.AzureConfigure `yaml:"azure,omitempty"` + ProgressBar bool `yaml:"progress-bar"` + ProjectFile `yaml:"project-file"` } type HookMapping struct { diff --git a/go.mod b/go.mod index d566e8b..bd971bc 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,12 @@ module rmk -go 1.21 +go 1.22.0 + +toolchain go1.22.8 require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6 v6.1.0 github.com/Masterminds/semver v1.5.0 github.com/Masterminds/sprig/v3 v3.2.3 github.com/aws/aws-sdk-go-v2 v1.24.1 @@ -15,28 +19,35 @@ require ( github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 github.com/aws/smithy-go v1.19.0 github.com/cheggaaa/pb v1.0.29 + github.com/ghodss/yaml v1.0.0 github.com/go-git/go-git/v5 v5.11.0 github.com/google/go-github v17.0.0+incompatible github.com/hashicorp/go-getter v1.7.3 github.com/slack-go/slack v0.12.3 github.com/urfave/cli/v2 v2.27.1 - go.uber.org/zap v1.26.0 - golang.org/x/crypto v0.18.0 - golang.org/x/oauth2 v0.16.0 + go.uber.org/zap v1.27.0 + golang.org/x/crypto v0.27.0 + golang.org/x/net v0.28.0 + golang.org/x/oauth2 v0.21.0 gopkg.in/yaml.v3 v3.0.1 + k8s.io/api v0.31.1 + k8s.io/apimachinery v0.31.1 + k8s.io/client-go v0.31.1 mvdan.cc/sh/v3 v3.8.0 ) require ( - cloud.google.com/go v0.110.2 // indirect - cloud.google.com/go/compute v1.20.1 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v0.13.0 // indirect - cloud.google.com/go/storage v1.29.0 // indirect + cloud.google.com/go v0.110.6 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // indirect + cloud.google.com/go/iam v1.1.1 // indirect + cloud.google.com/go/storage v1.30.1 // indirect dario.cat/mergo v1.0.0 // indirect - github.com/BurntSushi/toml v1.3.2 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect + github.com/BurntSushi/toml v1.4.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect github.com/aws/aws-sdk-go v1.44.122 // indirect @@ -55,59 +66,93 @@ require ( github.com/aws/aws-sdk-go-v2/service/sso v1.18.6 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.6 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect - github.com/cloudflare/circl v1.3.3 // indirect + github.com/cloudflare/circl v1.3.7 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/emicklei/go-restful/v3 v3.12.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect + github.com/fatih/color v1.17.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.5.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/google/go-cmp v0.6.0 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-querystring v1.1.0 // indirect + github.com/google/gofuzz v1.2.0 // indirect github.com/google/s2a-go v0.1.4 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect github.com/googleapis/gax-go/v2 v2.11.0 // indirect - github.com/gorilla/websocket v1.4.2 // indirect + github.com/gorilla/websocket v1.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/huandu/xstrings v1.3.3 // indirect - github.com/imdario/mergo v0.3.11 // indirect + github.com/huandu/xstrings v1.4.0 // indirect + github.com/imdario/mergo v0.3.16 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/klauspost/compress v1.15.11 // indirect - github.com/mattn/go-runewidth v0.0.4 // indirect - github.com/mitchellh/copystructure v1.0.0 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-runewidth v0.0.14 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/reflectwalk v1.0.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // 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/onsi/ginkgo/v2 v2.20.2 // indirect + github.com/onsi/gomega v1.34.2 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect + github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect + github.com/rivo/uniseg v0.4.2 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sergi/go-diff v1.1.0 // indirect - github.com/shopspring/decimal v1.2.0 // indirect + github.com/shopspring/decimal v1.3.1 // indirect github.com/skeema/knownhosts v1.2.1 // indirect - github.com/spf13/cast v1.3.1 // indirect + github.com/spf13/cast v1.6.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect github.com/ulikunitz/xz v0.5.10 // indirect + github.com/x448/float16 v0.8.4 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect go.opencensus.io v0.24.0 // indirect - go.uber.org/multierr v1.10.0 // indirect - golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.20.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.0 // indirect - golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.17.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/text v0.18.0 // indirect + golang.org/x/time v0.5.0 // indirect + golang.org/x/tools v0.24.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.126.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/grpc v1.55.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240610135401-a8a62080eff3 // indirect + google.golang.org/grpc v1.64.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a // indirect + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // 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.4.0 // indirect ) diff --git a/go.sum b/go.sum index 6474851..9701f9e 100644 --- a/go.sum +++ b/go.sum @@ -30,8 +30,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.110.2 h1:sdFPBr6xG9/wkBbfhmUz/JmZC7X6LavQgcrVINrKiVA= -cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= +cloud.google.com/go v0.110.6 h1:8uYAkj3YHTP/1iwReuHPxLSbdcyc+dSBbzFMrVwDR6Q= +cloud.google.com/go v0.110.6/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -68,10 +68,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg= -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= @@ -109,8 +107,8 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k= -cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iam v1.1.1 h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y= +cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= @@ -171,8 +169,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.29.0 h1:6weCgzRvMg7lzuUurI4697AqIRPU1SvzHhynwpW31jI= -cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= +cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM= +cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -187,16 +185,33 @@ cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoIS dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v5 v5.0.0 h1:5n7dPVqsWfVKw+ZiEKSd3Kzu7gwBkbEBkeXb8rgaE9Q= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v5 v5.0.0/go.mod h1:HcZY0PHPo/7d75p99lB6lK0qYOP4vLRJUBpiehYXtLQ= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6 v6.1.0 h1:FvuejXWdMIPK6sY0Tt3lgb45BCVybrvmmnGCEC7a1i4= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6 v6.1.0/go.mod h1:drbnYtukMoZqUQq9hJASf41w3RB4VoTJPoPpe+XDHPU= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 h1:2qsIIvxVT+uE6yrNldntJKlLRgxGbZ85kgtz5SNBhMw= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0/go.mod h1:AW8VEadnhw9xox+VaVd9sP7NjzOAnaZBLRH6Tq3cJ38= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= +github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= +github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= @@ -271,8 +286,9 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -287,10 +303,13 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= +github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= +github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -304,10 +323,14 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go. github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= @@ -322,8 +345,22 @@ github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lK github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-test/deep v1.0.4 h1:u2CU3YKy9I2pmu9pX0eq50wCgjfGIt539SqR7FbHiho= github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -356,11 +393,13 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -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/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -382,6 +421,9 @@ github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4r github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -403,13 +445,16 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -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/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= @@ -427,8 +472,9 @@ github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMd github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= @@ -440,22 +486,29 @@ github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mO github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= 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/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= +github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= +github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +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/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= @@ -466,32 +519,57 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 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/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +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/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= +github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= -github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +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 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +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/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4= +github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag= +github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= +github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= 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/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8= +github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= @@ -500,20 +578,25 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/slack-go/slack v0.12.3 h1:92/dfFU8Q5XP6Wp5rr5/T5JHLM5c5Smtn53fhToAP88= github.com/slack-go/slack v0.12.3/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 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/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -521,12 +604,14 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli/v2 v2.27.1 h1:8xSQ6szndafKVRmfyeUMxkNUJQMjL1F2zmsZ+qHpfho= github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= @@ -547,12 +632,12 @@ go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= -go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= -go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= -go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -564,8 +649,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -603,8 +688,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-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-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -656,8 +741,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -683,8 +768,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-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= @@ -700,8 +785,8 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -768,21 +853,22 @@ golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 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= @@ -796,11 +882,13 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -838,6 +926,7 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -846,6 +935,7 @@ golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= @@ -854,8 +944,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= -golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -921,8 +1011,9 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -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/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= 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= @@ -1024,12 +1115,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc h1:8DyZCyvI8mE1IdLy/60bS+52xfymkE72wv1asokgtao= -google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= -google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc h1:kVKPf/IiYSBWEWtkIn6wZXwWGCnLKcC8oWfZvXjsGnM= -google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 h1:L6iMMGrtzgHsWofoFcihmDEMYeDR9KN/ThbPWGrh++g= +google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= +google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 h1:QW9+G6Fir4VcRXVH8x3LilNAb6cxBGLa6+GM4hRwexE= +google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3/go.mod h1:kdrSS/OiLkPrNUpzD4aHgCq2rVuC/YRxok32HXZ4vRE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240610135401-a8a62080eff3 h1:9Xyg6I9IWQZhRVfCWjKK+l6kI0jHcPesVlMnT//aHNo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240610135401-a8a62080eff3/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1065,8 +1156,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= +google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1083,8 +1174,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1092,14 +1183,17 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/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= @@ -1110,8 +1204,26 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU= +k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI= +k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= +k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0= +k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a h1:zD1uj3Jf+mD4zmA7W+goE5TxDkI7OGJjBNBzq5fJtLA= +k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= mvdan.cc/sh/v3 v3.8.0 h1:ZxuJipLZwr/HLbASonmXtcvvC9HXY9d2lXZHnKGjFc8= mvdan.cc/sh/v3 v3.8.0/go.mod h1:w04623xkgBVo7/IUK89E0g8hBykgEpN0vgOj3RJr6MY= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +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.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/providers/aws_provider/aws.go b/providers/aws_provider/aws.go index 7f74ffb..75a3f77 100644 --- a/providers/aws_provider/aws.go +++ b/providers/aws_provider/aws.go @@ -31,6 +31,10 @@ import ( "rmk/util" ) +const ( + AWSClusterProvider = "aws" +) + type AwsConfigure struct { Profile string `yaml:"profile,omitempty"` Region string `yaml:"region,omitempty"` diff --git a/providers/azure_provider/azure.go b/providers/azure_provider/azure.go index b5dc3a4..a3db01e 100644 --- a/providers/azure_provider/azure.go +++ b/providers/azure_provider/azure.go @@ -1 +1,153 @@ package azure_provider + +import ( + "encoding/json" + "fmt" + "os" + "reflect" + "strings" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" + "golang.org/x/net/context" + + "rmk/util" +) + +const ( + AzureClusterProvider = "azure" + AzureHomeDir = "." + AzureClusterProvider + AzurePrefix = "service-principal-credentials_" +) + +type AzureRawServicePrincipal struct { + AppId string `json:"appId"` + DisplayName string `json:"displayName"` + Password string `json:"password"` + Tenant string `json:"tenant"` +} + +type AzureClient struct { + ARMClient *armcontainerservice.ManagedClustersClient `json:"-" yaml:"-"` + Ctx context.Context `json:"-" yaml:"-"` +} + +type AzureConfigure struct { + AzureClient `json:"-" yaml:"-"` + ClientID string `json:"client-id,omitempty" yaml:"-"` + ClientSecret string `json:"client-secret,omitempty" yaml:"-"` + SubscriptionID string `json:"subscription-id,omitempty"` + TenantID string `json:"tenant-id,omitempty" yaml:"-"` +} + +func NewAzureConfigure() *AzureConfigure { + return &AzureConfigure{} +} + +func NewRawSP() *AzureRawServicePrincipal { + return &AzureRawServicePrincipal{} +} + +func (ac *AzureConfigure) MergeAzureRawSP(asp *AzureRawServicePrincipal) { + ac.ClientID = asp.AppId + ac.ClientSecret = asp.Password + ac.TenantID = asp.Tenant +} + +func getTagStructName(i interface{}, name string) error { + if field, ok := reflect.TypeOf(i).Elem().FieldByName(name); ok { + return fmt.Errorf("service principal option %s not defined", strings.TrimSuffix(field.Tag.Get("json"), ",omitempty")) + } else { + return fmt.Errorf("field by name %s not defined", name) + } +} + +func (ac *AzureConfigure) CheckSPCredentials() error { + if len(ac.ClientID) == 0 { + if err := getTagStructName(ac, "ClientID"); err != nil { + return err + } + } + + if len(ac.ClientSecret) == 0 { + if err := getTagStructName(ac, "ClientSecret"); err != nil { + return err + } + } + + if len(ac.SubscriptionID) == 0 { + if err := getTagStructName(ac, "SubscriptionID"); err != nil { + return err + } + } + + if len(ac.TenantID) == 0 { + if err := getTagStructName(ac, "TenantID"); err != nil { + return err + } + } + + return nil +} + +func (ac *AzureConfigure) ReadSPCredentials(fileSuffix string) error { + data, err := os.ReadFile(util.GetHomePath(AzureHomeDir, AzurePrefix+fileSuffix+".json")) + if err != nil { + return err + } + + return json.Unmarshal(data, &ac) +} + +func (ac *AzureConfigure) WriteSPCredentials(fileSuffix string) error { + data, err := json.MarshalIndent(ac, "", " ") + if err != nil { + return err + } + + data = []byte(string(data) + "\n") + + if !util.IsExists(util.GetHomePath(AzureHomeDir), false) { + if err := os.MkdirAll(util.GetHomePath(AzureHomeDir), 0755); err != nil { + return err + } + } + + return os.WriteFile( + util.GetHomePath(AzureHomeDir, AzurePrefix+fileSuffix+".json"), + data, 0644) +} + +func (ac *AzureConfigure) NewAzureManagedClustersClient(ctx context.Context, fileName string) error { + if err := ac.ReadSPCredentials(fileName); err != nil { + return err + } + + cred, err := azidentity.NewClientSecretCredential(ac.TenantID, ac.ClientID, ac.ClientSecret, nil) + if err != nil { + return err + } + + factory, err := armcontainerservice.NewClientFactory(ac.SubscriptionID, cred, nil) + if err != nil { + return err + } + + ac.ARMClient = factory.NewManagedClustersClient() + ac.Ctx = ctx + + return nil +} + +func (ac *AzureConfigure) GetAzureClusterContext(groupName, clusterName string) ([]byte, error) { + credentials, err := ac.ARMClient.ListClusterAdminCredentials(ac.Ctx, groupName, clusterName, nil) + if err != nil { + return nil, err + } + + if len(credentials.CredentialResults.Kubeconfigs) == 1 { + return credentials.CredentialResults.Kubeconfigs[0].Value, nil + } + + return nil, fmt.Errorf("context for cluster %s not found", clusterName) +} diff --git a/util/dictionary.go b/util/dictionary.go index 760acd9..c923071 100644 --- a/util/dictionary.go +++ b/util/dictionary.go @@ -1,9 +1,8 @@ package util const ( - AWSClusterProvider = "aws" - AzureClusterProvider = "azure" CAPI = "capi" + CAPIContextName = K3DPrefix + "-" + CAPI GitSSHPrivateKey = ".ssh/id_rsa" GlobalsFileName = "globals.yaml.gotmpl" HelmfileFileName = "helmfile.yaml"