Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop DataPlaneService ConfigMaps and Secrets #852

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ spec:
type: string
certsFrom:
type: string
configMaps:
items:
type: string
type: array
containerImageFields:
items:
type: string
Expand Down Expand Up @@ -79,10 +75,6 @@ spec:
type: string
playbookContents:
type: string
secrets:
items:
type: string
type: array
tlsCerts:
additionalProperties:
properties:
Expand Down
8 changes: 0 additions & 8 deletions apis/dataplane/v1beta1/openstackdataplaneservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" yaml:"dataSources,omitempty"`
Expand Down
10 changes: 0 additions & 10 deletions apis/dataplane/v1beta1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ spec:
type: string
certsFrom:
type: string
configMaps:
items:
type: string
type: array
containerImageFields:
items:
type: string
Expand Down Expand Up @@ -79,10 +75,6 @@ spec:
type: string
playbookContents:
type: string
secrets:
items:
type: string
type: array
tlsCerts:
additionalProperties:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
tlsCerts:
default:
contents:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
tlsCerts:
default:
contents:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
tlsCerts:
default:
contents:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ metadata:
name: ovn
spec:
playbook: osp.edpm.ovn
configMaps:
- ovncontroller-config
dataSources:
- configMapRef:
name: ovncontroller-config
tlsCerts:
default:
contents:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
tlsCerts:
default:
contents:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
tlsCerts:
default:
Expand Down
10 changes: 0 additions & 10 deletions docs/assemblies/dataplane_resources.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -420,16 +420,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
| []<<datasource,DataSource>>
Expand Down
19 changes: 0 additions & 19 deletions pkg/dataplane/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,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 []*corev1.ConfigMap
Expand All @@ -388,24 +387,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{}
Expand Down
34 changes: 0 additions & 34 deletions pkg/dataplane/hashes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.TLSCerts != nil {
for certKey := range service.Spec.TLSCerts {
var secrets *corev1.SecretList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
})
})
Expand All @@ -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())
})
})
Expand Down
11 changes: 7 additions & 4 deletions tests/kuttl/tests/dataplane-service-config/00-create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading