Skip to content

Commit ef53fad

Browse files
Merge pull request #532 from rabi/extraMounts
Add extraMounts interface
2 parents ae77c00 + 19c9d33 commit ef53fad

22 files changed

Lines changed: 8662 additions & 29 deletions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ PROC_CMD = --procs ${PROCS}
130130

131131
.PHONY: test
132132
test: manifests generate gowork fmt vet envtest ginkgo ## Run tests.
133-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" $(GINKGO) --trace --cover --coverpkg=../../pkg/...,../../controllers,../../api/v1beta1 --coverprofile cover.out --covermode=atomic ${PROC_CMD} $(GINKGO_ARGS) ./tests/... ./controllers/...
133+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" $(GINKGO) --trace --cover --coverpkg=./pkg/...,./controllers,./api/v1beta1 --coverprofile cover.out --covermode=atomic ${PROC_CMD} $(GINKGO_ARGS) ./tests/... ./controllers/...
134134
##@ Build
135135

136136
.PHONY: build

api/bases/heat.openstack.org_heatapis.yaml

Lines changed: 1063 additions & 0 deletions
Large diffs are not rendered by default.

api/bases/heat.openstack.org_heatcfnapis.yaml

Lines changed: 1063 additions & 0 deletions
Large diffs are not rendered by default.

api/bases/heat.openstack.org_heatengines.yaml

Lines changed: 1063 additions & 0 deletions
Large diffs are not rendered by default.

api/bases/heat.openstack.org_heats.yaml

Lines changed: 1063 additions & 0 deletions
Large diffs are not rendered by default.

api/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.21
55
require (
66
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250424140239-2d89c1d9f3ec
77
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250505061650-7cb2f323fb35
8+
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20250423055245-3cb2ae8df6f0
89
k8s.io/api v0.29.15
910
k8s.io/apimachinery v0.29.15
1011
sigs.k8s.io/controller-runtime v0.17.6

api/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250424140239-2
7777
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250424140239-2d89c1d9f3ec/go.mod h1:XywwuHkxaBZA+6QsF+N/3f9ekBq3tH0I/gQZzwL89GU=
7878
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250505061650-7cb2f323fb35 h1:dczrtvVjeDXUR3OhnUQRhVVnN14KX52qp0KXCulo8pA=
7979
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250505061650-7cb2f323fb35/go.mod h1:UwHXRIrMSPJD3lFqrA4oKmRXVLFQCRkLAj9x6KLEHiQ=
80+
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20250423055245-3cb2ae8df6f0 h1:JejCQvZ28JmG87iGpy0tk8v4WJzZ07PIIAxXRpiMR9E=
81+
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20250423055245-3cb2ae8df6f0/go.mod h1:5+v92XC/PRATIiBrhNLEpJ+T4R9JpxBCgRP6QvbfwgE=
8082
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
8183
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
8284
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=

api/v1beta1/common_types.go

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20+
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
2021
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
22+
"github.com/openstack-k8s-operators/lib-common/modules/storage"
2123
corev1 "k8s.io/api/core/v1"
22-
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
2324
"k8s.io/apimachinery/pkg/util/validation/field"
2425
)
2526

@@ -44,6 +45,10 @@ type HeatTemplate struct {
4445
// +kubebuilder:default={service: HeatPassword, authEncryptionKey: HeatAuthEncryptionKey}
4546
// PasswordSelectors - Selectors to identify the DB and ServiceUser password from the Secret
4647
PasswordSelectors PasswordSelector `json:"passwordSelectors"`
48+
49+
// +kubebuilder:validation:Optional
50+
// ExtraMounts containing files and plugins
51+
ExtraMounts []HeatExtraVolMounts `json:"extraMounts,omitempty"`
4752
}
4853

4954
// HeatServiceTemplate -
@@ -111,6 +116,17 @@ type PasswordSelector struct {
111116
StackDomainAdminPassword string `json:"stackDomainAdminPassword"`
112117
}
113118

119+
// HeatExtraVolMounts exposes additional parameters processed by the heat-operator
120+
// and defines the common VolMounts structure provided by the main storage module
121+
type HeatExtraVolMounts struct {
122+
// +kubebuilder:validation:Optional
123+
Name string `json:"name,omitempty"`
124+
// +kubebuilder:validation:Optional
125+
Region string `json:"region,omitempty"`
126+
// +kubebuilder:validation:Required
127+
VolMounts []storage.VolMounts `json:"extraVol"`
128+
}
129+
114130
// ValidateTopology -
115131
func (instance *HeatServiceTemplate) ValidateTopology(
116132
basePath *field.Path,
@@ -122,3 +138,13 @@ func (instance *HeatServiceTemplate) ValidateTopology(
122138
*basePath.Child("topologyRef"), namespace)...)
123139
return allErrs
124140
}
141+
142+
// Propagate is a function used to filter VolMounts according to the specified
143+
// PropagationType array
144+
func (g *HeatExtraVolMounts) Propagate(svc []storage.PropagationType) []storage.VolMounts {
145+
var vl []storage.VolMounts
146+
for _, gv := range g.VolMounts {
147+
vl = append(vl, gv.Propagate(svc)...)
148+
}
149+
return vl
150+
}

api/v1beta1/heat_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20+
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
2021
"github.com/openstack-k8s-operators/lib-common/modules/common/condition"
2122
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
22-
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
2323

2424
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2525
)

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 34 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)