Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added METRIC_TEST_IMAGE var (#57)
Co-authored-by: Evgeny Levin <elevin@redhat.com>
  • Loading branch information
openshift-cherrypick-robot and evgenLevin committed Jun 13, 2022
1 parent 332cd8e commit c8812ee
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -68,3 +68,7 @@ Running `make deploy` will deploy the daemonset and set up the configuration to
## Deploy on k8s

Running `make deploy-k8s` will deploy the daemonset and set up the configuration to tie it to the Prometheus operator instance of an existing kubernetes cluster where the prometheus operator was deployed. Please note that the k8s version exposes metrics over a plain http port.

## List of environment variables used in the tests

- METRIC_TEST_IMAGE - path to generic container image used in tests
4 changes: 2 additions & 2 deletions test/network-metrics-daemon/network_metrics_daemon.go
Expand Up @@ -57,7 +57,7 @@ var _ = ginkgo.Describe("NetworkMetricsDaemon", func() {
Containers: []corev1.Container{
{
Name: "c1",
Image: "quay.io/centos/centos",
Image: consts.TestImage,
Command: []string{"/bin/bash", "-c", "sleep inf"},
},
},
Expand Down Expand Up @@ -226,7 +226,7 @@ var _ = ginkgo.Describe("NetworkMetricsDaemon", func() {
Containers: []corev1.Container{
{
Name: "c1",
Image: "quay.io/centos/centos",
Image: consts.TestImage,
Command: []string{"/bin/bash", "-c", "sleep inf"},
},
},
Expand Down
12 changes: 12 additions & 0 deletions test/utils/consts/consts.go
@@ -1,5 +1,17 @@
package consts

import "os"

// TestImage contains test image (default is quay.io/centos/centos)
var TestImage string

func init() {
TestImage = os.Getenv("METRIC_TEST_IMAGE")
if TestImage == "" {
TestImage = "quay.io/centos/centos"
}
}

const (
// TestingNamespace contains the name of the testing namespace
TestingNamespace = "metrictest"
Expand Down
2 changes: 1 addition & 1 deletion test/utils/pods/pods.go
Expand Up @@ -62,7 +62,7 @@ func getDefinition() *corev1.Pod {
Spec: corev1.PodSpec{
TerminationGracePeriodSeconds: pointer.Int64Ptr(0),
Containers: []corev1.Container{{Name: "test",
Image: "quay.io/centos/centos",
Image: consts.TestImage,
Command: []string{"/bin/bash", "-c", "sleep INF"},
}},
},
Expand Down

0 comments on commit c8812ee

Please sign in to comment.