Skip to content

Commit

Permalink
Merge pull request #308 from fmount/extraMounts
Browse files Browse the repository at this point in the history
Import ExtraMounts to horizon-operator
  • Loading branch information
openshift-merge-bot[bot] authored Mar 29, 2024
2 parents 7b8ae01 + 9574563 commit 68164dc
Show file tree
Hide file tree
Showing 11 changed files with 3,821 additions and 6 deletions.
1,859 changes: 1,859 additions & 0 deletions api/bases/horizon.openstack.org_horizons.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.20

require (
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240314165949-fec16b14c33b
github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.0
k8s.io/api v0.28.7
k8s.io/apimachinery v0.28.7
sigs.k8s.io/controller-runtime v0.16.5
Expand Down
2 changes: 2 additions & 0 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ github.com/onsi/ginkgo/v2 v2.16.0 h1:7q1w9frJDzninhXxjZd+Y/x54XNjG/UlRLIYPZafsPM
github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo=
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240314165949-fec16b14c33b h1:5EzrrjcGziV69MsEgoBwPdsggY56M6jUxGBP9pp+hwo=
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240314165949-fec16b14c33b/go.mod h1:DL+Ts0k+fzgZmx0XxWArIeAmdKuTkPa1I5DThdybfmE=
github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.0 h1:YOWmu6MrAqny4TzXbwnXiJikg9WNzvWpWLLezLLFU4o=
github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.0/go.mod h1:DnsRBWOFEwecwrVAntM4lbgiHRvqfoz/gKYpDjkvCYE=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
26 changes: 26 additions & 0 deletions api/v1beta1/horizon_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
"github.com/openstack-k8s-operators/lib-common/modules/storage"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -95,6 +96,10 @@ type HorizonSpecCore struct {
// +kubebuilder:default=false
// PreserveJobs - do not delete jobs after they finished e.g. to check logs
PreserveJobs bool `json:"preserveJobs"`

// ExtraMounts containing conf files
// +kubebuilder:default={}
ExtraMounts []HorizonExtraVolMounts `json:"extraMounts,omitempty"`
}

// HorizionOverrideSpec to override the generated manifest of several child resources.
Expand Down Expand Up @@ -183,3 +188,24 @@ func SetupDefaults() {

SetupHorizonDefaults(horizonDefaults)
}

// HorizonExtraVolMounts exposes additional parameters processed by the horizon-operator
// and defines the common VolMounts structure provided by the main storage module
type HorizonExtraVolMounts struct {
// +kubebuilder:validation:Optional
Name string `json:"name,omitempty"`
// +kubebuilder:validation:Optional
Region string `json:"region,omitempty"`
// +kubebuilder:validation:Required
VolMounts []storage.VolMounts `json:"extraVol"`
}

// Propagate is a function used to filter VolMounts according to the specified
// PropagationType array
func (c *HorizonExtraVolMounts) Propagate(svc []storage.PropagationType) []storage.VolMounts {
var vl []storage.VolMounts
for _, gv := range c.VolMounts {
vl = append(vl, gv.Propagate(svc)...)
}
return vl
}
30 changes: 30 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

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

Loading

0 comments on commit 68164dc

Please sign in to comment.