From 526686bff9c7c522e8d5b1144cf29b89a190f7a0 Mon Sep 17 00:00:00 2001 From: Miciah Masters Date: Tue, 20 Apr 2021 20:07:11 -0400 Subject: [PATCH] Fix RollingUpdateDaemonSet godoc regarding rounding Fix the godoc for RollingUpdateDaemonSet to state that spec.updateStrategy.rollingUpdate.maxUnavailable is rounded up. A recent commit changed the godoc to say that the value of this field was rounded down, but the actual implementation rounds up and always has rounded up. (This is in contrast to Deployments, where spec.strategy.rollingUpdate.maxUnavailable is rounded down.) Follow-up to commit 5aa53f885c980873087cbc86e1eccdf342e775b5. * api/openapi-spec/swagger.json: * staging/src/k8s.io/api/apps/v1/generated.proto: * pkg/apis/apps/types.go: * staging/src/k8s.io/api/apps/v1/types.go: * staging/src/k8s.io/api/apps/v1/types_swagger_doc_generated.go: * staging/src/k8s.io/api/apps/v1beta2/generated.proto: * staging/src/k8s.io/api/apps/v1beta2/types.go: * staging/src/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go: * staging/src/k8s.io/api/extensions/v1beta1/generated.proto: * staging/src/k8s.io/api/extensions/v1beta1/types.go: * staging/src/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go: * staging/src/k8s.io/cli-runtime/artifacts/openapi/swagger.json: * staging/src/k8s.io/kubectl/testdata/openapi/swagger.json: Change "rounding down" to "rounding up". Kubernetes-commit: 452e2eaf1ba40512e90a29d379774054e86e324d --- testdata/openapi/swagger.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testdata/openapi/swagger.json b/testdata/openapi/swagger.json index 4100a89a..3f170551 100644 --- a/testdata/openapi/swagger.json +++ b/testdata/openapi/swagger.json @@ -1520,7 +1520,7 @@ }, "maxUnavailable": { "$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString", - "description": "The maximum number of DaemonSet pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total number of DaemonSet pods at the start of the update (ex: 10%). Absolute number is calculated from percentage by rounding down to a minimum of one. This cannot be 0 if MaxSurge is 0 Default value is 1. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their pods stopped for an update at any given time. The update starts by stopping at most 30% of those DaemonSet pods and then brings up new DaemonSet pods in their place. Once the new pods are available, it then proceeds onto other DaemonSet pods, thus ensuring that at least 70% of original number of DaemonSet pods are available at all times during the update." + "description": "The maximum number of DaemonSet pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total number of DaemonSet pods at the start of the update (ex: 10%). Absolute number is calculated from percentage by rounding up. This cannot be 0 if MaxSurge is 0 Default value is 1. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their pods stopped for an update at any given time. The update starts by stopping at most 30% of those DaemonSet pods and then brings up new DaemonSet pods in their place. Once the new pods are available, it then proceeds onto other DaemonSet pods, thus ensuring that at least 70% of original number of DaemonSet pods are available at all times during the update." } }, "type": "object"