Skip to content

Commit

Permalink
Add test for sidecar volume
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromefroe committed Dec 4, 2020
1 parent d2f26e6 commit f685777
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions pkg/k8sops/m3db/generators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,17 +506,28 @@ func TestGenerateStatefulSet(t *testing.T) {
t.Log(fixture.Spec.ParallelPodManagement)
}

// Test sidecar containers.
// Test sidecar containers and volumes.
fixture = getFixture("testM3DBCluster.yaml", t)
fixture.Spec.SidecarContainers = []v1.Container{
{
Name: "sidecar0",
},
}
fixture.Spec.SidecarVolumes = []v1.Volume{
{
Name: "sidecar0",
},
}

ss = baseSS.DeepCopy()
sidecar := v1.Container{Name: "sidecar0"}

var (
sidecar = v1.Container{Name: "sidecar0"}
volume = v1.Volume{Name: "sidecar0"}
)
ss.Spec.Template.Spec.Containers = append(ss.Spec.Template.Spec.Containers, sidecar)
ss.Spec.Template.Spec.Volumes = append(ss.Spec.Template.Spec.Volumes, volume)

newSS, err = GenerateStatefulSet(fixture, isolationGroup, *instanceAmount)
assert.NoError(t, err)
assert.NotNil(t, newSS)
Expand Down

0 comments on commit f685777

Please sign in to comment.