Skip to content

Commit 8dd831b

Browse files
committed
Cleanup not required tls.Enabled() method
With the rework of the tls struct the method is not really useful.
1 parent a83c7f7 commit 8dd831b

File tree

16 files changed

+23
-39
lines changed

16 files changed

+23
-39
lines changed

apis/core/v1beta1/openstackcontrolplane_types.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
keystonev1 "github.com/openstack-k8s-operators/keystone-operator/api/v1beta1"
3131
condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition"
3232
"github.com/openstack-k8s-operators/lib-common/modules/common/route"
33-
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
3433
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"
3534
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
3635
"github.com/openstack-k8s-operators/lib-common/modules/storage"
@@ -822,17 +821,3 @@ func SetupDefaults() {
822821

823822
SetupOpenStackControlPlaneDefaults(openstackControlPlaneDefaults)
824823
}
825-
826-
// Enabled - returns status of tls configuration for the passed in endpoint type
827-
func (t *TLSSection) Enabled(endpt service.Endpoint) bool {
828-
if t != nil {
829-
switch endpt {
830-
case service.EndpointPublic:
831-
return t.Ingress.Enabled
832-
833-
case service.EndpointInternal:
834-
return t.PodLevel.Enabled
835-
}
836-
}
837-
return false
838-
}

pkg/openstack/barbican.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func ReconcileBarbican(ctx context.Context, instance *corev1beta1.OpenStackContr
5454
}
5555

5656
// preserve any previously set TLS certs, set CA cert
57-
if instance.Spec.TLS.Enabled(service.EndpointInternal) {
57+
if instance.Spec.TLS.PodLevel.Enabled {
5858
instance.Spec.Barbican.Template.BarbicanAPI.TLS = barbican.Spec.BarbicanAPI.TLS
5959
}
6060
instance.Spec.Barbican.Template.BarbicanAPI.TLS.CaBundleSecretName = instance.Status.TLS.CaBundleSecretName

pkg/openstack/cinder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func ReconcileCinder(ctx context.Context, instance *corev1beta1.OpenStackControl
5656
}
5757

5858
// preserve any previously set TLS certs,set CA cert
59-
if instance.Spec.TLS.Enabled(service.EndpointInternal) {
59+
if instance.Spec.TLS.PodLevel.Enabled {
6060
instance.Spec.Cinder.Template.CinderAPI.TLS = cinder.Spec.CinderAPI.TLS
6161
}
6262
instance.Spec.Cinder.Template.CinderAPI.TLS.CaBundleSecretName = instance.Status.TLS.CaBundleSecretName

pkg/openstack/glance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func ReconcileGlance(ctx context.Context, instance *corev1beta1.OpenStackControl
6868
}
6969

7070
// preserve any previously set TLS certs,set CA cert
71-
if instance.Spec.TLS.Enabled(service.EndpointInternal) {
71+
if instance.Spec.TLS.PodLevel.Enabled {
7272
glanceAPI.TLS.API = glance.Spec.GlanceAPIs[name].TLS.API
7373
}
7474
glanceAPI.TLS.CaBundleSecretName = instance.Status.TLS.CaBundleSecretName

pkg/openstack/heat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func ReconcileHeat(ctx context.Context, instance *corev1beta1.OpenStackControlPl
6767
}
6868

6969
// preserve any previously set TLS certs,set CA cert
70-
if instance.Spec.TLS.Enabled(service.EndpointInternal) {
70+
if instance.Spec.TLS.PodLevel.Enabled {
7171
instance.Spec.Heat.Template.HeatAPI.TLS = heat.Spec.HeatAPI.TLS
7272
instance.Spec.Heat.Template.HeatCfnAPI.TLS = heat.Spec.HeatCfnAPI.TLS
7373
}

pkg/openstack/horizon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func ReconcileHorizon(ctx context.Context, instance *corev1beta1.OpenStackContro
5858
}
5959

6060
// preserve any previously set TLS certs, set CA cert
61-
if instance.Spec.TLS.Enabled(service.EndpointInternal) {
61+
if instance.Spec.TLS.PodLevel.Enabled {
6262
instance.Spec.Horizon.Template.TLS = horizon.Spec.TLS
6363
}
6464
instance.Spec.Horizon.Template.TLS.CaBundleSecretName = instance.Status.TLS.CaBundleSecretName

pkg/openstack/ironic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func ReconcileIronic(ctx context.Context, instance *corev1beta1.OpenStackControl
6464
}
6565

6666
// preserve any previously set TLS certs,set CA cert
67-
if instance.Spec.TLS.Enabled(service.EndpointInternal) {
67+
if instance.Spec.TLS.PodLevel.Enabled {
6868
instance.Spec.Ironic.Template.IronicAPI.TLS = ironic.Spec.IronicAPI.TLS
6969
instance.Spec.Ironic.Template.IronicInspector.TLS = ironic.Spec.IronicInspector.TLS
7070
}

pkg/openstack/keystone.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func ReconcileKeystoneAPI(ctx context.Context, instance *corev1beta1.OpenStackCo
5757
}
5858

5959
// preserve any previously set TLS certs,set CA cert
60-
if instance.Spec.TLS.Enabled(service.EndpointInternal) {
60+
if instance.Spec.TLS.PodLevel.Enabled {
6161
instance.Spec.Keystone.Template.TLS = keystoneAPI.Spec.TLS
6262
}
6363
instance.Spec.Keystone.Template.TLS.CaBundleSecretName = instance.Status.TLS.CaBundleSecretName

pkg/openstack/manila.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func ReconcileManila(ctx context.Context, instance *corev1beta1.OpenStackControl
5656
}
5757

5858
// preserve any previously set TLS certs, set CA cert
59-
if instance.Spec.TLS.Enabled(service.EndpointInternal) {
59+
if instance.Spec.TLS.PodLevel.Enabled {
6060
instance.Spec.Manila.Template.ManilaAPI.TLS = manila.Spec.ManilaAPI.TLS
6161
}
6262
instance.Spec.Manila.Template.ManilaAPI.TLS.CaBundleSecretName = instance.Status.TLS.CaBundleSecretName

pkg/openstack/memcached.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func reconcileMemcached(
158158
Log.Info("Reconciling Memcached", "Memcached.Namespace", instance.Namespace, "Memcached.Name", name)
159159

160160
tlsCert := ""
161-
if instance.Spec.TLS.Enabled(service.EndpointInternal) {
161+
if instance.Spec.TLS.PodLevel.Enabled {
162162
certRequest := certmanager.CertificateRequest{
163163
IssuerName: tls.DefaultCAPrefix + string(service.EndpointInternal),
164164
CertName: fmt.Sprintf("%s-svc", memcached.Name),

0 commit comments

Comments
 (0)