Skip to content

Commit

Permalink
Bug Fix : Init Container tried to mount invalid volume name (#538)
Browse files Browse the repository at this point in the history
* Set up CI with Azure Pipelines

[skip ci]

* Update pipeline.yaml

* revert azure pipeline

Signed-off-by: Shubham Gupta <[email protected]>

* update the pipeline

Signed-off-by: Shubham Gupta <[email protected]>

* bug fix invalid volume connect in Init Container

Signed-off-by: Shubham Gupta <[email protected]>

---------

Signed-off-by: Shubham Gupta <[email protected]>
  • Loading branch information
shubham-cmyk authored Jul 1, 2023
1 parent 2f8f34e commit a570e6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions k8sutils/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func generateStatefulSetsDef(stsMeta metav1.ObjectMeta, params statefulSetParame
}

if initcontainerParams.Enabled != nil && *initcontainerParams.Enabled {
statefulset.Spec.Template.Spec.InitContainers = generateInitContainerDef("init-"+stsMeta.GetName(), initcontainerParams, initcontainerParams.AdditionalMountPath)
statefulset.Spec.Template.Spec.InitContainers = generateInitContainerDef(stsMeta.GetName(), initcontainerParams, initcontainerParams.AdditionalMountPath)
}
if params.Tolerations != nil {
statefulset.Spec.Template.Spec.Tolerations = *params.Tolerations
Expand Down Expand Up @@ -425,7 +425,7 @@ func generateContainerDef(name string, containerParams containerParameters, clus
func generateInitContainerDef(name string, initcontainerParams initContainerParameters, mountpath []corev1.VolumeMount) []corev1.Container {
initcontainerDefinition := []corev1.Container{
{
Name: name,
Name: "init" + name,
Image: initcontainerParams.Image,
ImagePullPolicy: initcontainerParams.ImagePullPolicy,
Command: initcontainerParams.Command,
Expand Down

0 comments on commit a570e6e

Please sign in to comment.