mirror of https://github.com/kubernetes/kops.git
Sanitize docker tag consistently
We need to use the same logic in the Makefile when we build the image, and in kops when we reference the image.
This commit is contained in:
parent
3a583c6b91
commit
2af3961d02
1
Makefile
1
Makefile
|
|
@ -55,6 +55,7 @@ ifndef VERSION
|
|||
endif
|
||||
|
||||
# + is valid in semver, but not in docker tags. Fixup CI versions.
|
||||
# Note that this mirrors the logic in DefaultProtokubeImageName
|
||||
PROTOKUBE_TAG := $(subst +,-,${VERSION})
|
||||
|
||||
# Go exports:
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ limitations under the License.
|
|||
|
||||
package kops
|
||||
|
||||
import "strings"
|
||||
|
||||
// This should be replaced by the makefile
|
||||
var Version = "1.5.0"
|
||||
|
||||
|
|
@ -24,5 +26,8 @@ var GitVersion = ""
|
|||
|
||||
// DefaultProtokubeImageName is the name of the protokube image, as we would pass to "docker run"
|
||||
func DefaultProtokubeImageName() string {
|
||||
return "protokube:" + Version
|
||||
// + is valid in semver, but not in docker tags.
|
||||
// Note that this mirrors the logic in the makefile for PROTOKUBE_TAG.
|
||||
dockerTag := strings.Replace(Version, "+", "-", -1)
|
||||
return "protokube:" + dockerTag
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue