Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Download etcd release abort and show error if package not found #145

Merged
merged 1 commit into from
Jan 15, 2020

Conversation

pytimer
Copy link
Contributor

@pytimer pytimer commented Dec 16, 2019

Fixes: #144

Add --fail when using curl download etcd release package.

If etcd release package not found, etcdadm will show below logs:

[root@k8s-1 ~]# etcdadm init --name k8s --release-url http://192.168.10.108/tools/etcd --version 3.3.12 -l debug
INFO[0000] [install] Artifact not found in cache. Trying to fetch from upstream: http://192.168.10.108/tools/etcd
INFO[0000] [install] Downloading & installing etcd http://192.168.10.108/tools/etcd from 3.3.12 to /var/cache/etcdadm/etcd/v3.3.12
INFO[0000] [install] downloading etcd from http://192.168.10.108/tools/etcd/v3.3.12/etcd-v3.3.12-linux-amd64.tar.gz to /var/cache/etcdadm/etcd/v3.3.12/etcd-v3.3.12-linux-amd64.tar.gz

+curl: (22) The requested URL returned error: 404 Not Found
FATA[0000] [install] Unable to fetch artifact from upstream: unable to download etcd: exit status 22

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 16, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @pytimer. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 16, 2019
@dlipovetsky
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 19, 2019
@chuckha
Copy link
Contributor

chuckha commented Jan 14, 2020

/lgtm

Definitely makes sense to fail on 404s. Copying in the man page to show why --fail is good for scripts and the one warning about using it:

       -f, --fail
              (HTTP)  Fail  silently  (no output at all) on server errors. This is mostly done to better enable scripts etc to better deal with failed attempts. In normal cases when an HTTP server fails to deliver a document, it returns an HTML document stating so (which often also describes why and more). This flag will prevent curl from outputting
              that and return error 22.

              This method is not fail-safe and there are occasions where non-successful response codes will slip through, especially when authentication is involved (response codes 401 and 407).

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 14, 2020
@dlipovetsky
Copy link
Contributor

/approve

Thanks @pytimer for finding and fixing the issue, and @chuckha for the review!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dlipovetsky, pytimer

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 Jan 15, 2020
@k8s-ci-robot k8s-ci-robot merged commit 3ad9cec into kubernetes-retired:master Jan 15, 2020
@pytimer pytimer deleted the download branch May 8, 2020 05:48
justinsb added a commit to justinsb/etcdadm that referenced this pull request Jul 25, 2020
justinsb added a commit to justinsb/etcdadm that referenced this pull request Aug 28, 2020
justinsb pushed a commit to justinsb/etcdadm that referenced this pull request Aug 28, 2020
Download etcd release abort and show error if package not found
justinsb added a commit to justinsb/etcdadm that referenced this pull request Aug 29, 2020
justinsb added a commit to justinsb/etcdadm that referenced this pull request Aug 29, 2020
justinsb added a commit to justinsb/etcdadm that referenced this pull request Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download etcd release package from custom url error
4 participants