-
Notifications
You must be signed in to change notification settings - Fork 0
/
gkeCredentials.go
29 lines (24 loc) · 1.11 KB
/
gkeCredentials.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package main
// GKECredentials represents the credentials of type kubernetes-engine as defined in the server config and passed to this trusted image
type GKECredentials struct {
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
AdditionalProperties GKECredentialAdditionalProperties `json:"additionalProperties,omitempty"`
}
// GKECredentialAdditionalProperties contains the non standard fields for this type of credentials
type GKECredentialAdditionalProperties struct {
Project string `json:"project,omitempty"`
Cluster string `json:"cluster,omitempty"`
Region string `json:"region,omitempty"`
Zone string `json:"zone,omitempty"`
ServiceAccountKeyfile string `json:"serviceAccountKeyfile,omitempty"`
}
// GetCredentialsByName returns a credential if the name exists
func GetCredentialsByName(c []GKECredentials, credentialName string) *GKECredentials {
for _, cred := range c {
if cred.Name == credentialName {
return &cred
}
}
return nil
}