@@ -659,6 +659,37 @@ func (r *IronicAPIReconciler) reconcileNormal(ctx context.Context, instance *iro
659659 // ConfigMap
660660 configMapVars := make (map [string ]env.Setter )
661661
662+ // Get secrets by Namespace and Label that we need to hash
663+ labelSelectorMap := map [string ]string {}
664+ lbl := labels .GetOwnerNameLabelSelector (labels .GetGroupLabel (ironic .ServiceName ))
665+ labelSelectorMap [lbl ] = ironicv1 .GetOwningIronicName (instance )
666+ secrets , err := secret .GetSecrets (ctx , helper , instance .Namespace , labelSelectorMap )
667+ if err != nil {
668+ Log .Info (fmt .Sprintf ("No secrets with label %s found" , lbl ))
669+ } else {
670+ for _ , s := range secrets .Items {
671+ hash , err := secret .Hash (& s )
672+ if err != nil {
673+ if k8s_errors .IsNotFound (err ) {
674+ Log .Info (fmt .Sprintf ("OpenStack secret %s not found" , instance .Spec .Secret ))
675+ instance .Status .Conditions .Set (condition .FalseCondition (
676+ condition .InputReadyCondition ,
677+ condition .RequestedReason ,
678+ condition .SeverityInfo ,
679+ condition .InputReadyWaitingMessage ))
680+ return ctrl.Result {RequeueAfter : time .Second * 10 }, nil
681+ }
682+ instance .Status .Conditions .Set (condition .FalseCondition (
683+ condition .InputReadyCondition ,
684+ condition .ErrorReason ,
685+ condition .SeverityWarning ,
686+ condition .InputReadyErrorMessage ,
687+ err .Error ()))
688+ return ctrl.Result {}, err
689+ }
690+ configMapVars [s .Name ] = env .SetValue (hash )
691+ }
692+ }
662693 //
663694 // check for required OpenStack secret holding passwords for service/admin user and add hash to the vars map
664695 //
0 commit comments