-
Notifications
You must be signed in to change notification settings - Fork 71
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
policy: fix broken default policy symlink on mkosi #1718
Merged
mkulke
merged 1 commit into
confidential-containers:main
from
mkulke:mkulke/fix-default-policy-on-mkosi
Feb 27, 2024
Merged
policy: fix broken default policy symlink on mkosi #1718
mkulke
merged 1 commit into
confidential-containers:main
from
mkulke:mkulke/fix-default-policy-on-mkosi
Feb 27, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The podvm makefile would be invoked with an empty default policy file setting from the mkosi docker build, in which the docker-build arg is set to an empty string. The podvm makefile would hence not pick the default, but attempt to use the empty string in the creation of the symbolic link, resulting in a symbolic link that points to itself. The change will make sure that the env is only set in the Dockerfile invocation if the variable is set in the mkosi makefile. Also we quote the the source file for the symbolic link creation, so we bail out properly, instead of creating a self-pointing symbolic link. Signed-off-by: Magnus Kulke <magnuskulke@microsoft.com>
mkulke
requested review from
surajssd,
bpradipt,
kartikjoshi21,
stevenhorsman and
katexochen
February 26, 2024 16:53
stevenhorsman
approved these changes
Feb 26, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for tracking it down!
bpradipt
approved these changes
Feb 27, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
stevenhorsman
added a commit
to stevenhorsman/cloud-api-adaptor
that referenced
this pull request
Mar 5, 2024
Nightly podvm-binaries build has been failing with: ``` # Set default policy 956.9 cd /src/cloud-api-adaptor/podvm/files/etc/kata-opa && ln -s -f "" default-policy.rego 956.9 ln: failed to create symbolic link 'default-policy.rego' -> '': No such file or directory ``` So port over the mkosi fix for this that Magnus did in confidential-containers#1718 Signed-off-by: stevenhorsman <steven@uk.ibm.com>
stevenhorsman
added a commit
to stevenhorsman/cloud-api-adaptor
that referenced
this pull request
Mar 5, 2024
Nightly podvm-binaries build has been failing with: ``` # Set default policy 956.9 cd /src/cloud-api-adaptor/podvm/files/etc/kata-opa && ln -s -f "" default-policy.rego 956.9 ln: failed to create symbolic link 'default-policy.rego' -> '': No such file or directory ``` So port over the mkosi fix for this that Magnus did in confidential-containers#1718 Signed-off-by: stevenhorsman <steven@uk.ibm.com>
stevenhorsman
added a commit
to stevenhorsman/cloud-api-adaptor
that referenced
this pull request
Mar 6, 2024
Nightly podvm-binaries build has been failing with: ``` 956.9 cd /src/cloud-api-adaptor/podvm/files/etc/kata-opa && ln -s -f "" default-policy.rego 956.9 ln: failed to create symbolic link 'default-policy.rego' -> '': No such file or directory ``` So port over the mkosi fix for this that Magnus did in confidential-containers#1718 Signed-off-by: stevenhorsman <steven@uk.ibm.com>
stevenhorsman
added a commit
that referenced
this pull request
Mar 6, 2024
Nightly podvm-binaries build has been failing with: ``` 956.9 cd /src/cloud-api-adaptor/podvm/files/etc/kata-opa && ln -s -f "" default-policy.rego 956.9 ln: failed to create symbolic link 'default-policy.rego' -> '': No such file or directory ``` So port over the mkosi fix for this that Magnus did in #1718 Signed-off-by: stevenhorsman <steven@uk.ibm.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The podvm makefile would be invoked with an empty default policy file setting from the mkosi docker build, in which the docker-build arg is set to an empty string. The podvm makefile would hence not pick the default, but attempt to use the empty string in the creation of the symbolic link, resulting in a symbolic link that points to itself.
The change will make sure that the env is only set in the Dockerfile invocation if the variable is set in the mkosi makefile. Also we quote the the source file for the symbolic link creation, so we bail out properly, instead of creating a self-pointing symbolic link.