Skip to content

Commit

Permalink
unify promethuse-operator url
Browse files Browse the repository at this point in the history
Signed-off-by: lowang-bh <lhui_wang@163.com>
  • Loading branch information
lowang-bh committed Sep 13, 2023
1 parent 6bd9e01 commit 24c169c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/e2e/utils/test_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ func (t *TestContext) makeCertManagerURL() string {
return fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
}

func (t *TestContext) makePrometheusOperatorURL() string {
return fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
}

// InstallCertManager installs the cert manager bundle. If hasv1beta1CRs is true,
// the legacy version (which uses v1alpha2 CRs) is installed.
func (t *TestContext) InstallCertManager() error {
Expand Down Expand Up @@ -149,14 +153,14 @@ func (t *TestContext) UninstallCertManager() {

// InstallPrometheusOperManager installs the prometheus manager bundle.
func (t *TestContext) InstallPrometheusOperManager() error {
url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
url := t.makePrometheusOperatorURL()
_, err := t.Kubectl.Apply(false, "-f", url)
return err
}

// UninstallPrometheusOperManager uninstalls the prometheus manager bundle.
func (t *TestContext) UninstallPrometheusOperManager() {
url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
url := t.makePrometheusOperatorURL()
if _, err := t.Kubectl.Delete(false, "-f", url); err != nil {
warnError(err)
}
Expand Down

0 comments on commit 24c169c

Please sign in to comment.