Merge pull request #129000 from RogerTaylor130/fix-log-info-in-sample-controller

Fix the log for current and desired number of replicas in sample controller

Kubernetes-commit: e85c72d4177fba224cb1baa1b5abfb5980e6d867
This commit is contained in:
Kubernetes Publisher 2024-12-23 10:40:11 +01:00
commit 7318a64a21
3 changed files with 13 additions and 13 deletions

View File

@ -289,7 +289,7 @@ func (c *Controller) syncHandler(ctx context.Context, objectRef cache.ObjectName
// number does not equal the current desired replicas on the Deployment, we
// should update the Deployment resource.
if foo.Spec.Replicas != nil && *foo.Spec.Replicas != *deployment.Spec.Replicas {
logger.V(4).Info("Update deployment resource", "currentReplicas", *foo.Spec.Replicas, "desiredReplicas", *deployment.Spec.Replicas)
logger.V(4).Info("Update deployment resource", "currentReplicas", *deployment.Spec.Replicas, "desiredReplicas", *foo.Spec.Replicas)
deployment, err = c.kubeclientset.AppsV1().Deployments(foo.Namespace).Update(ctx, newDeployment(foo), metav1.UpdateOptions{FieldManager: FieldManager})
}

8
go.mod
View File

@ -10,10 +10,10 @@ godebug winsymlink=0
require (
golang.org/x/time v0.7.0
k8s.io/api v0.0.0-20241214014715-eac45518d7fe
k8s.io/apimachinery v0.0.0-20241214014415-767f17a6afea
k8s.io/client-go v0.0.0-20241214015128-61ee2c5802c7
k8s.io/code-generator v0.0.0-20241214015924-a377fc713557
k8s.io/api v0.0.0-20241220201724-9603cdf39dd3
k8s.io/apimachinery v0.0.0-20241218214440-307a3ddd3cae
k8s.io/client-go v0.0.0-20241218215229-ea791f25013d
k8s.io/code-generator v0.0.0-20241218220056-bd95f067c5d5
k8s.io/klog/v2 v2.130.1
)

16
go.sum
View File

@ -138,14 +138,14 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.0.0-20241214014715-eac45518d7fe h1:3brWXwMKrWloyi0Qqv6SqRIGC/yS1wf5/OSxirB/ruw=
k8s.io/api v0.0.0-20241214014715-eac45518d7fe/go.mod h1:TeD+e60UFfC0xfnP9/tT92lG7sSnSs+ebTPX1oCNrDU=
k8s.io/apimachinery v0.0.0-20241214014415-767f17a6afea h1:ZUHj/k511rdZLx69atS9F5P+PDDQarX9DmI8/3TQ15Y=
k8s.io/apimachinery v0.0.0-20241214014415-767f17a6afea/go.mod h1:vmecNW2HWfNZboIXS3Vg/3qp+T42YyW6jCpcdhnas9s=
k8s.io/client-go v0.0.0-20241214015128-61ee2c5802c7 h1:W2NxcoEN3y/P48IBQdJgBj2nWlU+dyXvRQKjRYdV6y8=
k8s.io/client-go v0.0.0-20241214015128-61ee2c5802c7/go.mod h1:9DOj9Eg/2wdCibOBBR8J+SamkzoU+TVr9bk5B7KAbgM=
k8s.io/code-generator v0.0.0-20241214015924-a377fc713557 h1:nqDak2GLSCqij6a7RyrpMlfoeYdfK8g2h07dtKhaZWE=
k8s.io/code-generator v0.0.0-20241214015924-a377fc713557/go.mod h1:fOtNfcv8VMt+i9pw0b7ju4uC/ZpRQmGlkcFNp6+3wWc=
k8s.io/api v0.0.0-20241220201724-9603cdf39dd3 h1:3iyOtnvuB7R9AEVZwh3FVRdSz4Q6bDIHh2H8HRs8Tzw=
k8s.io/api v0.0.0-20241220201724-9603cdf39dd3/go.mod h1:bKle1AFx44vmuGNGuRrPJ7r/4K4DXYFQTlcRWFZTodM=
k8s.io/apimachinery v0.0.0-20241218214440-307a3ddd3cae h1:f/c+v/txPi2w3c3YUM1hO6aMDx8s1HOYYNUD3ugomyg=
k8s.io/apimachinery v0.0.0-20241218214440-307a3ddd3cae/go.mod h1:vmecNW2HWfNZboIXS3Vg/3qp+T42YyW6jCpcdhnas9s=
k8s.io/client-go v0.0.0-20241218215229-ea791f25013d h1:UMOF3Uc/A2/VVXWmhgOwsFbeCfECWK3qDEmLq5JXtCs=
k8s.io/client-go v0.0.0-20241218215229-ea791f25013d/go.mod h1:RD+R2WlG5zSBnVrEkEb3o57PHwfieZjluCbEHhwWAXc=
k8s.io/code-generator v0.0.0-20241218220056-bd95f067c5d5 h1:y+oT2yUWvqEVtx5bjUacSsQHA2PJaXMctZzq0ZKDbmA=
k8s.io/code-generator v0.0.0-20241218220056-bd95f067c5d5/go.mod h1:S2s8+x8/SQV7Vj2y5mTUN+hQp/tbovynHzvrLbWqldo=
k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 h1:si3PfKm8dDYxgfbeA6orqrtLkvvIeH8UqffFJDl0bz4=
k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9/go.mod h1:EJykeLsmFC60UQbYJezXkEsG2FLrt0GPNkU5iK5GWxU=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=