Skip to content
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

Merged

Conversation

CrystalChun
Copy link
Contributor

@CrystalChun CrystalChun commented Jan 31, 2024

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

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 31, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 31, 2024

@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:

Use the IgnitionInfo when sending requests to the ignition server.

List all the issues related to this PR

https://issues.redhat.com/browse/MGMT-16649

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 31, 2024
Copy link

openshift-ci bot commented Jan 31, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 31, 2024
@CrystalChun CrystalChun force-pushed the use-host-api-changes branch 4 times, most recently from a927d6c to 29fffea Compare February 7, 2024 23:31
@CrystalChun CrystalChun changed the title MGMT-16649: Use host IgnitionInfo API when requesting Ignition MGMT-16649: Use new ignition endpoint HTTP headers when requesting Ignition Feb 7, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 7, 2024

@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:

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

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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.

@CrystalChun CrystalChun marked this pull request as ready for review February 8, 2024 00:58
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 8, 2024
Copy link

codecov bot commented Feb 8, 2024

Codecov Report

Attention: 54 lines in your changes are missing coverage. Please review.

Comparison is base (80bb2b2) 68.31% compared to head (0cee4b8) 69.67%.
Report is 13 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            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     
Files Coverage Δ
...ost/hostcommands/api_vip_connectivity_check_cmd.go 66.66% <0.00%> (-9.01%) ⬇️
internal/ignition/ignition.go 60.57% <14.28%> (-0.33%) ⬇️
internal/host/host.go 72.50% <0.00%> (-0.92%) ⬇️
internal/bminventory/inventory.go 79.44% <60.60%> (+7.95%) ⬆️
...nternal/controller/controllers/agent_controller.go 74.54% <5.00%> (-1.24%) ⬇️

... and 7 files with indirect coverage changes

Copy link
Contributor

@avishayt avishayt left a 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

Comment on lines +1622 to +1623
Key: swag.String(""),
Value: swag.String(""),
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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!

internal/ignition/ignition.go Outdated Show resolved Hide resolved
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 11, 2024
Copy link

openshift-ci bot commented Feb 11, 2024

[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:
  • OWNERS [CrystalChun,avishayt]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD c5959f8 and 2 for PR HEAD 0cee4b8 in total

Copy link

openshift-ci bot commented Feb 11, 2024

@CrystalChun: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-agent-compact-ipv4 0cee4b8 link false /test e2e-agent-compact-ipv4

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.

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 9f19758 and 1 for PR HEAD 0cee4b8 in total

@openshift-merge-bot openshift-merge-bot bot merged commit d8fe3f4 into openshift:master Feb 11, 2024
15 of 16 checks passed
@openshift-bot
Copy link
Contributor

[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.
All builds following this will include this PR.

danmanor pushed a commit to danmanor/assisted-service that referenced this pull request Feb 12, 2024
…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
danmanor pushed a commit to danmanor/assisted-service that referenced this pull request Feb 12, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants