1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-16 09:16:38 +00:00

test/e2e: Get Secret before modifying

This might be required as the resourceVersion may not be correct.
This commit is contained in:
Frederic Branczyk 2017-11-30 14:45:24 +01:00
parent 0bad38a1fd
commit 5014795c9a
No known key found for this signature in database
GPG key ID: 7741A52782A90069
2 changed files with 7 additions and 2 deletions

View file

@ -33,7 +33,7 @@ container:
docker build -t $(REPO):$(TAG) .
e2e-test:
go test -timeout 20m -v ./test/e2e/ $(TEST_RUN_ARGS) --kubeconfig=$(KUBECONFIG) --operator-image=$(REPO):$(TAG) --namespace=$(NAMESPACE)
go test -timeout 40m -v ./test/e2e/ $(TEST_RUN_ARGS) --kubeconfig=$(KUBECONFIG) --operator-image=$(REPO):$(TAG) --namespace=$(NAMESPACE)
e2e-status:
kubectl get prometheus,alertmanager,servicemonitor,statefulsets,deploy,svc,endpoints,pods,cm,secrets,replicationcontrollers --all-namespaces

View file

@ -248,9 +248,14 @@ scrape_configs:
static_configs:
- targets:
- 111.111.111.111:9090
- 111.111.111.112:9090
- 111.111.111.112:9090
`
cfg, err := framework.KubeClient.CoreV1().Secrets(ns).Get(cfg.Name, metav1.GetOptions{})
if err != nil {
t.Fatal(errors.Wrap(err, "could not retrieve previous secret"))
}
cfg.Data["prometheus.yaml"] = []byte(secondConfig)
if _, err := framework.KubeClient.CoreV1().Secrets(ns).Update(cfg); err != nil {
t.Fatal(err)