File tree 2 files changed +6
-13
lines changed
2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -304,15 +304,6 @@ func (p *RestorePlugin) Execute(input *velero.RestoreItemActionExecuteInput) (*v
304
304
return velero .NewRestoreItemActionExecuteOutput (& unstructured.Unstructured {Object : out }), nil
305
305
}
306
306
307
- // checks the OCP Image registry existence
308
- func (p * RestorePlugin ) DoRegistryReplicasExist () (bool , error ) {
309
- ocpRegistryHasReplicas , err := openshift .ImageRegistryHasReplicas ()
310
- if err != nil {
311
- return false , err
312
- }
313
- return ocpRegistryHasReplicas , nil
314
- }
315
-
316
307
// Fetches OCP version information
317
308
func (p * RestorePlugin ) GetOCPVersion () (int , int , error ) {
318
309
ocpVersion , err := openshift .GetClusterVersion ()
@@ -338,7 +329,7 @@ func (p *RestorePlugin) UpdateWaitForPullSecrets() (bool, error) {
338
329
return false , err
339
330
}
340
331
341
- registryReplicasExist , err := p . DoRegistryReplicasExist ()
332
+ imageRegistryConfigIsNotRemoved , err := openshift . ImageRegistryConfigIsNotRemoved ()
342
333
if err != nil {
343
334
return false , err
344
335
}
@@ -348,7 +339,7 @@ func (p *RestorePlugin) UpdateWaitForPullSecrets() (bool, error) {
348
339
return false , err
349
340
}
350
341
351
- if ! (imageRegistryEnabled && registryReplicasExist ) && (majorVersionInt == 4 && minorVersionInt >= 15 || majorVersionInt > 4 ) {
342
+ if ! (imageRegistryEnabled && imageRegistryConfigIsNotRemoved ) && (majorVersionInt == 4 && minorVersionInt >= 15 || majorVersionInt > 4 ) {
352
343
return false , nil
353
344
}
354
345
Original file line number Diff line number Diff line change @@ -2,9 +2,11 @@ package openshift
2
2
3
3
import (
4
4
"context"
5
+
5
6
"github.com/konveyor/openshift-velero-plugin/velero-plugins/clients"
6
7
configv1 "github.com/openshift/api/config/v1"
7
8
v1 "github.com/openshift/api/imageregistry/v1"
9
+ operatorv1 "github.com/openshift/api/operator/v1"
8
10
k8serrors "k8s.io/apimachinery/pkg/api/errors"
9
11
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
10
12
)
@@ -36,15 +38,15 @@ func ImageRegistryCapabilityEnabled() (bool, error) {
36
38
return false , nil
37
39
}
38
40
39
- func ImageRegistryHasReplicas () (bool , error ) {
41
+ func ImageRegistryConfigIsNotRemoved () (bool , error ) {
40
42
c , err := GetImageRegistryConfig ()
41
43
if err != nil {
42
44
if k8serrors .IsNotFound (err ) {
43
45
return false , nil
44
46
}
45
47
return false , err
46
48
}
47
- return c .Status . ReadyReplicas > 0 , nil
49
+ return c .Spec . ManagementState != operatorv1 . Removed , nil
48
50
}
49
51
50
52
// https://github.com/openshift/cluster-image-registry-operator/blob/48875d3ccb4595be9d3bec563d1fda2eb940cecf/pkg/defaults/defaults.go#L19
You can’t perform that action at this time.
0 commit comments