-
Notifications
You must be signed in to change notification settings - Fork 18
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
log volumesnapshotbackup status if is not complete. #194
Conversation
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
9b708fb
to
65d31f1
Compare
/kind changelog-not-required |
@kaovilai: The label(s) In response to this:
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. |
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool
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:
/kind changelog-not-required
as a comment on this pull request.site/content/docs/main
.