-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deployment reconciler): Couldn't parse image reference "docker.io…
…/grafana/[email protected]" (#1320) * use ':' for deployment image tag delimiter * rename 'setGrafanaImage' to 'getGrafanaImage' changing verb to 'get' since the function returns a value
- Loading branch information
Showing
2 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
controllers/reconcilers/grafana/deployment_reconciler_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package grafana | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
config2 "github.com/grafana-operator/grafana-operator/v5/controllers/config" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func Test_getGrafanaImage(t *testing.T) { | ||
expectedDeploymentImage := fmt.Sprintf("%s:%s", config2.GrafanaImage, config2.GrafanaVersion) | ||
|
||
assert.Equal(t, expectedDeploymentImage, getGrafanaImage()) | ||
} | ||
|
||
func Test_getGrafanaImage_withEnvironmentOverride(t *testing.T) { | ||
expectedDeploymentImage := "I want this grafana image" | ||
t.Setenv("RELATED_IMAGE_GRAFANA", expectedDeploymentImage) | ||
|
||
assert.Equal(t, expectedDeploymentImage, getGrafanaImage()) | ||
} |