-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- image property in hydra.yaml now supports environment variables
- Loading branch information
Ben Keil
committed
Mar 10, 2018
1 parent
afaf65b
commit fcc3efb
Showing
5 changed files
with
47 additions
and
49 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
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
This file was deleted.
Oops, something went wrong.
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,32 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
// ImageUtil provides some helper methods | ||
type ImageUtil interface { | ||
getImageTags(config Config, tags []string) []string | ||
} | ||
|
||
// DefaultImageUtil is the default implementation for the ImageUtil interface | ||
type DefaultImageUtil struct { | ||
} | ||
|
||
// NewDefaultImageUtil creates a new instance of DefaultImageUtil | ||
func NewDefaultImageUtil() *DefaultImageUtil { | ||
return new(DefaultImageUtil) | ||
} | ||
|
||
// getImageTags returns the complete image name (including registry url, image name and tag) | ||
func (helper *DefaultImageUtil) getImageTags(config Config, tags []string) []string { | ||
// Define all images we want to build | ||
imageTags := []string{} | ||
for _, image := range config.Image { | ||
for _, tag := range tags { | ||
imageTags = append(imageTags, fmt.Sprintf("%s:%s", os.ExpandEnv(image), tag)) | ||
} | ||
} | ||
return imageTags | ||
} |
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