Skip to content

Commit

Permalink
Rung go1.19rc2 fmt ./... as the repo got upgraded to using go1.19rc2
Browse files Browse the repository at this point in the history
and go fmt output changed!
  • Loading branch information
KiranOpenSource committed Aug 1, 2022
1 parent c264309 commit 1f26b22
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 44 deletions.
4 changes: 3 additions & 1 deletion cmd/gke-exec-auth-plugin/tpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ var newNodeIdentity = nodeidentity.FromMetadata
//
// High-level flow (TPM commands in parens):
// - load AIK from template in NVRAM (TPM2_NV_ReadPublic, TPM2_NV_Read,
// TPM2_CreatePrimary)
//
// TPM2_CreatePrimary)
//
// - load privateKey into the TPM (TPM2_LoadExternal)
// - certify (sign) privateKey with AIK (TPM2_Certify)
// - read AIK certificate from NVRAM (TPM2_NV_ReadPubluc, TPM2_NV_Read)
Expand Down
28 changes: 16 additions & 12 deletions cmd/gke-gcloud-auth-plugin/cred/cred.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ const (

// cache is the struct that gets cached in the cache file in json format.
// {
// "current_context": "gke_user-gke-dev_us-central1_autopilot-cluster-11",
// "access_token": "ya29.A0ARrdaM8WL....G0xYXGIQNPi5WvHe07ia4Gs",
// "token_expiry": "2022-01-27T08:27:52Z"
//
// "current_context": "gke_user-gke-dev_us-central1_autopilot-cluster-11",
// "access_token": "ya29.A0ARrdaM8WL....G0xYXGIQNPi5WvHe07ia4Gs",
// "token_expiry": "2022-01-27T08:27:52Z"
//
// }
// The current_context helps us cache tokens by context(cluster) similar to how
// this was done for Authprovider in kubeconfig.
Expand Down Expand Up @@ -84,15 +86,17 @@ type Options struct {

// PrintCred prints ExecCredential to stdout to be consumed by kubectl to connect to GKE Clusters
// {
// "kind": "ExecCredential",
// "apiVersion": "client.authentication.k8s.io/v1beta1",
// "spec": {
// "interactive": false
// },
// "status": {
// "expirationTimestamp": "2022-01-27T07:10:46Z",
// "token": "ya29.A0ARrda.......0jDi8weH-36jJNru6Ps"
// }
//
// "kind": "ExecCredential",
// "apiVersion": "client.authentication.k8s.io/v1beta1",
// "spec": {
// "interactive": false
// },
// "status": {
// "expirationTimestamp": "2022-01-27T07:10:46Z",
// "token": "ya29.A0ARrda.......0jDi8weH-36jJNru6Ps"
// }
//
// }
func PrintCred(options *Options) error {
if options == nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ var (
"https://www.googleapis.com/auth/userinfo.email"}
)

//
// defaultCredentialsTokenProvider provides default credential tokens.
//
type defaultCredentialsTokenProvider struct {
googleDefaultTokenSource func(ctx context.Context, scope ...string) (oauth2.TokenSource, error)
}
Expand Down
2 changes: 0 additions & 2 deletions cmd/gke-gcloud-auth-plugin/cred/gcloud_token_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ type gcloudConfiguration struct {
} `json:"configuration"`
}

//
// gcloudTokenProvider provides gcloud OAth 2.0 tokens.
//
type gcloudTokenProvider struct {
readGcloudConfigRaw func() ([]byte, error)
readFile func(filename string) ([]byte, error)
Expand Down
14 changes: 7 additions & 7 deletions crd/client/gcpfirewall/clientset/versioned/fake/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions crd/client/gcpfirewall/clientset/versioned/scheme/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions pkg/controller/nodeipam/ipam/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@ limitations under the License.
// We currently support several kinds of IPAM allocators (these are denoted by
// the CIDRAllocatorType):
// - RangeAllocator is an allocator that assigns PodCIDRs to nodes and works
// in conjunction with the RouteController to configure the network to get
// connectivity.
//
// in conjunction with the RouteController to configure the network to get
// connectivity.
//
// - CloudAllocator is an allocator that synchronizes PodCIDRs from IP
// ranges assignments from the underlying cloud platform.
//
// ranges assignments from the underlying cloud platform.
//
// - (Alpha only) IPAMFromCluster is an allocator that has the similar
// functionality as the RangeAllocator but also synchronizes cluster-managed
// ranges into the cloud platform.
//
// functionality as the RangeAllocator but also synchronizes cluster-managed
// ranges into the cloud platform.
//
// - (Alpha only) IPAMFromCloud is the same as CloudAllocator (synchronizes
// from cloud into the cluster.)
//
// from cloud into the cluster.)
package ipam
6 changes: 3 additions & 3 deletions pkg/credentialconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ func GetPreferredDockercfgPath() string {
return preferredPath
}

//DefaultDockercfgPaths returns default search paths of .dockercfg
// DefaultDockercfgPaths returns default search paths of .dockercfg
func DefaultDockercfgPaths() []string {
return []string{GetPreferredDockercfgPath(), workingDirPath, homeDirPath, rootDirPath}
}

//DefaultDockerConfigJSONPaths returns default search paths of .docker/config.json
// DefaultDockerConfigJSONPaths returns default search paths of .docker/config.json
func DefaultDockerConfigJSONPaths() []string {
return []string{GetPreferredDockercfgPath(), workingDirPath, homeJSONDirPath, rootJSONDirPath}
}
Expand Down Expand Up @@ -156,7 +156,7 @@ func ReadDockerConfigJSONFile(searchPaths []string) (cfg DockerConfig, err error

}

//ReadSpecificDockerConfigJSONFile attempts to read docker configJSON from a given file path.
// ReadSpecificDockerConfigJSONFile attempts to read docker configJSON from a given file path.
func ReadSpecificDockerConfigJSONFile(filePath string) (cfg DockerConfig, err error) {
var contents []byte

Expand Down
3 changes: 2 additions & 1 deletion pkg/csrapproval/csrapproval.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ func getCertApprovalCondition(status *capi.CertificateSigningRequestStatus) (app
// - v.Validate(csr): Validate the SAN, IP address in the certificate.
//
// - SubjectAccessReview to ensure that the subject of the certificate
// has the Permission give in Options.Permission on the API server.
//
// has the Permission give in Options.Permission on the API server.
//
// - v.PreApproveHoook(csr) completes without error.
//
Expand Down
5 changes: 3 additions & 2 deletions pkg/gcpcredential/gcpcredential.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ type DockerConfigURLKeyProvider struct {
}

// ContainerRegistryProvider is a DockerConfigProvider that provides a dockercfg with:
// Username: "_token"
// Password: "{access token from metadata}"
//
// Username: "_token"
// Password: "{access token from metadata}"
type ContainerRegistryProvider struct {
MetadataProvider
}
Expand Down
2 changes: 1 addition & 1 deletion providers/gce/gce_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ func removeFinalizer(service *v1.Service, kubeClient v1core.CoreV1Interface, key
return err
}

//hasFinalizer returns if the given service has the specified key in its list of finalizers.
// hasFinalizer returns if the given service has the specified key in its list of finalizers.
func hasFinalizer(service *v1.Service, key string) bool {
for _, finalizer := range service.ObjectMeta.Finalizers {
if finalizer == key {
Expand Down

0 comments on commit 1f26b22

Please sign in to comment.