Skip to content

Commit

Permalink
Revert "Update Controller To Track Action Progress (#1487)" (#1577)
Browse files Browse the repository at this point in the history
This reverts commit 2fd28db.
  • Loading branch information
pavannd1 committed Jul 29, 2022
1 parent 98254fb commit cace6d1
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 1,251 deletions.
17 changes: 3 additions & 14 deletions pkg/apis/cr/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,9 @@ type ActionSpec struct {

// ActionSetStatus is the status for the actionset. This should only be updated by the controller.
type ActionSetStatus struct {
State State `json:"state"`
Actions []ActionStatus `json:"actions,omitempty"`
Error Error `json:"error,omitempty"`
Progress ActionProgress `json:"progress,omitempty"`
State State `json:"state"`
Actions []ActionStatus `json:"actions,omitempty"`
Error Error `json:"error,omitempty"`
}

// ActionStatus is updated as we execute phases.
Expand All @@ -132,16 +131,6 @@ type ActionStatus struct {
DeferPhase Phase `json:"deferPhase,omitempty"`
}

// ActionProgress provides information on the progress of an action.
type ActionProgress struct {
// PercentCompleted is computed by assessing the number of completed phases
// against the the total number of phases.
PercentCompleted string `json:"percentCompleted"`
// LastTransitionTime represents the last date time when the progress status
// was received.
LastTransitionTime metav1.Time `json:"lastTransitionTime"`
}

// State is the current state of a phase of execution.
type State string

Expand Down
18 changes: 0 additions & 18 deletions pkg/apis/cr/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import (
"github.com/kanisterio/kanister/pkg/field"
"github.com/kanisterio/kanister/pkg/log"
"github.com/kanisterio/kanister/pkg/param"
"github.com/kanisterio/kanister/pkg/progress"
"github.com/kanisterio/kanister/pkg/reconcile"
"github.com/kanisterio/kanister/pkg/validate"
osversioned "github.com/openshift/client-go/apps/clientset/versioned"
Expand Down Expand Up @@ -377,14 +376,6 @@ func (c *Controller) handleActionSet(as *crv1alpha1.ActionSet) (err error) {
}
}

go func() {
// progress update is computed on a best-effort basis.
// if it exits with error, we will just log it.
if err := progress.TrackActionsProgress(ctx, c.crClient, as.GetName(), as.GetNamespace()); err != nil {
log.Error().WithError(err)
}
}()

for i := range as.Status.Actions {
if err = c.runAction(ctx, as, i); err != nil {
// If runAction returns an error, it is a failure in the synchronous
Expand Down
22 changes: 0 additions & 22 deletions pkg/customresource/actionset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,6 @@ spec:
description: ActionSetStatus is the status for the actionset. This should
only be updated by the controller.
properties:
progress:
properties:
percentCompleted:
type: string
lastTransitionTime:
type: string
format: date-time
type: object
actions:
items:
properties:
Expand Down Expand Up @@ -261,20 +253,6 @@ spec:
type: string
type: object
type: object
additionalPrinterColumns:
- name: Progress
type: string
description: Progress of completion in percentage
jsonPath: .status.progress.percentCompleted
- name: Last Transition Time
type: string
format: date-time
description: Progress last transition time
jsonPath: .status.progress.lastTransitionTime
- name: State
type: string
description: State of the actionset
jsonPath: .status.state
status:
acceptedNames:
kind: ""
Expand Down
213 changes: 0 additions & 213 deletions pkg/progress/action.go

This file was deleted.

Loading

0 comments on commit cace6d1

Please sign in to comment.