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-17413: Change pull secret validation on register/update cluster/infraenv to run only against the required images #6158

Merged

Conversation

danmanor
Copy link
Contributor

@danmanor danmanor commented Apr 7, 2024

Currently, assisted-service performs validation of the user pull secret during actions like registering / updating a cluster / infraenv, in which it checks that the pull secret contains the tokens for all release images. Therefore, currently we can't add nightly release images to stage environment as it blocks users without the right token from installing clusters with different release images. To mitigate this, I am changing the validation on register/update cluster to run against the cluster's release image registry, and register/update Infraenv to run against images besides release images.

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

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

openshift-ci-robot commented Apr 7, 2024

@danmanor: This pull request references MGMT-17413 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.16.0" version, but no target version was set.

In response to this:

Currently, assisted-service performs validation of the user pull secret during actions like registering / updating a cluster / infraenv, in which it checks that the pull secret contains the tokens for all release images. Therefore, currently we can't add nightly release images to stage environment as it blocks users without the right token from installing clusters with different release images. To mitigate this, I am changing the validation on register/update cluster to run against the cluster's release image registry, and register/update Infraenv to run against images besides release images.

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

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

openshift-ci-robot commented Apr 7, 2024

@danmanor: This pull request references MGMT-17413 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.16.0" version, but no target version was set.

In response to this:

Currently, assisted-service performs validation of the user pull secret during actions like registering / updating a cluster / infraenv, in which it checks that the pull secret contains the tokens for all release images. Therefore, currently we can't add nightly release images to stage environment as it blocks users without the right token from installing clusters with different release images. To mitigate this, I am changing the validation on register/update cluster to run against the cluster's release image registry, and register/update Infraenv to run against images besides release images.

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

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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 7, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 7, 2024

@danmanor: This pull request references MGMT-17413 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.16.0" version, but no target version was set.

In response to this:

Currently, assisted-service performs validation of the user pull secret during actions like registering / updating a cluster / infraenv, in which it checks that the pull secret contains the tokens for all release images. Therefore, currently we can't add nightly release images to stage environment as it blocks users without the right token from installing clusters with different release images. To mitigate this, I am changing the validation on register/update cluster to run against the cluster's release image registry, and register/update Infraenv to run against images besides release images.

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

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 requested review from carbonin and gamli75 April 7, 2024 14:23
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 7, 2024
@danmanor
Copy link
Contributor Author

danmanor commented Apr 7, 2024

/cc @gamli75 @carbonin

Copy link

codecov bot commented Apr 7, 2024

Codecov Report

Attention: Patch coverage is 76.27119% with 28 lines in your changes are missing coverage. Please review.

Project coverage is 68.27%. Comparing base (a03cd2c) to head (3cafbfe).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6158      +/-   ##
==========================================
- Coverage   68.28%   68.27%   -0.01%     
==========================================
  Files         240      241       +1     
  Lines       35799    35811      +12     
==========================================
+ Hits        24445    24450       +5     
- Misses       9198     9204       +6     
- Partials     2156     2157       +1     
Files Coverage Δ
internal/cluster/validations/validations.go 13.60% <ø> (-12.27%) ⬇️
...ernal/controller/controllers/pullsecret_handler.go 76.00% <100.00%> (ø)
internal/bminventory/inventory.go 71.29% <83.33%> (ø)
...rnal/cluster/validations/pull_secret_validation.go 75.67% <75.67%> (ø)

... and 1 file with indirect coverage changes

@danmanor danmanor changed the title MGMT-17413: Change pull secret validation on register/update cluster/infraenv to run only against the required images wip: MGMT-17413: Change pull secret validation on register/update cluster/infraenv to run only against the required images Apr 7, 2024
@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 Apr 7, 2024
@danmanor danmanor changed the title wip: MGMT-17413: Change pull secret validation on register/update cluster/infraenv to run only against the required images WIP: MGMT-17413: Change pull secret validation on register/update cluster/infraenv to run only against the required images Apr 7, 2024
@danmanor danmanor marked this pull request as draft April 7, 2024 15:53
@danmanor danmanor force-pushed the changing-pull-secret-validation branch from 23887a2 to e8aa3fa Compare April 7, 2024 17:52
@danmanor
Copy link
Contributor Author

danmanor commented Apr 7, 2024

/test all

@danmanor danmanor changed the title WIP: MGMT-17413: Change pull secret validation on register/update cluster/infraenv to run only against the required images MGMT-17413: Change pull secret validation on register/update cluster/infraenv to run only against the required images Apr 8, 2024
@danmanor danmanor marked this pull request as ready for review April 8, 2024 07:14
@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 Apr 8, 2024
Copy link
Member

@carbonin carbonin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some nits, otherwise looks good.

FWIW this was added way back when we first started supporting multiple versions. So it's effectively been like this forever: #805

internal/cluster/validations/validations.go Outdated Show resolved Hide resolved
cmd/main.go Show resolved Hide resolved
@danmanor danmanor force-pushed the changing-pull-secret-validation branch from e8aa3fa to 0719712 Compare April 9, 2024 09:12
@danmanor danmanor requested a review from carbonin April 9, 2024 09:13
@danmanor
Copy link
Contributor Author

danmanor commented Apr 9, 2024

/retest

@danmanor
Copy link
Contributor Author

/retest

@danmanor danmanor force-pushed the changing-pull-secret-validation branch from 0719712 to 0ff2d92 Compare April 18, 2024 09:25
Copy link
Member

@carbonin carbonin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still ended up quite a bit more complicated than I think it needs to be.

Can we also pull the pull secret validator into it's own file?
It's strange that it's buried in this file with a bunch of other cluster validation code.

internal/cluster/validations/validations.go Outdated Show resolved Hide resolved
internal/cluster/validations/validations.go Outdated Show resolved Hide resolved
internal/cluster/validations/validations.go Outdated Show resolved Hide resolved
Copy link

openshift-ci bot commented Apr 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danmanor

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@danmanor danmanor force-pushed the changing-pull-secret-validation branch from 0ff2d92 to e2b81ce Compare April 24, 2024 13:58
@openshift-ci openshift-ci bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 24, 2024
@danmanor danmanor force-pushed the changing-pull-secret-validation branch from e2b81ce to e546277 Compare April 24, 2024 14:10
@danmanor
Copy link
Contributor Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 25, 2024
…infraenv to run only against the required images
@danmanor danmanor force-pushed the changing-pull-secret-validation branch 2 times, most recently from 114cc31 to db098fd Compare April 25, 2024 14:32
@danmanor danmanor force-pushed the changing-pull-secret-validation branch from db098fd to 3cafbfe Compare April 25, 2024 15:44
Copy link

openshift-ci bot commented Apr 25, 2024

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

@tsorya
Copy link
Contributor

tsorya commented Apr 26, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 26, 2024
@danmanor
Copy link
Contributor Author

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 30, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 8c73c0e into openshift:master Apr 30, 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.17.0-202404301246.p0.g8c73c0e.assembly.stream.el8 for distgit ose-agent-installer-api-server.
All builds following this will include this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants