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

Implement enhancements/oc/mirroring-release-signatures #343

Merged
merged 3 commits into from
Apr 17, 2020

Conversation

jottofar
Copy link
Contributor

@jottofar jottofar commented Mar 6, 2020

This PR implements enhancement openshift/enhancements#283

Local package pkg/verify was reused with minor changes from CVO so there is PR openshift/library-go#725 to move package verify into library-go.

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 6, 2020
@jottofar
Copy link
Contributor Author

jottofar commented Mar 6, 2020

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 29, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 2, 2020
@jottofar jottofar force-pushed the ota-119 branch 2 times, most recently from 87444e7 to 5fe2d40 Compare April 2, 2020 21:03
@jottofar
Copy link
Contributor Author

jottofar commented Apr 2, 2020

/test

@jottofar
Copy link
Contributor Author

jottofar commented Apr 2, 2020

/retest

@jottofar
Copy link
Contributor Author

jottofar commented Apr 3, 2020

/test verify

@jottofar
Copy link
Contributor Author

jottofar commented Apr 3, 2020

/test

@jottofar
Copy link
Contributor Author

jottofar commented Apr 3, 2020

/retest

@jottofar
Copy link
Contributor Author

jottofar commented Apr 3, 2020

/test verify

@jottofar
Copy link
Contributor Author

jottofar commented Apr 3, 2020

/test images

@jottofar
Copy link
Contributor Author

jottofar commented Apr 3, 2020

/retest

@jottofar jottofar force-pushed the ota-119 branch 2 times, most recently from e915b74 to c46131d Compare April 9, 2020 16:55
@jottofar jottofar changed the title WIP: implement enhancements/oc/mirroring-manifests Implement enhancements/oc/mirroring-release-signatures Apr 9, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 9, 2020
@jottofar
Copy link
Contributor Author

jottofar commented Apr 9, 2020

/cc @LalatenduMohanty

}
for i := range ms {
ms[i].OriginalFilename = filepath.Base(hdr.Name)
src := fmt.Sprintf("the config map %s/%s", ms[i].Obj.GetNamespace(), ms[i].Obj.GetName())
Copy link
Member

Choose a reason for hiding this comment

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

Do we know it's a config map here? I don't see you repeating the CVO's GVK check.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was suggesting using proper k8s encoding, as a follow-up. That will be the best.

Copy link
Contributor

@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
The remaining bits will be fixed in followups.

}
for i := range ms {
ms[i].OriginalFilename = filepath.Base(hdr.Name)
src := fmt.Sprintf("the config map %s/%s", ms[i].Obj.GetNamespace(), ms[i].Obj.GetName())
Copy link
Contributor

Choose a reason for hiding this comment

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

I was suggesting using proper k8s encoding, as a follow-up. That will be the best.

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

[APPROVALNOTIFIER] This PR is APPROVED

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

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 17, 2020
@openshift-merge-robot openshift-merge-robot merged commit 6b061e3 into openshift:master Apr 17, 2020
@stbenjam
Copy link
Member

stbenjam commented Apr 18, 2020

Was this intended to be a breaking change? This broke the e2e-metal-ipi automation. I filed https://bugzilla.redhat.com/show_bug.cgi?id=1825565, including a suggestion if you could just dump the config map to $PWD, instead of failing catastrophically.

If this breakage was intentional, some announcement would've been helpful.

+(./04_setup_ironic.sh:68): main(): oc adm release mirror --insecure=true -a combined-pullsecret--gyUsq8fVYL --from registry.svc.ci.openshift.org/ci-op-hmxpdxpw/release@sha256:7d9cc5731a84efab3c59fe66a81a66ec1d3e386183b383f905d0efc71dd6f161 --to-release-image virthost.ostest.test.metalkube.org:5000/localimages/local-release-image:7d9cc5731a84efab3c59fe66a81a66ec1d3e386183b383f905d0efc71dd6f161 --to virthost.ostest.test.metalkube.org:5000/localimages/local-release-image
error: if --to-dir and --apply-release-image-signature are not specified, --release-image-signature-to-dir must be used to specify a directory to export the signature

wking added a commit to wking/oc that referenced this pull request Apr 19, 2020
…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

  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.

* Only attempt to write to a file when either
  --release-image-signature-to-dir or --to-dir had been set.  This
  provides backwards compatibility with earlier 'oc', which did not
  interact with signatures at all, and avoids crashing if a default,
  unasked-for, config directory is not writeable [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.
* Convert 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 bother with Signatures() and warning on their empty-ness if
  the user wants us do to something with the signatures.
* Check to ensure that the release digest appears in the signature
  cache.

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1825565
wking added a commit to wking/oc that referenced this pull request Apr 19, 2020
…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.

* Only attempt to write to a file when either
  --release-image-signature-to-dir or --to-dir had been set.  This
  provides backwards compatibility with earlier 'oc', which did not
  interact with signatures at all, and avoids crashing if a default,
  unasked-for, config directory is not writeable [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 added a commit to wking/oc that referenced this pull request Apr 19, 2020
…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.

* Only attempt to write to a file when either
  --release-image-signature-to-dir or --to-dir had been set.  This
  provides backwards compatibility with earlier 'oc', which did not
  interact with signatures at all, and avoids crashing if a default,
  unasked-for, config directory is not writeable [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 added a commit to wking/oc that referenced this pull request Apr 19, 2020
…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.

* Only attempt to write to a file when either
  --release-image-signature-to-dir or --to-dir had been set.  This
  provides backwards compatibility with earlier 'oc', which did not
  interact with signatures at all, and avoids crashing if a default,
  unasked-for, config directory is not writeable [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 added a commit to wking/oc that referenced this pull request Apr 19, 2020
…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.

* Only attempt to write to a file when either
  --release-image-signature-to-dir or --to-dir had been set.  This
  provides backwards compatibility with earlier 'oc', which did not
  interact with signatures at all, and avoids crashing if a default,
  unasked-for, config directory is not writeable [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 added a commit to wking/oc that referenced this pull request Apr 19, 2020
…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.

* Only attempt to write to a file when either
  --release-image-signature-to-dir or --to-dir had been set.  This
  provides backwards compatibility with earlier 'oc', which did not
  interact with signatures at all, and avoids crashing if a default,
  unasked-for, config directory is not writeable [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 added a commit to wking/oc that referenced this pull request Apr 19, 2020
…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
jottofar pushed a commit to jottofar/oc that referenced this pull request May 19, 2020
…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
jottofar pushed a commit to jottofar/oc that referenced this pull request May 19, 2020
…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
jottofar pushed a commit to jottofar/oc that referenced this pull request May 21, 2020
…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
jottofar pushed a commit to jottofar/oc that referenced this pull request May 29, 2020
…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
jottofar pushed a commit to jottofar/oc that referenced this pull request May 29, 2020
…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
jottofar added a commit to jottofar/oc that referenced this pull request Jul 8, 2020
Modify to use proper k8s encoding/decoding and other minor cleanup.
Reference open comments from openshift#343.
jottofar added a commit to jottofar/oc that referenced this pull request Aug 26, 2020
Modify to use proper k8s encoding/decoding and other minor cleanup.
Reference open comments from openshift#343.
Use library-go verify package which was created since both CVO and
the oc client use them.
jottofar added a commit to jottofar/oc that referenced this pull request Aug 26, 2020
Modify to use proper k8s encoding/decoding and other minor cleanup.
Reference open comments from openshift#343.
Use library-go verify package which was created since both CVO and
the oc client use them.
jottofar added a commit to jottofar/oc that referenced this pull request Sep 9, 2020
Modify to use proper k8s encoding/decoding and other minor cleanup.
Reference open comments from openshift#343.
Use library-go verify package which was created since both CVO and
the oc client use them.
jottofar added a commit to jottofar/oc that referenced this pull request Sep 15, 2020
Modify to use proper k8s encoding/decoding and other minor cleanup.
Reference open comments from openshift#343.
Use library-go verify package which was created since both CVO and
the oc client use them.
jottofar added a commit to jottofar/oc that referenced this pull request Sep 15, 2020
Modify to use proper k8s encoding/decoding and other minor cleanup.
Reference open comments from openshift#343.
Use library-go verify package which was created since both CVO and
the oc client use them.
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. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants