diff --git a/pkg/client.go b/pkg/client.go index 7119c49..7ded7f9 100644 --- a/pkg/client.go +++ b/pkg/client.go @@ -85,9 +85,7 @@ func (c *Client) GetS3Client(namespace string, config *ArtifactRepositoryS3Provi return } -/* - GetGCSClient initializes a client to Google Cloud Storage. -*/ +// GetGCSClient initializes a client to Google Cloud Storage. func (c *Client) GetGCSClient(namespace string, config *ArtifactRepositoryGCSProvider) (gcsClient *gcs.Client, err error) { return gcs.NewClient(namespace, config.ServiceAccountJSON) } diff --git a/pkg/config_types.go b/pkg/config_types.go index b7e226d..40bca89 100644 --- a/pkg/config_types.go +++ b/pkg/config_types.go @@ -209,11 +209,11 @@ type ArtifactRepositoryGCSProvider struct { ServiceAccountJSON string `yaml:"omitempty"` } -// ArtifactRepositoryProvider is used to setup access into AWS Cloud Storage -// or Google Cloud storage. -// - The relevant sub-struct (S3, GCS) is unmarshalled into from the cluster configmap. -// Right now, either the S3 or GCS struct will be filled in. Multiple cloud -// providers are not supported at the same time in params.yaml (manifests deployment). +// ArtifactRepositoryProvider is used to setup access into AWS Cloud Storage +// or Google Cloud storage. +// - The relevant sub-struct (S3, GCS) is unmarshalled into from the cluster configmap. +// Right now, either the S3 or GCS struct will be filled in. Multiple cloud +// providers are not supported at the same time in params.yaml (manifests deployment). type ArtifactRepositoryProvider struct { S3 *ArtifactRepositoryS3Provider `yaml:"s3,omitempty"` GCS *ArtifactRepositoryGCSProvider `yaml:"gcs,omitempty"` @@ -228,10 +228,8 @@ type ArtifactRepositorySecret struct { Name string `yaml:"name"` } -/* - MarshalToYaml is used by the CLI to generate configmaps during deployment - or build operations. -*/ +// MarshalToYaml is used by the CLI to generate configmaps during deployment +// or build operations. func (a *ArtifactRepositoryS3Provider) MarshalToYaml() (string, error) { builder := &strings.Builder{} encoder := yaml.NewEncoder(builder) diff --git a/pkg/util/gcs/gcs.go b/pkg/util/gcs/gcs.go index 637fb23..3cb7d65 100644 --- a/pkg/util/gcs/gcs.go +++ b/pkg/util/gcs/gcs.go @@ -14,10 +14,8 @@ type Client struct { *storage.Client } -/* - NewClient handles the details of initializing the connection to Google Cloud Storage. - - Note that the permissions are set to ReadWrite. -*/ +// NewClient handles the details of initializing the connection to Google Cloud Storage. +// - Note that the permissions are set to ReadWrite. func NewClient(namespace string, serviceAccountJSON string) (gcsClient *Client, err error) { ctx := context.Background() creds, err := google.CredentialsFromJSON(ctx, []byte(serviceAccountJSON), storage.ScopeReadWrite)