Skip to content

Commit

Permalink
Update the TestCreateElasticsearchCR unit test to include a case with… (
Browse files Browse the repository at this point in the history
#1299)

… tolerations

Signed-off-by: Kevin Earls <[email protected]>
  • Loading branch information
kevinearls authored Nov 12, 2020
1 parent 660a6ff commit b057274
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions pkg/storage/elasticsearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ func TestCreateElasticsearchCR(t *testing.T) {
genuuidmaster1 := "myprojectfoomaster"
genuuid2 := "myprojectfoobar"
genuuidmaster2 := "myprojectfoobarmaster"
genuuid3 := "mytolerableprojecttolerations"

toleration := corev1.Toleration{
Key: "special",
Operator: "Equal",
Value: "false",
Effect: "NoSchedule",
}
tolerations := []corev1.Toleration{toleration}

tests := []struct {
name string
namespace string
Expand Down Expand Up @@ -123,6 +133,33 @@ func TestCreateElasticsearchCR(t *testing.T) {
},
},
},
{
name: "tolerations",
namespace: "mytolerableproject",
jEsSpec: v1.ElasticsearchSpec{
NodeCount: 2,
RedundancyPolicy: esv1.FullRedundancy,
Tolerations: tolerations,
Storage: esv1.ElasticsearchStorageSpec{
StorageClassName: &storageClassName,
},
},
esSpec: esv1.ElasticsearchSpec{
ManagementState: esv1.ManagementStateManaged,
RedundancyPolicy: esv1.FullRedundancy,
Spec: esv1.ElasticsearchNodeSpec{
Tolerations: tolerations,
},
Nodes: []esv1.ElasticsearchNode{
{
NodeCount: 2,
Storage: esv1.ElasticsearchStorageSpec{StorageClassName: &storageClassName},
Roles: []esv1.ElasticsearchNodeRole{esv1.ElasticsearchRoleMaster, esv1.ElasticsearchRoleClient, esv1.ElasticsearchRoleData},
GenUUID: &genuuid3,
},
},
},
},
}
for _, test := range tests {
j := v1.NewJaeger(types.NamespacedName{Name: test.name, Namespace: test.namespace})
Expand Down

0 comments on commit b057274

Please sign in to comment.