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

Validate versionlocks #1195

Merged
merged 5 commits into from
Mar 6, 2023
Merged

Validate versionlocks #1195

merged 5 commits into from
Mar 6, 2023

Conversation

cartermckinnon
Copy link
Member

@cartermckinnon cartermckinnon commented Feb 21, 2023

Issue #, if available:

#1193

Description of changes:

Adds some validation on kernel versionlocks, since multiple locks can lead to unexpected behavior.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Testing Done

Succeeds:

> make 1.25
...
2023-03-06T13:02:56-08:00: ==> amazon-ebs: Provisioning with shell script: awslabs/amazon-eks-ami/scripts/validate.sh
2023-03-06T13:02:57-08:00:     amazon-ebs: Verifying that kernel version 5.10.167-147.601.amzn2.x86_64 matches ...
2023-03-06T13:02:57-08:00:     amazon-ebs: Kernel matches expected version!
2023-03-06T13:02:57-08:00:     amazon-ebs: Verifying that the package versionlocks are correct...
2023-03-06T13:02:57-08:00:     amazon-ebs: Package versionlocks are correct!

Fails (as expected):

> git checkout 8b10a76977278e7afec85b51c326d17392565fd6
> curl -L https://github.com/awslabs/amazon-eks-ami/pull/1195.patch | git apply
> make 1.24
...
2023-03-06T13:28:35-08:00: ==> amazon-ebs: Provisioning with shell script: awslabs/amazon-eks-ami/scripts/validate.sh
2023-03-06T13:28:35-08:00:     amazon-ebs: Verifying that kernel version 5.10.167-147.601.amzn2.x86_64 matches ...
2023-03-06T13:28:35-08:00:     amazon-ebs: Kernel matches expected version!
2023-03-06T13:28:35-08:00:     amazon-ebs: Verifying that the package versionlocks are correct...
2023-03-06T13:28:36-08:00:     amazon-ebs: There is no package matching the versionlock entry: 'kernel-4.14.305-227.531.amzn2.*'
2023-03-06T13:28:36-08:00: ==> amazon-ebs: Provisioning step had errors: Running the cleanup provisioner, if present...

@mmerkes
Copy link
Member

mmerkes commented Feb 21, 2023

Did you validate that this works with the problematic AMI? As in, it would have failed.

@cartermckinnon
Copy link
Member Author

Yep! Updated the PR description.

@cartermckinnon cartermckinnon changed the title Validate kernel versionlocks Validate versionlocks Feb 22, 2023
@cartermckinnon cartermckinnon merged commit 951c6ec into master Mar 6, 2023
@cartermckinnon cartermckinnon deleted the validate-versionlock branch March 6, 2023 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants