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

Fix demo start #486

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading