Skip to content

Commit

Permalink
tidy test
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin committed Sep 18, 2023
1 parent 8f07221 commit 01550ff
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions internal/fullnode/build_pods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,21 @@ func TestBuildPods(t *testing.T) {
})

t.Run("instance overrides", func(t *testing.T) {
image := "agoric:latest"
overrideImage := "some_image:custom"
crd := &cosmosv1.CosmosFullNode{
ObjectMeta: metav1.ObjectMeta{
Name: "agoric",
},
Spec: cosmosv1.FullNodeSpec{
Replicas: 6,
PodTemplate: cosmosv1.PodSpec{
Image: "agoric:latest",
Image: image,
},
InstanceOverrides: map[string]cosmosv1.InstanceOverridesSpec{
"agoric-2": {DisableStrategy: ptr(cosmosv1.DisablePod)},
"agoric-4": {DisableStrategy: ptr(cosmosv1.DisableAll)},
"agoric-5": {Image: "some_image:custom"},
"agoric-5": {Image: overrideImage},
},
},
}
Expand All @@ -87,10 +89,11 @@ func TestBuildPods(t *testing.T) {
got := lo.Map(pods, func(pod diff.Resource[*corev1.Pod], _ int) string { return pod.Object().Name })
require.Equal(t, want, got)
for _, pod := range pods {
image := pod.Object().Spec.Containers[0].Image
if pod.Object().Name == "agoric-5" {
require.Equal(t, "some_image:custom", pod.Object().Spec.Containers[0].Image)
require.Equal(t, overrideImage, image)
} else {
require.Equal(t, "agoric:latest", pods[0].Object().Spec.Containers[0].Image)
require.Equal(t, image, image)
}
}
})
Expand Down

0 comments on commit 01550ff

Please sign in to comment.