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

Pass BUILDSYS_NAME to rpm2img so we use requested image name prefix #1312

Merged
merged 1 commit into from
Feb 9, 2021

Conversation

tjkirch
Copy link
Contributor

@tjkirch tjkirch commented Feb 9, 2021

Issue number:

Fixes #1311 - thanks @diranged!

Description of changes:

We had forgotten to pass BUILDSYS_NAME through rpm2img, so while we were able to build images, they weren't named properly, and the symlinks were broken.

Testing done:

After a cargo make -e BUILDSYS_NAME=nd-bottlerocket, the images are named appropriately:

-rw-r--r--. 1 tjk tjk  12M 02-09 19:49 bottlerocket-aws-k8s-1.17-x86_64-1.0.5-b890eca1-dirty-migrations.tar
drwxr-xr-x. 2 tjk tjk 4.0K 02-09 19:50 latest/
-rw-r--r--. 1 tjk tjk  12M 02-09 19:49 nd-bottlerocket-aws-k8s-1.17-x86_64-1.0.5-b890eca1-dirty-boot.ext4.lz4
-rw-r--r--. 1 tjk tjk 4.1M 02-09 19:49 nd-bottlerocket-aws-k8s-1.17-x86_64-1.0.5-b890eca1-dirty-data.img.lz4
-rw-r--r--. 1 tjk tjk 210M 02-09 19:50 nd-bottlerocket-aws-k8s-1.17-x86_64-1.0.5-b890eca1-dirty-root.ext4.lz4
-rw-r--r--. 1 tjk tjk 4.5M 02-09 19:49 nd-bottlerocket-aws-k8s-1.17-x86_64-1.0.5-b890eca1-dirty-root.verity.lz4
-rw-r--r--. 1 tjk tjk 278M 02-09 19:49 nd-bottlerocket-aws-k8s-1.17-x86_64-1.0.5-b890eca1-dirty.img.lz4

...and linked properly in latest:

lrwxrwxrwx. 1 tjk tjk   73 02-09 19:50 nd-bottlerocket-aws-k8s-1.17-x86_64-boot.ext4.lz4 -> ../nd-bottlerocket-aws-k8s-1.17-x86_64-1.0.5-b890eca1-dirty-boot.ext4.lz4
lrwxrwxrwx. 1 tjk tjk   72 02-09 19:50 nd-bottlerocket-aws-k8s-1.17-x86_64-data.img.lz4 -> ../nd-bottlerocket-aws-k8s-1.17-x86_64-1.0.5-b890eca1-dirty-data.img.lz4
lrwxrwxrwx. 1 tjk tjk   73 02-09 19:50 nd-bottlerocket-aws-k8s-1.17-x86_64-root.ext4.lz4 -> ../nd-bottlerocket-aws-k8s-1.17-x86_64-1.0.5-b890eca1-dirty-root.ext4.lz4
lrwxrwxrwx. 1 tjk tjk   75 02-09 19:50 nd-bottlerocket-aws-k8s-1.17-x86_64-root.verity.lz4 -> ../nd-bottlerocket-aws-k8s-1.17-x86_64-1.0.5-b890eca1-dirty-root.verity.lz4
lrwxrwxrwx. 1 tjk tjk   67 02-09 19:50 nd-bottlerocket-aws-k8s-1.17-x86_64.img.lz4 -> ../nd-bottlerocket-aws-k8s-1.17-x86_64-1.0.5-b890eca1-dirty.img.lz4

cargo make ami -e BUILDSYS_NAME=nd-bottlerocket succeeded with the new images (I cleaned out any others) and I was able to launch a healthy instance and run a pod OK.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@tjkirch tjkirch requested a review from bcressey February 9, 2021 20:01
Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

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

🌃

@tjkirch tjkirch merged commit 14dc4dd into bottlerocket-os:develop Feb 9, 2021
@tjkirch tjkirch deleted the rpm2img-name branch February 9, 2021 22:24
@@ -24,7 +24,7 @@ esac

mkdir -p "${OUTPUT_DIR}"

FILENAME_PREFIX="bottlerocket-${VARIANT}-${ARCH}-${VERSION_ID}-${BUILD_ID}"
FILENAME_PREFIX="${IMAGE_NAME}-${VARIANT}-${ARCH}-${VERSION_ID}-${BUILD_ID}"
Copy link

Choose a reason for hiding this comment

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

👍

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.

The "cargo make" step creates invalid symlinks when the BUILDSYS_NAME variable is set
6 participants