diff --git a/config/yurt-app-manager/crd/bases/apps.openyurt.io_uniteddeployments.yaml b/config/yurt-app-manager/crd/bases/apps.openyurt.io_uniteddeployments.yaml index 9b6520e..f030a76 100644 --- a/config/yurt-app-manager/crd/bases/apps.openyurt.io_uniteddeployments.yaml +++ b/config/yurt-app-manager/crd/bases/apps.openyurt.io_uniteddeployments.yaml @@ -127,8 +127,12 @@ spec: distributed across multiple groups of nodes. A pool's nodeSelectorTerm is not allowed to be updated. type: object - patches: - description: Indicates the patches for the templateSpec + patch: + description: Indicates the patch for the templateSpec Now + support strategic merge path :https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/#notes-on-the-strategic-merge-patch + Patch takes precedence over Replicas fields If the Patch + also modifies the Replicas, use the Replicas value in the + Patch type: object replicas: description: Indicates the number of the pod to be created diff --git a/pkg/yurtappmanager/apis/apps/v1alpha1/uniteddeployment_types.go b/pkg/yurtappmanager/apis/apps/v1alpha1/uniteddeployment_types.go index adb0dfb..c9d7473 100644 --- a/pkg/yurtappmanager/apis/apps/v1alpha1/uniteddeployment_types.go +++ b/pkg/yurtappmanager/apis/apps/v1alpha1/uniteddeployment_types.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The OpenYurt Authors. +Copyright 2021 The OpenYurt Authors. Copyright 2020 The Kruise Authors. Licensed under the Apache License, Version 2.0 (the "License"); @@ -126,9 +126,12 @@ type Pool struct { // +required Replicas *int32 `json:"replicas,omitempty"` - // Indicates the patches for the templateSpec + // Indicates the patch for the templateSpec + // Now support strategic merge path :https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/#notes-on-the-strategic-merge-patch + // Patch takes precedence over Replicas fields + // If the Patch also modifies the Replicas, use the Replicas value in the Patch // +optional - Patches *runtime.RawExtension `json:"patches,omitempty"` + Patch *runtime.RawExtension `json:"patch,omitempty"` } // UnitedDeploymentStatus defines the observed state of UnitedDeployment. diff --git a/pkg/yurtappmanager/apis/apps/v1alpha1/well_known_labels_annotations.go b/pkg/yurtappmanager/apis/apps/v1alpha1/well_known_labels_annotations.go index c8814a4..950e702 100644 --- a/pkg/yurtappmanager/apis/apps/v1alpha1/well_known_labels_annotations.go +++ b/pkg/yurtappmanager/apis/apps/v1alpha1/well_known_labels_annotations.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The OpenYurt Authors. +Copyright 2021 The OpenYurt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -31,8 +31,8 @@ const ( // SpecifiedDeleteKey indicates this object should be deleted, and the value could be the deletion option. SpecifiedDeleteKey = "apps.openyurt.io/specified-delete" - // AnnotationPatchesKey indicates the patches for every sub pool - AnnotationPatchesKey = "apps.openyurt.io/patches" + // AnnotationPatchKey indicates the patch for every sub pool + AnnotationPatchKey = "apps.openyurt.io/patch" ) // NodePool related labels and annotations diff --git a/pkg/yurtappmanager/controller/uniteddeployment/adapter/adapter_util.go b/pkg/yurtappmanager/controller/uniteddeployment/adapter/adapter_util.go index 8f76f76..14cc0fb 100644 --- a/pkg/yurtappmanager/controller/uniteddeployment/adapter/adapter_util.go +++ b/pkg/yurtappmanager/controller/uniteddeployment/adapter/adapter_util.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The OpenYurt Authors. +Copyright 2021 The OpenYurt Authors. Copyright 2019 The Kruise Authors. Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,14 +21,13 @@ import ( "encoding/json" "fmt" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/strategicpatch" - "k8s.io/klog" - - unitv1alpha1 "github.com/openyurtio/yurt-app-manager/pkg/yurtappmanager/apis/apps/v1alpha1" + appsv1alpha1 "github.com/openyurtio/yurt-app-manager/pkg/yurtappmanager/apis/apps/v1alpha1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/validation" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/strategicpatch" + "k8s.io/klog" ) func getPoolPrefix(controllerName, poolName string) string { @@ -39,12 +38,12 @@ func getPoolPrefix(controllerName, poolName string) string { return prefix } -func attachNodeAffinityAndTolerations(podSpec *corev1.PodSpec, pool *unitv1alpha1.Pool) { +func attachNodeAffinityAndTolerations(podSpec *corev1.PodSpec, pool *appsv1alpha1.Pool) { attachNodeAffinity(podSpec, pool) attachTolerations(podSpec, pool) } -func attachNodeAffinity(podSpec *corev1.PodSpec, pool *unitv1alpha1.Pool) { +func attachNodeAffinity(podSpec *corev1.PodSpec, pool *appsv1alpha1.Pool) { if podSpec.Affinity == nil { podSpec.Affinity = &corev1.Affinity{} } @@ -73,7 +72,7 @@ func attachNodeAffinity(podSpec *corev1.PodSpec, pool *unitv1alpha1.Pool) { } } -func attachTolerations(podSpec *corev1.PodSpec, poolConfig *unitv1alpha1.Pool) { +func attachTolerations(podSpec *corev1.PodSpec, poolConfig *appsv1alpha1.Pool) { if poolConfig.Tolerations == nil { return @@ -94,7 +93,7 @@ func getRevision(objMeta metav1.Object) string { if objMeta.GetLabels() == nil { return "" } - return objMeta.GetLabels()[unitv1alpha1.ControllerRevisionHashLabelKey] + return objMeta.GetLabels()[appsv1alpha1.ControllerRevisionHashLabelKey] } // getCurrentPartition calculates current partition by counting the pods not having the updated revision @@ -109,28 +108,55 @@ func getCurrentPartition(pods []*corev1.Pod, revision string) *int32 { return &partition } -func StrategicMergeByPatches(patchKind string, oldobj interface{}, patches *runtime.RawExtension, newPatched interface{}) error { +func StrategicMergeByPatches(oldobj interface{}, patch *runtime.RawExtension, newPatched interface{}) error { patchMap := make(map[string]interface{}) - if err := json.Unmarshal(patches.Raw, &patchMap); err != nil { - klog.Errorf("For %s Unmarshal Pool Patches error %v, Patches Raw %v", patchKind, err,string(patches.Raw)) - return err + if err := json.Unmarshal(patch.Raw, &patchMap); err != nil { + klog.Errorf("Unmarshal pool patch error %v, patch Raw %v", err, string(patch.Raw)) + return err } originalObjMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(oldobj) if err != nil { - klog.Errorf("For %s obj ToUnstructured error %v", patchKind, err) - return err + klog.Errorf("ToUnstructured error %v", err) + return err } patchedObjMap, err := strategicpatch.StrategicMergeMapPatch(originalObjMap, patchMap, newPatched) if err != nil { - klog.Errorf("For %s obj StartegicMergeMapPatch error %v", patchKind, err) + klog.Errorf("StartegicMergeMapPatch error %v", err) return err } if err := runtime.DefaultUnstructuredConverter.FromUnstructured(patchedObjMap, newPatched); err != nil { - klog.Errorf("For %s FromUnstructured error %v", patchKind, err) + klog.Errorf("FromUnstructured error %v", err) + return err + } + return nil +} + +func PoolHasPatch(poolConfig *appsv1alpha1.Pool, set metav1.Object) bool { + if poolConfig.Patch == nil { + // If No Patches, Must Set patches annotation to "" + if anno := set.GetAnnotations(); anno != nil { + anno[appsv1alpha1.AnnotationPatchKey] = "" + } + return false + } + return true +} + +func CreateNewPatchedObject(patchInfo *runtime.RawExtension, set metav1.Object, newPatched metav1.Object) error { + + if err := StrategicMergeByPatches(set, patchInfo, newPatched); err != nil { return err } + + if anno := newPatched.GetAnnotations(); anno == nil { + newPatched.SetAnnotations(map[string]string{ + appsv1alpha1.AnnotationPatchKey: string(patchInfo.Raw), + }) + } else { + anno[appsv1alpha1.AnnotationPatchKey] = string(patchInfo.Raw) + } return nil -} \ No newline at end of file +} diff --git a/pkg/yurtappmanager/controller/uniteddeployment/adapter/adapter_util_test.go b/pkg/yurtappmanager/controller/uniteddeployment/adapter/adapter_util_test.go index 1967d83..075751f 100644 --- a/pkg/yurtappmanager/controller/uniteddeployment/adapter/adapter_util_test.go +++ b/pkg/yurtappmanager/controller/uniteddeployment/adapter/adapter_util_test.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The OpenYurt Authors. +Copyright 2021 The OpenYurt Authors. Copyright 2019 The Kruise Authors. Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,6 +21,10 @@ import ( "fmt" "testing" + appsv1 "k8s.io/api/apps/v1" + + "k8s.io/apimachinery/pkg/runtime" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -86,3 +90,84 @@ func buildPodList(ordinals []int, revisions []string, t *testing.T) []*corev1.Po return pods } + +func TestCreateNewPatchedObject(t *testing.T) { + cases := []struct { + Name string + PatchInfo *runtime.RawExtension + OldObj *appsv1.Deployment + EqualFuntion func(new *appsv1.Deployment) bool + }{ + { + Name: "replace image", + PatchInfo: &runtime.RawExtension{Raw: []byte(`{"spec":{"template":{"spec":{"containers":[{"image":"nginx:1.18.0","name":"nginx"}]}}}}`)}, + OldObj: &appsv1.Deployment{ + Spec: appsv1.DeploymentSpec{ + Template: corev1.PodTemplateSpec{ + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: "nginx", + Image: "nginx:1.19.0", + }, + }, + }, + }, + }, + }, + EqualFuntion: func(new *appsv1.Deployment) bool { + return new.Spec.Template.Spec.Containers[0].Image == "nginx:1.18.0" + }, + }, + { + Name: "add other image", + PatchInfo: &runtime.RawExtension{Raw: []byte(`{"spec":{"template":{"spec":{"containers":[{"image":"nginx:1.18.0","name":"nginx111"}]}}}}`)}, + OldObj: &appsv1.Deployment{ + Spec: appsv1.DeploymentSpec{ + Template: corev1.PodTemplateSpec{ + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: "nginx", + Image: "nginx:1.19.0", + }, + }, + }, + }, + }, + }, + EqualFuntion: func(new *appsv1.Deployment) bool { + if len(new.Spec.Template.Spec.Containers) != 2 { + return false + } + containerMap := make(map[string]string) + for _, container := range new.Spec.Template.Spec.Containers { + containerMap[container.Name] = container.Image + } + image, ok := containerMap["nginx"] + if !ok { + return false + } + + image1, ok := containerMap["nginx111"] + if !ok { + return false + } + return image == "nginx:1.19.0" && image1 == "nginx:1.18.0" + }, + }, + } + + for _, c := range cases { + t.Run(c.Name, func(t *testing.T) { + newObj := &appsv1.Deployment{} + if err := CreateNewPatchedObject(c.PatchInfo, c.OldObj, newObj); err != nil { + t.Fatalf("%s CreateNewPatchedObject error %v", c.Name, err) + } + if !c.EqualFuntion(newObj) { + t.Fatalf("%s Not Expect equal funtion", c.Name) + } + }) + } + +} diff --git a/pkg/yurtappmanager/controller/uniteddeployment/adapter/deployment_adapter.go b/pkg/yurtappmanager/controller/uniteddeployment/adapter/deployment_adapter.go index 7f4911c..b60b623 100644 --- a/pkg/yurtappmanager/controller/uniteddeployment/adapter/deployment_adapter.go +++ b/pkg/yurtappmanager/controller/uniteddeployment/adapter/deployment_adapter.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The OpenYurt Authors. +Copyright 2021 The OpenYurt Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package adapter import ( "fmt" + "k8s.io/klog" alpha1 "github.com/openyurtio/yurt-app-manager/pkg/yurtappmanager/apis/apps/v1alpha1" @@ -110,7 +111,6 @@ func (a *DeploymentAdapter) ApplyPoolTemplate(ud *alpha1.UnitedDeployment, poolN set.Annotations[k] = v } - set.GenerateName = getPoolPrefix(ud.Name, poolName) selectors := ud.Spec.Selector.DeepCopy() @@ -138,31 +138,22 @@ func (a *DeploymentAdapter) ApplyPoolTemplate(ud *alpha1.UnitedDeployment, poolN attachNodeAffinityAndTolerations(&set.Spec.Template.Spec, poolConfig) - if poolConfig.Patches == nil { - // If No Patches, Must Set patches annotation - set.Annotations[alpha1.AnnotationPatchesKey]="" + if !PoolHasPatch(poolConfig, set) { klog.Infof("Deployment[%s/%s-] has no patches, do not need strategicmerge", set.Namespace, set.GenerateName) return nil } patched := &appsv1.Deployment{} - if err := StrategicMergeByPatches(set.Kind,set,poolConfig.Patches,patched); err != nil { + if err := CreateNewPatchedObject(poolConfig.Patch, set, patched); err != nil { klog.Errorf("Deployment[%s/%s-] strategic merge by patch %s error %v", set.Namespace, - set.GenerateName, string(poolConfig.Patches.Raw), err) + set.GenerateName, string(poolConfig.Patch.Raw), err) return err } - klog.Infof("Deployment [%s/%s-] has patches configure successfully:%v", set.Namespace, - set.GenerateName, string(poolConfig.Patches.Raw)) + patched.DeepCopyInto(set) - *set = *patched - - // Must Set Annotations, and judge whether is nil - if set.Annotations == nil { - set.Annotations = map[string]string{} - } - - set.Annotations[alpha1.AnnotationPatchesKey]=string(poolConfig.Patches.Raw) + klog.Infof("Deployment [%s/%s-] has patches configure successfully:%v", set.Namespace, + set.GenerateName, string(poolConfig.Patch.Raw)) return nil } diff --git a/pkg/yurtappmanager/controller/uniteddeployment/adapter/statefulset_adapter.go b/pkg/yurtappmanager/controller/uniteddeployment/adapter/statefulset_adapter.go index 5a77c12..70c0c1c 100644 --- a/pkg/yurtappmanager/controller/uniteddeployment/adapter/statefulset_adapter.go +++ b/pkg/yurtappmanager/controller/uniteddeployment/adapter/statefulset_adapter.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The OpenYurt Authors. +Copyright 2021 The OpenYurt Authors. Copyright 2019 The Kruise Authors. Licensed under the Apache License, Version 2.0 (the "License"); @@ -149,6 +149,21 @@ func (a *StatefulSetAdapter) ApplyPoolTemplate(ud *alpha1.UnitedDeployment, pool attachNodeAffinityAndTolerations(&set.Spec.Template.Spec, poolConfig) + if !PoolHasPatch(poolConfig, set) { + klog.Infof("StatefulSet[%s/%s-] has no patches, do not need strategicmerge", set.Namespace, + set.GenerateName) + return nil + } + + patched := &appsv1.StatefulSet{} + if err := CreateNewPatchedObject(poolConfig.Patch, set, patched); err != nil { + klog.Errorf("StatefulSet[%s/%s-] strategic merge by patch %s error %v", set.Namespace, + set.GenerateName, string(poolConfig.Patch.Raw), err) + return err + } + patched.DeepCopyInto(set) + klog.Infof("Statefulset [%s/%s-] has patches configure successfully:%v", set.Namespace, + set.GenerateName, string(poolConfig.Patch.Raw)) return nil } diff --git a/pkg/yurtappmanager/controller/uniteddeployment/allocator.go b/pkg/yurtappmanager/controller/uniteddeployment/allocator.go deleted file mode 100644 index 74b5aee..0000000 --- a/pkg/yurtappmanager/controller/uniteddeployment/allocator.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2020 The OpenYurt Authors. -Copyright 2019 The Kruise Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package uniteddeployment - -import ( - unitv1alpha1 "github.com/openyurtio/yurt-app-manager/pkg/yurtappmanager/apis/apps/v1alpha1" -) - -func GetNextReplicas(ud *unitv1alpha1.UnitedDeployment) map[string]int32 { - next := make(map[string]int32) - for _, pool := range ud.Spec.Topology.Pools { - next[pool.Name] = 0 - if pool.Replicas != nil { - next[pool.Name] = *pool.Replicas - } - } - return next -} diff --git a/pkg/yurtappmanager/controller/uniteddeployment/pool.go b/pkg/yurtappmanager/controller/uniteddeployment/pool.go index d1d3478..68603d9 100644 --- a/pkg/yurtappmanager/controller/uniteddeployment/pool.go +++ b/pkg/yurtappmanager/controller/uniteddeployment/pool.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The OpenYurt Authors. +Copyright 2021 The OpenYurt Authors. Copyright 2019 The Kruise Authors. Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,7 +30,6 @@ type Pool struct { Namespace string Spec PoolSpec Status PoolStatus - Patches string } // PoolSpec stores the spec details of the Pool @@ -42,6 +41,7 @@ type PoolSpec struct { type PoolStatus struct { ObservedGeneration int64 adapter.ReplicasInfo + PatchInfo string } // ResourceRef stores the Pool resource it represents. diff --git a/pkg/yurtappmanager/controller/uniteddeployment/pool_control.go b/pkg/yurtappmanager/controller/uniteddeployment/pool_control.go index ffad7af..8fd2ef9 100644 --- a/pkg/yurtappmanager/controller/uniteddeployment/pool_control.go +++ b/pkg/yurtappmanager/controller/uniteddeployment/pool_control.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The OpenYurt Authors. +Copyright 2021 The OpenYurt Authors. Copyright 2019 The Kruise Authors. Licensed under the Apache License, Version 2.0 (the "License"); @@ -168,8 +168,8 @@ func (m *PoolControl) convertToPool(set metav1.Object) (*Pool, error) { ReplicasInfo: specReplicas, }, } - if data, ok :=set.GetAnnotations()[alpha1.AnnotationPatchesKey] ;ok { - pool.Patches = data + if data, ok := set.GetAnnotations()[alpha1.AnnotationPatchKey]; ok { + pool.Status.PatchInfo = data } return pool, nil } diff --git a/pkg/yurtappmanager/controller/uniteddeployment/uniteddeployment_controller.go b/pkg/yurtappmanager/controller/uniteddeployment/uniteddeployment_controller.go index c21ff26..c08eccf 100644 --- a/pkg/yurtappmanager/controller/uniteddeployment/uniteddeployment_controller.go +++ b/pkg/yurtappmanager/controller/uniteddeployment/uniteddeployment_controller.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The OpenYurt Authors. +Copyright 2021 The OpenYurt Authors. Copyright 2019 The Kruise Authors. Licensed under the Apache License, Version 2.0 (the "License"); @@ -188,9 +188,6 @@ func (r *ReconcileUnitedDeployment) Reconcile(_ context.Context, request reconci return reconcile.Result{}, nil } - //nextReplicas := GetNextReplicas(instance) - //klog.V(4).Infof("Get UnitedDeployment %s/%s next Replicas %v", instance.Namespace, instance.Name, nextReplicas) - nextPatches := GetNextPatches(instance) klog.V(4).Infof("Get UnitedDeployment %s/%s next Patches %v", instance.Namespace, instance.Name, nextPatches) diff --git a/pkg/yurtappmanager/controller/uniteddeployment/uniteddeployment_controller_utils.go b/pkg/yurtappmanager/controller/uniteddeployment/uniteddeployment_controller_utils.go index 4fbe828..971bbb0 100644 --- a/pkg/yurtappmanager/controller/uniteddeployment/uniteddeployment_controller_utils.go +++ b/pkg/yurtappmanager/controller/uniteddeployment/uniteddeployment_controller_utils.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The OpenYurt Authors. +Copyright 2021 The OpenYurt Authors. Copyright 2019 The Kruise Authors. Copyright 2016 The Kubernetes Authors. @@ -34,7 +34,7 @@ const updateRetries = 5 type UnitedDeploymentPatches struct { Replicas int32 - Patches string + Patch string } func getPoolNameFrom(metaObj metav1.Object) (string, error) { @@ -103,15 +103,15 @@ func filterOutCondition(conditions []unitv1alpha1.UnitedDeploymentCondition, con return newConditions } -func GetNextPatches(ud *unitv1alpha1.UnitedDeployment) map[string]UnitedDeploymentPatches{ +func GetNextPatches(ud *unitv1alpha1.UnitedDeployment) map[string]UnitedDeploymentPatches { next := make(map[string]UnitedDeploymentPatches) for _, pool := range ud.Spec.Topology.Pools { t := UnitedDeploymentPatches{} if pool.Replicas != nil { t.Replicas = *pool.Replicas } - if pool.Patches != nil { - t.Patches = string(pool.Patches.Raw) + if pool.Patch != nil { + t.Patch = string(pool.Patch.Raw) } next[pool.Name] = t } diff --git a/pkg/yurtappmanager/controller/uniteddeployment/uniteddeployment_update.go b/pkg/yurtappmanager/controller/uniteddeployment/uniteddeployment_update.go index d0ca475..3ab6eb3 100644 --- a/pkg/yurtappmanager/controller/uniteddeployment/uniteddeployment_update.go +++ b/pkg/yurtappmanager/controller/uniteddeployment/uniteddeployment_update.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The OpenYurt Authors. +Copyright 2021 The OpenYurt Authors. Copyright 2019 The Kruise Authors. Licensed under the Apache License, Version 2.0 (the "License"); @@ -56,7 +56,7 @@ func (r *ReconcileUnitedDeployment) managePools(ud *unitv1alpha1.UnitedDeploymen pool := nameToPool[name] if r.poolControls[poolType].IsExpected(pool, expectedRevision.Name) || pool.Status.ReplicasInfo.Replicas != nextPatches[name].Replicas || - pool.Patches != nextPatches[name].Patches { + pool.Status.PatchInfo != nextPatches[name].Patch { needUpdate = append(needUpdate, name) } } @@ -67,7 +67,7 @@ func (r *ReconcileUnitedDeployment) managePools(ud *unitv1alpha1.UnitedDeploymen pool := nameToPool[cell] replicas := nextPatches[cell].Replicas - klog.V(0).Infof("UnitedDeployment %s/%s needs to update Pool (%s) %s/%s with revision %s, replicas %d ", + klog.Infof("UnitedDeployment %s/%s needs to update Pool (%s) %s/%s with revision %s, replicas %d ", ud.Namespace, ud.Name, poolType, pool.Namespace, pool.Name, expectedRevision.Name, replicas) updatePoolErr := r.poolControls[poolType].UpdatePool(pool, ud, expectedRevision.Name, replicas) @@ -125,7 +125,7 @@ func (r *ReconcileUnitedDeployment) managePoolProvision(ud *unitv1alpha1.UnitedD // manage creating if len(creates) > 0 { // do not consider deletion - klog.V(0).Infof("UnitedDeployment %s/%s needs creating pool (%s) with name: %v", ud.Namespace, ud.Name, workloadType, creates) + klog.Infof("UnitedDeployment %s/%s needs creating pool (%s) with name: %v", ud.Namespace, ud.Name, workloadType, creates) createdPools := make([]string, len(creates)) for i, pool := range creates { createdPools[i] = pool @@ -155,7 +155,7 @@ func (r *ReconcileUnitedDeployment) managePoolProvision(ud *unitv1alpha1.UnitedD // manage deleting if len(deletes) > 0 { - klog.V(0).Infof("UnitedDeployment %s/%s needs deleting pool (%s) with name: [%v]", ud.Namespace, ud.Name, workloadType, deletes) + klog.Infof("UnitedDeployment %s/%s needs deleting pool (%s) with name: [%v]", ud.Namespace, ud.Name, workloadType, deletes) var deleteErrs []error for _, poolName := range deletes { pool := nameToPool[poolName]