From 24cfaf5c51ed1e1485ad333c1d49fcc90526f067 Mon Sep 17 00:00:00 2001 From: Sebastien Coquelin Date: Thu, 24 Oct 2024 15:04:51 -0700 Subject: [PATCH] Add default containerPort for cdi-apiserver deployment (#3465) Signed-off-by: Sebastien Coquelin --- pkg/operator/resources/namespaced/apiserver.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkg/operator/resources/namespaced/apiserver.go b/pkg/operator/resources/namespaced/apiserver.go index acf0df0d54..845a46f8b8 100644 --- a/pkg/operator/resources/namespaced/apiserver.go +++ b/pkg/operator/resources/namespaced/apiserver.go @@ -98,7 +98,8 @@ func createAPIServerDeployment(image, verbosity, pullPolicy string, imagePullSec if replicas > 1 { deployment.Spec.Replicas = &replicas } - container := utils.CreateContainer(common.CDIApiServerResourceName, image, verbosity, pullPolicy) + container := utils.CreatePortsContainer(common.CDIApiServerResourceName, image, pullPolicy, createAPIServerPorts(common.CDIApiServerResourceName)) + container.Args = []string{"-v=" + verbosity} container.Env = []corev1.EnvVar{ { Name: common.InstallerPartOfLabel, @@ -195,3 +196,13 @@ func createAPIServerDeployment(image, verbosity, pullPolicy string, imagePullSec } return deployment } + +func createAPIServerPorts(name string) []corev1.ContainerPort { + return []corev1.ContainerPort{ + { + Name: name, + ContainerPort: 8443, + Protocol: "TCP", + }, + } +}