openshift / oc-mirror

Lifecycle manager for internet-disconnected OpenShift environments
Apache License 2.0
91 stars 82 forks source link

OCPBUGS-38461: oc-mirror should fail when the cincinnati API has errors #933

Closed lmzuccarelli closed 2 months ago

lmzuccarelli commented 2 months ago

Description

This fix addresses the issue when the API call to cincinnati (or any error regarding cincinnati) should be severe and fail immediately

Fixes # OCPBUGS-38461

Type of change

How Has This Been Tested?

Locally

Use the following imagesetconfig

apiVersion: mirror.openshift.io/v2alpha1
kind: ImageSetConfiguration
mirror:
  platform:
    channels:
    - name: stable-4.16
      minVersion: 4.16.0
      maxVersion: 4.16.5

Before doing a mirror-to-disk workflow set the following envar (to any non functioning url)

export UPDATE_URL_OVERRIDE=https://a-site-that-does-not-work

Execute mirror-to-disk workflow

unset the UPDATE_URL_OVERRIDE

Execute mirror-to-disk workflow

oc-mirror should complete the mirror-to-disk successfully

Expected Outcome

2024/09/25 16:05:06  [WARN]   : ⚠️  --v2 flag identified, flow redirected to the oc-mirror v2 version. This is Tech Preview, it is still under development and it is not production ready.
2024/09/25 16:05:06  [INFO]   : πŸ‘‹ Hello, welcome to oc-mirror
2024/09/25 16:05:06  [INFO]   : βš™οΈ  setting up the environment for you...
2024/09/25 16:05:06  [INFO]   : πŸ”€ workflow mode: mirrorToDisk 
2024/09/25 16:05:06  [INFO]   : Using the UPDATE_URL_OVERRIDE environment variable
2024/09/25 16:05:06  [INFO]   : πŸ•΅οΈ  going to discover the necessary images...
2024/09/25 16:05:06  [INFO]   : πŸ” collecting release images...
2024/09/25 16:05:06  [INFO]   : Using the UPDATE_URL_OVERRIDE environment variable
2024/09/25 16:05:06  [INFO]   : πŸ‘‹ Goodbye, thank you for using oc-mirror
2024/09/25 16:05:06  [ERROR]  : [GetReleaseReferenceImages] error list [APIRequestError: channel "stable-4.16": RemoteFailed: Get "https://a-site-that-does-not-work?arch=amd64&channel=stable-4.16&id=e6be7d21-f684-4b27-aeff-792dd35ed80d": dial tcp: lookup a-site-that-does-not-work: no such host]
openshift-ci-robot commented 2 months ago

@lmzuccarelli: This pull request references Jira Issue OCPBUGS-38461, which is valid. The bug has been moved to the POST state.

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

Requesting review from QA contact: /cc @zhouying7780

The bug has been updated to refer to the pull request using the external bug tracker.

In response to [this](https://github.com/openshift/oc-mirror/pull/933): ># Description > >This fix addresses the issue when the API call to cincinnati (or any error regarding cincinnati) should be severe and fail immediately > >Fixes # OCPBUGS-38461 > >## Type of change > >- [x] Bug fix (non-breaking change which fixes an issue) >- [ ] New feature (non-breaking change which adds functionality) >- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) >- [ ] This change requires a documentation update > ># How Has This Been Tested? > >Locally > >Use the following imagesetconfig > >``` >apiVersion: mirror.openshift.io/v2alpha1 >kind: ImageSetConfiguration >mirror: > platform: > channels: > - name: stable-4.16 > minVersion: 4.16.0 > maxVersion: 4.16.5 > >``` > >Before doing a mirror-to-disk workflow set the following envar (to any non functioning url) > >``` >export UPDATE_URL_OVERRIDE=https://a-site-that-does-not-work >``` >Execute mirror-to-disk workflow > >unset the UPDATE_URL_OVERRIDE > >Execute mirror-to-disk workflow > >oc-mirror should complete the mirror-to-disk successfully > > >## Expected Outcome > >``` >2024/09/25 16:05:06 [WARN] : ⚠️ --v2 flag identified, flow redirected to the oc-mirror v2 version. This is Tech Preview, it is still under development and it is not production ready. >2024/09/25 16:05:06 [INFO] : πŸ‘‹ Hello, welcome to oc-mirror >2024/09/25 16:05:06 [INFO] : βš™οΈ setting up the environment for you... >2024/09/25 16:05:06 [INFO] : πŸ”€ workflow mode: mirrorToDisk >2024/09/25 16:05:06 [INFO] : Using the UPDATE_URL_OVERRIDE environment variable >2024/09/25 16:05:06 [INFO] : πŸ•΅οΈ going to discover the necessary images... >2024/09/25 16:05:06 [INFO] : πŸ” collecting release images... >2024/09/25 16:05:06 [INFO] : Using the UPDATE_URL_OVERRIDE environment variable >2024/09/25 16:05:06 [INFO] : πŸ‘‹ Goodbye, thank you for using oc-mirror >2024/09/25 16:05:06 [ERROR] : [GetReleaseReferenceImages] error list [APIRequestError: channel "stable-4.16": RemoteFailed: Get "https://a-site-that-does-not-work?arch=amd64&channel=stable-4.16&id=e6be7d21-f684-4b27-aeff-792dd35ed80d": dial tcp: lookup a-site-that-does-not-work: no such host] >``` > > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Foc-mirror). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci[bot] commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lmzuccarelli

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](https://github.com/openshift/oc-mirror/blob/main/OWNERS)~~ [lmzuccarelli] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
lmzuccarelli commented 2 months ago

@zhouying7780 @kasturinarra - I have not done exhaustive testing, could you please ensure that this works for disk-to-mirror and mirror-to-mirror, I'm having problems with disk space issues, thought to leave the full test work flow for your automation process.

kasturinarra commented 2 months ago

/lgtm

kasturinarra commented 2 months ago

/label qe-approved

openshift-ci-robot commented 2 months ago

@lmzuccarelli: This pull request references Jira Issue OCPBUGS-38461, which is valid.

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

Requesting review from QA contact: /cc @kasturinarra

The bug has been updated to refer to the pull request using the external bug tracker.

In response to [this](https://github.com/openshift/oc-mirror/pull/933): ># Description > >This fix addresses the issue when the API call to cincinnati (or any error regarding cincinnati) should be severe and fail immediately > >Fixes # OCPBUGS-38461 > >## Type of change > >- [x] Bug fix (non-breaking change which fixes an issue) >- [ ] New feature (non-breaking change which adds functionality) >- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) >- [ ] This change requires a documentation update > ># How Has This Been Tested? > >Locally > >Use the following imagesetconfig > >``` >apiVersion: mirror.openshift.io/v2alpha1 >kind: ImageSetConfiguration >mirror: > platform: > channels: > - name: stable-4.16 > minVersion: 4.16.0 > maxVersion: 4.16.5 > >``` > >Before doing a mirror-to-disk workflow set the following envar (to any non functioning url) > >``` >export UPDATE_URL_OVERRIDE=https://a-site-that-does-not-work >``` >Execute mirror-to-disk workflow > >unset the UPDATE_URL_OVERRIDE > >Execute mirror-to-disk workflow > >oc-mirror should complete the mirror-to-disk successfully > > >## Expected Outcome > >``` >2024/09/25 16:05:06 [WARN] : ⚠️ --v2 flag identified, flow redirected to the oc-mirror v2 version. This is Tech Preview, it is still under development and it is not production ready. >2024/09/25 16:05:06 [INFO] : πŸ‘‹ Hello, welcome to oc-mirror >2024/09/25 16:05:06 [INFO] : βš™οΈ setting up the environment for you... >2024/09/25 16:05:06 [INFO] : πŸ”€ workflow mode: mirrorToDisk >2024/09/25 16:05:06 [INFO] : Using the UPDATE_URL_OVERRIDE environment variable >2024/09/25 16:05:06 [INFO] : πŸ•΅οΈ going to discover the necessary images... >2024/09/25 16:05:06 [INFO] : πŸ” collecting release images... >2024/09/25 16:05:06 [INFO] : Using the UPDATE_URL_OVERRIDE environment variable >2024/09/25 16:05:06 [INFO] : πŸ‘‹ Goodbye, thank you for using oc-mirror >2024/09/25 16:05:06 [ERROR] : [GetReleaseReferenceImages] error list [APIRequestError: channel "stable-4.16": RemoteFailed: Get "https://a-site-that-does-not-work?arch=amd64&channel=stable-4.16&id=e6be7d21-f684-4b27-aeff-792dd35ed80d": dial tcp: lookup a-site-that-does-not-work: no such host] >``` > > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Foc-mirror). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci[bot] commented 2 months ago

@lmzuccarelli: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
openshift-ci-robot commented 2 months ago

@lmzuccarelli: Jira Issue OCPBUGS-38461: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-38461 has been moved to the MODIFIED state.

In response to [this](https://github.com/openshift/oc-mirror/pull/933): ># Description > >This fix addresses the issue when the API call to cincinnati (or any error regarding cincinnati) should be severe and fail immediately > >Fixes # OCPBUGS-38461 > >## Type of change > >- [x] Bug fix (non-breaking change which fixes an issue) >- [ ] New feature (non-breaking change which adds functionality) >- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) >- [ ] This change requires a documentation update > ># How Has This Been Tested? > >Locally > >Use the following imagesetconfig > >``` >apiVersion: mirror.openshift.io/v2alpha1 >kind: ImageSetConfiguration >mirror: > platform: > channels: > - name: stable-4.16 > minVersion: 4.16.0 > maxVersion: 4.16.5 > >``` > >Before doing a mirror-to-disk workflow set the following envar (to any non functioning url) > >``` >export UPDATE_URL_OVERRIDE=https://a-site-that-does-not-work >``` >Execute mirror-to-disk workflow > >unset the UPDATE_URL_OVERRIDE > >Execute mirror-to-disk workflow > >oc-mirror should complete the mirror-to-disk successfully > > >## Expected Outcome > >``` >2024/09/25 16:05:06 [WARN] : ⚠️ --v2 flag identified, flow redirected to the oc-mirror v2 version. This is Tech Preview, it is still under development and it is not production ready. >2024/09/25 16:05:06 [INFO] : πŸ‘‹ Hello, welcome to oc-mirror >2024/09/25 16:05:06 [INFO] : βš™οΈ setting up the environment for you... >2024/09/25 16:05:06 [INFO] : πŸ”€ workflow mode: mirrorToDisk >2024/09/25 16:05:06 [INFO] : Using the UPDATE_URL_OVERRIDE environment variable >2024/09/25 16:05:06 [INFO] : πŸ•΅οΈ going to discover the necessary images... >2024/09/25 16:05:06 [INFO] : πŸ” collecting release images... >2024/09/25 16:05:06 [INFO] : Using the UPDATE_URL_OVERRIDE environment variable >2024/09/25 16:05:06 [INFO] : πŸ‘‹ Goodbye, thank you for using oc-mirror >2024/09/25 16:05:06 [ERROR] : [GetReleaseReferenceImages] error list [APIRequestError: channel "stable-4.16": RemoteFailed: Get "https://a-site-that-does-not-work?arch=amd64&channel=stable-4.16&id=e6be7d21-f684-4b27-aeff-792dd35ed80d": dial tcp: lookup a-site-that-does-not-work: no such host] >``` > > Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Foc-mirror). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-bot commented 2 months ago

[ART PR BUILD NOTIFIER]

Distgit: oc-mirror-plugin This PR has been included in build oc-mirror-plugin-container-v4.18.0-202409262111.p0.g227a9c4.assembly.stream.el9. All builds following this will include this PR.