Skip to content

Commit

Permalink
Merge pull request #294 from dprince/core_api
Browse files Browse the repository at this point in the history
Add HorizonSpecCore struct
  • Loading branch information
openshift-merge-bot[bot] authored Mar 4, 2024
2 parents 8c50610 + c1363cc commit 946bc7d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
6 changes: 6 additions & 0 deletions api/v1beta1/horizon_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ const (

// HorizonSpec defines the desired state of Horizon
type HorizonSpec struct {
HorizonSpecCore `json:",inline"`

// +kubebuilder:validation:Required
// horizon Container Image URL
ContainerImage string `json:"containerImage"`
}

// HorizonSpecBase -
type HorizonSpecCore struct {

// +kubebuilder:validation:Optional
// +kubebuilder:default=1
Expand Down
7 changes: 7 additions & 0 deletions api/v1beta1/horizon_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,16 @@ func (r *Horizon) Default() {

// Default - set defaults for this Horizon spec
func (spec *HorizonSpec) Default() {
// NOTE: only containerImage validations go here
if spec.ContainerImage == "" {
spec.ContainerImage = horizonDefaults.ContainerImageURL
}
spec.HorizonSpecCore.Default()
}

// Default - set defaults for this Horizon spec core (this one gets used by OpenstackControlPlane)
func (spec *HorizonSpecCore) Default() {
// nothing here yet
}

// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
Expand Down
22 changes: 19 additions & 3 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 946bc7d

Please sign in to comment.