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-16501: Add request headers to api_vip_connectivity check request #5870

Merged
merged 1 commit into from Jan 17, 2024

Conversation

CrystalChun
Copy link
Contributor

@CrystalChun CrystalChun commented Jan 8, 2024

MGMT-16501
API change to include additional request headers when making a call to the ignition endpoint. Allows for more flexibility to pass headers to different ignition servers.

List all the issues related to this PR

  • 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

Pre-steps:

  1. Installed dev-scripts environment with API changes and extra worker
  2. Installed hypershift

Backwards compatibility test:

  1. Created hypershift cluster & bmh with extra worker
  2. Verify that the worker gets added to the cluster

Using new header test:

  1. Modify assisted installer agent to use the new header
	if len(connectivityReq.RequestHeaders) > 0 {
		for _, requestHeader := range connectivityReq.RequestHeaders {
			req.Header.Set(requestHeader.Key, requestHeader.Value)
		}
	}
/*	if connectivityReq.IgnitionEndpointToken != nil {
		bearerToken := fmt.Sprintf("Bearer %s", *connectivityReq.IgnitionEndpointToken)
		req.Header.Set("Authorization", bearerToken)
	}
*/
  1. Modify assisted-service to send ignition token as request header
	var requestHeaders []*models.APIVipConnectivityAdditionalRequestHeader
	if commonHost.IgnitionEndpointToken != "" {
		requestHeaders = append(requestHeaders, &models.APIVipConnectivityAdditionalRequestHeader{Key: "Authorization", Value: fmt.Sprintf("Bearer %s", commonHost.IgnitionEndpointToken)})
		//request.IgnitionEndpointToken = &commonHost.IgnitionEndpointToken
	}
	request.RequestHeaders = requestHeaders
  1. Update CSV in cluster to use assisted server and assisted installer agent image with new header changes
  2. Created hypershift cluster & bmh with extra worker
  3. Verify that the worker gets added to the cluster

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?

/cc @avishayt

@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 8, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 8, 2024

@CrystalChun: This pull request references MGMT-16501 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 task to target the "4.16.0" version, but no target version was set.

In response to this:

MGMT-16501
API change to include additional request headers when making a call to the ignition endpoint. Allows for more flexibility to pass headers to different ignition servers.

List all the issues related to this PR

  • 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

Pre-steps:

  1. Installed dev-scripts environment with API changes and extra worker
  2. Installed hypershift

Backwards compatibility test:

  1. Created hypershift cluster & bmh with extra worker
  2. Verify that the worker gets added to the cluster

Using new header test:

  1. Modify assisted installer agent to use the new header
  if len(connectivityReq.RequestHeaders) > 0 {
  	for _, requestHeader := range connectivityReq.RequestHeaders {
  		req.Header.Set(requestHeader.Key, requestHeader.Value)
  	}
  }
/*	if connectivityReq.IgnitionEndpointToken != nil {
  	bearerToken := fmt.Sprintf("Bearer %s", *connectivityReq.IgnitionEndpointToken)
  	req.Header.Set("Authorization", bearerToken)
  }
*/
  1. Update CSV in cluster to use assisted installer agent image with new header changes
  2. Created hypershift cluster & bmh with extra worker
  3. Verify that the worker gets added to the cluster

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?

/cc @avishayt

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 requested a review from avishayt January 8, 2024 22:00
@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 8, 2024
Copy link

openshift-ci bot commented Jan 8, 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/S Denotes a PR that changes 10-29 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 8, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 8, 2024

@CrystalChun: This pull request references MGMT-16501 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 task to target the "4.16.0" version, but no target version was set.

In response to this:

MGMT-16501
API change to include additional request headers when making a call to the ignition endpoint. Allows for more flexibility to pass headers to different ignition servers.

List all the issues related to this PR

  • 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

Pre-steps:

  1. Installed dev-scripts environment with API changes and extra worker
  2. Installed hypershift

Backwards compatibility test:

  1. Created hypershift cluster & bmh with extra worker
  2. Verify that the worker gets added to the cluster

Using new header test:

  1. Modify assisted installer agent to use the new header
  if len(connectivityReq.RequestHeaders) > 0 {
  	for _, requestHeader := range connectivityReq.RequestHeaders {
  		req.Header.Set(requestHeader.Key, requestHeader.Value)
  	}
  }
/*	if connectivityReq.IgnitionEndpointToken != nil {
  	bearerToken := fmt.Sprintf("Bearer %s", *connectivityReq.IgnitionEndpointToken)
  	req.Header.Set("Authorization", bearerToken)
  }
*/
  1. Modify assisted-service to send ignition token as request header
  var requestHeaders []*models.APIVipConnectivityAdditionalRequestHeader
  if commonHost.IgnitionEndpointToken != "" {
  	requestHeaders = append(requestHeaders, &models.APIVipConnectivityAdditionalRequestHeader{Key: "Authorization", Value: fmt.Sprintf("Bearer %s", commonHost.IgnitionEndpointToken)})
  	//request.IgnitionEndpointToken = &commonHost.IgnitionEndpointToken
  }
  request.RequestHeaders = requestHeaders
  1. Update CSV in cluster to use assisted installer agent image with new header changes
  2. Created hypershift cluster & bmh with extra worker
  3. Verify that the worker gets added to the cluster

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?

/cc @avishayt

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-robot
Copy link

openshift-ci-robot commented Jan 8, 2024

@CrystalChun: This pull request references MGMT-16501 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 task to target the "4.16.0" version, but no target version was set.

In response to this:

MGMT-16501
API change to include additional request headers when making a call to the ignition endpoint. Allows for more flexibility to pass headers to different ignition servers.

List all the issues related to this PR

  • 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

Pre-steps:

  1. Installed dev-scripts environment with API changes and extra worker
  2. Installed hypershift

Backwards compatibility test:

  1. Created hypershift cluster & bmh with extra worker
  2. Verify that the worker gets added to the cluster

Using new header test:

  1. Modify assisted installer agent to use the new header
  if len(connectivityReq.RequestHeaders) > 0 {
  	for _, requestHeader := range connectivityReq.RequestHeaders {
  		req.Header.Set(requestHeader.Key, requestHeader.Value)
  	}
  }
/*	if connectivityReq.IgnitionEndpointToken != nil {
  	bearerToken := fmt.Sprintf("Bearer %s", *connectivityReq.IgnitionEndpointToken)
  	req.Header.Set("Authorization", bearerToken)
  }
*/
  1. Modify assisted-service to send ignition token as request header
  var requestHeaders []*models.APIVipConnectivityAdditionalRequestHeader
  if commonHost.IgnitionEndpointToken != "" {
  	requestHeaders = append(requestHeaders, &models.APIVipConnectivityAdditionalRequestHeader{Key: "Authorization", Value: fmt.Sprintf("Bearer %s", commonHost.IgnitionEndpointToken)})
  	//request.IgnitionEndpointToken = &commonHost.IgnitionEndpointToken
  }
  request.RequestHeaders = requestHeaders
  1. Update CSV in cluster to use assisted server and assisted installer agent image with new header changes
  2. Created hypershift cluster & bmh with extra worker
  3. Verify that the worker gets added to the cluster

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?

/cc @avishayt

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 lgtm Indicates that a PR is ready to be merged. label Jan 16, 2024
Copy link

openshift-ci bot commented Jan 16, 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

@CrystalChun CrystalChun marked this pull request as ready for review January 16, 2024 15:09
@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 Jan 16, 2024
Copy link

codecov bot commented Jan 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (77bd860) 68.03% compared to head (c28b45a) 68.10%.
Report is 12 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5870      +/-   ##
==========================================
+ Coverage   68.03%   68.10%   +0.06%     
==========================================
  Files         235      235              
  Lines       34574    34640      +66     
==========================================
+ Hits        23523    23592      +69     
+ Misses       8988     8985       -3     
  Partials     2063     2063              
Files Coverage Δ
...ost/hostcommands/api_vip_connectivity_check_cmd.go 75.67% <100.00%> (+2.14%) ⬆️

... and 13 files with indirect coverage changes

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD ede4113 and 2 for PR HEAD 08cf018 in total

@openshift-ci openshift-ci bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 16, 2024
https://issues.redhat.com/browse/MGMT-16501
API change to include additional request headers when making a call
to the ignition endpoint. Allows for more flexibility to pass headers
to different ignition servers.
@avishayt
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 17, 2024
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 2db51d7 and 2 for PR HEAD c28b45a in total

Copy link

openshift-ci bot commented Jan 17, 2024

@CrystalChun: 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/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit a75c684 into openshift:master Jan 17, 2024
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-202401180211.p0.ga75c684.assembly.stream for distgit ose-agent-installer-api-server.
All builds following this will include this PR.

@CrystalChun CrystalChun deleted the MGMT-16501 branch January 29, 2024 23:47
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants