From 2b8dd80f0218cfcc7a9187c448032f959e53a591 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Thu, 6 Jun 2024 14:42:36 -0400 Subject: [PATCH] Drop DataPlaneService ConfigMaps and Secrets - Drops the ConfigMaps and Secrets fields from OpenStackDataPlaneService. - Updates all services under config/services to use the OpenStackDataPlaneService.Spec.DataSources field instead. - Removes some un-needed labels from some services as they aren't needed and for brevity. - Update docs for the switch to DataSources. Depends-On: https://github.com/openstack-k8s-operators/install_yamls/pull/846 Depends-On: https://github.com/openstack-k8s-operators/ci-framework/pull/1847 Depends-On: https://github.com/openstack-k8s-operators/architecture/pull/276 Signed-off-by: James Slagle --- ...nstack.org_openstackdataplaneservices.yaml | 8 ----- .../openstackdataplaneservice_types.go | 8 ----- api/v1beta1/zz_generated.deepcopy.go | 10 ------ ...nstack.org_openstackdataplaneservices.yaml | 8 ----- ...1_openstackdataplaneservice_bootstrap.yaml | 6 ---- ...ackdataplaneservice_configure_network.yaml | 6 ---- ...ckdataplaneservice_configure_ovs_dpdk.yaml | 6 ---- ...ataplaneservice_derive_pci_devicespec.yaml | 6 ---- ...nstackdataplaneservice_download_cache.yaml | 6 ---- ...enstackdataplaneservice_install_certs.yaml | 6 ---- ...ta1_openstackdataplaneservice_libvirt.yaml | 5 +-- ...ta1_openstackdataplaneservice_logging.yaml | 5 +-- ...penstackdataplaneservice_neutron_dhcp.yaml | 5 +-- ...tackdataplaneservice_neutron_metadata.yaml | 8 +++-- ...openstackdataplaneservice_neutron_ovn.yaml | 5 +-- ...enstackdataplaneservice_neutron_sriov.yaml | 5 +-- ...1beta1_openstackdataplaneservice_nova.yaml | 8 +++-- ...v1beta1_openstackdataplaneservice_ovn.yaml | 5 +-- ...enstackdataplaneservice_ovn_bgp_agent.yaml | 5 +-- ...beta1_openstackdataplaneservice_swift.yaml | 12 ++++--- ...1_openstackdataplaneservice_telemetry.yaml | 5 +-- ...tackdataplaneservice_validate_network.yaml | 6 ---- docs/assemblies/custom_resources.adoc | 10 ------ .../proc_creating-a-custom-service.adoc | 20 ++++++----- pkg/deployment/deployment.go | 19 ----------- pkg/deployment/hashes.go | 34 ------------------- tests/functional/service_test.go | 6 ++-- .../dataplane-service-config/00-create.yaml | 11 +++--- 28 files changed, 62 insertions(+), 182 deletions(-) diff --git a/api/bases/dataplane.openstack.org_openstackdataplaneservices.yaml b/api/bases/dataplane.openstack.org_openstackdataplaneservices.yaml index b4e92bd92..32bdc7410 100644 --- a/api/bases/dataplane.openstack.org_openstackdataplaneservices.yaml +++ b/api/bases/dataplane.openstack.org_openstackdataplaneservices.yaml @@ -38,10 +38,6 @@ spec: type: string certsFrom: type: string - configMaps: - items: - type: string - type: array containerImageFields: items: type: string @@ -79,10 +75,6 @@ spec: type: string playbook: type: string - secrets: - items: - type: string - type: array tlsCert: properties: contents: diff --git a/api/v1beta1/openstackdataplaneservice_types.go b/api/v1beta1/openstackdataplaneservice_types.go index ca4b16326..d03ba7a8a 100644 --- a/api/v1beta1/openstackdataplaneservice_types.go +++ b/api/v1beta1/openstackdataplaneservice_types.go @@ -58,14 +58,6 @@ type OpenstackDataPlaneServiceCert struct { // OpenStackDataPlaneServiceSpec defines the desired state of OpenStackDataPlaneService type OpenStackDataPlaneServiceSpec struct { - // ConfigMaps list of ConfigMap names to mount as ExtraMounts for the OpenStackAnsibleEE - // +kubebuilder:validation:Optional - ConfigMaps []string `json:"configMaps,omitempty" yaml:"configMaps,omitempty"` - - // Secrets list of Secret names to mount as ExtraMounts for the OpenStackAnsibleEE - // +kubebuilder:validation:Optional - Secrets []string `json:"secrets,omitempty"` - // DataSources list of DataSource objects to mount as ExtraMounts for the // OpenStackAnsibleEE DataSources []DataSource `json:"datasources,omitempty"` diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index 7afac91ff..75767ab01 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -664,16 +664,6 @@ func (in *OpenStackDataPlaneServiceList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OpenStackDataPlaneServiceSpec) DeepCopyInto(out *OpenStackDataPlaneServiceSpec) { *out = *in - if in.ConfigMaps != nil { - in, out := &in.ConfigMaps, &out.ConfigMaps - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Secrets != nil { - in, out := &in.Secrets, &out.Secrets - *out = make([]string, len(*in)) - copy(*out, *in) - } if in.DataSources != nil { in, out := &in.DataSources, &out.DataSources *out = make([]DataSource, len(*in)) diff --git a/config/crd/bases/dataplane.openstack.org_openstackdataplaneservices.yaml b/config/crd/bases/dataplane.openstack.org_openstackdataplaneservices.yaml index b4e92bd92..32bdc7410 100644 --- a/config/crd/bases/dataplane.openstack.org_openstackdataplaneservices.yaml +++ b/config/crd/bases/dataplane.openstack.org_openstackdataplaneservices.yaml @@ -38,10 +38,6 @@ spec: type: string certsFrom: type: string - configMaps: - items: - type: string - type: array containerImageFields: items: type: string @@ -79,10 +75,6 @@ spec: type: string playbook: type: string - secrets: - items: - type: string - type: array tlsCert: properties: contents: diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_bootstrap.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_bootstrap.yaml index bfd69dd31..fc5734c04 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_bootstrap.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_bootstrap.yaml @@ -1,12 +1,6 @@ apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneService metadata: - labels: - app.kubernetes.io/name: openstackdataplaneservice - app.kubernetes.io/instance: openstackdataplaneservice-bootstrap - app.kubernetes.io/part-of: dataplane-operator - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/created-by: dataplane-operator name: bootstrap spec: playbook: osp.edpm.bootstrap diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_configure_network.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_configure_network.yaml index bb968d101..3b83b5660 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_configure_network.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_configure_network.yaml @@ -1,12 +1,6 @@ apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneService metadata: - labels: - app.kubernetes.io/name: openstackdataplaneservice - app.kubernetes.io/instance: openstackdataplaneservice-configure-network - app.kubernetes.io/part-of: dataplane-operator - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/created-by: dataplane-operator name: configure-network spec: playbook: osp.edpm.configure_network diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_configure_ovs_dpdk.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_configure_ovs_dpdk.yaml index 77988fd8d..07570f477 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_configure_ovs_dpdk.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_configure_ovs_dpdk.yaml @@ -1,12 +1,6 @@ apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneService metadata: - labels: - app.kubernetes.io/name: openstackdataplaneservice - app.kubernetes.io/instance: openstackdataplaneservice-configure-ovs-dpdk - app.kubernetes.io/part-of: dataplane-operator - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/created-by: dataplane-operator name: configure-ovs-dpdk spec: playbook: osp.edpm.configure_ovs_dpdk diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_derive_pci_devicespec.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_derive_pci_devicespec.yaml index 86e1b9ebd..9dfc80b79 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_derive_pci_devicespec.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_derive_pci_devicespec.yaml @@ -1,12 +1,6 @@ apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneService metadata: - labels: - app.kubernetes.io/name: openstackdataplaneservice - app.kubernetes.io/instance: openstackdataplaneservice-derive-pci-devicespec - app.kubernetes.io/part-of: dataplane-operator - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/created-by: dataplane-operator name: derive-pci-devicespec spec: playbook: osp.edpm.sriov_derive_device_spec diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_download_cache.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_download_cache.yaml index c480703b9..a9d429c80 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_download_cache.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_download_cache.yaml @@ -1,12 +1,6 @@ apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneService metadata: - labels: - app.kubernetes.io/name: openstackdataplaneservice - app.kubernetes.io/instance: openstackdataplaneservice-download-cache - app.kubernetes.io/part-of: dataplane-operator - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/created-by: dataplane-operator name: download-cache spec: playbook: osp.edpm.download_cache diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_install_certs.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_install_certs.yaml index 45654d467..feeb111b7 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_install_certs.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_install_certs.yaml @@ -1,12 +1,6 @@ apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneService metadata: - labels: - app.kubernetes.io/name: openstackdataplaneservice - app.kubernetes.io/instance: openstackdataplaneservice-install-certs - app.kubernetes.io/part-of: dataplane-operator - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/created-by: dataplane-operator name: install-certs spec: playbook: osp.edpm.install_certs diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_libvirt.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_libvirt.yaml index bb39d9369..65309a93a 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_libvirt.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_libvirt.yaml @@ -4,10 +4,11 @@ metadata: name: libvirt spec: playbook: osp.edpm.libvirt - secrets: + dataSources: # NOTE: this Secret needs to be created before deploying the data plane. # It should contain the libvirt sasl auth password using the key LibvirtPassword - - libvirt-secret + - secretRef: + name: libvirt-secret tlsCert: contents: - dnsnames diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_logging.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_logging.yaml index 2d5a5dac6..449eeeed2 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_logging.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_logging.yaml @@ -3,6 +3,7 @@ kind: OpenStackDataPlaneService metadata: name: logging spec: - secrets: - - logging-compute-config-data + dataSources: + - secretRef: + name: logging-compute-config-data playbook: osp.edpm.telemetry_logging diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_dhcp.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_dhcp.yaml index c12bf69a8..52a171ff4 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_dhcp.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_dhcp.yaml @@ -4,8 +4,9 @@ metadata: name: neutron-dhcp spec: playbook: osp.edpm.neutron_dhcp - secrets: - - neutron-dhcp-agent-neutron-config + dataSources: + - secretRef: + name: neutron-dhcp-agent-neutron-config caCerts: combined-ca-bundle containerImageFields: - EdpmNeutronDhcpAgentImage diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_metadata.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_metadata.yaml index 662f03b35..b415d8137 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_metadata.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_metadata.yaml @@ -4,9 +4,11 @@ metadata: name: neutron-metadata spec: playbook: osp.edpm.neutron_metadata - secrets: - - neutron-ovn-metadata-agent-neutron-config - - nova-metadata-neutron-config + dataSources: + - secretRef: + name: neutron-ovn-metadata-agent-neutron-config + - secretRef: + name: nova-metadata-neutron-config tlsCert: contents: - dnsnames diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_ovn.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_ovn.yaml index f6566862a..353732eb6 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_ovn.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_ovn.yaml @@ -4,8 +4,9 @@ metadata: name: neutron-ovn spec: playbook: osp.edpm.neutron_ovn - secrets: - - neutron-ovn-agent-neutron-config + dataSources: + - secretRef: + name: neutron-ovn-agent-neutron-config tlsCert: contents: - dnsnames diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_sriov.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_sriov.yaml index 89fc2f036..12980afb3 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_sriov.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_neutron_sriov.yaml @@ -4,8 +4,9 @@ metadata: name: neutron-sriov spec: playbook: osp.edpm.neutron_sriov - secrets: - - neutron-sriov-agent-neutron-config + dataSources: + - secretRef: + name: neutron-sriov-agent-neutron-config caCerts: combined-ca-bundle containerImageFields: - EdpmNeutronSriovAgentImage diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_nova.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_nova.yaml index 257fa5833..b1c287be7 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_nova.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_nova.yaml @@ -3,12 +3,14 @@ kind: OpenStackDataPlaneService metadata: name: nova spec: - secrets: - - nova-cell1-compute-config + dataSources: + - secretRef: + name: nova-cell1-compute-config # NOTE: this Secret needs to be created before deploying the data plane. # It should contain an ssh key-pair in the secret fields: ssh-privatekey # and ssh-publickey - - nova-migration-ssh-key + - secretRef: + name: nova-migration-ssh-key playbook: osp.edpm.nova caCerts: combined-ca-bundle containerImageFields: diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_ovn.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_ovn.yaml index 1816a3852..06e0d25e7 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_ovn.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_ovn.yaml @@ -4,8 +4,9 @@ metadata: name: ovn spec: playbook: osp.edpm.ovn - configMaps: - - ovncontroller-config + dataSources: + - configMapRef: + name: ovncontroller-config tlsCert: contents: - dnsnames diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_ovn_bgp_agent.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_ovn_bgp_agent.yaml index e8024b106..0ae87fd78 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_ovn_bgp_agent.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_ovn_bgp_agent.yaml @@ -4,8 +4,9 @@ metadata: name: ovn-bgp-agent spec: playbook: osp.edpm.ovn_bgp_agent - secrets: - - neutron-ovn-agent-neutron-config + dataSources: + - secretRef: + name: neutron-ovn-agent-neutron-config tlsCert: contents: - dnsnames diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_swift.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_swift.yaml index c8ebf2448..04d7ac02b 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_swift.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_swift.yaml @@ -4,8 +4,10 @@ metadata: name: swift spec: playbook: osp.edpm.swift - secrets: - - swift-conf - configMaps: - - swift-storage-config-data - - swift-ring-files + dataSources: + - secretRef: + name: swift-conf + - configMapRef: + name: swift-storage-config-data + - configMapRef: + name: swift-ring-files diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_telemetry.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_telemetry.yaml index f43e4ec87..c6cd8c4de 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_telemetry.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_telemetry.yaml @@ -3,8 +3,9 @@ kind: OpenStackDataPlaneService metadata: name: telemetry spec: - secrets: - - ceilometer-compute-config-data + dataSources: + - secretRef: + name: ceilometer-compute-config-data playbook: osp.edpm.telemetry tlsCert: contents: diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_validate_network.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_validate_network.yaml index 723d59f55..66ae6cc9a 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_validate_network.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_validate_network.yaml @@ -1,12 +1,6 @@ apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneService metadata: - labels: - app.kubernetes.io/name: openstackdataplaneservice - app.kubernetes.io/instance: openstackdataplaneservice-validate-network - app.kubernetes.io/part-of: dataplane-operator - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/created-by: dataplane-operator name: validate-network spec: playbook: osp.edpm.validate_network diff --git a/docs/assemblies/custom_resources.adoc b/docs/assemblies/custom_resources.adoc index 644440edc..935e43c4b 100644 --- a/docs/assemblies/custom_resources.adoc +++ b/docs/assemblies/custom_resources.adoc @@ -299,16 +299,6 @@ OpenStackDataPlaneServiceSpec defines the desired state of OpenStackDataPlaneSer |=== | Field | Description | Scheme | Required -| configMaps -| ConfigMaps list of ConfigMap names to mount as ExtraMounts for the OpenStackAnsibleEE -| []string -| false - -| secrets -| Secrets list of Secret names to mount as ExtraMounts for the OpenStackAnsibleEE -| []string -| false - | datasources | DataSources list of DataSource objects to mount as ExtraMounts for the OpenStackAnsibleEE | []<> diff --git a/docs/assemblies/proc_creating-a-custom-service.adoc b/docs/assemblies/proc_creating-a-custom-service.adoc index f00f1bb50..21421812f 100644 --- a/docs/assemblies/proc_creating-a-custom-service.adoc +++ b/docs/assemblies/proc_creating-a-custom-service.adoc @@ -68,7 +68,7 @@ spec: . Optional: Designate and configure a node set for a Compute feature or workload. For more information, see xref:proc_configuring-a-node-set-for-a-Compute-feature-or-workload_dataplane[Configuring a node set for a Compute feature or workload]. -. Optional: Specify `Secret` resources to use to pass secrets into the `OpenStackAnsibleEE` job. Secrets are specified with a `name` and `required` field. When `required` is false, the service deployment will not fail if the secret doesn't exist. +. Optional: Specify <> resources to use to pass `ConfigMaps` or `Secrets` into the `OpenStackAnsibleEE` job. When the `optional` field is true on a <> `configMapRef` or `secretRef`, the resource is optional, and an error won't occur when it doesn't exist. + ---- apiVersion: dataplane.openstack.org/v1beta1 @@ -79,14 +79,18 @@ spec: ... play: | ... - secrets: - - name: hello-world-secret-0 - required: true - - name: hello-world-secret-1 - required: false + dataSources: + - configMapRef: + name: hello-world-cm-0 + - secretRef: + name: hello-world-secret-0 + - secretRef: + name: hello-world-secret-1 + # This secret is optional, it does not need to exist. + optional: true ---- + -A mount is created for each `secret` in the `OpenStackAnsibleEE` pod with a filename that matches the `secret` value. The mounts are created under `/var/lib/openstack/configs/`. +A mount is created for each `ConfigMap` and `Secret` in the `OpenStackAnsibleEE` pod with a filename that matches the resource value. The mounts are created under `/var/lib/openstack/configs/`. . Optional: It may be necessary to run some services on all nodesets at the same time. These services need to have their `deployOnAllNodeSets` field set to true. + @@ -108,7 +112,7 @@ spec: deployOnAllNodeSets: true ---- -. Optional: Specify the `edpmServiceType` field for the service. Different custom services may use the same ansible content to manage the same EDPM service (such as `ovn` or `nova`). The `ConfigMaps`, `Secrets`, TLS certificates, and CA certificates need to be mounted at the same locations so they can be found by the ansible content even when using a custom service. `edpmServiceType` is used to create this association. The value is the name of the default service that uses the same ansible content as the custom service. +. Optional: Specify the `edpmServiceType` field for the service. Different custom services may use the same ansible content to manage the same EDPM service (such as `ovn` or `nova`). The `DataSources`, TLS certificates, and CA certificates need to be mounted at the same locations so they can be found by the ansible content even when using a custom service. `edpmServiceType` is used to create this association. The value is the name of the default service that uses the same ansible content as the custom service. + For example, a custom service that uses the `edpm_ovn` ansible content from `edpm-ansible` would set `edpmServiceType` to `ovn`, which matches the default `ovn` service name provided by `dataplane-operator`. + diff --git a/pkg/deployment/deployment.go b/pkg/deployment/deployment.go index 00ce97a1f..7c20ab97e 100644 --- a/pkg/deployment/deployment.go +++ b/pkg/deployment/deployment.go @@ -359,7 +359,6 @@ func (d *Deployer) addCertMounts( func (d *Deployer) addServiceExtraMounts( service dataplanev1.OpenStackDataPlaneService, ) (*dataplanev1.AnsibleEESpec, error) { - client := d.Helper.GetClient() baseMountPath := path.Join(ConfigPaths, service.Name) var configMaps []*v1.ConfigMap @@ -379,24 +378,6 @@ func (d *Deployer) addServiceExtraMounts( } } - for _, cmName := range service.Spec.ConfigMaps { - cm := &corev1.ConfigMap{} - err := client.Get(d.Ctx, types.NamespacedName{Name: cmName, Namespace: service.Namespace}, cm) - if err != nil { - return d.AeeSpec, err - } - configMaps = append(configMaps, cm) - } - - for _, secretName := range service.Spec.Secrets { - sec := &corev1.Secret{} - err := client.Get(d.Ctx, types.NamespacedName{Name: secretName, Namespace: service.Namespace}, sec) - if err != nil { - return d.AeeSpec, err - } - secrets = append(secrets, sec) - } - for _, cm := range configMaps { volMounts := storage.VolMounts{} diff --git a/pkg/deployment/hashes.go b/pkg/deployment/hashes.go index ac514b1ef..005d9aa90 100644 --- a/pkg/deployment/hashes.go +++ b/pkg/deployment/hashes.go @@ -70,40 +70,6 @@ func GetDeploymentHashesForService( } } - for _, cmName := range service.Spec.ConfigMaps { - namespacedName := types.NamespacedName{ - Name: cmName, - Namespace: namespace, - } - cm := &corev1.ConfigMap{} - err := helper.GetClient().Get(context.Background(), namespacedName, cm) - if err != nil { - helper.GetLogger().Error(err, "Unable to retrieve ConfigMap %v") - return err - } - configMapHashes[cmName], err = configmap.Hash(cm) - if err != nil { - helper.GetLogger().Error(err, "Unable to hash ConfigMap %v") - } - - } - for _, secretName := range service.Spec.Secrets { - namespacedName := types.NamespacedName{ - Name: secretName, - Namespace: namespace, - } - sec := &corev1.Secret{} - err := helper.GetClient().Get(ctx, namespacedName, sec) - if err != nil { - helper.GetLogger().Error(err, "Unable to retrieve Secret %v") - return err - } - secretHashes[secretName], err = secret.Hash(sec) - if err != nil { - helper.GetLogger().Error(err, "Unable to hash Secret %v") - } - } - if service.Spec.TLSCert != nil { var secrets *corev1.SecretList for _, nodeSet := range nodeSets.Items { diff --git a/tests/functional/service_test.go b/tests/functional/service_test.go index c1d5d9b2a..1a622486e 100644 --- a/tests/functional/service_test.go +++ b/tests/functional/service_test.go @@ -41,9 +41,8 @@ var _ = Describe("OpenstackDataplaneService Test", func() { It("spec fields are set up", func() { service := GetService(dataplaneServiceName) - Expect(service.Spec.Secrets).To(BeEmpty()) + Expect(service.Spec.DataSources).To(BeEmpty()) Expect(service.Spec.Playbook).To(BeEmpty()) - Expect(service.Spec.ConfigMaps).To(BeEmpty()) Expect(service.Spec.DeployOnAllNodeSets).To(BeFalse()) }) }) @@ -57,9 +56,8 @@ var _ = Describe("OpenstackDataplaneService Test", func() { It("spec fields are set up", func() { service := GetService(dataplaneServiceName) - Expect(service.Spec.Secrets).To(BeEmpty()) + Expect(service.Spec.DataSources).To(BeEmpty()) Expect(service.Spec.Playbook).To(BeEmpty()) - Expect(service.Spec.ConfigMaps).To(BeEmpty()) Expect(service.Spec.DeployOnAllNodeSets).To(BeTrue()) }) }) diff --git a/tests/kuttl/tests/dataplane-service-config/00-create.yaml b/tests/kuttl/tests/dataplane-service-config/00-create.yaml index 4ddea13d4..f7415ad67 100644 --- a/tests/kuttl/tests/dataplane-service-config/00-create.yaml +++ b/tests/kuttl/tests/dataplane-service-config/00-create.yaml @@ -47,10 +47,13 @@ spec: - name: Sleep command: sleep infinity delegate_to: localhost - configMaps: - - kuttl-service-cm-0 - - kuttl-service-cm-1 - - kuttl-service-cm-2 + dataSources: + - configMapRef: + name: kuttl-service-cm-0 + - configMapRef: + name: kuttl-service-cm-1 + - configMapRef: + name: kuttl-service-cm-2 --- apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneNodeSet