-
Notifications
You must be signed in to change notification settings - Fork 8
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
OCPBUGS-15259: Updates to ignition config and site-config handling #98
OCPBUGS-15259: Updates to ignition config and site-config handling #98
Conversation
Signed-off-by: Don Penney <dpenney@redhat.com>
Signed-off-by: Don Penney <dpenney@redhat.com>
As the content of the extract-ai.sh and extract-ocp.sh scripts are now the same, this update replaces them with a single extract-images.sh as the source code. The original names are maintained in the ignition config files, as the name is used to differentiate which installation stage is triggering the image extraction. Signed-off-by: Don Penney <dpenney@redhat.com>
This commit rewrites the update-site-config.sh helper utility to use yq and jq commands to merge the prestaging ignition configs and installer args into a site-config, including purging prestaging entries that are no longer required (ie. dropping override of agent-fix script) from the site-config. This also adds support for using a custom partition label. Signed-off-by: Don Penney <dpenney@redhat.com>
This update introduces a new factory-precaching-cli command, siteconfig, which takes an existing site-config yaml as input and adds the required prestaging hooks. If the site-config already has ignitionConfigOverride or installerArgs entries, the prestaging hooks are merged into the existing values. Additionally, the tool looks for stale prestaging hooks that may have changed or been dropped and prunes them from the site-config. To support this tool, the prestaging ignition config files are now used to generate go-bindata source, requiring a developer to run the "make update-bindata" command when updating these files. Additionally, regression tests have been added to verify the siteconfig command, along with truncated testmode ignition files to avoid requiring test updates whenever the prestaging ignition files or image extract script are updated. Signed-off-by: Don Penney <dpenney@redhat.com>
@donpenney: This pull request references Jira Issue OCPBUGS-15259, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: donpenney The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/jira refresh |
@donpenney: This pull request references Jira Issue OCPBUGS-15259, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (obochan@redhat.com), skipping review request. The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Don Penney <dpenney@redhat.com>
# | ||
function update_installer_args { | ||
local installer_args='"--save-partlabel","'"${PARTITION_LABEL}"'"' | ||
if ! yq "${NODE_INSTALLER_ARGS}" "${SITECFG}" | jq -cM | grep "${installer_args}"; then |
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.
Would it be safer to use jq to check if the option exists? Just in case the installer_args contain special characters
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.
Do you have some example in mind? As far as I know, installerArgs should be a json array of args passed to the installer. Grepping the compact format of this json array for the desired pair of args should be safe, I would think (although this could/should be "grep -q" here).
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.
I can't think of any examples with a special character that couldn't be handled by grep. This is a more general comment since the script deals with JSON data rather than text files. However, considering the specific use case and the nature of the data being processed, I'm fine with using grep in this context.
/lgtm |
@donpenney: Jira Issue OCPBUGS-15259: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-15259 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This update provides the following enhancements and fixes, related to site-config and ignitionConfigOverride handling:
In support of the new "siteconfig" command, go-bindata has been added to generate GO code that incorporates the ignition config files.