Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log volumesnapshotbackup status if is not complete. #194

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

kaovilai
Copy link
Member

@kaovilai kaovilai commented Sep 1, 2022

Thank you for contributing to Velero!

Please add a summary of your change

Does your change fix a particular issue?

Fixes #(issue)

Please indicate you've done the following:

  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Created a changelog file or added /kind changelog-not-required as a comment on this pull request.
  • Updated the corresponding documentation in site/content/docs/main.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 1, 2022
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@kaovilai
Copy link
Member Author

kaovilai commented Sep 1, 2022

/kind changelog-not-required

@openshift-ci
Copy link

openshift-ci bot commented Sep 1, 2022

@kaovilai: The label(s) kind/changelog-not-required cannot be applied, because the repository doesn't have them.

In response to this:

/kind changelog-not-required

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kaovilai kaovilai marked this pull request as ready for review September 1, 2022 19:47
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 1, 2022
eemcmullan
eemcmullan previously approved these changes Sep 1, 2022
if len(tmpVSB.Status.Phase) == 0 || tmpVSB.Status.Phase != snapmoverv1alpha1.SnapMoverBackupPhaseCompleted {
log.Infof("Waiting for volumesnapshotbackup to complete %s/%s. Retrying in %ds", volumesnapshotbackup.Namespace, volumesnapshotbackup.Name, interval/time.Second)
if len(currentVSB.Status.Phase) == 0 || currentVSB.Status.Phase != snapmoverv1alpha1.SnapMoverBackupPhaseCompleted {
log.Infof("Waiting for volumesnapshotbackup status.phase to change from %s to complete %s/%s. Retrying in %ds", currentVSB.Status.Phase, volumesnapshotbackup.Namespace, volumesnapshotbackup.Name, interval/time.Second)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to hit nil pointer ref here if currentVSB.Status.Phase doesn't exist yet? It is only included once a replicationSource is created.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not possible to hit nil pointer here.
VolumeSnapshotBackupStatus from this PR's go.mod indicates that status.Phase is not a pointer and has an underlying type of string. Therefore, uninitialized, status.Phase should be "". And if somehow it was nil, you can certainly Printf("%s", nil)

type VolumeSnapshotBackupStatus struct {
	Completed bool `json:"completed,omitempty"`
	// Include references to the volsync CRs and their state as they are
	// running
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// Includes source PVC name and size
	SourcePVCData PVCData `json:"sourcePVCData,omitempty"`
	// Includes restic repository path
	ResticRepository string `json:"resticrepository,omitempty"`
	// volumesnapshot backup phase status
	Phase VolumeSnapshotBackupPhase `json:"phase,omitempty"`
	// name of the VolumeSnapshotClass
	VolumeSnapshotClassName string `json:"volumeSnapshotClassName,omitempty"`
}

type VolumeSnapshotBackupPhase string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool

@kaovilai kaovilai merged commit 7b84e93 into openshift:konveyor-1.9 Sep 6, 2022
@kaovilai kaovilai deleted the reportVSBwhenNotComplete branch November 21, 2023 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants