Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Fix demo start (#486)
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Co-authored-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
  • Loading branch information
eapolinario and eapolinario committed May 21, 2024
1 parent c712318 commit 1884dcf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 0 additions & 4 deletions pkg/configutil/version.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
admin:
# For GRPC endpoints you might want to use dns:///flyte.myexample.com
endpoint: dns:///localhost:30081
authType: Pkce
insecure: true
logger:
show-source: true
level: 0
15 changes: 11 additions & 4 deletions pkg/github/githubutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,20 @@ func GetLatestRelease(repoName string, g GHRepoService) (*github.RepositoryRelea
}

// ListReleases returns the list of release of provided repoName
func ListReleases(repoName string, g GHRepoService) ([]*github.RepositoryRelease, error) {
func ListReleases(repoName string, g GHRepoService, filterPrefix string) ([]*github.RepositoryRelease, error) {
releases, _, err := g.ListReleases(context.Background(), owner, repoName, &github.ListOptions{
PerPage: 100,
})
if err != nil {
return nil, err
}
return releases, err
var filteredReleases []*github.RepositoryRelease
for _, release := range releases {
if !strings.HasPrefix(release.GetTagName(), filterPrefix) {
filteredReleases = append(filteredReleases, release)
}
}
return filteredReleases, err
}

// GetReleaseByTag returns the provided tag release if tag exist in repository
Expand Down Expand Up @@ -118,7 +124,8 @@ func GetAssetFromRelease(tag, assetName, repoName string, g GHRepoService) (*git
func GetSandboxImageSha(tag string, pre bool, g GHRepoService) (string, string, error) {
var release *github.RepositoryRelease
if len(tag) == 0 {
releases, err := ListReleases(flyte, g)
// Only fetch Flyte releases
releases, err := ListReleases(flyte, g, "flytectl/")
if err != nil {
return "", release.GetTagName(), err
}
Expand Down Expand Up @@ -231,7 +238,7 @@ func GetGHRepoService() GHRepoService {
gh = github.NewClient(oauth2.NewClient(context.Background(), oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: os.Getenv("GITHUB_TOKEN")},
)))
if _, err := ListReleases(flyte, gh.Repositories); err != nil {
if _, err := ListReleases(flyte, gh.Repositories, ""); err != nil {
logger.Warnf(context.Background(), "Found GITHUB_TOKEN but failed to fetch releases. Using empty http.Client: %s.", err)
gh = nil
}
Expand Down

0 comments on commit 1884dcf

Please sign in to comment.