Skip to content

Commit

Permalink
Add omitempty to storage DTO fields (#288)
Browse files Browse the repository at this point in the history
add omitempty
  • Loading branch information
korotkov-aerospike authored Dec 23, 2024
1 parent ae82738 commit 270aed5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/dto/storage_gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
type GcpStorage struct {
SecretAgentConfig `yaml:",inline"`
// Path to the file containing the service account key in JSON format.
KeyFile string `yaml:"key-file-path" json:"key-file-path"`
KeyFile string `yaml:"key-file-path,omitempty" json:"key-file-path,omitempty"`
// Key is the service account key in JSON format.
// This is sensitive information. Can be a path in secret agent or an actual value.
Key string `yaml:"key" json:"key"`
Key string `yaml:"key,omitempty" json:"key,omitempty"`
// GCP storage bucket name.
BucketName string `yaml:"bucket-name" json:"bucket-name" validate:"required"`
// The root path for the backup repository. If not specified, backups will be saved in the bucket's root.
Expand Down
4 changes: 2 additions & 2 deletions pkg/dto/storage_s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ type S3Storage struct {
MaxConnsPerHost int `yaml:"max_async_connections,omitempty" json:"max_async_connections,omitempty" example:"16"`
// Access Key ID for authentication with S3 StaticCredentialsProvider.
// This is sensitive information. Can be a path in secret agent or an actual value.
AccessKeyID *string `yaml:"access-key-id" json:"access-key-id"`
AccessKeyID *string `yaml:"access-key-id,omitempty" json:"access-key-id,omitempty"`
// Secret Access Key for authentication with S3 StaticCredentialsProvider.
// This is sensitive information. Can be a path in secret agent or an actual value.
SecretAccessKey *string `yaml:"secret-access-key" json:"secret-access-key"`
SecretAccessKey *string `yaml:"secret-access-key,omitempty" json:"secret-access-key,omitempty"`
}

// Validate checks if the S3Storage is valid.
Expand Down

0 comments on commit 270aed5

Please sign in to comment.