Skip to content

[wip]feat: changes to support network restricted environments when creating RHEL OS bundles#1156

Draft
some-things wants to merge 11 commits intomesosphere:release-2.9from
some-things:release-2.9
Draft

[wip]feat: changes to support network restricted environments when creating RHEL OS bundles#1156
some-things wants to merge 11 commits intomesosphere:release-2.9from
some-things:release-2.9

Conversation

@some-things
Copy link
Contributor

What problem does this PR solve?:

Which issue(s) does this PR fix?:

Special notes for your reviewer:

I don't have permissions to push images to test a3512a5. Any help there would be greatly appreciated.

Does this PR introduce a user-facing change?:


Comment on lines 76 to 83
if [[ -f /etc/yum.repos.d/user-repos.repo ]]; then
USER_REPOS="$(awk -F '[][]' '/^\[.*\]/ {print $2}' /etc/yum.repos.d/user-repos.repo | paste -sd, -)"
if [[ -n "${ENABLED_REPOS}" ]] && [[ -n "${USER_REPOS}" ]]; then
ENABLED_REPOS="${ENABLED_REPOS},${USER_REPOS}"
elif [[ -z "${ENABLED_REPOS}" ]] && [[ -n "${USER_REPOS}" ]]; then
ENABLED_REPOS="${USER_REPOS}"
fi
fi
Copy link
Contributor Author

@some-things some-things Aug 21, 2024

Choose a reason for hiding this comment

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

This requires users to define their rpm repos in repo-templates/user-repos.repo. We will need to document this workflow.

While KIB CLI automatically adds any repo files in repo-templates/ to /etc/yum.repos.d, we need to selectively enable/disable repos that already exist there (e.g., /etc/yum.repos.d/ubi.repo). We could only parse files other than the pre-existing ones, but maybe it is simpler to just have one file that users modify and we look for.

Open to any feedback.

Comment on lines 81 to 88
if [[ -f /etc/yum.repos.d/user-repos.repo ]]; then
USER_REPOS="$(awk -F '[][]' '/^\[.*\]/ {print $2}' /etc/yum.repos.d/user-repos.repo | paste -sd, -)"
if [[ -n "${ENABLED_REPOS}" ]] && [[ -n "${USER_REPOS}" ]]; then
ENABLED_REPOS="${ENABLED_REPOS},${USER_REPOS}"
elif [[ -z "${ENABLED_REPOS}" ]] && [[ -n "${USER_REPOS}" ]]; then
ENABLED_REPOS="${USER_REPOS}"
fi
fi
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can think of another way of handling this. not a huge fan of usig awk this way

Copy link
Contributor Author

@some-things some-things Aug 21, 2024

Choose a reason for hiding this comment

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

@faiq I changed this in 8cb5c52. Let me know what you think.

rm packages.txt reqs.txt
curl https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm -o amazon-ssm-agent.rpm
createrepo -v .
chown -R 1000:1000 repodata/
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this removed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

removed from main.

@faiq
Copy link
Collaborator

faiq commented Aug 24, 2024

I'm going to break this pr into smaller ones for release-2.9

regarding the satellite and skip subscription manager features open lets consider doing this in main first.

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.

2 participants