From c5b4b8336fd2814087c6334c507dd453b52d3ccb Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Mon, 8 May 2023 14:02:34 -0700 Subject: [PATCH] update automation to update jammy --- .github/workflows/update-ubuntu-version.yml | 6 +++--- .../ubuntu_version/update_ubuntu_version.go | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/update-ubuntu-version.yml b/.github/workflows/update-ubuntu-version.yml index b7ce74d6ff..1b00958d3e 100644 --- a/.github/workflows/update-ubuntu-version.yml +++ b/.github/workflows/update-ubuntu-version.yml @@ -37,16 +37,16 @@ jobs: uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 with: token: ${{ secrets.MINIKUBE_BOT_PAT }} - commit-message: 'Kicbase: Bump ubuntu:focal from ${{ steps.bumpUbuntu.outputs.OLD_VERSION }} to ${{ steps.bumpUbuntu.outpus.NEW_VERSION }}' + commit-message: 'Kicbase: Bump ubuntu:jammy from ${{ steps.bumpUbuntu.outputs.OLD_VERSION }} to ${{ steps.bumpUbuntu.outpus.NEW_VERSION }}' committer: minikube-bot author: minikube-bot branch: auto_bump_ubuntu_version push-to-fork: minikube-bot/minikube base: master delete-branch: true - title: 'Kicbase: Bump ubuntu:focal from ${{ steps.bumpUbuntu.outputs.OLD_VERSION }} to ${{ steps.bumpUbuntu.outpus.NEW_VERSION }}' + title: 'Kicbase: Bump ubuntu:jammy from ${{ steps.bumpUbuntu.outputs.OLD_VERSION }} to ${{ steps.bumpUbuntu.outpus.NEW_VERSION }}' body: | - The ubuntu:focal image released a new version + The ubuntu:jammy image released a new version This PR was auto-generated by `make update-ubuntu-version` using [update-ubuntu-version.yml](https://github.com/kubernetes/minikube/tree/master/.github/workflows/update-ubuntu-version.yml) CI Workflow. - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 diff --git a/hack/update/ubuntu_version/update_ubuntu_version.go b/hack/update/ubuntu_version/update_ubuntu_version.go index 48768e88e0..cedcd4e332 100644 --- a/hack/update/ubuntu_version/update_ubuntu_version.go +++ b/hack/update/ubuntu_version/update_ubuntu_version.go @@ -49,13 +49,13 @@ var ( schema = map[string]update.Item{ "deploy/kicbase/Dockerfile": { Replace: map[string]string{ - `UBUNTU_FOCAL_IMAGE=.*`: `UBUNTU_FOCAL_IMAGE="{{.LatestVersion}}"`, + `UBUNTU_JAMMY_IMAGE=.*`: `UBUNTU_JAMMY_IMAGE="{{.LatestVersion}}"`, }, }, } ) -// Data holds latest Ubuntu focal version in semver format. +// Data holds latest Ubuntu jammy version in semver format. type Data struct { LatestVersion string } @@ -70,7 +70,7 @@ type Response struct { func getLatestVersion() (string, error) { resp, err := http.Get(dockerHubUbuntuBaseURL) if err != nil { - return "", fmt.Errorf("unable to get Ubuntu focal's latest version: %v", err) + return "", fmt.Errorf("unable to get Ubuntu jammy's latest version: %v", err) } defer resp.Body.Close() @@ -86,22 +86,22 @@ func getLatestVersion() (string, error) { } for _, i := range content.Results { - if strings.Contains(i.Name, "focal-") { + if strings.Contains(i.Name, "jammy-") { return i.Name, nil } } - return "", fmt.Errorf("response from Docker Hub does not contain a latest focal image") + return "", fmt.Errorf("response from Docker Hub does not contain a latest jammy image") } func main() { - // get Ubuntu Focal latest version + // get Ubuntu Jammy latest version latest, err := getLatestVersion() if err != nil { - klog.Fatalf("Unable to find latest ubuntu:focal version: %v\n", err) + klog.Fatalf("Unable to find latest ubuntu:jammy version: %v\n", err) } data := Data{LatestVersion: fmt.Sprintf("ubuntu:%s", latest)} - klog.Infof("Ubuntu focal latest version: %s", latest) + klog.Infof("Ubuntu jammy latest version: %s", latest) update.Apply(schema, data) }