-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
kops compares sha1 with sha256 while checking hash of nodeup #8242
Comments
I believe it would be better to fix the documentation to specify downloading the sha256 |
Looks like the sha256 started being provided around 1.14.7. |
Since kops 1.15, kops assets are only verified with the sha256 per this commit. |
@johngmyers |
I'm sorry, I don't understand this sentence. Could you rephrase? Kops only uses sha256 for kops assets and this is both intended and desirable. |
Just like I said above, the method |
It would be much more likely for it to be unable to get |
@justinsb |
@yzx777 we had a similar issue just now on upgrading, because we manage Kops assets in our own S3 buckets for region independence (see #6368) - TL;DR anyone who is copying the Kops assets (nodeup, etc) and wasn't copying the equivalent sha256 hash file will have this issue. For us it was fixed by:
|
@elblivion I still think there is a problem that kops does wrong action according to the external environment. It's illogical. |
@yzx777 agreed, I think the problem is that Lines 316 to 339 in b6be949
|
@elblivion It seems to do this to support previous versions of kubernetes. |
Kubernetes versions before 1.15.4 or thereabouts don't have sha256 files. Since kops supports those earlier versions, it needs to be able to verify sha1 files for Kubernetes assets. When kops drops support for Kubernetes versions earlier from that, it will likely drop support for verifying sha1 files altogether. Kops does not, however, need to support kops assets from earlier versions. So it does not support verifying anything other than sha256 files for kops assets. The kops assets have sha256 files. If someone is copying the assets locally, they need to also copy the sha256 files for the kops ones. Now that the |
1. What
kops
version are you running?Version 1.15.0
2. What Kubernetes version are you running?
v1.15.7
3. What cloud provider are you using?
AWS
4. What commands did you run? What is the simplest way to reproduce this issue?
I created my cluster with --kubernetes-version according to the doc How to use kops in AWS China Region.
Note that I only downloaded the "$url.sha1" file, not the sha256 file.
5. What happened after the commands executed?
kops generated user-data to initialize the master nodes, but compared sha1 with sha256 while checking hash of the file "nodeup". So the initialization couldn't be done.
6. The nodes
journalctl
logs7. Anything else do we need to know?
I notice that the method
findHash
inpkg/assets/builder.go
will try ".sha256" first, then ".sha1".It means that we use sha1 when couldn't get sha256.
But the
NodeUpTemplate
inpkg/model/resources/nodeup.go
looks like below.It just uses
sha256sum
.So, would it be better to do like this in
NodeUpTemplate
? (length of sha1 is 40.)The text was updated successfully, but these errors were encountered: