-
Notifications
You must be signed in to change notification settings - Fork 183
mantle/platform/gcloud: fix confidential compute check #3876
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
Conversation
In db803c3 we add support for ConfidentialType but we made it so that we always execute this code where we don't want to do that if the user didn't specify any ConfidentialType for GCP. The way the code is now we can't run any GCP tests on non confidential instances. ``` failed to create instance "kola-dd144aac7413f66c85e9": Does not support confidential type , should be: sev, sev_snp ```
This is to appease golangci-lint: ``` Error: SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: As of Go 1.20 there is no reason to call Seed with a random value. Programs that call Seed with a known value to get a specific sequence of results should use New(NewSource(seed)) to obtain a local random generator. (staticcheck) ``` According to https://pkg.go.dev/math/rand#Seed "If Seed is not called, the generator is seeded randomly at program startup." so I think it's safe to just drop it.
Overall LGTM, thanks for the fixing! Seems need to fix CI.
|
For the ci error:
Can change
|
Confirm the patch works with both normal and confidential vm.
|
hey @HuijingHei thanks fo trying to fix this. It looks like in other code where we use coreos-assembler/mantle/platform/machine/do/cluster.go Lines 117 to 119 in c211431
|
b1d2b59
to
fe8b2f1
Compare
To appease golangci-lint: ``` Error: SA1019: rand.Read has been deprecated since Go 1.20 because it shouldn't be used: For almost all use cases, [crypto/rand.Read] is more appropriate. ```
fe8b2f1
to
8af0e65
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
In db803c3 we add support for ConfidentialType but we made it so that we always execute this code where we don't want to do that if the user didn't specify any ConfidentialType for GCP.
The way the code is now we can't run any GCP tests on non confidential instances.