Skip to content

Commit

Permalink
Adds easy way for devs to swap their own registry
Browse files Browse the repository at this point in the history
Without this you have to constantly change the flags depending
on the command and its verbose/painful. This will just be
a hidden little developer helper.

Signed-off-by: John Schnake <[email protected]>
  • Loading branch information
johnSchnake committed Sep 17, 2021
1 parent fe560d0 commit 7d59d80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/sonobuoy/app/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func AddDNSPodLabelsFlag(str *[]string, flags *pflag.FlagSet) {
// AddSonobuoyImage initialises an image url flag.
func AddSonobuoyImage(image *string, flags *pflag.FlagSet) {
flags.StringVar(
image, sonobuoyImageFlag, config.DefaultImage,
image, sonobuoyImageFlag, *image,
"Container image override for the sonobuoy worker and aggregator.",
)
}
Expand Down
6 changes: 6 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package config

import (
"fmt"
"os"
"path"
"time"

Expand Down Expand Up @@ -365,6 +367,10 @@ func New() *Config {
}

cfg.WorkerImage = DefaultImage
devRepo := os.Getenv("SONOBUOY_DEV_REPO")
if len(devRepo) > 0 {
cfg.WorkerImage = fmt.Sprintf("%v/sonobuoy:%v", devRepo, buildinfo.Version)
}
cfg.ImagePullPolicy = DefaultSonobuoyPullPolicy

cfg.ProgressUpdatesPort = DefaultProgressUpdatesPort
Expand Down

0 comments on commit 7d59d80

Please sign in to comment.