Skip to content

Commit

Permalink
todo
Browse files Browse the repository at this point in the history
Signed-off-by: Raghavendra Talur <[email protected]>
  • Loading branch information
raghavendra-talur committed Dec 11, 2024
1 parent 395bd2a commit 1edb32c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions internal/controller/vrg_volrep.go
Original file line number Diff line number Diff line change
Expand Up @@ -1971,6 +1971,30 @@ func (v *VRGInstance) s3KeyPrefix() string {
return S3KeyPrefix(v.namespacedName)
}

func (v *VRGInstance) restoreKubeObjects(result *ctrl.Result) error {
v.log.Info("Restoring KubeObjects")

if len(v.instance.Spec.S3Profiles) == 0 {
v.log.Info("No S3 profiles configured")

result.Requeue = true

return fmt.Errorf("no S3Profiles configured")
}

v.log.Info(fmt.Sprintf("Restoring KubeObjects to this managed cluster. ProfileList: %v", v.instance.Spec.S3Profiles))

count, err := v.restoreKubeObjectsFromS3(result)

Check failure on line 1987 in internal/controller/vrg_volrep.go

View workflow job for this annotation

GitHub Actions / Build image

v.restoreKubeObjectsFromS3 undefined (type *VRGInstance has no field or method restoreKubeObjectsFromS3)

Check failure on line 1987 in internal/controller/vrg_volrep.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

v.restoreKubeObjectsFromS3 undefined (type *VRGInstance has no field or method restoreKubeObjectsFromS3)

Check failure on line 1987 in internal/controller/vrg_volrep.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

v.restoreKubeObjectsFromS3 undefined (type *VRGInstance has no field or method restoreKubeObjectsFromS3)

Check failure on line 1987 in internal/controller/vrg_volrep.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

v.restoreKubeObjectsFromS3 undefined (type *VRGInstance has no field or method restoreKubeObjectsFromS3)

Check failure on line 1987 in internal/controller/vrg_volrep.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

v.restoreKubeObjectsFromS3 undefined (type *VRGInstance has no field or method restoreKubeObjectsFromS3)

Check failure on line 1987 in internal/controller/vrg_volrep.go

View workflow job for this annotation

GitHub Actions / Unit tests

v.restoreKubeObjectsFromS3 undefined (type *VRGInstance has no field or method restoreKubeObjectsFromS3)

Check failure on line 1987 in internal/controller/vrg_volrep.go

View workflow job for this annotation

GitHub Actions / Unit tests

v.restoreKubeObjectsFromS3 undefined (type *VRGInstance has no field or method restoreKubeObjectsFromS3)
if err != nil {
errMsg := fmt.Sprintf("failed to restore PVs and PVCs using profile list (%v)", v.instance.Spec.S3Profiles)
v.log.Info(errMsg)

return 0, fmt.Errorf("%s: %w", errMsg, err)

Check failure on line 1992 in internal/controller/vrg_volrep.go

View workflow job for this annotation

GitHub Actions / Build image

too many return values

Check failure on line 1992 in internal/controller/vrg_volrep.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

too many return values

Check failure on line 1992 in internal/controller/vrg_volrep.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

too many return values

Check failure on line 1992 in internal/controller/vrg_volrep.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

too many return values

Check failure on line 1992 in internal/controller/vrg_volrep.go

View workflow job for this annotation

GitHub Actions / Unit tests

too many return values

Check failure on line 1992 in internal/controller/vrg_volrep.go

View workflow job for this annotation

GitHub Actions / Unit tests

too many return values
}

return count, nil
}

func (v *VRGInstance) restorePVsAndPVCsForVolRep(result *ctrl.Result) (int, error) {
v.log.Info("Restoring VolRep PVs and PVCs")

Expand Down

0 comments on commit 1edb32c

Please sign in to comment.