Skip to content

Commit

Permalink
Test updates, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dprince committed Mar 22, 2024
1 parent 444c7bc commit 89fd4bc
Show file tree
Hide file tree
Showing 12 changed files with 149 additions and 22 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ golangci-lint:

.PHONY: test
test: manifests generate gowork fmt vet envtest ginkgo ## Run tests.
source hack/export_related_images.sh && \
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) -v debug --bin-dir $(LOCALBIN) use $(ENVTEST_K8S_VERSION) -p path)" \
OPERATOR_TEMPLATES="$(PWD)/templates" \
$(GINKGO) --trace --cover --coverpkg=../../pkg/openstack,../../pkg/openstackclient,../../pkg/util,../../controllers,../../apis/client/v1beta1,../../apis/core/v1beta1 --coverprofile cover.out --covermode=atomic ${PROC_CMD} $(GINKGO_ARGS) ./tests/... ./apis/client/...
Expand All @@ -151,6 +152,7 @@ run: export HEALTH_PORT?=8081
run: export ENABLE_WEBHOOKS?=false
run: manifests generate fmt vet ## Run a controller from your host.
/bin/bash hack/clean_local_webhook.sh
source hack/export_related_images.sh && \
go run ./main.go -metrics-bind-address ":$(METRICS_PORT)" -health-probe-bind-address ":$(HEALTH_PORT)"

.PHONY: docker-build
Expand Down Expand Up @@ -389,6 +391,7 @@ run-with-webhook: export METRICS_PORT?=8080
run-with-webhook: export HEALTH_PORT?=8081
run-with-webhook: manifests generate fmt vet ## Run a controller from your host.
/bin/bash hack/configure_local_webhook.sh
source hack/export_related_images.sh && \
go run ./main.go -metrics-bind-address ":$(METRICS_PORT)" -health-probe-bind-address ":$(HEALTH_PORT)"

# refresh the bundle extra data based on go.mod entries
Expand Down
1 change: 1 addition & 0 deletions apis/core/v1beta1/openstackcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const (
// RabbitMqContainerImage is the fall-back container image for RabbitMQ
RabbitMqContainerImage = "quay.io/podified-antelope-centos9/openstack-rabbitmq:current-podified"

// OvnDbCaName -
OvnDbCaName = tls.DefaultCAPrefix + "ovn"
)

Expand Down
22 changes: 15 additions & 7 deletions apis/core/v1beta1/openstackversion_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ import (
)

const (
// MinorUpdateOvnControlPlane -
MinorUpdateOvnControlPlane string = "Minor Update OVN Controlplane In Progress"
MinorUpdateControlPlane string = "Minor Update OVN Controlplane In Progress"
MinorUpdateComplete string = "Complete"
// MinorUpdateControlPlane -
MinorUpdateControlPlane string = "Minor Update Controlplane In Progress"
// MinorUpdateComplete -
MinorUpdateComplete string = "Complete"
)

// OpenStackVersionSpec defines the desired state of OpenStackVersion
// OpenStackVersionSpec - defines the desired state of OpenStackVersion
type OpenStackVersionSpec struct {

// +kubebuilder:validation:Required
Expand All @@ -38,21 +41,21 @@ type OpenStackVersionSpec struct {
CustomContainerImages CustomContainerImages `json:"customContainerImages,omitempty"`
}

// struct for custom container images
// CustomContainerImages - struct for custom container images
type CustomContainerImages struct {
ContainerTemplate `json:",inline"`
CinderVolumeImages map[string]*string `json:"cinderVolumeImages,omitempty"`
ManilaShareImages map[string]*string `json:"manilaShareImages,omitempty"`
}

// struct that contains container image default URLs for each service (internal use only)
// ContainerDefaults - struct that contains container image default URLs for each service (internal use only)
type ContainerDefaults struct {
ContainerTemplate `json:",inline"`
CinderVolumeImage *string `json:"cinderVolumeImage,omitempty"`
ManilaShareImage *string `json:"manilaShareImage,omitempty"`
}

// struct acts as the source of truth for container image URLs to be deployed
// ContainerImages - struct acts as the source of truth for container image URLs to be deployed
type ContainerImages struct {
ContainerTemplate `json:",inline"`
// CinderVolumeImages custom Cinder Volume images for each backend (default Cinder volume image is stored 'default' key)
Expand All @@ -63,7 +66,7 @@ type ContainerImages struct {
ManilaShareImages map[string]*string `json:"manilaShareImages,omitempty"`
}

// struct that contains container image URLs for each service in OpenStackControlplane
// ContainerTemplate - struct that contains container image URLs for each service in OpenStackControlplane
type ContainerTemplate struct {
AgentImage *string `json:"agentImage,omitempty"`
AnsibleeeImage *string `json:"ansibleeeImage,omitempty"`
Expand Down Expand Up @@ -178,3 +181,8 @@ type OpenStackVersionList struct {
func init() {
SchemeBuilder.Register(&OpenStackVersion{}, &OpenStackVersionList{})
}

// IsReady - returns true if service is ready to serve requests
func (instance OpenStackVersion) IsReady() bool {
return instance.Status.Conditions.IsTrue(condition.ReadyCondition)
}
6 changes: 3 additions & 3 deletions controllers/core/openstackcontrolplane_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (r *OpenStackControlPlaneReconciler) Reconcile(ctx context.Context, req ctr
}

// wait until the version is initialized so we have images on the version.Status
if version.Status.Conditions.IsFalse(corev1beta1.OpenStackVersionInitialized) {
if !version.IsReady() {
return ctrlResult, nil
}

Expand All @@ -195,7 +195,7 @@ func (r *OpenStackControlPlaneReconciler) Reconcile(ctx context.Context, req ctr
instance.Status.DeployedVersion = &version.Spec.TargetVersion
return ctrl.Result{}, nil
} else {
if version.Status.Conditions.IsFalse(corev1beta1.OpenStackVersionMinorUpdateOVNControlplane) {
if !version.Status.Conditions.IsTrue(corev1beta1.OpenStackVersionMinorUpdateOVNControlplane) {
Log.Info("Minor update OVN on the ControlPlane")
ctrlResult, err := r.reconcileOVNControllers(ctx, instance, version, helper)
if err != nil {
Expand All @@ -205,7 +205,7 @@ func (r *OpenStackControlPlaneReconciler) Reconcile(ctx context.Context, req ctr
}
instance.Status.DeployedOVNVersion = &version.Spec.TargetVersion
return ctrl.Result{}, nil
} else if version.Status.Conditions.IsFalse(corev1beta1.OpenStackVersionMinorUpdateControlplane) {
} else if !version.Status.Conditions.IsTrue(corev1beta1.OpenStackVersionMinorUpdateControlplane) {
Log.Info("Minor update on the ControlPlane")
ctrlResult, err := r.reconcileNormal(ctx, instance, version, helper)
if err != nil {
Expand Down
11 changes: 2 additions & 9 deletions controllers/core/openstackversion_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package core

import (
"context"
"fmt"
"os"
"strings"

Expand All @@ -43,7 +42,6 @@ var envAvailableVersion string

// SetupVersionDefaults -
func SetupVersionDefaults() {
fmt.Println("SetupVersionDefaults")
localVars := make(map[string]*string)
for _, name := range os.Environ() {
envArr := strings.Split(name, "=")
Expand Down Expand Up @@ -122,7 +120,6 @@ func (r *OpenStackVersionReconciler) Reconcile(ctx context.Context, req ctrl.Req

instance.Status.Conditions = condition.Conditions{}
// greenfield deployment
//cl := condition.Conditions{}
cl := condition.CreateList(
condition.UnknownCondition(corev1beta1.OpenStackVersionInitialized, condition.InitReason, string(corev1beta1.OpenStackVersionInitializedInitMessage)),
)
Expand Down Expand Up @@ -206,12 +203,8 @@ func (r *OpenStackVersionReconciler) Reconcile(ctx context.Context, req ctrl.Req

// minor update for OVN Controlplane in progress
if instance.Status.DeployedVersion != nil && instance.Spec.TargetVersion != *instance.Status.DeployedVersion {
if controlPlane.Status.Conditions.IsFalse(condition.ReadyCondition) {
Log.Info("Minor update Controlplane is not in ready condition, waiting")
return ctrl.Result{}, nil
}
if !compareStringPointers(controlPlane.Status.ContainerImages.OvnControllerImage, instance.Status.ContainerImages.OvnControllerImage) ||
controlPlane.Status.Conditions.IsFalse(corev1beta1.OpenStackVersionMinorUpdateOVNControlplane) {
!controlPlane.Status.Conditions.IsTrue(corev1beta1.OpenStackVersionMinorUpdateOVNControlplane) {
instance.Status.Conditions.Set(condition.FalseCondition(
corev1beta1.OpenStackVersionMinorUpdateOVNControlplane,
condition.RequestedReason,
Expand Down Expand Up @@ -242,7 +235,7 @@ func (r *OpenStackVersionReconciler) Reconcile(ctx context.Context, req ctrl.Req
corev1beta1.OpenStackVersionMinorUpdateReadyMessage)
}

if controlPlane.Status.Conditions.AllSubConditionIsTrue() {
if controlPlane.IsReady() {
Log.Info("Setting DeployedVersion")
instance.Status.DeployedVersion = &instance.Spec.TargetVersion
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ replace github.com/openstack-k8s-operators/openstack-operator/apis => ./apis
replace github.com/openshift/api => github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 //allow-merging

// custom RabbitmqClusterSpecCore for OpenStackControlplane (v2.6.0_patches_tag)
replace github.com/rabbitmq/cluster-operator/v2 => github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20240313124519-961a0ee8bf7f // allow-merging
replace github.com/rabbitmq/cluster-operator/v2 => github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20240313124519-961a0ee8bf7f //allow-merging
72 changes: 72 additions & 0 deletions hack/export_related_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash

export OPENSTACK_VERSION=0.0.1
export RELATED_IMAGE_OPENSTACK_CLIENT_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-openstackclient:current-podified
export RELATED_IMAGE_RABBITMQ_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-rabbitmq:current-podified
export RELATED_IMAGE_KEYSTONE_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-keystone:current-podified
export RELATED_IMAGE_MARIADB_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-mariadb:current-podified
export RELATED_IMAGE_INFRA_MEMCACHED_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-memcached:current-podified
export RELATED_IMAGE_INFRA_REDIS_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-redis:current-podified
export RELATED_IMAGE_INFRA_DNSMASQ_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-neutron-server:current-podified
export RELATED_IMAGE_ANSIBLEEE_IMAGE_URL_DEFAULT=quay.io/openstack-k8s-operators/openstack-ansibleee-runner:current-podified
export RELATED_IMAGE_NOVA_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-nova-api:current-podified
export RELATED_IMAGE_NOVA_CONDUCTOR_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-nova-conductor:current-podified
export RELATED_IMAGE_NOVA_NOVNC_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-nova-novncproxy:current-podified
export RELATED_IMAGE_NOVA_SCHEDULER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-nova-scheduler:current-podified
export RELATED_IMAGE_NOVA_COMPUTE_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-nova-compute:current-podified
export RELATED_IMAGE_NEUTRON_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-neutron-server:current-podified
export RELATED_IMAGE_MANILA_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-manila-api:current-podified
export RELATED_IMAGE_MANILA_SCHEDULER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-manila-scheduler:current-podified
export RELATED_IMAGE_MANILA_SHARE_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-manila-share:current-podified
export RELATED_IMAGE_GLANCE_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-glance-api:current-podified
export RELATED_IMAGE_IRONIC_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ironic-api:current-podified
export RELATED_IMAGE_IRONIC_CONDUCTOR_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ironic-conductor:current-podified
export RELATED_IMAGE_IRONIC_INSPECTOR_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ironic-inspector:current-podified
export RELATED_IMAGE_IRONIC_PXE_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ironic-pxe:current-podified
export RELATED_IMAGE_IRONIC_NEUTRON_AGENT_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ironic-neutron-agent:current-podified
export RELATED_IMAGE_IRONIC_PYTHON_AGENT_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/ironic-python-agent:current-podified
export RELATED_IMAGE_OS_CONTAINER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/edpm-hardened-uefi:current-podified
export RELATED_IMAGE_AGENT_IMAGE_URL_DEFAULT=quay.io/openstack-k8s-operators/openstack-baremetal-operator-agent:current-podified
export RELATED_IMAGE_APACHE_IMAGE_URL_DEFAULT=registry.redhat.io/rhel8/httpd-24:current-podified
export OS_IMAGE_DEFAULT=edpm-hardened-uefi.qcow2
export RELATED_IMAGE_PLACEMENT_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-placement-api:current-podified
export RELATED_IMAGE_CEILOMETER_CENTRAL_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ceilometer-central:current-podified
export RELATED_IMAGE_CEILOMETER_COMPUTE_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ceilometer-compute:current-podified
export RELATED_IMAGE_CEILOMETER_NOTIFICATION_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ceilometer-notification:current-podified
export RELATED_IMAGE_CEILOMETER_IPMI_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ceilometer-ipmi:current-podified
export RELATED_IMAGE_CEILOMETER_SGCORE_IMAGE_URL_DEFAULT=quay.io/infrawatch/sg-core:current-podified
export RELATED_IMAGE_AODH_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-aodh-api:current-podified
export RELATED_IMAGE_AODH_EVALUATOR_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-aodh-evaluator:current-podified
export RELATED_IMAGE_AODH_NOTIFIER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-aodh-notifier:current-podified
export RELATED_IMAGE_AODH_LISTENER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-aodh-listener:current-podified
export RELATED_IMAGE_OVN_NB_DBCLUSTER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ovn-nb-db-server:current-podified
export RELATED_IMAGE_OVN_SB_DBCLUSTER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ovn-sb-db-server:current-podified
export RELATED_IMAGE_OVN_NORTHD_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ovn-northd:current-podified
export RELATED_IMAGE_OVN_CONTROLLER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ovn-controller:current-podified
export RELATED_IMAGE_OVN_CONTROLLER_OVS_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ovn-base:current-podified
export RELATED_IMAGE_CINDER_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-cinder-api:current-podified
export RELATED_IMAGE_CINDER_BACKUP_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-cinder-backup:current-podified
export RELATED_IMAGE_CINDER_SCHEDULER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-cinder-scheduler:current-podified
export RELATED_IMAGE_CINDER_VOLUME_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-cinder-volume:current-podified
export RELATED_IMAGE_HORIZON_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-horizon:current-podified
export RELATED_IMAGE_HEAT_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-heat-api:current-podified
export RELATED_IMAGE_HEAT_CFNAPI_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-heat-api-cfn:current-podified
export RELATED_IMAGE_HEAT_ENGINE_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-heat-engine:current-podified
export RELATED_IMAGE_SWIFT_PROXY_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-swift-proxy-server:current-podified
export RELATED_IMAGE_SWIFT_ACCOUNT_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-swift-account:current-podified
export RELATED_IMAGE_SWIFT_CONTAINER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-swift-container:current-podified
export RELATED_IMAGE_SWIFT_OBJECT_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-swift-object:current-podified
export RELATED_IMAGE_OCTAVIA_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-octavia-api:current-podified
export RELATED_IMAGE_OCTAVIA_HOUSEKEEPING_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-octavia-housekeeping:current-podified
export RELATED_IMAGE_OCTAVIA_HEALTHMANAGER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-octavia-health-manager:current-podified
export RELATED_IMAGE_OCTAVIA_WORKER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-octavia-worker:current-podified
export RELATED_IMAGE_DESIGNATE_API_IMAGE_URL_DEFAULT=quay.io/tripleowallabycentos9/openstack-designate-api:current-podified
export RELATED_IMAGE_DESIGNATE_CENTRAL_IMAGE_URL_DEFAULT=quay.io/tripleowallabycentos9/openstack-designate-central:current-podified
export RELATED_IMAGE_DESIGNATE_MDNS_IMAGE_URL_DEFAULT=quay.io/tripleowallabycentos9/openstack-designate-mdns:current-podified
export RELATED_IMAGE_DESIGNATE_PRODUCER_IMAGE_URL_DEFAULT=quay.io/tripleowallabycentos9/openstack-designate-producer:current-podified
export RELATED_IMAGE_DESIGNATE_WORKER_IMAGE_URL_DEFAULT=quay.io/tripleowallabycentos9/openstack-designate-worker:current-podified
export RELATED_IMAGE_DESIGNATE_BACKENDBIND9_IMAGE_URL_DEFAULT=quay.io/tripleowallabycentos9/openstack-designate-backend-bind9:current-podified
export RELATED_IMAGE_DESIGNATE_UNBOUND_IMAGE_URL_DEFAULT=quay.io/tripleowallabycentos9/openstack-unbound:current-podified
export RELATED_IMAGE_BARBICAN_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-barbican-api:current-podified
export RELATED_IMAGE_BARBICAN_WORKER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-barbican-worker:current-podified
export RELATED_IMAGE_BARBICAN_KEYSTONE_LISTENER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-barbican-keystone-listener:current-podified
2 changes: 1 addition & 1 deletion pkg/openstack/barbican.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func ReconcileBarbican(ctx context.Context, instance *corev1beta1.OpenStackContr
barbican.Spec.BarbicanWorker.ContainerImage = *version.Status.ContainerImages.BarbicanWorkerImage
barbican.Spec.BarbicanKeystoneListener.ContainerImage = *version.Status.ContainerImages.BarbicanKeystoneListenerImage

// FIXME: barbican webhooks are not setting this correctly yet
// FIXME: barbican webhooks are not setting this correctly yet
if barbican.Spec.DatabaseAccount == "" {
barbican.Spec.DatabaseAccount = "barbican"
}
Expand Down
1 change: 0 additions & 1 deletion pkg/openstack/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func InitializeOpenStackVersionImageDefaults(ctx context.Context, envImages map[
Log.Info(fmt.Sprintf("Initialize Field name: %s", fieldName))
field := d.FieldByName(fieldName)
if field.IsValid() && field.CanSet() {
//field.SetString(*val)
field.Set(reflect.ValueOf(val))
} else {
Log.Info(fmt.Sprintf("Field not found: %s", fieldName))
Expand Down
27 changes: 27 additions & 0 deletions tests/functional/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,33 @@ func OpenStackClientConditionGetter(name types.NamespacedName) condition.Conditi
return instance.Status.Conditions
}

func CreateOpenStackVersion(name types.NamespacedName, spec map[string]interface{}) client.Object {

raw := map[string]interface{}{
"apiVersion": "core.openstack.org/v1beta1",
"kind": "OpenStackVersion",
"metadata": map[string]interface{}{
"name": name.Name,
"namespace": name.Namespace,
},
"spec": spec,
}
return th.CreateUnstructured(raw)
}

func GetOpenStackVersion(name types.NamespacedName) *corev1.OpenStackVersion {
instance := &corev1.OpenStackVersion{}
Eventually(func(g Gomega) {
g.Expect(k8sClient.Get(ctx, name, instance)).Should(Succeed())
}, timeout, interval).Should(Succeed())
return instance
}

func OpenStackVersionConditionGetter(name types.NamespacedName) condition.Conditions {
instance := GetOpenStackVersion(name)
return instance.Status.Conditions
}

func CreateOpenStackControlPlane(name types.NamespacedName, spec map[string]interface{}) client.Object {

raw := map[string]interface{}{
Expand Down
Loading

0 comments on commit 89fd4bc

Please sign in to comment.