From 0441a8003eba24e63236307203d36d241a53360a Mon Sep 17 00:00:00 2001 From: Dmitriy Kalinin Date: Tue, 17 May 2022 16:47:07 -0400 Subject: [PATCH 1/2] missing disableAutoChecksumValidation in examples/github-release --- examples/github-release/vendir.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/github-release/vendir.yml b/examples/github-release/vendir.yml index cdc53dd9..8ea2429c 100644 --- a/examples/github-release/vendir.yml +++ b/examples/github-release/vendir.yml @@ -45,6 +45,7 @@ directories: - path: github.com/kubernetes/kubectl githubRelease: slug: kubernetes/kubernetes + disableAutoChecksumValidation: true tagSelection: semver: constraints: "~v1.23.x" From 283ec6f6acbaee92d2fb16d2dfe393c856cb7c23 Mon Sep 17 00:00:00 2001 From: Dmitriy Kalinin Date: Tue, 17 May 2022 16:55:54 -0400 Subject: [PATCH 2/2] add tag to githubRelease lock --- examples/github-release/vendir.lock.yml | 5 +++++ examples/locked/vendir.lock.yml | 1 + examples/versionselection/vendir.lock.yml | 1 + pkg/vendir/config/directory.go | 1 + pkg/vendir/config/lock_directory.go | 1 + pkg/vendir/fetch/githubrelease/sync.go | 1 + 6 files changed, 10 insertions(+) diff --git a/examples/github-release/vendir.lock.yml b/examples/github-release/vendir.lock.yml index a26d45a6..ae36f0a7 100644 --- a/examples/github-release/vendir.lock.yml +++ b/examples/github-release/vendir.lock.yml @@ -2,18 +2,23 @@ apiVersion: vendir.k14s.io/v1alpha1 directories: - contents: - githubRelease: + tag: v0.1.0 url: https://api.github.com/repos/vmware-tanzu/carvel-kapp-controller/releases/21912613 path: github.com/k14s/kapp-controller - githubRelease: + tag: v1.8.0 url: https://api.github.com/repos/cert-manager/cert-manager/releases/63665514 path: github.com/cert-manager/cert-manager - githubRelease: + tag: v0.35.0 url: https://api.github.com/repos/vmware-tanzu/carvel-kapp-controller/releases/64149930 path: specific-asset-checksum-checked - githubRelease: + tag: v1.2.0 url: https://api.github.com/repos/cloudfoundry/eirini-release/releases/23064766 path: github.com/cloudfoundry-incubator/eirini-release - githubRelease: + tag: v1.23.0 url: https://api.github.com/repos/kubernetes/kubernetes/releases/54824547 path: github.com/kubernetes/kubectl path: vendor diff --git a/examples/locked/vendir.lock.yml b/examples/locked/vendir.lock.yml index 8af0cb66..90107eca 100644 --- a/examples/locked/vendir.lock.yml +++ b/examples/locked/vendir.lock.yml @@ -6,6 +6,7 @@ directories: sha: e4f715485ff4484ce571cd31dcba5b6e47475f22 path: github.com/cloudfoundry/cf-k8s-networking - githubRelease: + tag: v0.1.0 url: https://api.github.com/repos/vmware-tanzu/carvel-kapp-controller/releases/21912613 path: github.com/k14s/kapp-controller - helmChart: diff --git a/examples/versionselection/vendir.lock.yml b/examples/versionselection/vendir.lock.yml index 3daa9835..bb534c37 100644 --- a/examples/versionselection/vendir.lock.yml +++ b/examples/versionselection/vendir.lock.yml @@ -20,6 +20,7 @@ directories: - v1.0.0-rc.2 path: with-filtered-prerelease - githubRelease: + tag: v0.2.0 url: https://api.github.com/repos/vmware-tanzu/carvel-kapp-controller/releases/24178930 path: github-release-tag-selection path: vendor diff --git a/pkg/vendir/config/directory.go b/pkg/vendir/config/directory.go index 4d782e41..c2f40d98 100644 --- a/pkg/vendir/config/directory.go +++ b/pkg/vendir/config/directory.go @@ -389,6 +389,7 @@ func (c *DirectoryContentsGithubRelease) Lock(lockConfig *LockDirectoryContentsG return fmt.Errorf("Expected github release URL to be non-empty") } c.URL = lockConfig.URL + c.Tag = lockConfig.Tag return nil } diff --git a/pkg/vendir/config/lock_directory.go b/pkg/vendir/config/lock_directory.go index 291f6bbd..41651e47 100644 --- a/pkg/vendir/config/lock_directory.go +++ b/pkg/vendir/config/lock_directory.go @@ -49,6 +49,7 @@ type LockDirectoryContentsImgpkgBundle struct { type LockDirectoryContentsGithubRelease struct { URL string `json:"url"` + Tag string `json:"tag,omitempty"` } type LockDirectoryContentsHelmChart struct { diff --git a/pkg/vendir/fetch/githubrelease/sync.go b/pkg/vendir/fetch/githubrelease/sync.go index 27e730ce..e62d3c20 100644 --- a/pkg/vendir/fetch/githubrelease/sync.go +++ b/pkg/vendir/fetch/githubrelease/sync.go @@ -198,6 +198,7 @@ func (d Sync) Sync(dstPath string, tempArea ctlfetch.TempArea) (ctlconf.LockDire } lockConf.URL = releaseAPI.URL + lockConf.Tag = releaseAPI.Tag return lockConf, nil }