Skip to content

Commit

Permalink
chore: fix linting errors #137
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Oct 3, 2023
1 parent dd1b2a4 commit 28f8970
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/provision/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ var Cmd = &cobra.Command{
serviceAccount := cmd.Flag("service-account").Value.String()

if cloudKMS != "" {
re := regexp.MustCompile(`projects\/([a-zA-Z0-9_-]+)\/locations\/([a-zA-Z0-9_-]+)\/keyRings\/([a-zA-Z0-9_-]+)\/cryptoKeys\/([a-zA-Z0-9_-]+)\/cryptoKeyVersions\/([0-9]+)`)
re := regexp.MustCompile(`projects\/([a-zA-Z0-9_-]+)\/locations\/([a-zA-Z0-9_-]+)\/` +
`keyRings\/([a-zA-Z0-9_-]+)\/cryptoKeys\/([a-zA-Z0-9_-]+)\/cryptoKeyVersions\/([0-9]+)`)
ok := re.Match([]byte(cloudKMS))
if !ok {
return fmt.Errorf("CloudKMS key must be of the format " +
"projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}")
"projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}" +
"/cryptoKeyVersions/{cryptoKeyVersion}")
}
}

Expand Down

0 comments on commit 28f8970

Please sign in to comment.