Skip to content

Commit

Permalink
fix: fallback to default if image repository empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdh committed Jul 30, 2024
1 parent 30a76ab commit e3317ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ entropy*.dev.yml
test_*.yml
test_*.json
requests.http
entropy.yaml
10 changes: 8 additions & 2 deletions modules/firehose/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var defaultDriverConf = driverConf{
defaultKey: "firehose",
},
ChartValues: ChartValues{
ImageRepository: "gotocompany/firehose",
ImageRepository: imageRepo,
ImageTag: "latest",
ChartVersion: "0.1.3",
ImagePullPolicy: "IfNotPresent",
Expand Down Expand Up @@ -304,12 +304,18 @@ func (fd *firehoseDriver) getHelmRelease(res resource.Resource, conf Config,
rc.Namespace = conf.Namespace
rc.ForceUpdate = true
rc.Version = conf.ChartValues.ChartVersion

imageRepository := fd.conf.ChartValues.ImageRepository
if conf.ChartValues.ImageRepository != "" {
imageRepository = conf.ChartValues.ImageRepository
}

rc.Values = map[string]any{
labelsConfKey: modules.CloneAndMergeMaps(deploymentLabels, entropyLabels),
"replicaCount": conf.Replicas,
"firehose": map[string]any{
"image": map[string]any{
"repository": conf.ChartValues.ImageRepository,
"repository": imageRepository,
"pullPolicy": conf.ChartValues.ImagePullPolicy,
"tag": conf.ChartValues.ImageTag,
},
Expand Down

0 comments on commit e3317ec

Please sign in to comment.