@@ -928,8 +928,10 @@ func (o *Operator) ensureInstallPlan(logger *logrus.Entry, namespace string, sub
928
928
for _ , sub := range subs {
929
929
ownerWasAdded = ownerWasAdded || ! ownerutil .EnsureOwner (installPlan , sub )
930
930
}
931
+
932
+ out := installPlan .DeepCopy ()
931
933
if ownerWasAdded {
932
- _ , err : = o .client .OperatorsV1alpha1 ().InstallPlans (installPlan .GetNamespace ()).Update (installPlan )
934
+ out , err = o .client .OperatorsV1alpha1 ().InstallPlans (installPlan .GetNamespace ()).Update (installPlan )
933
935
if err != nil {
934
936
return nil , err
935
937
}
@@ -938,19 +940,18 @@ func (o *Operator) ensureInstallPlan(logger *logrus.Entry, namespace string, sub
938
940
// Use provided `installPlanApproval` to determine the appropreciate
939
941
// phase
940
942
if installPlanApproval == v1alpha1 .ApprovalAutomatic {
941
- installPlan .Status .Phase = v1alpha1 .InstallPlanPhaseInstalling
943
+ out .Status .Phase = v1alpha1 .InstallPlanPhaseInstalling
942
944
} else {
943
- logger .Info ("Testing" )
944
- installPlan .Status .Phase = v1alpha1 .InstallPlanPhaseRequiresApproval
945
+ out .Status .Phase = v1alpha1 .InstallPlanPhaseRequiresApproval
945
946
}
946
- for _ , step := range installPlan .Status .Plan {
947
+ for _ , step := range out .Status .Plan {
947
948
step .Status = v1alpha1 .StepStatusUnknown
948
949
}
949
- _ , err = o .client .OperatorsV1alpha1 ().InstallPlans (namespace ).UpdateStatus (installPlan )
950
+ res , err : = o .client .OperatorsV1alpha1 ().InstallPlans (namespace ).UpdateStatus (out )
950
951
if err != nil {
951
952
return nil , err
952
953
}
953
- return reference .GetReference (installPlan )
954
+ return reference .GetReference (res )
954
955
}
955
956
}
956
957
logger .Warn ("no installplan found with matching manifests, creating new one" )
0 commit comments