-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
OCPBUGS-46488: Validate Encryption Keys for GCP #9328
base: main
Are you sure you want to change the base?
Conversation
@barbacbd: This pull request references Jira Issue OCPBUGS-46488, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
/hold Still figuring out if there is further validation/error checking. |
/jira-refresh |
/jira refresh |
@jianli-wei: This pull request references Jira Issue OCPBUGS-46488, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
/label qe-approved |
c7faacb
to
29e3029
Compare
/hold cancel |
/retest-required |
29e3029
to
118a5fb
Compare
/label acknowledge-critical-fixes-only |
@@ -80,3 +84,45 @@ func ValidateDefaultDiskType(p *gcp.MachinePool, fldPath *field.Path) field.Erro | |||
|
|||
return allErrs | |||
} | |||
|
|||
func ValidateKMSKey(platform *gcp.Platform, p *types.MachinePool, fldPath *field.Path) field.ErrorList { |
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.
This validation should go in the validation run by pkg/asset. pkg/types should include minimal external dependencies to allow easy importing by other packages. The pkg/asset validation is called here:
installer/pkg/asset/installconfig/gcp/validation.go
Lines 52 to 75 in d2bb750
func Validate(client API, ic *types.InstallConfig) error { | |
allErrs := field.ErrorList{} | |
if err := validate.GCPClusterName(ic.ObjectMeta.Name); err != nil { | |
allErrs = append(allErrs, field.Invalid(field.NewPath("clusterName"), ic.ObjectMeta.Name, err.Error())) | |
} | |
allErrs = append(allErrs, validateProject(client, ic, field.NewPath("platform").Child("gcp"))...) | |
allErrs = append(allErrs, validateNetworkProject(client, ic, field.NewPath("platform").Child("gcp"))...) | |
allErrs = append(allErrs, validateRegion(client, ic, field.NewPath("platform").Child("gcp"))...) | |
allErrs = append(allErrs, validateZones(client, ic)...) | |
allErrs = append(allErrs, validateNetworks(client, ic, field.NewPath("platform").Child("gcp"))...) | |
allErrs = append(allErrs, validateInstanceTypes(client, ic)...) | |
allErrs = append(allErrs, ValidateCredentialMode(client, ic)...) | |
allErrs = append(allErrs, validatePreexistingServiceAccount(client, ic)...) | |
allErrs = append(allErrs, validateServiceAccountPresent(client, ic)...) | |
allErrs = append(allErrs, validateMarketplaceImages(client, ic)...) | |
if err := validateUserTags(client, ic.Platform.GCP.ProjectID, ic.Platform.GCP.UserTags); err != nil { | |
allErrs = append(allErrs, field.Invalid(field.NewPath("platform").Child("gcp").Child("userTags"), ic.Platform.GCP.UserTags, err.Error())) | |
} | |
return allErrs.ToAggregate() | |
} |
Parent: fmt.Sprintf("projects/%s/locations/%s", project, location), | ||
} | ||
|
||
it := kmsClient.ListKeyRings(context.Background(), req) |
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.
Can you use GetKeyRing to avoid the iterator and simplify this?
118a5fb
to
8af8eae
Compare
} | ||
} | ||
|
||
return allErrs |
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.
It appears that we are not returning an error when the key is not found in the keyring. (I see that qe did some pre-merge testing and it works for them. Not sure if it was against this iteration of the fix.)
8af8eae
to
61475f1
Compare
61475f1
to
00ffb37
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sadasu 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 |
7a48d62
to
7ead689
Compare
** Validate install config information for GCP KMS Encryption keys.
** Add KMS package for GCP
7ead689
to
7cebbfa
Compare
@barbacbd: The following tests failed, say
Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
** Validate install config information for GCP KMS Encryption keys.
** Update Vendor
** Add KMS Google Module