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 confusing no-op validate: tags. #1251

Merged
merged 1 commit into from
Jan 8, 2020
Merged
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
20 changes: 10 additions & 10 deletions pkg/apis/kudo/v1beta1/operatorversion_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ const (
// Plan specifies a series of Phases that need to be completed.
type Plan struct {
// +optional
Strategy Ordering `json:"strategy" validate:"required"` // makes field mandatory and checks if set and non empty
Strategy Ordering `json:"strategy"`
// Phases maps a phase name to a Phase object.
// +optional
// +nullable
Phases []Phase `json:"phases" validate:"required,gt=0,dive"` // makes field mandatory and checks if its gt 0
Phases []Phase `json:"phases"`
}

// Parameter captures the variability of an OperatorVersion being instantiated in an instance.
Expand Down Expand Up @@ -100,31 +100,31 @@ type Parameter struct {
// Phase specifies a list of steps that contain Kubernetes objects.
type Phase struct {
// +optional
Name string `json:"name" validate:"required"` // makes field mandatory and checks if set and non empty
Name string `json:"name"`
// +optional
Strategy Ordering `json:"strategy" validate:"required"` // makes field mandatory and checks if set and non empty
Strategy Ordering `json:"strategy"`

// Steps maps a step name to a list of templated Kubernetes objects stored as a string.
// +optional
Steps []Step `json:"steps" validate:"required,gt=0,dive"` // makes field mandatory and checks if its gt 0
Steps []Step `json:"steps"`
}

// Step defines a specific set of operations that occur.
type Step struct {
// +optional
Name string `json:"name" validate:"required"` // makes field mandatory and checks if set and non empty
Name string `json:"name"`
// +optional
Tasks []string `json:"tasks" validate:"required,gt=0,dive"` // makes field mandatory and checks if non empty
Tasks []string `json:"tasks"`
}

// Task is a global, polymorphic implementation of all publicly available tasks
type Task struct {
// +optional
Name string `json:"name" validate:"required"`
Name string `json:"name"`
// +optional
Kind string `json:"kind" validate:"required"`
Kind string `json:"kind"`
// +optional
Spec TaskSpec `json:"spec" validate:"required"`
Spec TaskSpec `json:"spec"`
}

// TaskSpec embeds all possible task specs. This allows us to avoid writing custom un/marshallers that would only parse
Expand Down