Skip to content

Commit

Permalink
Merge pull request #1014 from aziontech/hotfix-readonly-buckets
Browse files Browse the repository at this point in the history
fix: change default to read_only when creating buckets
  • Loading branch information
PatrickMenoti authored Dec 5, 2024
2 parents 24a5115 + c8a5775 commit f489b33
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (cmd *DeployCmd) Run(f *cmdutil.Factory) error {
if settings.S3AccessKey == "" || settings.S3SecreKey == "" {
nameBucket := fmt.Sprintf("%s-%s", conf.Name, cmd.VersionID())
storageClient := storage.NewClient(f.HttpClient, f.Config.GetString("storage_url"), f.Config.GetString("token"))
err := storageClient.CreateBucket(ctx, storage.RequestBucket{BucketCreate: sdk.BucketCreate{Name: nameBucket, EdgeAccess: sdk.READ_WRITE}})
err := storageClient.CreateBucket(ctx, storage.RequestBucket{BucketCreate: sdk.BucketCreate{Name: nameBucket, EdgeAccess: sdk.READ_ONLY}})
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/deploy_remote/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (cmd *DeployCmd) doBucket(
nameBucket := replaceInvalidChars(conf.Name)

err := client.CreateBucket(ctx, api.RequestBucket{
BucketCreate: storage.BucketCreate{Name: nameBucket, EdgeAccess: storage.READ_WRITE}})
BucketCreate: storage.BucketCreate{Name: nameBucket, EdgeAccess: storage.READ_ONLY}})
if err != nil {
// If the name is already in use, try 10 times with different names
for i := 0; i < 10; i++ {
Expand All @@ -39,7 +39,7 @@ func (cmd *DeployCmd) doBucket(
logger.FInfoFlags(cmd.Io.Out, msgf, cmd.F.Format, cmd.F.Out)
*msgs = append(*msgs, msgf)
err := client.CreateBucket(ctx, api.RequestBucket{
BucketCreate: storage.BucketCreate{Name: nameB, EdgeAccess: storage.READ_WRITE}})
BucketCreate: storage.BucketCreate{Name: nameB, EdgeAccess: storage.READ_ONLY}})
if err != nil {
if errors.Is(err, utils.ErrorNameInUse) && i < 9 {
continue
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/link/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func (cmd *LinkCmd) run(c *cobra.Command, info *LinkInfo) error {

logger.Debug("Running build command from link command")
buildCmd := cmd.BuildCmd(cmd.F)
err := buildCmd.ExternalRun(&contracts.BuildInfo{Preset: info.Preset}, info.projectPath, &msgs)
err := buildCmd.ExternalRun(&contracts.BuildInfo{Preset: strings.ToLower(info.Preset)}, info.projectPath, &msgs)
if err != nil {
logger.Debug("Error while running build command called by link command", zap.Error(err))
return err
Expand Down

0 comments on commit f489b33

Please sign in to comment.