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:
parent
0bad38a1fd
commit
5014795c9a
2 changed files with 7 additions and 2 deletions
2
Makefile
2
Makefile
|
@ -33,7 +33,7 @@ container:
|
||||||
docker build -t $(REPO):$(TAG) .
|
docker build -t $(REPO):$(TAG) .
|
||||||
|
|
||||||
e2e-test:
|
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:
|
e2e-status:
|
||||||
kubectl get prometheus,alertmanager,servicemonitor,statefulsets,deploy,svc,endpoints,pods,cm,secrets,replicationcontrollers --all-namespaces
|
kubectl get prometheus,alertmanager,servicemonitor,statefulsets,deploy,svc,endpoints,pods,cm,secrets,replicationcontrollers --all-namespaces
|
||||||
|
|
|
@ -248,9 +248,14 @@ scrape_configs:
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets:
|
- targets:
|
||||||
- 111.111.111.111:9090
|
- 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)
|
cfg.Data["prometheus.yaml"] = []byte(secondConfig)
|
||||||
if _, err := framework.KubeClient.CoreV1().Secrets(ns).Update(cfg); err != nil {
|
if _, err := framework.KubeClient.CoreV1().Secrets(ns).Update(cfg); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|
Loading…
Add table
Reference in a new issue