Skip to content

Commit

Permalink
Merge pull request #161 from vmware-tanzu/gh-release-tag
Browse files Browse the repository at this point in the history
record GH release tag in vendir.lock.yml
  • Loading branch information
cppforlife authored May 17, 2022
2 parents 809caa8 + 283ec6f commit 7429d0c
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/github-release/vendir.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions examples/github-release/vendir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ directories:
- path: github.com/kubernetes/kubectl
githubRelease:
slug: kubernetes/kubernetes
disableAutoChecksumValidation: true
tagSelection:
semver:
constraints: "~v1.23.x"
Expand Down
1 change: 1 addition & 0 deletions examples/locked/vendir.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions examples/versionselection/vendir.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions pkg/vendir/config/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions pkg/vendir/config/lock_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type LockDirectoryContentsImgpkgBundle struct {

type LockDirectoryContentsGithubRelease struct {
URL string `json:"url"`
Tag string `json:"tag,omitempty"`
}

type LockDirectoryContentsHelmChart struct {
Expand Down
1 change: 1 addition & 0 deletions pkg/vendir/fetch/githubrelease/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 7429d0c

Please sign in to comment.