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

🐛 clusterctl: return early if release for latest tag does not exist yet #8253

Merged

Conversation

chrischdi
Copy link
Member

@chrischdi chrischdi commented Mar 8, 2023

What this PR does / why we need it:

This PR adds the ability to detect a 404 error from the github client and handle the error differently than just bubbling up the usual error message.

It now also does not retry fetching the release on 404 errors and immediately returns instead.

Old output was (after 1m timeout):

Error: failed to get provider components for the "cluster-api" provider: failed to read "core-components.yaml" from provider's repository "cluster-api": failed to get GitHub release v1.3.6: failed to read release "v1.3.6": GET https://api.github.com/repos/kubernetes-sigs/cluster-api/releases/tags/v1.3.6: 404 Not Found []

New output is:

Error: failed to get provider components for the "cluster-api" provider: failed to get repository client for the CoreProvider with name cluster-api: error creating the GitHub repository client: failed to get latest release: release does not exist yet, consider setting "GOPROXY=off" as workaround: failed to get GitHub release v1.3.6: 404 Not Found

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Partially fixing #7889

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 8, 2023
@sbueringer
Copy link
Member

/assign @ykakarap @Jont828

@chrischdi
Copy link
Member Author

Taking back to VIP to go over unit tests and add new ones

/retitle WIP 🐛 clusterctl: return early if release for latest tag does not exist yet

@k8s-ci-robot k8s-ci-robot changed the title 🐛 clusterctl: return early if release for latest tag does not exist yet WIP 🐛 clusterctl: return early if release for latest tag does not exist yet Mar 9, 2023
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 9, 2023
@chrischdi chrischdi force-pushed the pr-clusterctl-404-error branch from 48d467a to 42e0607 Compare March 9, 2023 10:16
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 9, 2023
@chrischdi
Copy link
Member Author

/retitle 🐛 clusterctl: return early if release for latest tag does not exist yet

@k8s-ci-robot k8s-ci-robot changed the title WIP 🐛 clusterctl: return early if release for latest tag does not exist yet 🐛 clusterctl: return early if release for latest tag does not exist yet Mar 9, 2023
@k8s-ci-robot k8s-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 Mar 9, 2023
@chrischdi chrischdi force-pushed the pr-clusterctl-404-error branch from 42e0607 to 05bf57f Compare March 9, 2023 11:04
@chrischdi
Copy link
Member Author

May needs adjustments after #8240 merges

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 21, 2023
@chrischdi chrischdi force-pushed the pr-clusterctl-404-error branch from 05bf57f to c34d48e Compare March 21, 2023 18:59
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 21, 2023
@chrischdi chrischdi force-pushed the pr-clusterctl-404-error branch from c34d48e to 9a1b6a8 Compare March 23, 2023 07:39
@k8s-ci-robot k8s-ci-robot added the area/clusterctl Issues or PRs related to clusterctl label Mar 23, 2023
@chrischdi chrischdi force-pushed the pr-clusterctl-404-error branch from 9a1b6a8 to be16f6c Compare March 23, 2023 17:10
@chrischdi
Copy link
Member Author

@fabriziopandini / @ykakarap , apologise for the ping :-) buy could you give it another look?

@ykakarap
Copy link
Contributor

ykakarap commented Apr 7, 2023

Overall LGTM. Just one nit: #8253 (comment)

@fabriziopandini
Copy link
Member

lgtm pending the change to the error message suggested by @ykakarap

@chrischdi chrischdi force-pushed the pr-clusterctl-404-error branch from be16f6c to e3f73a6 Compare April 24, 2023 08:04
@chrischdi
Copy link
Member Author

Fixed + squashed :-)

@ykakarap
Copy link
Contributor

ykakarap commented May 4, 2023

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 4, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 84bd56f17a9e465b72222c09802e0545f5487033

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ykakarap

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 4, 2023
@k8s-ci-robot k8s-ci-robot merged commit ecd3e14 into kubernetes-sigs:main May 5, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.5 milestone May 5, 2023
@killianmuldoon
Copy link
Contributor

/cherry-pick release-1.4

@k8s-infra-cherrypick-robot

@killianmuldoon: new pull request created: #8965

In response to this:

/cherry-pick release-1.4

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.

prasad-shirodkar added a commit to verrazzano/verrazzano that referenced this pull request Aug 29, 2023
…r-api intermittently retrieving either non-existent provider releases or failing to retrieve legitimate provider releases.

Related bug kubernetes-sigs/cluster-api#7889. This bug is linked to a partial fix kubernetes-sigs/cluster-api#8253 fixed in cluster-api v1.5.0. On uptaking cluster-api v1.5.0, we may no longer require to set the GOPROXY environment variable.
prasad-shirodkar added a commit to verrazzano/verrazzano that referenced this pull request Aug 29, 2023
…r-api intermittently retrieving either non-existent provider releases or failing to retrieve legitimate provider releases.

Related bug kubernetes-sigs/cluster-api#7889. This bug is linked to a partial fix kubernetes-sigs/cluster-api#8253 fixed in cluster-api v1.5.0. On uptaking cluster-api v1.5.0, we may no longer require to set the GOPROXY environment variable.
prasad-shirodkar added a commit to verrazzano/verrazzano that referenced this pull request Aug 29, 2023
Updated capi ApplyUpgradeOptions when capi version overrides are specified

Setting GOPROXY to direct to avoid Not Found 404 errors due to cluster-api intermittently retrieving either non-existent provider releases or failing to retrieve legitimate provider releases.

Related bug kubernetes-sigs/cluster-api#7889. This bug is linked to a partial fix kubernetes-sigs/cluster-api#8253 fixed in cluster-api v1.5.0. On uptaking cluster-api v1.5.0, we may no longer require to set the GOPROXY environment variable.
prasad-shirodkar added a commit to verrazzano/verrazzano that referenced this pull request Aug 30, 2023
Updated capi ApplyUpgradeOptions when capi version overrides are specified

Setting GOPROXY to direct to avoid Not Found 404 errors due to cluster-api intermittently retrieving either non-existent provider releases or failing to retrieve legitimate provider releases.

Related bug kubernetes-sigs/cluster-api#7889. This bug is linked to a partial fix kubernetes-sigs/cluster-api#8253 fixed in cluster-api v1.5.0. On uptaking cluster-api v1.5.0, we may no longer require to set the GOPROXY environment variable.
prasad-shirodkar added a commit to verrazzano/verrazzano that referenced this pull request Aug 30, 2023
…#6909)

Updated capi ApplyUpgradeOptions when capi version overrides are specified

Setting GOPROXY to direct to avoid Not Found 404 errors due to cluster-api intermittently retrieving either non-existent provider releases or failing to retrieve legitimate provider releases.

Related bug kubernetes-sigs/cluster-api#7889. This bug is linked to a partial fix kubernetes-sigs/cluster-api#8253 fixed in cluster-api v1.5.0. On uptaking cluster-api v1.5.0, we may no longer require to set the GOPROXY environment variable.
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. area/clusterctl Issues or PRs related to clusterctl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", 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.

8 participants