From 9669bc8afa47e35f63f1b94690a1cf81a7a5ee91 Mon Sep 17 00:00:00 2001 From: Otto Bittner Date: Thu, 22 Jun 2023 10:45:06 +0200 Subject: [PATCH] hack: add `bucket` flag to configapi cli The flag can be used to set another bucket for testing. Also allow setting the region. --- hack/configapi/cmd/root.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hack/configapi/cmd/root.go b/hack/configapi/cmd/root.go index 276f0fefc..7003c4148 100644 --- a/hack/configapi/cmd/root.go +++ b/hack/configapi/cmd/root.go @@ -22,8 +22,6 @@ import ( ) const ( - awsRegion = "eu-central-1" - awsBucket = "cdn-constellation-backend" invalidDefault = 0 envAwsKeyID = "AWS_ACCESS_KEY_ID" envAwsKey = "AWS_ACCESS_KEY" @@ -32,6 +30,8 @@ const ( ) var ( + awsBucket string + awsRegion string versionFilePath string force bool // Cosign credentials. @@ -55,6 +55,8 @@ func newRootCmd() *cobra.Command { RunE: runCmd, } rootCmd.Flags().StringVarP(&versionFilePath, "version-file", "f", "", "File path to the version json file.") + rootCmd.Flags().StringVar(&awsBucket, "bucket", "cdn-constellation-backend", "Bucket to upload files to.") + rootCmd.Flags().StringVar(&awsRegion, "region", "eu-central-1", "Bucket to upload files to.") rootCmd.Flags().BoolVar(&force, "force", false, "force to upload version regardless of comparison to latest API value.") rootCmd.Flags().StringP("upload-date", "d", "", "upload a version with this date as version name. Setting it implies --force.") must(enforceRequiredFlags(rootCmd, "version-file"))