Skip to content

Commit

Permalink
Add default containerPort for cdi-apiserver deployment (kubevirt#3465)
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastien Coquelin <[email protected]>
  • Loading branch information
scoquelin authored and universal-itengineer committed Oct 29, 2024
1 parent 03484d9 commit 24cfaf5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/operator/resources/namespaced/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
},
}
}

0 comments on commit 24cfaf5

Please sign in to comment.