forked from RamenDR/ramen
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #270 from red-hat-storage/sync_us--main
Syncing latest changes from upstream main for ramen
- Loading branch information
Showing
23 changed files
with
1,142 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
channelname: "ramen-gitops" | ||
channelnamespace: "ramen-samples" | ||
giturl: "https://github.com/RamenDR/ocm-ramen-samples.git" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// SPDX-FileCopyrightText: The RamenDR authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package deployers | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
"github.com/ramendr/ramen/e2e/util" | ||
subscriptionv1 "open-cluster-management.io/multicloud-operators-subscription/pkg/apis/apps/v1" | ||
) | ||
|
||
const FiveSecondsDuration = 5 * time.Second | ||
|
||
func waitSubscriptionPhase(namespace, name string, phase subscriptionv1.SubscriptionPhase) error { | ||
// sleep to wait for subscription is processed | ||
time.Sleep(FiveSecondsDuration) | ||
|
||
startTime := time.Now() | ||
|
||
for { | ||
sub, err := getSubscription(util.Ctx.Hub.CtrlClient, namespace, name) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
currentPhase := sub.Status.Phase | ||
if currentPhase == phase { | ||
util.Ctx.Log.Info(fmt.Sprintf("subscription %s phase is %s", name, phase)) | ||
|
||
return nil | ||
} | ||
|
||
if time.Since(startTime) > time.Second*time.Duration(util.Timeout) { | ||
return fmt.Errorf(fmt.Sprintf("subscription %s status is not %s yet before timeout of %v", | ||
name, phase, util.Timeout)) | ||
} | ||
|
||
if currentPhase == "" { | ||
currentPhase = "empty" | ||
} | ||
|
||
util.Ctx.Log.Info(fmt.Sprintf("current subscription %s phase is %s, expecting %s, retry in %v seconds", | ||
name, currentPhase, phase, util.TimeInterval)) | ||
time.Sleep(time.Second * time.Duration(util.TimeInterval)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.