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

Bug 1825565: pkg/cli/admin/release/mirror: Allow --apply-release-image-signature and --release-image-signature-to-dir #392

Conversation

wking
Copy link
Member

@wking wking commented Apr 19, 2020

Applying directly to a cluster and writing to a local file are orthogonal actions, and we can do both or neither. This commit removes previous restrictions from 331c1a1 (#343) to:

  • Allow users to set both flags for a single oc invocation. To support this, some dry-run continue were removed, because in the case where all of:

    --dry-run --apply-release-image-signature --release-image-signature-to-dir=whatever
    

    are set, we want to log both the fact that we'd be applying and writing-to-disk each signature, and not log the application but skip over the writing-to-disk log.

  • Allow for mirrors that set none of --apply-release-image-signature, --release-image-signature-to-dir, or --to-dir. This provides backwards compatibility with earlier oc, which did not interact with signatures at all (rhbz#1825565).

Also fix a few nits by:

  • Using filepath.Join to create the ReleaseImageSignatureToDir fallback, so we are not sensitive to whether a given --to-dir did or did not end in whatever the local path separator happens to be.
  • Replacing tabs with spaces where they appeared within LongDesc lines.
  • Converting handleSignatures to return an error, so we don't end up exiting zero if signature handling is requested by the user but fails to happen. This also simplifies logging, because we only need to attach a little bit of context as we bubble the errors up, and final formatting for user display can happen at some higher-level, centralized location.
  • Only bothering with Signatures() and warning on their empty-ness if the user wants us do to something with the signatures.
  • Checking to ensure that the release digest appears in the signature cache.

@openshift-ci-robot
Copy link

@wking: This pull request references Bugzilla bug 1825565, which is invalid:

  • expected the bug to target the "4.5.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1825565: pkg/cli/admin/release/mirror: Allow --apply-release-image-signature and --release-image-signature-to-dir

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.

@openshift-ci-robot openshift-ci-robot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Apr 19, 2020
@wking wking force-pushed the release-image-signature-no-op-default branch from 32c23a4 to 1298072 Compare April 19, 2020 05:14
@wking
Copy link
Member Author

wking commented Apr 19, 2020

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Apr 19, 2020
@openshift-ci-robot
Copy link

@wking: This pull request references Bugzilla bug 1825565, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

/bugzilla refresh

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.

@wking wking force-pushed the release-image-signature-no-op-default branch from 1298072 to 2bf554b Compare April 19, 2020 05:16
@wking
Copy link
Member Author

wking commented Apr 19, 2020

/assign @soltysh

@wking wking force-pushed the release-image-signature-no-op-default branch 3 times, most recently from 588acff to 6bde5aa Compare April 19, 2020 05:32
…nd --release-image-signature-to-dir

Applying directly to a cluster and writing to a local file are
orthogonal actions, and we can do both or neither.  This commit
removes previous restrictions from 331c1a1 (Implement
enhancements/oc/mirroring-release-signatures, 2020-04-17, openshift#343) to:

* Allow users to set both flags for a single 'oc' invocation.  To
  support this, some dry-run 'continue' were removed, because in the
  case where all of:

    --dry-run --apply-release-image-signature --release-image-signature-to-dir=whatever

  are set, we want to log both the fact that we'd be applying and
  writing-to-disk each signature, and not log the application but skip
  over the writing-to-disk log.

* Allow for mirrors that set none of --apply-release-image-signature,
  --release-image-signature-to-dir, or --to-dir.  This provides
  backwards compatibility with earlier 'oc', which did not interact
  with signatures at all [1].

Also fix a few nits by:

* Using filepath.Join to create the ReleaseImageSignatureToDir
  fallback, so we are not sensitive to whether a given --to-dir did or
  did not end in whatever the local path separator happens to be.
* Replacing tabs with spaces where they appeared within LongDesc
  lines.
* Converting handleSignatures to return an error, so we don't end up
  exiting zero if signature handling is requested by the user but
  fails to happen.  This also simplifies logging, because we only need
  to attach a little bit of context as we bubble the errors up, and
  final formatting for user display can happen at some higher-level,
  centralized location.
* Only bothering with Signatures() and warning on their empty-ness if
  the user wants us do to something with the signatures.
* Checking to ensure that the release digest appears in the signature
  cache.

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1825565
@wking wking force-pushed the release-image-signature-no-op-default branch from 6bde5aa to 2706f0f Compare April 19, 2020 05:50
@openshift-ci-robot
Copy link

@wking: This pull request references Bugzilla bug 1825565, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1825565: pkg/cli/admin/release/mirror: Allow --apply-release-image-signature and --release-image-signature-to-dir

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.

1 similar comment
@openshift-ci-robot
Copy link

@wking: This pull request references Bugzilla bug 1825565, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1825565: pkg/cli/admin/release/mirror: Allow --apply-release-image-signature and --release-image-signature-to-dir

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.

@stbenjam
Copy link
Member

stbenjam commented Apr 19, 2020

Thanks for quick fix.

Could we run this through e2e-metal-ipi? It does a disconnected install.

This PR optionally enables it for this repo: openshift/release#8415

Copy link
Member

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve
/retest

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 20, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: soltysh, wking

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 20, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@jottofar
Copy link
Contributor

/retest

@openshift-merge-robot openshift-merge-robot merged commit 8dda2e7 into openshift:master Apr 20, 2020
@openshift-ci-robot
Copy link

@wking: All pull requests linked via external trackers have merged: openshift/oc#392. Bugzilla bug 1825565 has been moved to the MODIFIED state.

In response to this:

Bug 1825565: pkg/cli/admin/release/mirror: Allow --apply-release-image-signature and --release-image-signature-to-dir

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.

@wking wking deleted the release-image-signature-no-op-default branch April 20, 2020 21:55
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. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants