@@ -140,10 +140,10 @@ func (actuator userActuator) CreateResource(ctx context.Context, obj orcObjectPT
140140 }
141141
142142 var password string
143- {
143+ if resource . PasswordRef != nil {
144144 secret , secretReconcileStatus := dependency .FetchDependency (
145145 ctx , actuator .k8sClient , obj .Namespace ,
146- & resource .PasswordRef , "Secret" ,
146+ resource .PasswordRef , "Secret" ,
147147 func (* corev1.Secret ) bool { return true },
148148 )
149149 reconcileStatus = reconcileStatus .WithReconcileStatus (secretReconcileStatus )
@@ -189,11 +189,11 @@ func (actuator userActuator) DeleteResource(ctx context.Context, _ orcObjectPT,
189189func (actuator userActuator ) reconcilePassword (ctx context.Context , obj orcObjectPT , osResource * osResourceT ) progress.ReconcileStatus {
190190 log := ctrl .LoggerFrom (ctx )
191191 resource := obj .Spec .Resource
192- if resource == nil {
192+ if resource == nil || resource . PasswordRef == nil {
193193 return nil
194194 }
195195
196- currentRef := string (resource .PasswordRef )
196+ currentRef := string (* resource .PasswordRef )
197197 var lastAppliedRef string
198198 if obj .Status .Resource != nil {
199199 lastAppliedRef = obj .Status .Resource .AppliedPasswordRef
@@ -206,7 +206,7 @@ func (actuator userActuator) reconcilePassword(ctx context.Context, obj orcObjec
206206 // Read the password from the referenced Secret
207207 secret , secretRS := dependency .FetchDependency (
208208 ctx , actuator .k8sClient , obj .Namespace ,
209- & resource .PasswordRef , "Secret" ,
209+ resource .PasswordRef , "Secret" ,
210210 func (* corev1.Secret ) bool { return true },
211211 )
212212 if secretRS != nil {
0 commit comments