diff --git a/pkg/release/release.go b/pkg/release/release.go index 3a1804b..dca7c3d 100644 --- a/pkg/release/release.go +++ b/pkg/release/release.go @@ -52,18 +52,8 @@ func ProcessNewReleases(options *util.Options) { } func createNewReleases(newTags map[string]*semver.Version) error { - mapping, err := util.LoadUpstreamSources() - if err != nil { - log.Fatal("err during loading upstream sources: " + err.Error()) - } - for _, tag := range newTags { - tektonTaskBranch, err := util.GetTektonTasksBranch(mapping, fmt.Sprintf("%v.%v", tag.Major(), tag.Minor())) - if err != nil { - return err - } - - err = generateManifests(tag.Original(), tektonTaskBranch) + err := generateManifests(tag.Original()) if err != nil { log.Fatal("err during generation of manifests: " + err.Error()) } @@ -76,9 +66,8 @@ func createNewReleases(newTags map[string]*semver.Version) error { return nil } -func generateManifests(tag, branch string) error { +func generateManifests(tag string) error { os.Setenv("RELEASE_VERSION", tag) - os.Setenv("RELEASE_BRANCH", branch) cmd := exec.Command("bash", "-c", "./generate-manifests.sh") cmd.Stdout = os.Stdout cmd.Stderr = os.Stdout diff --git a/pkg/util/util.go b/pkg/util/util.go index e6cb5a8..28a79db 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -1,12 +1,5 @@ package util -import ( - "bufio" - "fmt" - "os" - "strings" -) - type Options struct { DryRun bool ExistingTags string @@ -15,26 +8,3 @@ type Options struct { Username string GitToken string } - -func LoadUpstreamSources() (map[string]string, error) { - file, err := os.Open("upstream_sources.yaml") - if err != nil { - return nil, err - } - fscanner := bufio.NewScanner(file) - upstreamSourcesMapping := make(map[string]string) - for fscanner.Scan() { - line := strings.Split(fscanner.Text(), ":") - upstreamSourcesMapping[line[0]] = line[1] - } - return upstreamSourcesMapping, nil -} - -func GetTektonTasksBranch(upstreamSources map[string]string, version string) (string, error) { - var branch string - var ok bool - if branch, ok = upstreamSources[version]; !ok { - return "", fmt.Errorf("There is missing mapping between branch of kubevirt-tekton-tasks and OCP V version " + version) - } - return branch, nil -} diff --git a/upstream_sources.yaml b/upstream_sources.yaml deleted file mode 100644 index 8202661..0000000 --- a/upstream_sources.yaml +++ /dev/null @@ -1,2 +0,0 @@ -4.15:main -4.16:main