From 3bd1415a421da0c0fda53c887419c594a0fa00eb Mon Sep 17 00:00:00 2001 From: akorotkov Date: Mon, 23 Dec 2024 11:07:35 +0200 Subject: [PATCH] add omitempty --- pkg/dto/storage_gcp.go | 4 ++-- pkg/dto/storage_s3.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/dto/storage_gcp.go b/pkg/dto/storage_gcp.go index 2c8cfb6c..98a1e43d 100644 --- a/pkg/dto/storage_gcp.go +++ b/pkg/dto/storage_gcp.go @@ -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. diff --git a/pkg/dto/storage_s3.go b/pkg/dto/storage_s3.go index 381e05be..eb96b95a 100644 --- a/pkg/dto/storage_s3.go +++ b/pkg/dto/storage_s3.go @@ -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.