Skip to content

Commit 0c026e9

Browse files
authored
Merge pull request kubernetes-sigs#10990 from vincepri/allow-image-customizable
🌱 test/framework: Allow ScaleUp Deployment image to be customized
2 parents 523d61e + 3059ae1 commit 0c026e9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/framework/autoscaler_helpers.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,16 @@ func ApplyAutoscalerToWorkloadCluster(ctx context.Context, input ApplyAutoscaler
135135

136136
// AddScaleUpDeploymentAndWaitInput is the input for AddScaleUpDeploymentAndWait.
137137
type AddScaleUpDeploymentAndWaitInput struct {
138-
ClusterProxy ClusterProxy
138+
ClusterProxy ClusterProxy
139+
ContainerImage string
139140
}
140141

141142
// AddScaleUpDeploymentAndWait create a deployment that will trigger the autoscaler to scale up and create a new machine.
142143
func AddScaleUpDeploymentAndWait(ctx context.Context, input AddScaleUpDeploymentAndWaitInput, intervals ...interface{}) {
143144
By("Create a scale up deployment with resource requests to force scale up")
145+
if input.ContainerImage == "" {
146+
input.ContainerImage = "registry.k8s.io/pause"
147+
}
144148

145149
// gets the node size
146150
nodes := &corev1.NodeList{}
@@ -192,7 +196,7 @@ func AddScaleUpDeploymentAndWait(ctx context.Context, input AddScaleUpDeployment
192196
Containers: []corev1.Container{
193197
{
194198
Name: "pause",
195-
Image: "registry.k8s.io/pause",
199+
Image: input.ContainerImage,
196200
ImagePullPolicy: corev1.PullIfNotPresent,
197201
Resources: corev1.ResourceRequirements{
198202
Requests: map[corev1.ResourceName]resource.Quantity{

0 commit comments

Comments
 (0)