(t *testing.T)
| 163 | } |
| 164 | |
| 165 | func 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 | |
| 188 | func TestStatefulSetUpdateWithEnv(t *testing.T) { |
| 189 | oldSpec := &acidv1.PostgresSpec{ |
nothing calls this directly
no test coverage detected