Skip to content

Commit 3ef4534

Browse files
authored
Merge pull request crossplane-contrib#2203 from anagarlau/fix/add-omitempty
fix(rds): add json omitempty tag for optional fields in restoreFrom
2 parents 19bd9d4 + fef9da0 commit 3ef4534

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

apis/database/v1beta1/rdsinstance_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ type PointInTimeRestoreBackupConfiguration struct {
170170
// Can't be specified if the useLatestRestorableTime parameter is enabled.
171171
// Example: 2011-09-07T23:45:00Z
172172
// +optional
173-
RestoreTime *metav1.Time `json:"restoreTime"`
173+
RestoreTime *metav1.Time `json:"restoreTime,omitempty"`
174174

175175
// UseLatestRestorableTime indicates that the DB instance is restored from the latest backup
176176
// Can't be specified if the restoreTime parameter is provided.
@@ -180,16 +180,16 @@ type PointInTimeRestoreBackupConfiguration struct {
180180
// SourceDBInstanceAutomatedBackupsArn specifies the Amazon Resource Name (ARN) of the replicated automated backups
181181
// from which to restore. Example: arn:aws:rds:useast-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE
182182
// +optional
183-
SourceDBInstanceAutomatedBackupsArn *string `json:"sourceDBInstanceAutomatedBackupsArn"`
183+
SourceDBInstanceAutomatedBackupsArn *string `json:"sourceDBInstanceAutomatedBackupsArn,omitempty"`
184184

185185
// SourceDBInstanceIdentifier specifies the identifier of the source DB instance from which to restore. Constraints:
186186
// Must match the identifier of an existing DB instance.
187187
// +optional
188-
SourceDBInstanceIdentifier *string `json:"sourceDBInstanceIdentifier"`
188+
SourceDBInstanceIdentifier *string `json:"sourceDBInstanceIdentifier,omitempty"`
189189

190190
// SourceDbiResourceID specifies the resource ID of the source DB instance from which to restore.
191191
// +optional
192-
SourceDbiResourceID *string `json:"sourceDbiResourceId"`
192+
SourceDbiResourceID *string `json:"sourceDbiResourceId,omitempty"`
193193
}
194194

195195
// RestoreBackupConfiguration defines the backup to restore a new RDS instance from.

apis/rds/v1alpha1/custom_types.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ type PointInTimeRestoreBackupConfiguration struct {
394394
// Can't be specified if the useLatestRestorableTime parameter is enabled.
395395
// Example: 2011-09-07T23:45:00Z
396396
// +optional
397-
RestoreTime *metav1.Time `json:"restoreTime"`
397+
RestoreTime *metav1.Time `json:"restoreTime,omitempty"`
398398

399399
// UseLatestRestorableTime indicates that the DB instance is restored from the latest backup
400400
// Can't be specified if the restoreTime parameter is provided.
@@ -404,16 +404,16 @@ type PointInTimeRestoreBackupConfiguration struct {
404404
// SourceDBInstanceAutomatedBackupsArn specifies the Amazon Resource Name (ARN) of the replicated automated backups
405405
// from which to restore. Example: arn:aws:rds:useast-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE
406406
// +optional
407-
SourceDBInstanceAutomatedBackupsArn *string `json:"sourceDBInstanceAutomatedBackupsArn"`
407+
SourceDBInstanceAutomatedBackupsArn *string `json:"sourceDBInstanceAutomatedBackupsArn,omitempty"`
408408

409409
// SourceDBInstanceIdentifier specifies the identifier of the source DB instance from which to restore. Constraints:
410410
// Must match the identifier of an existing DB instance.
411411
// +optional
412-
SourceDBInstanceIdentifier *string `json:"sourceDBInstanceIdentifier"`
412+
SourceDBInstanceIdentifier *string `json:"sourceDBInstanceIdentifier,omitempty"`
413413

414414
// SourceDbiResourceID specifies the resource ID of the source DB instance from which to restore.
415415
// +optional
416-
SourceDbiResourceID *string `json:"sourceDbiResourceId"`
416+
SourceDbiResourceID *string `json:"sourceDbiResourceId,omitempty"`
417417
}
418418

419419
// PointInTimeRestoreDBClusterBackupConfiguration defines the details of the time to restore from
@@ -423,7 +423,7 @@ type PointInTimeRestoreDBClusterBackupConfiguration struct {
423423
// Can't be specified if the useLatestRestorableTime parameter is enabled.
424424
// Example: 2011-09-07T23:45:00Z
425425
// +optional
426-
RestoreTime *metav1.Time `json:"restoreTime"`
426+
RestoreTime *metav1.Time `json:"restoreTime,omitempty"`
427427

428428
// UseLatestRestorableTime indicates that the DB instance is restored from the latest backup
429429
// Can't be specified if the restoreTime parameter is provided.
@@ -433,16 +433,16 @@ type PointInTimeRestoreDBClusterBackupConfiguration struct {
433433
// SourceDBInstanceAutomatedBackupsArn specifies the Amazon Resource Name (ARN) of the replicated automated backups
434434
// from which to restore. Example: arn:aws:rds:useast-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE
435435
// +optional
436-
SourceDBInstanceAutomatedBackupsArn *string `json:"sourceDBInstanceAutomatedBackupsArn"`
436+
SourceDBInstanceAutomatedBackupsArn *string `json:"sourceDBInstanceAutomatedBackupsArn,omitempty"`
437437

438438
// SourceDBClusterIdentifier specifies the identifier of the source DB cluster from which to restore. Constraints:
439439
// Must match the identifier of an existing DB instance.
440440
// +optional
441-
SourceDBClusterIdentifier *string `json:"sourceDBClusterIdentifier"`
441+
SourceDBClusterIdentifier *string `json:"sourceDBClusterIdentifier,omitempty"`
442442

443443
// SourceDbiResourceID specifies the resource ID of the source DB instance from which to restore.
444444
// +optional
445-
SourceDbiResourceID *string `json:"sourceDbiResourceId"`
445+
SourceDbiResourceID *string `json:"sourceDbiResourceId,omitempty"`
446446

447447
// The type of restore to be performed. You can specify one of the following
448448
// values:
@@ -462,7 +462,7 @@ type PointInTimeRestoreDBClusterBackupConfiguration struct {
462462
// Valid for: Aurora DB clusters and Multi-AZ DB clusters
463463
// +optional
464464
// +kubebuilder:validation:Enum=full-copy;copy-on-write
465-
RestoreType *string `json:"restoreType"`
465+
RestoreType *string `json:"restoreType,omitempty"`
466466
}
467467

468468
// RestoreDBInstanceBackupConfiguration defines the backup to restore a new DBCluster from.

0 commit comments

Comments
 (0)