MCPcopy
hub / github.com/zalando/postgres-operator / TestStatefulSetAnnotations

Function TestStatefulSetAnnotations

pkg/cluster/cluster_test.go:165–186  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

163}
164
165func TestStatefulSetAnnotations(t *testing.T) {
166 spec := acidv1.PostgresSpec{
167 TeamID: "myapp", NumberOfInstances: 1,
168 Resources: &acidv1.Resources{
169 ResourceRequests: acidv1.ResourceDescription{CPU: k8sutil.StringToPointer("1"), Memory: k8sutil.StringToPointer("10")},
170 ResourceLimits: acidv1.ResourceDescription{CPU: k8sutil.StringToPointer("1"), Memory: k8sutil.StringToPointer("10")},
171 },
172 Volume: acidv1.Volume{
173 Size: "1G",
174 },
175 }
176 ss, err := cl.generateStatefulSet(&spec)
177 if err != nil {
178 t.Errorf("in %s no statefulset created %v", t.Name(), err)
179 }
180 if ss != nil {
181 annotation := ss.ObjectMeta.GetAnnotations()
182 if _, ok := annotation["downscaler/downtime_replicas"]; !ok {
183 t.Errorf("in %s respective annotation not found on sts", t.Name())
184 }
185 }
186}
187
188func TestStatefulSetUpdateWithEnv(t *testing.T) {
189 oldSpec := &acidv1.PostgresSpec{

Callers

nothing calls this directly

Calls 2

StringToPointerFunction · 0.92
generateStatefulSetMethod · 0.80

Tested by

no test coverage detected