Skip to content

Commit

Permalink
Fix S3 creation in iad (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekgogia authored May 24, 2022
1 parent f743be9 commit 53b4575
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions substrate/cmd/kitctl/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func bootstrap(cmd *cobra.Command, args []string) {
start := time.Now()
name := parseName(ctx, args)
logging.FromContext(ctx).Infof("Bootstrapping %q", name)
vpcCidrs := []string{"10.0.0.0/16", "10.1.0.0/16", "10.2.0.0/16", "10.3.0.0/16", "10.4.0.0/16", "10.5.0.0/16"}
vpcCidrs := []string{"10.0.0.0/16", "10.1.0.0/16", "10.2.0.0/16", "10.3.0.0/16", "10.4.0.0/16"}
if err := substrate.NewController(ctx).Reconcile(ctx, &v1alpha1.Substrate{
ObjectMeta: metav1.ObjectMeta{Name: name},

Expand All @@ -64,7 +64,6 @@ func bootstrap(cmd *cobra.Command, args []string) {
{Zone: "us-west-2c", CIDR: vpcCidrs[2]},
{Zone: "us-west-2a", CIDR: vpcCidrs[3], Public: true},
{Zone: "us-west-2b", CIDR: vpcCidrs[4], Public: true},
{Zone: "us-west-2c", CIDR: vpcCidrs[5], Public: true},
},
},
}); err != nil {
Expand Down
4 changes: 1 addition & 3 deletions substrate/pkg/controller/substrate/cluster/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,7 @@ func (c *Config) generateStaticPodManifests(cfg *kubeadm.InitConfiguration, subs
}

func (c *Config) ensureBucket(ctx context.Context, substrate *v1alpha1.Substrate) error {
if _, err := c.S3.CreateBucket(&s3.CreateBucketInput{Bucket: discovery.Name(substrate),
CreateBucketConfiguration: &s3.CreateBucketConfiguration{LocationConstraint: c.S3.Config.Region},
}); err != nil {
if _, err := c.S3.CreateBucket(&s3.CreateBucketInput{Bucket: discovery.Name(substrate)}); err != nil {
if err.(awserr.Error).Code() != s3.ErrCodeBucketAlreadyOwnedByYou {
return fmt.Errorf("creating S3 bucket, %w", err)
}
Expand Down

0 comments on commit 53b4575

Please sign in to comment.