-
Notifications
You must be signed in to change notification settings - Fork 157
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
Implement ExecutionProgress method on Kanister functions #2117
Implement ExecutionProgress method on Kanister functions #2117
Conversation
Thanks for submitting this pull request 🎉. The team will review it soon and get back to you. If you haven't already, please take a moment to review our project contributing guideline and Code of Conduct document. |
b.progressPercent = progress.StartedPercent | ||
defer func() { b.progressPercent = progress.CompletedPercent }() |
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.
so, we are going to set the progress to 100 even if the function execution failed?
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.
@viveksinghggits in case of failure, the phase progress is set to nil. Here is an example from tests where out of 3, first phase completed but second phase fails
status:
actions:
- artifacts:
operatorBackup:
keyValue:
path: '{{ .Phases.phase3.Output.path }}'
blueprint: operator-blueprint
deferPhase:
name: ""
progress: {}
state: ""
name: backup
object:
apiVersion: v1
group: apps
kind: statefulset
name: mysql
namespace: mysql
resource: statefulsets
phases:
- name: phase1
output:
path: /operator-backups/2023-05-22T07-32-36/backup.tgz
progress:
lastTransitionTime: "2023-05-22T07:32:54Z"
progressPercent: "100"
state: complete
- name: phase2
progress: {}
state: failed
- name: phase3
progress: {}
state: pending
error:
message: "Failed while waiting for Pod kanister-job-sk2bk to complete: Pod failed
or did not transition into complete state: Running backup\
.
.
progress:
lastTransitionTime: "2023-05-22T07:32:54Z"
percentCompleted: "33"
state: failed
Will take a look at this soon 👀 |
Signed-off-by: Prasad Ghangal <[email protected]>
Signed-off-by: Prasad Ghangal <[email protected]>
Co-authored-by: Pavan Navarathna <[email protected]>
a9b5fee
to
204c67d
Compare
…rogress (#2023) * Add phase level progress fields in actionset object Signed-off-by: Prasad Ghangal <[email protected]> * Change weight based progress calc with func implementation Signed-off-by: Prasad Ghangal <[email protected]> * Refactor and add unit tests for phase progress Signed-off-by: Prasad Ghangal <[email protected]> * Update generated deepcopy methods Signed-off-by: Prasad Ghangal <[email protected]> * Fix import cycle issue in test Signed-off-by: Prasad Ghangal <[email protected]> * Update pkg/apis/cr/v1alpha1/types.go Co-authored-by: Pavan Navarathna <[email protected]> * Update pkg/apis/cr/v1alpha1/types.go Co-authored-by: Pavan Navarathna <[email protected]> * Update pkg/apis/cr/v1alpha1/types.go Co-authored-by: Pavan Navarathna <[email protected]> * Update pkg/apis/cr/v1alpha1/types.go Co-authored-by: Pavan Navarathna <[email protected]> * Use correct action index while updating action phase state Signed-off-by: Prasad Ghangal <[email protected]> * Implement ExecutionProgress method on Kanister functions (#2117) * Implement ExecutionProgress method on Kanister functions Signed-off-by: Prasad Ghangal <[email protected]> * Set LastTransitionTime in ExecutionProgress return Signed-off-by: Prasad Ghangal <[email protected]> * Update pkg/function/backup_data.go Co-authored-by: Pavan Navarathna <[email protected]> --------- Signed-off-by: Prasad Ghangal <[email protected]> Co-authored-by: Pavan Navarathna <[email protected]> * Implement ExecProgress on test function Signed-off-by: Prasad Ghangal <[email protected]> * Remove unused mockPhase in test Signed-off-by: Prasad Ghangal <[email protected]> * Remove unnecessary whitespace in updateActionProgress func Signed-off-by: Prasad Ghangal <[email protected]> --------- Signed-off-by: Prasad Ghangal <[email protected]> Signed-off-by: Prasad Ghangal <[email protected]> Co-authored-by: Pavan Navarathna <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…rogress (#2023) * Add phase level progress fields in actionset object Signed-off-by: Prasad Ghangal <[email protected]> * Change weight based progress calc with func implementation Signed-off-by: Prasad Ghangal <[email protected]> * Refactor and add unit tests for phase progress Signed-off-by: Prasad Ghangal <[email protected]> * Update generated deepcopy methods Signed-off-by: Prasad Ghangal <[email protected]> * Fix import cycle issue in test Signed-off-by: Prasad Ghangal <[email protected]> * Update pkg/apis/cr/v1alpha1/types.go Co-authored-by: Pavan Navarathna <[email protected]> * Update pkg/apis/cr/v1alpha1/types.go Co-authored-by: Pavan Navarathna <[email protected]> * Update pkg/apis/cr/v1alpha1/types.go Co-authored-by: Pavan Navarathna <[email protected]> * Update pkg/apis/cr/v1alpha1/types.go Co-authored-by: Pavan Navarathna <[email protected]> * Use correct action index while updating action phase state Signed-off-by: Prasad Ghangal <[email protected]> * Implement ExecutionProgress method on Kanister functions (#2117) * Implement ExecutionProgress method on Kanister functions Signed-off-by: Prasad Ghangal <[email protected]> * Set LastTransitionTime in ExecutionProgress return Signed-off-by: Prasad Ghangal <[email protected]> * Update pkg/function/backup_data.go Co-authored-by: Pavan Navarathna <[email protected]> --------- Signed-off-by: Prasad Ghangal <[email protected]> Co-authored-by: Pavan Navarathna <[email protected]> * Implement ExecProgress on test function Signed-off-by: Prasad Ghangal <[email protected]> * Remove unused mockPhase in test Signed-off-by: Prasad Ghangal <[email protected]> * Remove unnecessary whitespace in updateActionProgress func Signed-off-by: Prasad Ghangal <[email protected]> --------- Signed-off-by: Prasad Ghangal <[email protected]> Signed-off-by: Prasad Ghangal <[email protected]> Co-authored-by: Pavan Navarathna <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Change Overview
This PR implements
ExecutionProgress()
on Kanister functions to address the interface changes introduced in #2023 to report progress tracking by each functionThis PR is part of #2023, split to make it easier for review
Pull request type
Please check the type of change your PR introduces:
Test Plan
Added in #2023