Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove json:omitempty from required fields #4018

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ spec:
- plan
- provider
- region
- secret
- storage
type: object
status:
Expand Down
3 changes: 2 additions & 1 deletion internal/controller/postgrescluster/pgbackrest.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,9 @@ func (r *Reconciler) setScheduledJobStatus(ctx context.Context,
for _, job := range jobList.Items {
// we only care about the scheduled backup Jobs created by the
// associated CronJobs
sbs := v1beta1.PGBackRestScheduledBackupStatus{}
if job.GetLabels()[naming.LabelPGBackRestCronJob] != "" {
sbs := v1beta1.PGBackRestScheduledBackupStatus{}

if len(job.OwnerReferences) > 0 {
sbs.CronJobName = job.OwnerReferences[0].Name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type CrunchyBridgeClusterSpec struct {

// Whether the cluster is protected. Protected clusters can't be destroyed until
// their protected flag is removed
// +optional
// +kubebuilder:validation:Optional
IsProtected bool `json:"isProtected,omitempty"`

// The name of the cluster
Expand Down Expand Up @@ -65,14 +65,14 @@ type CrunchyBridgeClusterSpec struct {
// are retrieved from the Bridge API. An empty list creates no role secrets.
// Removing a role from this list does NOT drop the role nor revoke their
// access, but it will delete that role's secret from the kube cluster.
// +kubebuilder:validation:Optional
// +listType=map
// +listMapKey=name
// +optional
Roles []*CrunchyBridgeClusterRoleSpec `json:"roles,omitempty"`

// The name of the secret containing the API key and team id
// +kubebuilder:validation:Required
Secret string `json:"secret,omitempty"`
Secret string `json:"secret"`

// The amount of storage available to the cluster in gigabytes.
// The amount must be an integer, followed by Gi (gibibytes) or G (gigabytes) to match Kubernetes conventions.
Expand All @@ -86,9 +86,11 @@ type CrunchyBridgeClusterSpec struct {
type CrunchyBridgeClusterRoleSpec struct {
// Name of the role within Crunchy Bridge.
// More info: https://docs.crunchybridge.com/concepts/users
// +kubebuilder:validation:Required
Name string `json:"name"`

// The name of the Secret that will hold the role credentials.
// +kubebuilder:validation:Required
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Type=string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ type PGBackRestJobStatus struct {
type PGBackRestScheduledBackupStatus struct {

// The name of the associated pgBackRest scheduled backup CronJob
// +kubebuilder:validation:Required
// +kubebuilder:validation:Optional
CronJobName string `json:"cronJobName,omitempty"`

// The name of the associated pgBackRest repository
// +kubebuilder:validation:Required
// +kubebuilder:validation:Optional
RepoName string `json:"repo,omitempty"`

// The pgBackRest backup type for this Job
// +kubebuilder:validation:Required
// +kubebuilder:validation:Optional
Type string `json:"type,omitempty"`

// Represents the time the manual backup Job was acknowledged by the Job controller.
Expand Down
Loading