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
MGMT-16649: Use new ignition endpoint HTTP headers when requesting Ignition #5934
MGMT-16649: Use new ignition endpoint HTTP headers when requesting Ignition #5934
Conversation
@CrystalChun: This pull request references MGMT-16649 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 story to target the "4.16.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. |
a927d6c
to
29fffea
Compare
https://issues.redhat.com/browse/MGMT-16649 Adds the ignition headers from the Agent CR to the host
29fffea
to
5c9ae98
Compare
@CrystalChun: This pull request references MGMT-16649 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 story to target the "4.16.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. |
5c9ae98
to
28bdc76
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #5934 +/- ##
==========================================
+ Coverage 68.31% 69.67% +1.36%
==========================================
Files 236 236
Lines 34917 36612 +1695
==========================================
+ Hits 23853 25510 +1657
+ Misses 8996 8974 -22
- Partials 2068 2128 +60
|
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 question
Key: swag.String(""), | ||
Value: swag.String(""), |
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.
Why empty key+value, instead of just unsetting?
A couple lines above, you check if internalHost.IgnitionEndpointHTTPHeaders != ""
. Will this "if" condition work with an empty 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.
Sorry this is a bit confusing!
Why empty key+value, instead of just unsetting?
Just unsetting it would look like there is no update because of this check here:
func (b *bareMetalInventory) updateIgnitionEndpointHTTPHeaders(ctx context.Context, host *common.Host, ignitionEndpointHTTPHeadersList []*models.IgnitionEndpointHTTPHeadersParams, db *gorm.DB) error {
log := logutil.FromContext(ctx, b.log)
if ignitionEndpointHTTPHeadersList == nil {
log.Infof("No request for ignition endpoint HTTP Headers update for host %s", host.ID)
return nil
}
So we set the empty key+value to actually unset it in the database.
Side note: This check is needed so that we don't update this every time host update is called.
A couple lines above, you check if internalHost.IgnitionEndpointHTTPHeaders != "". Will this "if" condition work with an empty key+value?
Yes, internalHost.IgnitionEndpointHTTPHeaders
is the DB column and if it's not empty then that means we need to unset it, otherwise if the agent doesn't specify the headers and it's empty then we don't need to do anything
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.
Let me know if you'd like me to clarify or reword!
28bdc76
to
0cee4b8
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: avishayt, CrystalChun 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 |
@CrystalChun: The following test failed, say
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/test-infra repository. I understand the commands that are listed here. |
d8fe3f4
into
openshift:master
[ART PR BUILD NOTIFIER] This PR has been included in build ose-agent-installer-api-server-container-v4.16.0-202402112240.p0.gd8fe3f4.assembly.stream.el8 for distgit ose-agent-installer-api-server. |
…nition (openshift#5934) * MGMT-16649: Update host with ignition headers from Agent CR https://issues.redhat.com/browse/MGMT-16649 Adds the ignition headers from the Agent CR to the host * MGMT-16649: Update ignition API to use new HTTP headers https://issues.redhat.com/browse/MGMT-16649 Pass in the new headers when fetching ignition. * MGMT-16649: Use ignition HTTP headers in host API_VIP check command https://issues.redhat.com/browse/MGMT-16649
…nition (openshift#5934) * MGMT-16649: Update host with ignition headers from Agent CR https://issues.redhat.com/browse/MGMT-16649 Adds the ignition headers from the Agent CR to the host * MGMT-16649: Update ignition API to use new HTTP headers https://issues.redhat.com/browse/MGMT-16649 Pass in the new headers when fetching ignition. * MGMT-16649: Use ignition HTTP headers in host API_VIP check command https://issues.redhat.com/browse/MGMT-16649
Add the new ignition endpoint HTTP headers to the host table and use the headers when sending requests to the ignition server.
List all the issues related to this PR
https://issues.redhat.com/browse/MGMT-16649
What environments does this code impact?
How was this code tested?
Checklist
docs
, README, etc)Reviewers Checklist