From cb45ad1b4481d82aef07255a0c3d9f006b7a6493 Mon Sep 17 00:00:00 2001 From: Daniel Mieg <56156797+DanielMieg@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:55:43 +0200 Subject: [PATCH] Add possible values and default (#5030) --- cmd/abapEnvironmentCloneGitRepo_generated.go | 6 +++--- resources/metadata/abapEnvironmentCloneGitRepo.yaml | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/abapEnvironmentCloneGitRepo_generated.go b/cmd/abapEnvironmentCloneGitRepo_generated.go index 8e160194f1..4a474950ed 100644 --- a/cmd/abapEnvironmentCloneGitRepo_generated.go +++ b/cmd/abapEnvironmentCloneGitRepo_generated.go @@ -20,7 +20,7 @@ type abapEnvironmentCloneGitRepoOptions struct { Password string `json:"password,omitempty"` ByogUsername string `json:"byogUsername,omitempty"` ByogPassword string `json:"byogPassword,omitempty"` - ByogAuthMethod string `json:"byogAuthMethod,omitempty"` + ByogAuthMethod string `json:"byogAuthMethod,omitempty" validate:"possible-values=TOKEN BASIC"` Repositories string `json:"repositories,omitempty"` RepositoryName string `json:"repositoryName,omitempty"` BranchName string `json:"branchName,omitempty"` @@ -145,7 +145,7 @@ func addAbapEnvironmentCloneGitRepoFlags(cmd *cobra.Command, stepConfig *abapEnv cmd.Flags().StringVar(&stepConfig.Password, "password", os.Getenv("PIPER_password"), "Password for either the Cloud Foundry API or the Communication Arrangement for SAP_COM_0948") cmd.Flags().StringVar(&stepConfig.ByogUsername, "byogUsername", os.Getenv("PIPER_byogUsername"), "Username for bring your own git (BYOG) authentication") cmd.Flags().StringVar(&stepConfig.ByogPassword, "byogPassword", os.Getenv("PIPER_byogPassword"), "Password for bring your own git (BYOG) authentication") - cmd.Flags().StringVar(&stepConfig.ByogAuthMethod, "byogAuthMethod", os.Getenv("PIPER_byogAuthMethod"), "Specifies which authentication method is used for bring your own git (BYOG) repositories") + cmd.Flags().StringVar(&stepConfig.ByogAuthMethod, "byogAuthMethod", `TOKEN`, "Specifies which authentication method is used for bring your own git (BYOG) repositories") cmd.Flags().StringVar(&stepConfig.Repositories, "repositories", os.Getenv("PIPER_repositories"), "Specifies a YAML file containing the repositories configuration") cmd.Flags().StringVar(&stepConfig.RepositoryName, "repositoryName", os.Getenv("PIPER_repositoryName"), "Specifies a repository (Software Components) on the SAP BTP ABAP Environment system") cmd.Flags().StringVar(&stepConfig.BranchName, "branchName", os.Getenv("PIPER_branchName"), "Specifies a branch of a repository (Software Components) on the SAP BTP ABAP Environment system") @@ -245,7 +245,7 @@ func abapEnvironmentCloneGitRepoMetadata() config.StepData { Type: "string", Mandatory: false, Aliases: []config.Alias{}, - Default: os.Getenv("PIPER_byogAuthMethod"), + Default: `TOKEN`, }, { Name: "repositories", diff --git a/resources/metadata/abapEnvironmentCloneGitRepo.yaml b/resources/metadata/abapEnvironmentCloneGitRepo.yaml index 746c2c3a82..6a49f159fa 100644 --- a/resources/metadata/abapEnvironmentCloneGitRepo.yaml +++ b/resources/metadata/abapEnvironmentCloneGitRepo.yaml @@ -84,6 +84,10 @@ spec: - STAGES - STEPS - GENERAL + possibleValues: + - TOKEN + - BASIC + default: TOKEN - name: repositories type: string description: Specifies a YAML file containing the repositories configuration