Skip to content

Commit

Permalink
Merge pull request #7131 from taciomcosta/master
Browse files Browse the repository at this point in the history
update_kubernetes_version: update regexes and paths
  • Loading branch information
tstromberg authored Mar 21, 2020
2 parents 5a5f869 + beadb86 commit ba4e993
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions hack/kubernetes_version/update_kubernetes_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ func main() {
}
mode := info.Mode()

re := regexp.MustCompile(`var DefaultKubernetesVersion = .*`)
f := re.ReplaceAllString(string(cf), "var DefaultKubernetesVersion = \""+v+"\"")
re := regexp.MustCompile(`DefaultKubernetesVersion = \".*`)
f := re.ReplaceAllString(string(cf), "DefaultKubernetesVersion = \""+v+"\"")

re = regexp.MustCompile(`var NewestKubernetesVersion = .*`)
f = re.ReplaceAllString(f, "var NewestKubernetesVersion = \""+v+"\"")
re = regexp.MustCompile(`NewestKubernetesVersion = \".*`)
f = re.ReplaceAllString(f, "NewestKubernetesVersion = \""+v+"\"")

if err := ioutil.WriteFile(constantsFile, []byte(f), mode); err != nil {
fmt.Println(err)
os.Exit(1)
}

testData := "../../pkg/minikube/bootstrapper/kubeadm/testdata"
testData := "../../pkg/minikube/bootstrapper/bsutil/testdata"

err = filepath.Walk(testData, func(path string, info os.FileInfo, err error) error {
if err != nil {
Expand Down

0 comments on commit ba4e993

Please sign in to comment.