forked from rancher/fleet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbundle_status.go
More file actions
27 lines (23 loc) · 842 Bytes
/
bundle_status.go
File metadata and controls
27 lines (23 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package reconciler
import (
"fmt"
"github.com/rancher/fleet/internal/cmd/controller/summary"
"github.com/rancher/fleet/internal/cmd/controller/target"
fleet "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
)
func resetStatus(status *fleet.BundleStatus, allTargets []*target.Target) (err error) {
status.Summary = fleet.BundleSummary{}
status.PartitionStatus = nil
status.Unavailable = 0
status.NewlyCreated = 0
status.Summary = target.Summary(allTargets)
status.Unavailable = target.Unavailable(allTargets)
status.MaxUnavailable, err = target.MaxUnavailable(allTargets)
return err
}
func updateDisplay(status *fleet.BundleStatus) {
status.Display.ReadyClusters = fmt.Sprintf("%d/%d",
status.Summary.Ready,
status.Summary.DesiredReady)
status.Display.State = string(summary.GetSummaryState(status.Summary))
}