-
Notifications
You must be signed in to change notification settings - Fork 542
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to override default registry and tag in pkg/name (#824)
* Add name Option functions Adds a name OptionFn type that allows for overriding default option values. Also introduces two new option fields, defaultRegistry and defaultTag. These are set to the previously used defaults unless overridden by their respective OptionFns. Signed-off-by: hasheddan <[email protected]> * Set default registry when building the registry object Moves registry name defaulting to construction rather than defaulting in registry methods. This allows for a user to override the configured default via name options. Note that we still rewrite docker.io to index.docker.io if it is explictly provided. This also means that if the default is set to docker.io by a user and no registry is provided, we will rewrite the defeault to index.docker.io. Signed-off-by: hasheddan <[email protected]> * Set default tag when building tag object Moves tag defaulting to construction of the tag object rather than defaulting in tag methods. Note that we assume a default tag is valid in the eyes of the user and do not check the default for validity if it is overridden. This is consistent with the current behavior as defaulting was previously happening much later than the check for a valid tag. Signed-off-by: hasheddan <[email protected]> * Add ParseReference tests for registry and tag defaulting Adds tests for paring full image references with registry and tag defaulting. Signed-off-by: hasheddan <[email protected]>
- Loading branch information
Showing
6 changed files
with
107 additions
and
18 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 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 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