Skip to content

Commit e733f6a

Browse files
Merge pull request #1806 from Deydra71/fix/appcred-isready-nil-guard
Add Conditions nil check before IsReady() calls
2 parents 3c0eba8 + 166f9c1 commit e733f6a

14 files changed

Lines changed: 14 additions & 14 deletions

File tree

internal/openstack/barbican.go

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

6767
// Application Credential Management (Day-2 operation)
68-
barbicanReady := barbican.Status.ObservedGeneration == barbican.Generation && barbican.IsReady()
68+
barbicanReady := barbican.Status.Conditions != nil && barbican.Status.ObservedGeneration == barbican.Generation && barbican.IsReady()
6969

7070
// Apply same fallback logic as in CreateOrPatch to avoid passing empty values to AC
7171
barbicanSecret := instance.Spec.Barbican.Template.Secret

internal/openstack/cinder.go

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

9090
// Application Credential Management (Day-2 operation)
91-
cinderReady := cinder.Status.ObservedGeneration == cinder.Generation && cinder.IsReady()
91+
cinderReady := cinder.Status.Conditions != nil && cinder.Status.ObservedGeneration == cinder.Generation && cinder.IsReady()
9292

9393
// Apply same fallback logic as in CreateOrPatch to avoid passing empty values to AC
9494
cinderSecret := instance.Spec.Cinder.Template.Secret

internal/openstack/designate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func ReconcileDesignate(ctx context.Context, instance *corev1beta1.OpenStackCont
7777
}
7878

7979
// Application Credential Management (Day-2 operation)
80-
designateReady := designate.Status.ObservedGeneration == designate.Generation && designate.IsReady()
80+
designateReady := designate.Status.Conditions != nil && designate.Status.ObservedGeneration == designate.Generation && designate.IsReady()
8181

8282
// Apply same fallback logic as in CreateOrPatch to avoid passing empty values to AC
8383
designateSecret := instance.Spec.Designate.Template.Secret

internal/openstack/glance.go

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

112112
// Application Credential Management (Day-2 operation)
113113
// Check if AC should be enabled and manage it accordingly
114-
glanceReady := glance.Status.ObservedGeneration == glance.Generation && glance.IsReady()
114+
glanceReady := glance.Status.Conditions != nil && glance.Status.ObservedGeneration == glance.Generation && glance.IsReady()
115115

116116
// Apply same fallback logic as in CreateOrPatch to avoid passing empty values to AC
117117
glanceSecret := instance.Spec.Glance.Template.Secret

internal/openstack/heat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func ReconcileHeat(ctx context.Context, instance *corev1beta1.OpenStackControlPl
112112
instance.Spec.Heat.Template.HeatCfnAPI.TLS.CaBundleSecretName = instance.Status.TLS.CaBundleSecretName
113113

114114
// Application Credential Management (Day-2 operation)
115-
heatReady := heat.Status.ObservedGeneration == heat.Generation && heat.IsReady()
115+
heatReady := heat.Status.Conditions != nil && heat.Status.ObservedGeneration == heat.Generation && heat.IsReady()
116116

117117
// Apply same fallback logic as in CreateOrPatch to avoid passing empty values to AC
118118
heatSecret := instance.Spec.Heat.Template.Secret

internal/openstack/ironic.go

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

116116
// Application Credential Management (Day-2 operation)
117117
// Ironic has 2 users: ironic (main service) and ironic-inspector
118-
ironicReady := ironic.Status.ObservedGeneration == ironic.Generation && ironic.IsReady()
118+
ironicReady := ironic.Status.Conditions != nil && ironic.Status.ObservedGeneration == ironic.Generation && ironic.IsReady()
119119

120120
// Apply same fallback logic as in CreateOrPatch to avoid passing empty values to AC
121121
// Both ironic and ironic-inspector share the same secret

internal/openstack/manila.go

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

6969
// Application Credential Management (Day-2 operation)
70-
manilaReady := manila.Status.ObservedGeneration == manila.Generation && manila.IsReady()
70+
manilaReady := manila.Status.Conditions != nil && manila.Status.ObservedGeneration == manila.Generation && manila.IsReady()
7171

7272
// Apply same fallback logic as in CreateOrPatch to avoid passing empty values to AC
7373
manilaSecret := instance.Spec.Manila.Template.Secret

internal/openstack/neutron.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func ReconcileNeutron(ctx context.Context, instance *corev1beta1.OpenStackContro
111111
instance.Spec.Neutron.Template.TLS.CaBundleSecretName = instance.Status.TLS.CaBundleSecretName
112112

113113
// Application Credential Management (Day-2 operation)
114-
neutronReady := neutronAPI.Status.ObservedGeneration == neutronAPI.Generation && neutronAPI.IsReady()
114+
neutronReady := neutronAPI.Status.Conditions != nil && neutronAPI.Status.ObservedGeneration == neutronAPI.Generation && neutronAPI.IsReady()
115115

116116
// Apply same fallback logic as in CreateOrPatch to avoid passing empty values to AC
117117
neutronSecret := instance.Spec.Neutron.Template.Secret

internal/openstack/nova.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func ReconcileNova(ctx context.Context, instance *corev1beta1.OpenStackControlPl
183183
}
184184

185185
// Application Credential Management (Day-2 operation)
186-
novaReady := nova.Status.ObservedGeneration == nova.Generation && nova.IsReady()
186+
novaReady := nova.Status.Conditions != nil && nova.Status.ObservedGeneration == nova.Generation && nova.IsReady()
187187

188188
// Apply same fallback logic as in CreateOrPatch to avoid passing empty values to AC
189189
novaSecret := instance.Spec.Nova.Template.Secret

internal/openstack/octavia.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func ReconcileOctavia(ctx context.Context, instance *corev1beta1.OpenStackContro
159159
}
160160

161161
// Application Credential Management (Day-2 operation)
162-
octaviaReady := octavia.Status.ObservedGeneration == octavia.Generation && octavia.IsReady()
162+
octaviaReady := octavia.Status.Conditions != nil && octavia.Status.ObservedGeneration == octavia.Generation && octavia.IsReady()
163163

164164
// Apply same fallback logic as in CreateOrPatch to avoid passing empty values to AC
165165
octaviaSecret := instance.Spec.Octavia.Template.Secret

0 commit comments

Comments
 (0)