Add KANIKO_REGISTRY_MIRROR env var (#1875)

This commit is contained in:
Jason Hall 2022-01-14 11:07:55 -05:00 committed by GitHub
parent 0f986a423f
commit 1a6b8ce37b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -218,6 +218,11 @@ func addKanikoOptionsFlags() {
RootCmd.PersistentFlags().BoolVarP(&opts.CacheCopyLayers, "cache-copy-layers", "", false, "Caches copy layers")
RootCmd.PersistentFlags().VarP(&opts.IgnorePaths, "ignore-path", "", "Ignore these paths when taking a snapshot. Set it repeatedly for multiple paths.")
RootCmd.PersistentFlags().BoolVarP(&opts.ForceBuildMetadata, "force-build-metadata", "", false, "Force add metadata layers to build image")
// Allow setting --registry-mirror using an environment variable.
if val, ok := os.LookupEnv("KANIKO_REGISTRY_MIRROR"); ok {
opts.RegistryMirrors.Set(val)
}
}
// addHiddenFlags marks certain flags as hidden from the executor help text