mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-19 18:48:32 +00:00
Add APIs for computing status based on fetching resource info from a
cluster
This commit is contained in:
@@ -6,8 +6,8 @@ package status
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
corev1 "sigs.k8s.io/kustomize/pseudo/k8s/api/core/v1"
|
||||
"sigs.k8s.io/kustomize/pseudo/k8s/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
)
|
||||
|
||||
// GetConditionsFn defines the signature for functions to compute the
|
||||
@@ -36,6 +36,8 @@ const (
|
||||
tooFewAvailable = "LessAvailable"
|
||||
tooFewUpdated = "LessUpdated"
|
||||
tooFewReplicas = "LessReplicas"
|
||||
|
||||
onDeleteUpdateStrategy = "OnDelete"
|
||||
)
|
||||
|
||||
// GetLegacyConditionsFn returns a function that can compute the status for the
|
||||
@@ -71,7 +73,7 @@ func stsConditions(u *unstructured.Unstructured) (*Result, error) {
|
||||
|
||||
// updateStrategy==ondelete is a user managed statefulset.
|
||||
updateStrategy := GetStringField(obj, ".spec.updateStrategy.type", "")
|
||||
if updateStrategy == "ondelete" {
|
||||
if updateStrategy == onDeleteUpdateStrategy {
|
||||
return &Result{
|
||||
Status: CurrentStatus,
|
||||
Message: "StatefulSet is using the ondelete update strategy",
|
||||
|
||||
Reference in New Issue
Block a user