diff --git a/pkg/configutil/version.yaml b/pkg/configutil/version.yaml index 2f492d60..81d5806c 100644 --- a/pkg/configutil/version.yaml +++ b/pkg/configutil/version.yaml @@ -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 \ No newline at end of file diff --git a/pkg/github/githubutil.go b/pkg/github/githubutil.go index 68008537..b310a2e4 100644 --- a/pkg/github/githubutil.go +++ b/pkg/github/githubutil.go @@ -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 @@ -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 } @@ -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 }