Skip to content

subscription-manager pre-registration#1528

Merged
arewm merged 1 commit into
konflux-ci:mainfrom
brianwcook:pre-registration
Oct 24, 2024
Merged

subscription-manager pre-registration#1528
arewm merged 1 commit into
konflux-ci:mainfrom
brianwcook:pre-registration

Conversation

@brianwcook
Copy link
Copy Markdown
Member

@brianwcook brianwcook commented Oct 23, 2024

This add support for pre-registering with subscription-manager in the buildah tasks (0.2 only). When activation keys are provided the buildah-task container will register and then provide certs to the buildah env via volume mounts so that users do not need to add subscription-manager register commands to the Containerfiles. This makes downstreaming somewhat easier and addresses negative user feedback.

Before you complete this pull request ...

Look for any open pull requests in the repository with the title "e2e-tests update" and
see if there are recent e2e-tests updates that will be applicable to your change.

@brianwcook
Copy link
Copy Markdown
Member Author

/retest

@skateman
Copy link
Copy Markdown

Tested with the buildah task, works well 🎉

@brianwcook
Copy link
Copy Markdown
Member Author

/retest

brianwcook added a commit to konflux-ci/buildah-container that referenced this pull request Oct 23, 2024
install subscription manager in the buildah-task container to support konflux-ci/build-definitions#1528
@brianwcook
Copy link
Copy Markdown
Member Author

opened konflux-ci/buildah-container#98 to get subscription-manager included in buildah-task

@ezr-ondrej
Copy link
Copy Markdown

Works on ubi9 as well :)

@brianwcook
Copy link
Copy Markdown
Member Author

rebased and removed dnf install.

Comment thread task/buildah-oci-ta/0.2/buildah-oci-ta.yaml
# user is not running registration in the Containerfile: pre-register.
echo "Pre-registering with subscription manager."
subscription-manager register --org "$(cat /tmp/activation-key/org)" --activationkey "$(cat /tmp/activation-key/activationkey)"
REGISTERED=$?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
REGISTERED=$?
trap 'subscription-manager unregister' EXIT

This will make us unregister always, even if the build fails

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

did not get this in but I will file a follow up PR. testing all cases manually was getting complicated

Comment thread task/buildah-oci-ta/0.2/buildah-oci-ta.yaml
@brianwcook
Copy link
Copy Markdown
Member Author

/retest

@brianwcook
Copy link
Copy Markdown
Member Author

i'm doing some add'l testing, don't merge for now.

This add support for pre-registering with subscription-manager
in the buildah tasks (0.2 only). When activation keys are provided
the buildah-task container will register and then provide certs to
the buildah env via volume mounts so that users do not need to add
subscription-manager register commands to the Containerfiles. This
makes downstreaming somewhat easier and addresses negative user
feedback.
@brianwcook
Copy link
Copy Markdown
Member Author

this is ready to go. tested with:

  • entitlement certificates as key value secrets
  • activation keys secret + registration in Dockerfile
  • activation keys as secrets and auto-pre-registration

Copy link
Copy Markdown
Member

@arewm arewm left a comment

Choose a reason for hiding this comment

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

LGTM

@arewm arewm added this pull request to the merge queue Oct 24, 2024
Merged via the queue into konflux-ci:main with commit bb0f4aa Oct 24, 2024
Comment thread task/buildah-oci-ta/0.2/buildah-oci-ta.yaml
Comment thread task/buildah-oci-ta/0.2/buildah-oci-ta.yaml
Comment thread task/buildah-oci-ta/0.2/buildah-oci-ta.yaml
Comment thread task/buildah-oci-ta/0.2/buildah-oci-ta.yaml
arewm pushed a commit to arewm/buildah-container that referenced this pull request Jan 6, 2025
install subscription manager in the buildah-task container to support konflux-ci/build-definitions#1528
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.

6 participants