diff --git a/.github/workflows/build-openstack-operator.yaml b/.github/workflows/build-openstack-operator.yaml index a6e1b7ee6..5c4d0f15d 100644 --- a/.github/workflows/build-openstack-operator.yaml +++ b/.github/workflows/build-openstack-operator.yaml @@ -17,7 +17,7 @@ jobs: operator_name: openstack go_version: 1.20.x operator_sdk_version: 1.31.0 - bundle_dockerfile: ./custom-bundle.Dockerfile + bundle_dockerfile: ./bundle.Dockerfile catalog_extra_bundles_script: ./hack/pin-bundle-images.sh secrets: IMAGENAMESPACE: ${{ secrets.IMAGENAMESPACE }} diff --git a/.prow_ci.env b/.prow_ci.env index 564ca8958..48fc5e272 100644 --- a/.prow_ci.env +++ b/.prow_ci.env @@ -1,3 +1,3 @@ export USE_IMAGE_DIGESTS=true -export BUNDLE_DOCKERFILE=custom-bundle.Dockerfile +export BUNDLE_DOCKERFILE=bundle.Dockerfile export FAIL_FIPS_CHECK=true diff --git a/Makefile b/Makefile index 473e59d6d..b596d9e28 100644 --- a/Makefile +++ b/Makefile @@ -189,7 +189,6 @@ cover: test ## Run tests and display functional test coverage .PHONY: build build: generate fmt vet ## Build manager binary. go build -o bin/manager main.go - go build -o bin/csv-merger cmd/csv-merger/csv-merger.go .PHONY: run run: export METRICS_PORT?=8080 @@ -330,7 +329,7 @@ endif endif .PHONY: bundle -bundle: build manifests kustomize bundle-cache-extra-data operator-sdk ## Generate bundle manifests and metadata, then validate generated files. +bundle: build manifests kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files. $(OPERATOR_SDK) generate kustomize manifests -q cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) @@ -339,7 +338,7 @@ bundle: build manifests kustomize bundle-cache-extra-data operator-sdk ## Genera .PHONY: bundle-build bundle-build: bundle ## Build the bundle image. - podman build -f custom-bundle.Dockerfile -t $(BUNDLE_IMG) . + podman build -f bundle.Dockerfile -t $(BUNDLE_IMG) . .PHONY: bundle-push bundle-push: ## Push the bundle image. @@ -469,10 +468,3 @@ run-with-webhook: manifests generate fmt vet ## Run a controller from your host. .PHONY: webhook-cleanup webhook-cleanup: /bin/bash hack/clean_local_webhook.sh - -# refresh the bundle extra data based on go.mod entries -# bundle extra data includes: -# - extracted ENV vars from all operators (required for webhooks) -.PHONY: bundle-cache-extra-data -bundle-cache-extra-data: build - bash hack/bundle-cache-data.sh diff --git a/README.md b/README.md index 2be7b0932..ad00113bd 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ bundle. make dep-bundle-build-push ``` -3. Run bundle-build. This will execute podman to build the custom-bundle.Dockerfile. +3. Run bundle-build. This will execute podman to build the bundle.Dockerfile. ```sh make bundle-build diff --git a/apis/bases/client.openstack.org_openstackclients.yaml b/apis/bases/client.openstack.org_openstackclients.yaml index 2d141986c..96dd6f0ac 100644 --- a/apis/bases/client.openstack.org_openstackclients.yaml +++ b/apis/bases/client.openstack.org_openstackclients.yaml @@ -12,6 +12,9 @@ spec: kind: OpenStackClient listKind: OpenStackClientList plural: openstackclients + shortNames: + - osclient + - osclients singular: openstackclient scope: Namespaced versions: diff --git a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml index 793b88319..f5f4da630 100644 --- a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -17530,6 +17530,8 @@ spec: type: string ceilometerNotificationImage: type: string + ceilometerProxyImage: + type: string ceilometerSgcoreImage: type: string cinderAPIImage: @@ -17628,6 +17630,8 @@ spec: type: string octaviaAPIImage: type: string + octaviaApacheImage: + type: string octaviaHealthmanagerImage: type: string octaviaHousekeepingImage: diff --git a/apis/bases/core.openstack.org_openstackversions.yaml b/apis/bases/core.openstack.org_openstackversions.yaml index 7351e3c55..68a5c3c2a 100644 --- a/apis/bases/core.openstack.org_openstackversions.yaml +++ b/apis/bases/core.openstack.org_openstackversions.yaml @@ -438,6 +438,8 @@ spec: type: string ceilometerNotificationImage: type: string + ceilometerProxyImage: + type: string ceilometerSgcoreImage: type: string cinderAPIImage: @@ -536,6 +538,8 @@ spec: type: string octaviaAPIImage: type: string + octaviaApacheImage: + type: string octaviaHealthmanagerImage: type: string octaviaHousekeepingImage: diff --git a/apis/client/v1beta1/openstackclient_types.go b/apis/client/v1beta1/openstackclient_types.go index 6936ecead..c8362a179 100644 --- a/apis/client/v1beta1/openstackclient_types.go +++ b/apis/client/v1beta1/openstackclient_types.go @@ -72,6 +72,8 @@ type OpenStackClientStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status +//+operator-sdk:csv:customresourcedefinitions:displayName="OpenStack Client" +//+kubebuilder:resource:shortName=osclient;osclients //+kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[0].status",description="Status" //+kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[0].message",description="Message" diff --git a/apis/core/v1beta1/openstackversion_types.go b/apis/core/v1beta1/openstackversion_types.go index dd33c5f26..82162429d 100644 --- a/apis/core/v1beta1/openstackversion_types.go +++ b/apis/core/v1beta1/openstackversion_types.go @@ -57,23 +57,26 @@ type ContainerDefaults struct { // ContainerImages - struct acts as the source of truth for container image URLs to be deployed type ContainerImages struct { - ContainerTemplate `json:",inline"` + ContainerTemplate `json:",inline"` + OctaviaApacheImage *string `json:"octaviaApacheImage,omitempty"` // gets set to ApacheImage once applied + CeilometerProxyImage *string `json:"ceilometerProxyImage,omitempty"` // gets set to ApacheImage once applied // CinderVolumeImages custom Cinder Volume images for each backend (default Cinder volume image is stored 'default' key) // TODO: add validation to cinder-operator to prevent backend being named 'default' CinderVolumeImages map[string]*string `json:"cinderVolumeImages,omitempty"` // ManilaShareImages custom Manila Share images for each backend (default Manila share image is stored 'default' key) - // TODO: add validation to cinder-operator to prevent backend being named 'default' + // TODO: add validation to manila-operator to prevent backend being named 'default' ManilaShareImages map[string]*string `json:"manilaShareImages,omitempty"` } // 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"` - AodhAPIImage *string `json:"aodhAPIImage,omitempty"` - AodhEvaluatorImage *string `json:"aodhEvaluatorImage,omitempty"` - AodhListenerImage *string `json:"aodhListenerImage,omitempty"` - AodhNotifierImage *string `json:"aodhNotifierImage,omitempty"` + AgentImage *string `json:"agentImage,omitempty"` + AnsibleeeImage *string `json:"ansibleeeImage,omitempty"` + AodhAPIImage *string `json:"aodhAPIImage,omitempty"` + AodhEvaluatorImage *string `json:"aodhEvaluatorImage,omitempty"` + AodhListenerImage *string `json:"aodhListenerImage,omitempty"` + AodhNotifierImage *string `json:"aodhNotifierImage,omitempty"` + // this is shared by BaremetalOperator, OctaviaOperator, and TelemetryOperator ApacheImage *string `json:"apacheImage,omitempty"` BarbicanAPIImage *string `json:"barbicanAPIImage,omitempty"` BarbicanKeystoneListenerImage *string `json:"barbicanKeystoneListenerImage,omitempty"` diff --git a/apis/core/v1beta1/zz_generated.deepcopy.go b/apis/core/v1beta1/zz_generated.deepcopy.go index 6b92c09d0..893942acc 100644 --- a/apis/core/v1beta1/zz_generated.deepcopy.go +++ b/apis/core/v1beta1/zz_generated.deepcopy.go @@ -192,6 +192,16 @@ func (in *ContainerDefaults) DeepCopy() *ContainerDefaults { func (in *ContainerImages) DeepCopyInto(out *ContainerImages) { *out = *in in.ContainerTemplate.DeepCopyInto(&out.ContainerTemplate) + if in.OctaviaApacheImage != nil { + in, out := &in.OctaviaApacheImage, &out.OctaviaApacheImage + *out = new(string) + **out = **in + } + if in.CeilometerProxyImage != nil { + in, out := &in.CeilometerProxyImage, &out.CeilometerProxyImage + *out = new(string) + **out = **in + } if in.CinderVolumeImages != nil { in, out := &in.CinderVolumeImages, &out.CinderVolumeImages *out = make(map[string]*string, len(*in)) diff --git a/cmd/csv-merger/csv-merger.go b/cmd/csv-merger/csv-merger.go deleted file mode 100644 index c0eb6d41f..000000000 --- a/cmd/csv-merger/csv-merger.go +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Copyright 2022 Red Hat, Inc. - * - */ - -package main - -import ( - "encoding/json" - "flag" - "os" - "runtime/debug" - "strings" - - "github.com/ghodss/yaml" - "github.com/imdario/mergo" - "github.com/openstack-k8s-operators/openstack-operator/pkg/util" - - semver "github.com/blang/semver/v4" - "github.com/operator-framework/api/pkg/lib/version" - csvv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" - - v1 "k8s.io/api/core/v1" -) - -func getEnvsFromFile(filename string) []v1.EnvVar { - csvBytes, err := os.ReadFile(filename) - if err != nil { - exitWithError(err.Error()) - } - envVarList := &[]v1.EnvVar{} - - err = yaml.Unmarshal(csvBytes, envVarList) - if err != nil { - exitWithError(err.Error()) - } - return *envVarList -} - -func writeEnvToYaml(filename string, data interface{}) { - yamlBytes, err := yaml.Marshal(data) - if err != nil { - exitWithError(err.Error()) - } - - file, err := os.Create(filename) - if err != nil { - exitWithError(err.Error()) - } - defer file.Close() - _, err = file.Write(yamlBytes) - if err != nil { - exitWithError(err.Error()) - } -} - -func exitWithError(msg string) { - os.Stderr.WriteString(msg) - debug.PrintStack() - os.Exit(1) -} - -var ( - baseCsv = flag.String("base-csv", "", "Base CSV filename") - keystoneCsv = flag.String("keystone-csv", "", "Keystone CSV filename") - mariadbCsv = flag.String("mariadb-csv", "", "Mariadb CSV filename") - rabbitmqCsv = flag.String("rabbitmq-csv", "", "RabbitMQ CSV filename") - infraCsv = flag.String("infra-csv", "", "Infra CSV filename") - ansibleEECsv = flag.String("ansibleee-csv", "", "Ansible EE CSV filename") - novaCsv = flag.String("nova-csv", "", "Nova CSV filename") - heatCsv = flag.String("heat-csv", "", "Heat CSV filename") - neutronCsv = flag.String("neutron-csv", "", "Neutron CSV filename") - glanceCsv = flag.String("glance-csv", "", "Glance CSV filename") - ironicCsv = flag.String("ironic-csv", "", "Ironic CSV filename") - baremetalCsv = flag.String("baremetal-csv", "", "Baremetal CSV filename") - manilaCsv = flag.String("manila-csv", "", "Manila CSV filename") - placementCsv = flag.String("placement-csv", "", "Placement CSV filename") - telemetryCsv = flag.String("telemetry-csv", "", "Telemetry CSV filename") - ovnCsv = flag.String("ovn-csv", "", "OVN CSV filename") - cinderCsv = flag.String("cinder-csv", "", "Cinder CSV filename") - horizonCsv = flag.String("horizon-csv", "", "Horizon CSV filename") - swiftCsv = flag.String("swift-csv", "", "Swift CSV filename") - octaviaCsv = flag.String("octavia-csv", "", "Octavia CSV filename") - designateCsv = flag.String("designate-csv", "", "Designate CSV filename") - barbicanCsv = flag.String("barbican-csv", "", "Barbican CSV filename") - testCsv = flag.String("test-csv", "", "Test Operator CSV filename") - csvOverrides = flag.String("csv-overrides", "", "CSV like string with punctual changes that will be recursively applied (if possible)") - importEnvFiles = flag.String("import-env-files", "", "Comma separated list of file names to read default operator ENVs from. Used for inter-bundle ENV merging.") - exportEnvFile = flag.String("export-env-file", "", "Name the external file to write operator ENVs to. Used for inter-bundle ENV merging.") - almExamples = flag.Bool("alm-examples", false, "Merge almExamples into the CSV") - visibleCRDList = flag.String("visible-crds-list", "openstackversions.core.openstack.org,openstackcontrolplanes.core.openstack.org,openstackdataplanenodesets.dataplane.openstack.org,openstackdataplanedeployments.dataplane.openstack.org", - "Comma separated list of all the CRDs that should be visible in OLM console") -) - -func getCSVBase(filename string) *csvv1alpha1.ClusterServiceVersion { - csvBytes, err := os.ReadFile(filename) - if err != nil { - exitWithError(err.Error()) - } - csvStruct := &csvv1alpha1.ClusterServiceVersion{} - - err = yaml.Unmarshal(csvBytes, csvStruct) - if err != nil { - exitWithError(err.Error()) - } - return csvStruct -} - -func main() { - flag.Parse() - - csvs := []string{ - *keystoneCsv, - *mariadbCsv, - *rabbitmqCsv, - *infraCsv, - *ansibleEECsv, - *novaCsv, - *neutronCsv, - *manilaCsv, - *glanceCsv, - *ironicCsv, - *baremetalCsv, - *placementCsv, - *telemetryCsv, - *ovnCsv, - *cinderCsv, - *horizonCsv, - *heatCsv, - *swiftCsv, - *octaviaCsv, - *designateCsv, - *barbicanCsv, - *testCsv, - } - - csvVersion := os.Getenv("CSV_VERSION") - - // BaseCSV is built on the bundle/manifests/openstack-operator.clusterserviceversion.yaml from this repo - csvBase := getCSVBase(*baseCsv) - csvNew := csvv1alpha1.ClusterServiceVersion{ - TypeMeta: csvBase.TypeMeta, - ObjectMeta: csvBase.ObjectMeta, - Spec: csvBase.Spec, - Status: csvBase.Status} - - installStrategyBase := csvBase.Spec.InstallStrategy.StrategySpec - csvNew.Spec.RelatedImages = csvBase.Spec.RelatedImages - - envVarList := []v1.EnvVar{} - if len(*importEnvFiles) > 0 { - for _, filename := range strings.Split(*importEnvFiles, ",") { - envVarList = append(envVarList, getEnvsFromFile(filename)...) - } - } - for _, csvFile := range csvs { - if csvFile != "" { - csvBytes, err := os.ReadFile(csvFile) - if err != nil { - exitWithError(err.Error()) - } - - csvStruct := &csvv1alpha1.ClusterServiceVersion{} - - err = yaml.Unmarshal(csvBytes, csvStruct) - if err != nil { - exitWithError(err.Error()) - } - - // 1. We need to add the "env" section from the operator deployment in case there - // are default values configured. - for _, container := range csvStruct.Spec.InstallStrategy.StrategySpec.DeploymentSpecs[0].Spec.Template.Spec.Containers { - // Copy env vars from the Service Operator into the OpenStack Operator - if container.Name == "manager" { - envVarList = append(envVarList, container.Env...) - } - } - - installStrategyBase.DeploymentSpecs = append(installStrategyBase.DeploymentSpecs, csvStruct.Spec.InstallStrategy.StrategySpec.DeploymentSpecs...) - installStrategyBase.ClusterPermissions = append(installStrategyBase.ClusterPermissions, csvStruct.Spec.InstallStrategy.StrategySpec.ClusterPermissions...) - installStrategyBase.Permissions = append(installStrategyBase.Permissions, csvStruct.Spec.InstallStrategy.StrategySpec.Permissions...) - csvNew.Spec.RelatedImages = append(csvNew.Spec.RelatedImages, csvStruct.Spec.RelatedImages...) - - for _, owned := range csvStruct.Spec.CustomResourceDefinitions.Owned { - csvNew.Spec.CustomResourceDefinitions.Owned = append( - csvNew.Spec.CustomResourceDefinitions.Owned, - csvv1alpha1.CRDDescription{ - Name: owned.Name, - Version: owned.Version, - Kind: owned.Kind, - Description: owned.Description, - DisplayName: owned.DisplayName, - }, - ) - } - - if *almExamples { - csvBaseAlmString := csvNew.Annotations["alm-examples"] - csvStructAlmString := csvStruct.Annotations["alm-examples"] - var baseAlmCrs []interface{} - var structAlmCrs []interface{} - if err = json.Unmarshal([]byte(csvBaseAlmString), &baseAlmCrs); err != nil { - print(csvBaseAlmString) - exitWithError(err.Error()) - } - if err = json.Unmarshal([]byte(csvStructAlmString), &structAlmCrs); err == nil { - //panic(err) - baseAlmCrs = append(baseAlmCrs, structAlmCrs...) - } - almB, err := json.Marshal(baseAlmCrs) - if err != nil { - exitWithError(err.Error()) - } - csvNew.Annotations["alm-examples"] = string(almB) - } - csvNew.Spec.WebhookDefinitions = append(csvNew.Spec.WebhookDefinitions, csvStruct.Spec.WebhookDefinitions...) - } - - } - if len(*exportEnvFile) > 0 { - writeEnvToYaml(*exportEnvFile, envVarList) - } else { - installStrategyBase.DeploymentSpecs[0].Spec.Template.Spec.Containers[1].Env = append( - // OpenStack Operator controller-manager container env vars - installStrategyBase.DeploymentSpecs[0].Spec.Template.Spec.Containers[1].Env, - // Service Operator controller-manager container env vars - envVarList..., - ) - } - - // by default we hide all CRDs in the Console - hiddenCrds := []string{} - visibleCrds := strings.Split(*visibleCRDList, ",") - for _, owned := range csvNew.Spec.CustomResourceDefinitions.Owned { - found := false - for _, name := range visibleCrds { - if owned.Name == name { - found = true - } - } - if !found { - hiddenCrds = append( - hiddenCrds, - owned.Name, - ) - } - } - hiddenCrdsJ, err := json.Marshal(hiddenCrds) - if err != nil { - exitWithError(err.Error()) - } - csvNew.Annotations["operators.operatorframework.io/internal-objects"] = string(hiddenCrdsJ) - - csvNew.Spec.InstallStrategy.StrategyName = "deployment" - csvNew.Spec.InstallStrategy = csvv1alpha1.NamedInstallStrategy{ - StrategyName: "deployment", - StrategySpec: installStrategyBase, - } - - if csvVersion != "" { - csvNew.Spec.Version = version.OperatorVersion{ - Version: semver.MustParse(csvVersion), - } - csvNew.Name = strings.Replace(csvNew.Name, "0.0.1", csvVersion, 1) - } - - if *csvOverrides != "" { - csvOBytes := []byte(*csvOverrides) - - csvO := &csvv1alpha1.ClusterServiceVersion{} - - err := yaml.Unmarshal(csvOBytes, csvO) - if err != nil { - exitWithError(err.Error()) - } - - err = mergo.Merge(&csvNew, csvO, mergo.WithOverride) - if err != nil { - exitWithError(err.Error()) - } - - } - - err = util.MarshallObject(csvNew, os.Stdout) - if err != nil { - exitWithError(err.Error()) - } - -} diff --git a/config/crd/bases/client.openstack.org_openstackclients.yaml b/config/crd/bases/client.openstack.org_openstackclients.yaml index 2d141986c..96dd6f0ac 100644 --- a/config/crd/bases/client.openstack.org_openstackclients.yaml +++ b/config/crd/bases/client.openstack.org_openstackclients.yaml @@ -12,6 +12,9 @@ spec: kind: OpenStackClient listKind: OpenStackClientList plural: openstackclients + shortNames: + - osclient + - osclients singular: openstackclient scope: Namespaced versions: diff --git a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml index 793b88319..f5f4da630 100644 --- a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -17530,6 +17530,8 @@ spec: type: string ceilometerNotificationImage: type: string + ceilometerProxyImage: + type: string ceilometerSgcoreImage: type: string cinderAPIImage: @@ -17628,6 +17630,8 @@ spec: type: string octaviaAPIImage: type: string + octaviaApacheImage: + type: string octaviaHealthmanagerImage: type: string octaviaHousekeepingImage: diff --git a/config/crd/bases/core.openstack.org_openstackversions.yaml b/config/crd/bases/core.openstack.org_openstackversions.yaml index 7351e3c55..68a5c3c2a 100644 --- a/config/crd/bases/core.openstack.org_openstackversions.yaml +++ b/config/crd/bases/core.openstack.org_openstackversions.yaml @@ -438,6 +438,8 @@ spec: type: string ceilometerNotificationImage: type: string + ceilometerProxyImage: + type: string ceilometerSgcoreImage: type: string cinderAPIImage: @@ -536,6 +538,8 @@ spec: type: string octaviaAPIImage: type: string + octaviaApacheImage: + type: string octaviaHealthmanagerImage: type: string octaviaHousekeepingImage: diff --git a/config/default/manager_default_images.yaml b/config/default/manager_default_images.yaml index b56ab8f02..f70700c4b 100644 --- a/config/default/manager_default_images.yaml +++ b/config/default/manager_default_images.yaml @@ -11,18 +11,66 @@ spec: containers: - name: manager env: - - name: RELATED_IMAGE_RABBITMQ_IMAGE_URL_DEFAULT - value: quay.io/podified-antelope-centos9/openstack-rabbitmq:current-podified - - name: RELATED_IMAGE_OPENSTACK_CLIENT_IMAGE_URL_DEFAULT - value: quay.io/podified-antelope-centos9/openstack-openstackclient:current-podified + - name: RELATED_IMAGE_AGENT_IMAGE_URL_DEFAULT + value: quay.io/openstack-k8s-operators/openstack-baremetal-operator-agent:latest + - name: RELATED_IMAGE_ANSIBLEEE_IMAGE_URL_DEFAULT + value: quay.io/openstack-k8s-operators/openstack-ansibleee-runner:latest + - name: RELATED_IMAGE_AODH_API_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-aodh-api:current-podified + - name: RELATED_IMAGE_AODH_EVALUATOR_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-aodh-evaluator:current-podified + - name: RELATED_IMAGE_AODH_LISTENER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-aodh-listener:current-podified + - name: RELATED_IMAGE_AODH_NOTIFIER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-aodh-notifier:current-podified + - name: RELATED_IMAGE_APACHE_IMAGE_URL_DEFAULT + value: registry.redhat.io/ubi9/httpd-24:latest + - name: RELATED_IMAGE_BARBICAN_API_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-barbican-api:current-podified + - name: RELATED_IMAGE_BARBICAN_KEYSTONE_LISTENER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-barbican-keystone-listener:current-podified + - name: RELATED_IMAGE_BARBICAN_WORKER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-barbican-worker:current-podified + - name: RELATED_IMAGE_CEILOMETER_CENTRAL_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-ceilometer-central:current-podified + - name: RELATED_IMAGE_CEILOMETER_COMPUTE_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-ceilometer-compute:current-podified + - name: RELATED_IMAGE_CEILOMETER_IPMI_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-ceilometer-ipmi:current-podified + - name: RELATED_IMAGE_CEILOMETER_NOTIFICATION_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-ceilometer-notification:current-podified + - name: RELATED_IMAGE_CEILOMETER_SGCORE_IMAGE_URL_DEFAULT + value: quay.io/infrawatch/sg-core:v5.2.0-nextgen + - name: RELATED_IMAGE_CINDER_API_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-cinder-api:current-podified + - name: RELATED_IMAGE_CINDER_BACKUP_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-cinder-backup:current-podified + - name: RELATED_IMAGE_CINDER_SCHEDULER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-cinder-scheduler:current-podified + - name: RELATED_IMAGE_CINDER_VOLUME_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-cinder-volume:current-podified + - name: RELATED_IMAGE_DESIGNATE_API_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-designate-api:current-podified + - name: RELATED_IMAGE_DESIGNATE_BACKENDBIND9_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-designate-backend-bind9:current-podified + - name: RELATED_IMAGE_DESIGNATE_CENTRAL_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-designate-central:current-podified + - name: RELATED_IMAGE_DESIGNATE_MDNS_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-designate-mdns:current-podified + - name: RELATED_IMAGE_DESIGNATE_PRODUCER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-designate-producer:current-podified + - name: RELATED_IMAGE_DESIGNATE_UNBOUND_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-unbound:current-podified + - name: RELATED_IMAGE_DESIGNATE_WORKER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-designate-worker:current-podified - name: RELATED_IMAGE_EDPM_FRR_IMAGE_URL_DEFAULT value: quay.io/podified-antelope-centos9/openstack-frr:current-podified - name: RELATED_IMAGE_EDPM_ISCSID_IMAGE_URL_DEFAULT value: quay.io/podified-antelope-centos9/openstack-iscsid:current-podified - name: RELATED_IMAGE_EDPM_LOGROTATE_CROND_IMAGE_URL_DEFAULT value: quay.io/podified-antelope-centos9/openstack-cron:current-podified - - name: RELATED_IMAGE_EDPM_OVN_CONTROLLER_AGENT_IMAGE_URL_DEFAULT - value: quay.io/podified-antelope-centos9/openstack-ovn-controller:current-podified + - name: RELATED_IMAGE_EDPM_MULTIPATHD_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-multipathd:current-podified - name: RELATED_IMAGE_EDPM_NEUTRON_DHCP_AGENT_IMAGE_URL_DEFAULT value: quay.io/podified-antelope-centos9/openstack-neutron-dhcp-agent:current-podified - name: RELATED_IMAGE_EDPM_NEUTRON_METADATA_AGENT_IMAGE_URL_DEFAULT @@ -31,9 +79,87 @@ spec: value: quay.io/podified-antelope-centos9/openstack-neutron-ovn-agent:current-podified - name: RELATED_IMAGE_EDPM_NEUTRON_SRIOV_AGENT_IMAGE_URL_DEFAULT value: quay.io/podified-antelope-centos9/openstack-neutron-sriov-agent:current-podified - - name: RELATED_IMAGE_EDPM_OVN_BGP_AGENT_IMAGE_URL_DEFAULT - value: quay.io/podified-antelope-centos9/openstack-ovn-bgp-agent:current-podified - name: RELATED_IMAGE_EDPM_NODE_EXPORTER_IMAGE_URL_DEFAULT value: quay.io/prometheus/node-exporter:v1.5.0 - - name: RELATED_IMAGE_EDPM_MULTIPATHD_IMAGE_URL_DEFAULT - value: quay.io/podified-antelope-centos9/openstack-multipathd:current-podified + - name: RELATED_IMAGE_EDPM_OVN_BGP_AGENT_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-ovn-bgp-agent:current-podified + - name: RELATED_IMAGE_GLANCE_API_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-glance-api:current-podified + - name: RELATED_IMAGE_HEAT_API_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-heat-api:current-podified + - name: RELATED_IMAGE_HEAT_CFNAPI_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-heat-api-cfn:current-podified + - name: RELATED_IMAGE_HEAT_ENGINE_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-heat-engine:current-podified + - name: RELATED_IMAGE_HORIZON_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-horizon:current-podified + - name: RELATED_IMAGE_INFRA_MEMCACHED_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-memcached:current-podified + - name: RELATED_IMAGE_IRONIC_API_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-ironic-api:current-podified + - name: RELATED_IMAGE_IRONIC_CONDUCTOR_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-ironic-conductor:current-podified + - name: RELATED_IMAGE_IRONIC_INSPECTOR_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-ironic-inspector:current-podified + - name: RELATED_IMAGE_IRONIC_NEUTRON_AGENT_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-ironic-neutron-agent:current-podified + - name: RELATED_IMAGE_IRONIC_PXE_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-ironic-pxe:current-podified + - name: RELATED_IMAGE_IRONIC_PYTHON_AGENT_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/ironic-python-agent:current-podified + - name: RELATED_IMAGE_KEYSTONE_API_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-keystone:current-podified + - name: RELATED_IMAGE_MANILA_API_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-manila-api:current-podified + - name: RELATED_IMAGE_MANILA_SCHEDULER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-manila-scheduler:current-podified + - name: RELATED_IMAGE_MANILA_SHARE_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-manila-share:current-podified + - name: RELATED_IMAGE_MARIADB_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-mariadb:current-podified + - name: RELATED_IMAGE_NEUTRON_API_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-neutron-server:current-podified + - name: RELATED_IMAGE_NOVA_API_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-nova-api:current-podified + - name: RELATED_IMAGE_NOVA_COMPUTE_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-nova-compute:current-podified + - name: RELATED_IMAGE_NOVA_CONDUCTOR_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-nova-conductor:current-podified + - name: RELATED_IMAGE_NOVA_NOVNC_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-nova-novncproxy:current-podified + - name: RELATED_IMAGE_NOVA_SCHEDULER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-nova-scheduler:current-podified + - name: RELATED_IMAGE_OCTAVIA_API_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-octavia-api:current-podified + - name: RELATED_IMAGE_OCTAVIA_HEALTHMANAGER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-octavia-health-manager:current-podified + - name: RELATED_IMAGE_OCTAVIA_HOUSEKEEPING_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-octavia-housekeeping:current-podified + - name: RELATED_IMAGE_OCTAVIA_WORKER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-octavia-worker:current-podified + - name: RELATED_IMAGE_OPENSTACK_CLIENT_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-openstackclient:current-podified + - name: RELATED_IMAGE_OS_CONTAINER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/edpm-hardened-uefi:current-podified + - name: RELATED_IMAGE_OVN_CONTROLLER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-ovn-controller:current-podified + - name: RELATED_IMAGE_OVN_CONTROLLER_OVS_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-ovn-base:current-podified + - name: RELATED_IMAGE_OVN_NB_DBCLUSTER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-ovn-nb-db-server:current-podified + - name: RELATED_IMAGE_OVN_NORTHD_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-ovn-northd:current-podified + - name: RELATED_IMAGE_OVN_SB_DBCLUSTER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-ovn-sb-db-server:current-podified + - name: RELATED_IMAGE_PLACEMENT_API_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-placement-api:current-podified + - name: RELATED_IMAGE_RABBITMQ_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-rabbitmq:current-podified + - name: RELATED_IMAGE_SWIFT_ACCOUNT_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-swift-account:current-podified + - name: RELATED_IMAGE_SWIFT_CONTAINER_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-swift-container:current-podified + - name: RELATED_IMAGE_SWIFT_OBJECT_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-swift-object:current-podified + - name: RELATED_IMAGE_SWIFT_PROXY_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-swift-proxy-server:current-podified diff --git a/config/manifests/bases/openstack-operator.clusterserviceversion.yaml b/config/manifests/bases/openstack-operator.clusterserviceversion.yaml index 47cb300e8..c71671e06 100644 --- a/config/manifests/bases/openstack-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/openstack-operator.clusterserviceversion.yaml @@ -12,7 +12,8 @@ metadata: features.operators.openshift.io/token-auth-azure: "false" features.operators.openshift.io/token-auth-gcp: "false" operatorframework.io/suggested-namespace: openstack-operators - operators.operatorframework.io/builder: operator-sdk-v1.26.0 + operators.operatorframework.io/builder: operator-sdk-v1.31.0 + operators.operatorframework.io/internal-objects: '["openstackclients.client.openstack.org","openstackdataplaneservices.dataplane.openstack.org"]' operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 name: openstack-operator.v0.0.0 namespace: placeholder diff --git a/custom-bundle.Dockerfile b/custom-bundle.Dockerfile deleted file mode 100644 index 206c1a534..000000000 --- a/custom-bundle.Dockerfile +++ /dev/null @@ -1,76 +0,0 @@ -ARG GOLANG_CTX=registry.access.redhat.com/ubi9/go-toolset:1.20 - -FROM $GOLANG_CTX as builder - -WORKDIR /workspace -# Copy the Go Modules manifests -COPY go.mod go.mod -COPY go.sum go.sum - -COPY apis/ apis/ - -# cache deps before building and copying source so that we don't need to re-download as much -# and so that source changes don't invalidate our downloaded layer -RUN go mod download - -# Copy the go source -USER root -COPY cmd/csv-merger/csv-merger.go csv-merger.go -COPY pkg/ pkg/ - -# Build the csv-merger -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o csv-merger csv-merger.go - -USER $USER_ID - -FROM $GOLANG_CTX as merger -WORKDIR /workspace -COPY --from=builder /workspace/csv-merger . - -USER root -# local operator manifests -COPY bundle/manifests /manifests/ -COPY bundle_extra_data /bundle_extra_data - -# Merge things into our openstack-operator CSV: -# -openstack-operator CSV -# -ENV vars from all operators (for webhooks) -RUN /workspace/csv-merger \ - --import-env-files=/bundle_extra_data/env-vars.yaml \ - --base-csv=/manifests/openstack-operator.clusterserviceversion.yaml | tee /openstack-operator.clusterserviceversion.yaml.new - -# remove all individual operator CSV's -RUN rm /manifests/*clusterserviceversion.yaml - -USER $USER_ID - -### Put everything together -FROM scratch - -# Core bundle labels. -LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 -LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ -LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ -LABEL operators.operatorframework.io.bundle.package.v1=openstack-operator -LABEL operators.operatorframework.io.bundle.channels.v1=alpha -LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.22.1 -LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 -LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3 - -# Labels for testing. -LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1 -LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/ - -# Copy files to locations specified by labels. -USER root -COPY bundle/metadata /metadata/ -COPY bundle/tests/scorecard /tests/scorecard/ - -# copy in manifests from operators -COPY bundle/manifests /manifests/ -COPY --from=merger /manifests/* /manifests/ - -# overwrite with the final merged CSV -COPY --from=merger /openstack-operator.clusterserviceversion.yaml.new /manifests/openstack-operator.clusterserviceversion.yaml - -USER $USER_ID diff --git a/go.mod b/go.mod index 782c14bc8..0476b6075 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,12 @@ module github.com/openstack-k8s-operators/openstack-operator go 1.20 require ( - github.com/blang/semver/v4 v4.0.0 github.com/cert-manager/cert-manager v1.13.6 github.com/ghodss/yaml v1.0.0 github.com/go-logr/logr v1.4.2 github.com/go-playground/validator/v10 v10.22.0 github.com/google/uuid v1.6.0 github.com/iancoleman/strcase v0.3.0 - github.com/imdario/mergo v0.3.16 github.com/onsi/ginkgo/v2 v2.20.0 github.com/onsi/gomega v1.34.1 github.com/openshift/api v3.9.0+incompatible @@ -41,7 +39,6 @@ require ( github.com/openstack-k8s-operators/swift-operator/api v0.4.1-0.20240812114343-789f4ced41df github.com/openstack-k8s-operators/telemetry-operator/api v0.4.1-0.20240815220838-855ff928766f github.com/openstack-k8s-operators/test-operator/api v0.0.0-20240815212722-79883cdd9cdb - github.com/operator-framework/api v0.21.0 github.com/rabbitmq/cluster-operator/v2 v2.9.0 go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 @@ -76,6 +73,7 @@ require ( github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect github.com/gophercloud/gophercloud v1.14.0 // indirect + github.com/imdario/mergo v0.3.16 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.4.0 // indirect @@ -95,7 +93,6 @@ require ( github.com/rhobs/obo-prometheus-operator/pkg/apis/monitoring v0.69.0-rhobs1 // indirect github.com/rhobs/observability-operator v0.0.28 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect - github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/pflag v1.0.5 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.26.0 // indirect diff --git a/go.sum b/go.sum index 12367f1d6..b9efc03b6 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= -github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/cert-manager/cert-manager v1.13.6 h1:yngKM4ZQoyFQ3LGHTx95fWqyiNJP11UM5PWq7pAr3T0= github.com/cert-manager/cert-manager v1.13.6/go.mod h1:iWFePja8XKEl+Dv1kZtwPshT8D0SmC4Hyu5Qc5KS0tM= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -154,8 +152,6 @@ github.com/openstack-k8s-operators/telemetry-operator/api v0.4.1-0.2024081522083 github.com/openstack-k8s-operators/telemetry-operator/api v0.4.1-0.20240815220838-855ff928766f/go.mod h1:STrbQmMpeU1vFiJkloUudTDWHqFYjwB1mBRe2Y60j1E= github.com/openstack-k8s-operators/test-operator/api v0.0.0-20240815212722-79883cdd9cdb h1:s++MLu7L9gISMEfqqM9Qwoa5pjY8Jwt3Mj3VPXS3kI8= github.com/openstack-k8s-operators/test-operator/api v0.0.0-20240815212722-79883cdd9cdb/go.mod h1:gCJ7bCKjr+QKyEG5sn1LnGdAO6RqXbMbuYHAzBM/ZJA= -github.com/operator-framework/api v0.21.0 h1:89LhqGTLskxpPR4siEaorkF9PY3KLI51S5mFxP6q1G8= -github.com/operator-framework/api v0.21.0/go.mod h1:3tsDLxXChMY1KgxO5v1CZQogHNQCIMy14YXkXqA5lT4= 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/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -175,13 +171,10 @@ github.com/rhobs/observability-operator v0.0.28/go.mod h1:LbxNGGlKlcD7NBt0axiTeR github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= -github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -227,7 +220,6 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= @@ -270,7 +262,6 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= k8s.io/api v0.28.13 h1:0Sw8MjdkmrJAF/uVv09HXSZ3cQauVyZHQWKt8hiiKo4= diff --git a/hack/bundle-cache-data.sh b/hack/bundle-cache-data.sh deleted file mode 100755 index 330c7544c..000000000 --- a/hack/bundle-cache-data.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -# extract select data from bundles: -# -env vars from all service operators -set -ex - -function extract_csv { - local IN_DIR=$1 - local OUT_DIR=$2 - - for X in $(file ${IN_DIR}/* | grep gzip | cut -f 1 -d ':'); do - # NOTE(gibi): There might be multiple gzip in the bundle and - # not all of them hand csv file in it. If none of them has - # the csv then the build will fail at the csv-merger call - tar xvf $X -C ${OUT_DIR} --wildcards --no-anchor '**/*clusterserviceversion.yaml' || true - done -} - -OUT_BUNDLE=bundle_extra_data -EXTRACT_DIR=tmp/bundle_extract - -mkdir -p "$EXTRACT_DIR" -mkdir -p "$EXTRACT_DIR/csvs" -mkdir -p "$OUT_BUNDLE" - -for BUNDLE in $(hack/pin-bundle-images.sh | tr "," " "); do - skopeo copy "docker://$BUNDLE" dir:${EXTRACT_DIR}/tmp; - extract_csv "${EXTRACT_DIR}/tmp" "${EXTRACT_DIR}/csvs" -done - -# Extract the ENV vars from all the CSVs -CSV_DIR="${EXTRACT_DIR}/csvs/manifests" -bin/csv-merger \ - --export-env-file=$OUT_BUNDLE/env-vars.yaml \ - --mariadb-csv=$CSV_DIR/mariadb-operator.clusterserviceversion.yaml \ - --infra-csv=$CSV_DIR/infra-operator.clusterserviceversion.yaml \ - --keystone-csv=$CSV_DIR/keystone-operator.clusterserviceversion.yaml \ - --placement-csv=$CSV_DIR/placement-operator.clusterserviceversion.yaml \ - --ovn-csv=$CSV_DIR/ovn-operator.clusterserviceversion.yaml \ - --neutron-csv=$CSV_DIR/neutron-operator.clusterserviceversion.yaml \ - --ansibleee-csv=$CSV_DIR/openstack-ansibleee-operator.clusterserviceversion.yaml \ - --nova-csv=$CSV_DIR/nova-operator.clusterserviceversion.yaml \ - --heat-csv=$CSV_DIR/heat-operator.clusterserviceversion.yaml \ - --ironic-csv=$CSV_DIR/ironic-operator.clusterserviceversion.yaml \ - --baremetal-csv=$CSV_DIR/openstack-baremetal-operator.clusterserviceversion.yaml \ - --horizon-csv=$CSV_DIR/horizon-operator.clusterserviceversion.yaml \ - --telemetry-csv=$CSV_DIR/telemetry-operator.clusterserviceversion.yaml \ - --glance-csv=$CSV_DIR/glance-operator.clusterserviceversion.yaml \ - --cinder-csv=$CSV_DIR/cinder-operator.clusterserviceversion.yaml \ - --manila-csv=$CSV_DIR/manila-operator.clusterserviceversion.yaml \ - --swift-csv=$CSV_DIR/swift-operator.clusterserviceversion.yaml \ - --octavia-csv=$CSV_DIR/octavia-operator.clusterserviceversion.yaml \ - --designate-csv=$CSV_DIR/designate-operator.clusterserviceversion.yaml \ - --barbican-csv=$CSV_DIR/barbican-operator.clusterserviceversion.yaml \ - --test-csv=$CSV_DIR/test-operator.clusterserviceversion.yaml \ - --base-csv=config/manifests/bases/openstack-operator.clusterserviceversion.yaml | tee "$EXTRACT_DIR/out.yaml" - -# cleanup our temporary dir used for extraction -rm -Rf "$EXTRACT_DIR" - -# we only keep manifests from extracted (merged) bundles -rm -Rf "$OUT_BUNDLE/metadata" -rm -Rf "$OUT_BUNDLE/tests" diff --git a/hack/export_related_images.sh b/hack/export_related_images.sh index d83a5ac02..c9d32f2cc 100755 --- a/hack/export_related_images.sh +++ b/hack/export_related_images.sh @@ -6,7 +6,6 @@ export RELATED_IMAGE_RABBITMQ_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos 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_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 diff --git a/pkg/openstack/octavia.go b/pkg/openstack/octavia.go index 3f028ff97..8f9fa176d 100644 --- a/pkg/openstack/octavia.go +++ b/pkg/openstack/octavia.go @@ -56,8 +56,7 @@ func ReconcileOctavia(ctx context.Context, instance *corev1beta1.OpenStackContro instance.Status.ContainerImages.OctaviaWorkerImage = nil instance.Status.ContainerImages.OctaviaHealthmanagerImage = nil instance.Status.ContainerImages.OctaviaHousekeepingImage = nil - //FIXME: (dprince) Octavia should have its own parameter for the apache image (it can share the same image in OpenStackVersion though) - instance.Status.ContainerImages.ApacheImage = nil + instance.Status.ContainerImages.OctaviaApacheImage = nil return ctrl.Result{}, nil } @@ -174,7 +173,7 @@ func ReconcileOctavia(ctx context.Context, instance *corev1beta1.OpenStackContro octavia.Spec.OctaviaWorker.ContainerImage = *version.Status.ContainerImages.OctaviaWorkerImage octavia.Spec.OctaviaHealthManager.ContainerImage = *version.Status.ContainerImages.OctaviaHealthmanagerImage octavia.Spec.OctaviaHousekeeping.ContainerImage = *version.Status.ContainerImages.OctaviaHousekeepingImage - octavia.Spec.ApacheContainerImage = *version.Status.ContainerImages.ApacheImage + octavia.Spec.ApacheContainerImage = *version.Status.ContainerImages.OctaviaApacheImage if octavia.Spec.Secret == "" { octavia.Spec.Secret = instance.Spec.Secret @@ -205,7 +204,7 @@ func ReconcileOctavia(ctx context.Context, instance *corev1beta1.OpenStackContro instance.Status.ContainerImages.OctaviaWorkerImage = version.Status.ContainerImages.OctaviaWorkerImage instance.Status.ContainerImages.OctaviaHealthmanagerImage = version.Status.ContainerImages.OctaviaHealthmanagerImage instance.Status.ContainerImages.OctaviaHousekeepingImage = version.Status.ContainerImages.OctaviaHousekeepingImage - instance.Status.ContainerImages.ApacheImage = version.Status.ContainerImages.ApacheImage + instance.Status.ContainerImages.OctaviaApacheImage = version.Status.ContainerImages.ApacheImage instance.Status.Conditions.MarkTrue(corev1beta1.OpenStackControlPlaneOctaviaReadyCondition, corev1beta1.OpenStackControlPlaneOctaviaReadyMessage) } else { instance.Status.Conditions.Set(condition.FalseCondition( @@ -226,7 +225,7 @@ func OctaviaImageMatch(controlPlane *corev1beta1.OpenStackControlPlane, version !stringPointersEqual(controlPlane.Status.ContainerImages.OctaviaWorkerImage, version.Status.ContainerImages.OctaviaWorkerImage) || !stringPointersEqual(controlPlane.Status.ContainerImages.OctaviaHealthmanagerImage, version.Status.ContainerImages.OctaviaHealthmanagerImage) || !stringPointersEqual(controlPlane.Status.ContainerImages.OctaviaHousekeepingImage, version.Status.ContainerImages.OctaviaHousekeepingImage) || - !stringPointersEqual(controlPlane.Status.ContainerImages.ApacheImage, version.Status.ContainerImages.ApacheImage) { + !stringPointersEqual(controlPlane.Status.ContainerImages.OctaviaApacheImage, version.Status.ContainerImages.ApacheImage) { return false } } diff --git a/pkg/openstack/telemetry.go b/pkg/openstack/telemetry.go index 2f283f3ff..3fb1eab4e 100644 --- a/pkg/openstack/telemetry.go +++ b/pkg/openstack/telemetry.go @@ -46,7 +46,7 @@ func ReconcileTelemetry(ctx context.Context, instance *corev1beta1.OpenStackCont instance.Status.ContainerImages.CeilometerIpmiImage = nil instance.Status.ContainerImages.CeilometerNotificationImage = nil instance.Status.ContainerImages.CeilometerSgcoreImage = nil - instance.Status.ContainerImages.ApacheImage = nil + instance.Status.ContainerImages.CeilometerProxyImage = nil instance.Status.ContainerImages.AodhAPIImage = nil instance.Status.ContainerImages.AodhEvaluatorImage = nil instance.Status.ContainerImages.AodhNotifierImage = nil @@ -250,7 +250,7 @@ func ReconcileTelemetry(ctx context.Context, instance *corev1beta1.OpenStackCont telemetry.Spec.Ceilometer.IpmiImage = *version.Status.ContainerImages.CeilometerIpmiImage telemetry.Spec.Ceilometer.NotificationImage = *version.Status.ContainerImages.CeilometerNotificationImage telemetry.Spec.Ceilometer.SgCoreImage = *version.Status.ContainerImages.CeilometerSgcoreImage - telemetry.Spec.Ceilometer.ProxyImage = *version.Status.ContainerImages.ApacheImage + telemetry.Spec.Ceilometer.ProxyImage = *version.Status.ContainerImages.CeilometerProxyImage telemetry.Spec.Autoscaling.AutoscalingSpec.Aodh.APIImage = *version.Status.ContainerImages.AodhAPIImage telemetry.Spec.Autoscaling.AutoscalingSpec.Aodh.EvaluatorImage = *version.Status.ContainerImages.AodhEvaluatorImage telemetry.Spec.Autoscaling.AutoscalingSpec.Aodh.NotifierImage = *version.Status.ContainerImages.AodhNotifierImage @@ -297,7 +297,7 @@ func ReconcileTelemetry(ctx context.Context, instance *corev1beta1.OpenStackCont instance.Status.ContainerImages.CeilometerIpmiImage = version.Status.ContainerImages.CeilometerIpmiImage instance.Status.ContainerImages.CeilometerNotificationImage = version.Status.ContainerImages.CeilometerNotificationImage instance.Status.ContainerImages.CeilometerSgcoreImage = version.Status.ContainerImages.CeilometerSgcoreImage - instance.Status.ContainerImages.ApacheImage = version.Status.ContainerImages.ApacheImage + instance.Status.ContainerImages.CeilometerProxyImage = version.Status.ContainerImages.CeilometerProxyImage instance.Status.ContainerImages.AodhAPIImage = version.Status.ContainerImages.AodhAPIImage instance.Status.ContainerImages.AodhEvaluatorImage = version.Status.ContainerImages.AodhEvaluatorImage instance.Status.ContainerImages.AodhNotifierImage = version.Status.ContainerImages.AodhNotifierImage @@ -323,7 +323,7 @@ func TelemetryImageMatch(controlPlane *corev1beta1.OpenStackControlPlane, versio !stringPointersEqual(controlPlane.Status.ContainerImages.CeilometerIpmiImage, version.Status.ContainerImages.CeilometerIpmiImage) || !stringPointersEqual(controlPlane.Status.ContainerImages.CeilometerNotificationImage, version.Status.ContainerImages.CeilometerNotificationImage) || !stringPointersEqual(controlPlane.Status.ContainerImages.CeilometerSgcoreImage, version.Status.ContainerImages.CeilometerSgcoreImage) || - !stringPointersEqual(controlPlane.Status.ContainerImages.ApacheImage, version.Status.ContainerImages.ApacheImage) || + !stringPointersEqual(controlPlane.Status.ContainerImages.CeilometerProxyImage, version.Status.ContainerImages.CeilometerProxyImage) || !stringPointersEqual(controlPlane.Status.ContainerImages.AodhAPIImage, version.Status.ContainerImages.AodhAPIImage) || !stringPointersEqual(controlPlane.Status.ContainerImages.AodhEvaluatorImage, version.Status.ContainerImages.AodhEvaluatorImage) || !stringPointersEqual(controlPlane.Status.ContainerImages.AodhNotifierImage, version.Status.ContainerImages.AodhNotifierImage) || diff --git a/pkg/openstack/version.go b/pkg/openstack/version.go index 3821eebfa..5b7c29b66 100644 --- a/pkg/openstack/version.go +++ b/pkg/openstack/version.go @@ -55,6 +55,11 @@ func InitializeOpenStackVersionImageDefaults(ctx context.Context, envImages map[ if envImages["RELATED_IMAGE_MANILA_SHARE_IMAGE_URL_DEFAULT"] != nil { defaults.ManilaShareImage = envImages["RELATED_IMAGE_MANILA_SHARE_IMAGE_URL_DEFAULT"] } + // this is shared with the infra-operator (for dnsmasq), avoiding two RELATED_IMAGES + // with the same value fixes bundle validation warnings + if envImages["RELATED_IMAGE_NEUTRON_API_IMAGE_URL_DEFAULT"] != nil { + defaults.InfraDnsmasqImage = envImages["RELATED_IMAGE_NEUTRON_API_IMAGE_URL_DEFAULT"] + } Log.Info("Initialize OpenStackVersion return defaults") return defaults @@ -73,8 +78,10 @@ func getImg(val1 *string, val2 *string) *string { func GetContainerImages(defaults *corev1beta1.ContainerDefaults, instance corev1beta1.OpenStackVersion) corev1beta1.ContainerImages { containerImages := corev1beta1.ContainerImages{ - CinderVolumeImages: instance.Spec.CustomContainerImages.CinderVolumeImages, - ManilaShareImages: instance.Spec.CustomContainerImages.ManilaShareImages, + CinderVolumeImages: instance.Spec.CustomContainerImages.CinderVolumeImages, + ManilaShareImages: instance.Spec.CustomContainerImages.ManilaShareImages, + CeilometerProxyImage: getImg(instance.Spec.CustomContainerImages.ApacheImage, defaults.ApacheImage), + OctaviaApacheImage: getImg(instance.Spec.CustomContainerImages.ApacheImage, defaults.ApacheImage), ContainerTemplate: corev1beta1.ContainerTemplate{ AgentImage: getImg(instance.Spec.CustomContainerImages.AgentImage, defaults.AgentImage), AnsibleeeImage: getImg(instance.Spec.CustomContainerImages.AnsibleeeImage, defaults.AnsibleeeImage), diff --git a/tests/functional/ctlplane/openstackversion_controller_test.go b/tests/functional/ctlplane/openstackversion_controller_test.go index afbf53ad2..0e5043ab8 100644 --- a/tests/functional/ctlplane/openstackversion_controller_test.go +++ b/tests/functional/ctlplane/openstackversion_controller_test.go @@ -113,6 +113,7 @@ var _ = Describe("OpenStackOperator controller", func() { g.Expect(version.Status.ContainerImages.CeilometerComputeImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.CeilometerNotificationImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.CeilometerSgcoreImage).ShouldNot(BeNil()) + g.Expect(version.Status.ContainerImages.CeilometerProxyImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.CinderAPIImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.CinderBackupImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.CinderSchedulerImage).ShouldNot(BeNil()) @@ -153,6 +154,7 @@ var _ = Describe("OpenStackOperator controller", func() { g.Expect(version.Status.ContainerImages.NovaConductorImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.NovaNovncImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.NovaSchedulerImage).ShouldNot(BeNil()) + g.Expect(version.Status.ContainerImages.OctaviaApacheImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.OctaviaAPIImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.OctaviaHealthmanagerImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.OctaviaHousekeepingImage).ShouldNot(BeNil())