Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loudly error when failing to make an AMI public #38

Merged
merged 2 commits into from
Mar 27, 2024

Conversation

cunnie
Copy link
Member

@cunnie cunnie commented Mar 20, 2024

We published a light stemcell (Jammy 1.406) whose AMI in region eu-central-1 was not public, causing an error when a user tried to deploy.

The problem was we never checked to make sure that our attempt to make the AMI public succeeded.

With this commit, we now propagate any errors that occur when attempting to make the AMI we publish public.

Signed-off-by: Brian Cunnie [email protected]

[#184045754] Ensure the aws light stemcell builder catches errors when making AMIs public

The test attempts to make an encrypted snapshot public when copying, which triggers the error, "failed to make AMI 'ami-0957311dac7d2f6fe' public: UnsupportedOperation: Encrypted snapshots can't be shared publicly. Specify another snapshot.\n\tstatus code: 400".

We published a light stemcell (Jammy 1.406) whose AMI in region
`eu-central-1` was not public, causing an error when a user tried to
deploy.

The problem was we never checked to make sure that our attempt to make
the AMI public succeeded.

With this commit, we now propagate any errors that occur when attempting
to make the AMI we publish public.

Signed-off-by: Brian Cunnie <[email protected]>

[#184045754] Ensure the aws light stemcell builder catches errors when making AMIs public
@jpalermo jpalermo requested review from a team, aramprice and nouseforaname and removed request for a team March 21, 2024 16:04
@@ -128,7 +128,7 @@ func (d *SDKCopyAmiDriver) Create(driverConfig resources.AmiDriverConfig) (resou

if driverConfig.Accessibility == resources.PublicAmiAccessibility {
d.logger.Printf("making AMI: %s public", *amiIDptr)
ec2Client.ModifyImageAttribute(&ec2.ModifyImageAttributeInput{ //nolint:errcheck
_, err = ec2Client.ModifyImageAttribute(&ec2.ModifyImageAttributeInput{ //nolint:errcheck
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the //nolint:errcheck linting directive still needed?

Signed-off-by: Joseph Palermo <[email protected]>
Co-authored-by: Joseph Palermo <[email protected]>
Copy link
Member

@jpalermo jpalermo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We removed the nolint check that shouldn't be needed any longer.

Everything looks good.

@jpalermo jpalermo merged commit 5e4f86d into master Mar 27, 2024
5 checks passed
@jpalermo jpalermo deleted the error-on-publicizing branch March 27, 2024 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants