diff --git a/charts/fleet-crd/templates/crds.yaml b/charts/fleet-crd/templates/crds.yaml index 8488ad4b23..df06832d9c 100644 --- a/charts/fleet-crd/templates/crds.yaml +++ b/charts/fleet-crd/templates/crds.yaml @@ -420,7 +420,7 @@ spec: type: object nullable: true type: array - notApplied: + waitApplied: type: integer notReady: type: integer @@ -459,7 +459,7 @@ spec: type: object nullable: true type: array - notApplied: + waitApplied: type: integer notReady: type: integer @@ -938,7 +938,7 @@ spec: type: object nullable: true type: array - notApplied: + waitApplied: type: integer notReady: type: integer @@ -1095,7 +1095,7 @@ spec: type: object nullable: true type: array - notApplied: + waitApplied: type: integer notReady: type: integer @@ -1341,7 +1341,7 @@ spec: type: object nullable: true type: array - notApplied: + waitApplied: type: integer notReady: type: integer diff --git a/docs/bundles.md b/docs/bundles.md index e30f1e3273..23634b1198 100644 --- a/docs/bundles.md +++ b/docs/bundles.md @@ -104,7 +104,7 @@ namespace: default # When resources are applied the system will wait for the resources to initially # become Ready. If the resources are not ready in this time frame the -# application of resources fails and the bundle will stay in a NotApplied state. +# application of resources fails and the bundle will stay in a WaitApplied state. # Default: 600 (10 minutes) timeoutSeconds: 600 diff --git a/pkg/apis/fleet.cattle.io/v1alpha1/bundle.go b/pkg/apis/fleet.cattle.io/v1alpha1/bundle.go index df0bfdf1f3..60425f68f2 100644 --- a/pkg/apis/fleet.cattle.io/v1alpha1/bundle.go +++ b/pkg/apis/fleet.cattle.io/v1alpha1/bundle.go @@ -12,22 +12,22 @@ import ( ) var ( - Ready BundleState = "Ready" - NotReady BundleState = "NotReady" - NotApplied BundleState = "NotApplied" - ErrApplied BundleState = "ErrApplied" - OutOfSync BundleState = "OutOfSync" - Pending BundleState = "Pending" - Modified BundleState = "Modified" + Ready BundleState = "Ready" + NotReady BundleState = "NotReady" + WaitApplied BundleState = "WaitApplied" + ErrApplied BundleState = "ErrApplied" + OutOfSync BundleState = "OutOfSync" + Pending BundleState = "Pending" + Modified BundleState = "Modified" StateRank = map[BundleState]int{ - ErrApplied: 7, - NotApplied: 6, - Modified: 5, - OutOfSync: 4, - Pending: 3, - NotReady: 2, - Ready: 1, + ErrApplied: 7, + WaitApplied: 6, + Modified: 5, + OutOfSync: 4, + Pending: 3, + NotReady: 2, + Ready: 1, } ) @@ -113,7 +113,7 @@ type BundleTarget struct { type BundleSummary struct { NotReady int `json:"notReady,omitempty"` - NotApplied int `json:"notApplied,omitempty"` + WaitApplied int `json:"waitApplied,omitempty"` ErrApplied int `json:"errApplied,omitempty"` OutOfSync int `json:"outOfSync,omitempty"` Modified int `json:"modified,omitempty"` @@ -180,6 +180,7 @@ type BundleDeploymentOptions struct { Values *GenericMap `json:"values,omitempty"` ServiceAccount string `json:"serviceAccount,omitempty"` Force bool `json:"force,omitempty"` + TakeOwnership bool `json:"takeOwnership,omitempty"` } type BundleDeploymentSpec struct { diff --git a/pkg/summary/summary.go b/pkg/summary/summary.go index 5846b38cb5..f059f3a96b 100644 --- a/pkg/summary/summary.go +++ b/pkg/summary/summary.go @@ -18,8 +18,8 @@ func IncrementState(summary *fleet.BundleSummary, name string, state fleet.Bundl summary.Modified++ case fleet.Pending: summary.Pending++ - case fleet.NotApplied: - summary.NotApplied++ + case fleet.WaitApplied: + summary.WaitApplied++ case fleet.ErrApplied: summary.ErrApplied++ case fleet.NotReady: @@ -46,7 +46,7 @@ func IsReady(summary fleet.BundleSummary) bool { func Increment(left *fleet.BundleSummary, right fleet.BundleSummary) { left.NotReady += right.NotReady - left.NotApplied += right.NotApplied + left.WaitApplied += right.WaitApplied left.ErrApplied += right.ErrApplied left.OutOfSync += right.OutOfSync left.Modified += right.Modified @@ -64,7 +64,7 @@ func GetDeploymentState(bundleDeployment *fleet.BundleDeployment) fleet.BundleSt if condition.Cond(fleet.BundleDeploymentConditionDeployed).IsFalse(bundleDeployment) { return fleet.ErrApplied } - return fleet.NotApplied + return fleet.WaitApplied case !bundleDeployment.Status.Ready: return fleet.NotReady case bundleDeployment.Spec.DeploymentID != bundleDeployment.Spec.StagedDeploymentID: @@ -109,12 +109,12 @@ func MessageFromDeployment(deployment *fleet.BundleDeployment) string { func ReadyMessage(summary fleet.BundleSummary, referencedKind string) string { var messages []string for msg, count := range map[fleet.BundleState]int{ - fleet.OutOfSync: summary.OutOfSync, - fleet.NotReady: summary.NotReady, - fleet.NotApplied: summary.NotApplied, - fleet.ErrApplied: summary.ErrApplied, - fleet.Pending: summary.Pending, - fleet.Modified: summary.Modified, + fleet.OutOfSync: summary.OutOfSync, + fleet.NotReady: summary.NotReady, + fleet.WaitApplied: summary.WaitApplied, + fleet.ErrApplied: summary.ErrApplied, + fleet.Pending: summary.Pending, + fleet.Modified: summary.Modified, } { if count <= 0 { continue @@ -122,7 +122,11 @@ func ReadyMessage(summary fleet.BundleSummary, referencedKind string) string { for _, v := range summary.NonReadyResources { name := v.Name if v.State == msg { - messages = append(messages, fmt.Sprintf("%s(%d) [%s %s: %s]", msg, count, referencedKind, name, v.Message)) + if len(v.Message) == 0 { + messages = append(messages, fmt.Sprintf("%s(%d) [%s %s]", msg, count, referencedKind, name)) + } else { + messages = append(messages, fmt.Sprintf("%s(%d) [%s %s: %s]", msg, count, referencedKind, name, v.Message)) + } break } }