Skip to content

Commit

Permalink
Continue PR145 - Fix Keystone Listener and Worker
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauricio Harley authored and abays committed Sep 27, 2024
1 parent f136e40 commit 01bbb9f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 44 deletions.
22 changes: 0 additions & 22 deletions controllers/barbicankeystonelistener_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,26 +182,7 @@ func (r *BarbicanKeystoneListenerReconciler) getSecret(
envVars *map[string]env.Setter,
) (ctrl.Result, error) {
Log := r.GetLogger(ctx)
//secret, hash, err := secret.GetSecret(ctx, h, secretName, instance.Namespace)
hash, result, err := secret.VerifySecret(ctx, types.NamespacedName{Name: secretName, Namespace: instance.Namespace}, expectedFields, h.GetClient(), time.Second*10)
/*if err != nil {
if k8s_errors.IsNotFound(err) {
h.GetLogger().Info(fmt.Sprintf("secret %s not found", secretName))
instance.Status.Conditions.Set(condition.FalseCondition(
condition.InputReadyCondition,
condition.RequestedReason,
condition.SeverityInfo,
condition.InputReadyWaitingMessage))
return ctrl.Result{RequeueAfter: time.Duration(10) * time.Second}, nil
}
instance.Status.Conditions.Set(condition.FalseCondition(
condition.InputReadyCondition,
condition.ErrorReason,
condition.SeverityWarning,
condition.InputReadyErrorMessage,
err.Error()))
return ctrl.Result{}, err
}*/
if err != nil {
instance.Status.Conditions.Set(condition.FalseCondition(
condition.InputReadyCondition,
Expand Down Expand Up @@ -389,9 +370,7 @@ func (r *BarbicanKeystoneListenerReconciler) reconcileNormal(ctx context.Context
//
// check for required OpenStack secret holding passwords for service/admin user and add hash to the vars map
//
// Log.Info(fmt.Sprintf("[KeystoneListener] Get secret 1 '%s'", instance.Name))
Log.Info(fmt.Sprintf("[KeystoneListener] Get secret 1 '%s'", instance.Spec.Secret))
// ctrlResult, err := r.getSecret(ctx, helper, instance, instance.Spec.Secret, &configVars)
ctrlResult, err := r.getSecret(ctx, helper, instance, instance.Spec.Secret, []string{instance.Spec.PasswordSelectors.Service}, &configVars)
if err != nil {
return ctrlResult, err
Expand All @@ -401,7 +380,6 @@ func (r *BarbicanKeystoneListenerReconciler) reconcileNormal(ctx context.Context
// check for required TransportURL secret holding transport URL string
//
Log.Info(fmt.Sprintf("[KeystoneListener] Get secret 2 '%s'", instance.Spec.TransportURLSecret))
// ctrlResult, err = r.getSecret(ctx, helper, instance, instance.Spec.TransportURLSecret, &configVars)
ctrlResult, err = r.getSecret(ctx, helper, instance, instance.Spec.TransportURLSecret, []string{TransportURL}, &configVars)
if err != nil {
return ctrlResult, err
Expand Down
22 changes: 0 additions & 22 deletions controllers/barbicanworker_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,25 +171,6 @@ func (r *BarbicanWorkerReconciler) getSecret(
envVars *map[string]env.Setter,
) (ctrl.Result, error) {
Log := r.GetLogger(ctx)
/* secret, hash, err := secret.GetSecret(ctx, h, secretName, instance.Namespace)
if err != nil {
if k8s_errors.IsNotFound(err) {
h.GetLogger().Info(fmt.Sprintf("secret %s not found", secretName))
instance.Status.Conditions.Set(condition.FalseCondition(
condition.InputReadyCondition,
condition.RequestedReason,
condition.SeverityInfo,
condition.InputReadyWaitingMessage))
return ctrl.Result{RequeueAfter: time.Duration(10) * time.Second}, nil
}
instance.Status.Conditions.Set(condition.FalseCondition(
condition.InputReadyCondition,
condition.ErrorReason,
condition.SeverityWarning,
condition.InputReadyErrorMessage,
err.Error()))
return ctrl.Result{}, err
}*/
hash, result, err := secret.VerifySecret(ctx, types.NamespacedName{Name: secretName, Namespace: instance.Namespace}, expectedFields, h.GetClient(), time.Second*10)
if err != nil {
instance.Status.Conditions.Set(condition.FalseCondition(
Expand Down Expand Up @@ -351,8 +332,6 @@ func (r *BarbicanWorkerReconciler) reconcileNormal(ctx context.Context, instance
//
// check for required OpenStack secret holding passwords for service/admin user and add hash to the vars map
//
/*Log.Info(fmt.Sprintf("[Worker] Get secret 1 '%s'", instance.Name))
ctrlResult, err := r.getSecret(ctx, helper, instance, instance.Spec.Secret, &configVars)*/
Log.Info(fmt.Sprintf("[API] Get secret 1 '%s'", instance.Spec.Secret))
ctrlResult, err := r.getSecret(ctx, helper, instance, instance.Spec.Secret, []string{instance.Spec.PasswordSelectors.Service}, &configVars)
if err != nil {
Expand All @@ -363,7 +342,6 @@ func (r *BarbicanWorkerReconciler) reconcileNormal(ctx context.Context, instance
// check for required TransportURL secret holding transport URL string
//
Log.Info(fmt.Sprintf("[Worker] Get secret 2 '%s'", instance.Spec.TransportURLSecret))
// ctrlResult, err = r.getSecret(ctx, helper, instance, instance.Spec.TransportURLSecret, &configVars)
ctrlResult, err = r.getSecret(ctx, helper, instance, instance.Spec.TransportURLSecret, []string{TransportURL}, &configVars)
if err != nil {
return ctrlResult, err
Expand Down

0 comments on commit 01bbb9f

Please sign in to comment.