-
Notifications
You must be signed in to change notification settings - Fork 87
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
ACM-15078: Fixing agents reuse problem in z/VM after reclaim #817
Conversation
veera-damisetti
commented
Oct 28, 2024
- Updated bootLoaderConfigTemplateS390x to add ai.ip_cfg_override to take care of IP and nameserver parameters , which is a mandatory parameter in z/VM as mac address is not persistent.
- Updated paramaters which are being passed to zipl , to include parameters from /proc/cmdline which will help in reusing the agents after reclaim.
…meserver persistent for agents Signed-off-by: DAMISETTI-VEERABHADRARAO <[email protected]>
Signed-off-by: DAMISETTI-VEERABHADRARAO <[email protected]>
@veera-damisetti: This pull request references ACM-15078 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.18.0" version, but no target version was set. 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 openshift-eng/jira-lifecycle-plugin repository. |
Skipping CI for Draft Pull Request. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #817 +/- ##
==========================================
- Coverage 59.70% 59.50% -0.21%
==========================================
Files 74 74
Lines 3809 3842 +33
==========================================
+ Hits 2274 2286 +12
- Misses 1367 1388 +21
Partials 168 168
|
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
Would be great to see how and why these additional parameters are needed specifically for Z in order for the hosts to be reusable! Maybe a doc or blog post would be the route to show everyone? |
Sure @CrystalChun , thanks for the review In order to reuse the hosts, hosts should be booted with proper/desired network and storage configurations. In case of Z ( z/VM) ,
HCP IBMZ doc for z/VM for cmdline parameter reference: https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.11/html/clusters/cluster_mce_overview#hosted-bare-metal-adding-agents-ibmz-zvm-lpar RH doc for explaining more details about each param: https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/installation_guide/chap-installer-booting-ipl-s390#chap-installer-booting-ipl-s390 |
/assign @eifrach |
for _, param := range paramsToExtract { | ||
regex := regexp.MustCompile(fmt.Sprintf(`\b%s=([^\s]+)`, param)) | ||
match := regex.FindStringSubmatch(stdout) | ||
if len(match) > 1 { | ||
cmdline_params[param] = match[1] | ||
} | ||
} | ||
|
||
for key, value := range cmdline_params { | ||
requiredCmdline += fmt.Sprintf("%s=%s ", key, value) | ||
} |
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 think we should create a function for this and a unit test.
once we start to use regex it can break in future changes + make this function more readable
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.
Sure @eifrach
Do you want me to write entire s390x logic in a seperate function and unit test ? or just this fetching parameters using regexp as a seperate function ?
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.
yes just the regex / paramter fatching. cause we do want make sure that changes wont break it later on
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.
Sure
regex := regexp.MustCompile(fmt.Sprintf(`\b%s=([^\s]+)`, param)) | ||
match := regex.FindStringSubmatch(stdout) |
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.
what happens if we don't have a match ?
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.
If there’s no match for a parameter in stdout, the current code will not assign those parameters, so cmdline_params[param] remains unset.
and this should be the expected behaviour, if paramsToExtract are not present in /proc/cmdline
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.
how is the unit-test passed without a change?
we are missing here a lot for testing to this logic
… test case for the same Signed-off-by: DAMISETTI-VEERABHADRARAO <[email protected]>
/test edge-e2e-metal-assisted |
/test edge-subsystem-test |
@veera-damisetti: all tests passed! Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
@eifrach , thanks for the review. I did changes to have a separate function for the logic and added unit tests for the same, and |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CrystalChun, eifrach, veera-damisetti 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 |
Thanks @CrystalChun @eifrach , for the quick reviews. |
[ART PR BUILD NOTIFIER] Distgit: ose-agent-installer-node-agent |
/cherry-pick release-ocm-2.12 |
@carbonin: new pull request created: #908 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-sigs/prow repository. |
/cherry-pick release-ocm-2.11 |
@carbonin: #817 failed to apply on top of branch "release-ocm-2.11":
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-sigs/prow repository. |