-
Notifications
You must be signed in to change notification settings - Fork 18
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
Inspection refactoring and cleanup #400
Conversation
In order to avoid adding return variables for each value we want to extract at migration time we are now collecting them in a result object. This object could later be extended and reused for the inspect scripts instead of using a map.
When migrating from a non-containerized server, the user may want to setup confidential computing attestation.
bc75baa
to
dc76504
Compare
We have rather clean dir structure, how about having |
3432d88
to
9db69f8
Compare
I was hesitating doing it... looks like I'll do it if we have the same idea 😉 |
8d7bde6
to
4692c1d
Compare
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
Using podman creds is not secure as those will show up in the the ps output. Instead we generate a temporary podman authentication file and pass it to podman pull.
4692c1d
to
ab101b8
Compare
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, just a few nitpicks
It doesn't make sense to try to extract all the values for both containers and hosts. This commit introduces Inspector objects that are responsible for generating the inspection script and parsing it into a structure. While at it, the extracted values that were not used have been removed. This gains quite some time at each execution since extracting the SCC registration status was quite long. While doing this we could also drop the InspectData proxyHost flag as SCC credentials are extracted for both server and proxy hosts.
ab101b8
to
03a0910
Compare
token := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", creds.SccUsername, creds.SccPassword))) | ||
authFileContent := fmt.Sprintf(`{ | ||
"auths": { | ||
"registry.suse.com" : { |
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.
Can we hard code this registry when we can have a different registry name on the cloud?
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.
This is only set if we have SCC credentials... so no other registry uses them
What does this PR change?
Split the inspection scripts based on their usage
It doesn't make sense to try to extract all the values for both
containers and hosts. This commit introduces Inspector objects that are
responsible for generating the inspection script and parsing it into a
structure.
While at it, the extracted values that were not used have been removed.
This gains quite some time at each execution since extracting the
SCC registration status was quite long.
While doing this we could also drop the InspectData proxyHost flag as
SCC credentials are extracted for both server and proxy hosts.
Test coverage
Unit tests were added
DONE
Links
Issue(s): #
Changelogs
Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test
(see below)Before you merge
Check How to branch and merge properly!