Prevent deployment from rolling update due to different instance-id (#1454)
The pod template is embedded inside the deployment. So if the pod annotation contains instance-id, the deployment will get updated and thus triggers a rolling update whenever a new executor starts which is unwanted. After this PR, poolmanager will patches instance-id when a pod is chosen for a function. For newdeploy, unlike poolmanager manages the lifecycle of function pod directly, newdeploy is only responsible to create the deployment so we append instance-id to top- level controller (deployment) only.
This commit is contained in:
@@ -31,7 +31,9 @@ import (
|
||||
// when creating the environment deployment since kubelet will retry to
|
||||
// pull image until successes.
|
||||
func ApplyImagePullSecret(secret string, podspec apiv1.PodSpec) *apiv1.PodSpec {
|
||||
podspec.ImagePullSecrets = []apiv1.LocalObjectReference{{Name: secret}}
|
||||
if len(secret) > 0 {
|
||||
podspec.ImagePullSecrets = []apiv1.LocalObjectReference{{Name: secret}}
|
||||
}
|
||||
return &podspec
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user