Skip to content

Commit

Permalink
feat: remove deployment
Browse files Browse the repository at this point in the history
Signed-off-by: Jing Qi <[email protected]>
  • Loading branch information
jinqi7 committed Feb 23, 2024
1 parent 9bbd0cc commit af50683
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 425 deletions.
194 changes: 0 additions & 194 deletions tests/release/pipelines/push_to_external_registry.go

This file was deleted.

28 changes: 13 additions & 15 deletions tests/release/quay.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package common
import (
"fmt"
"net/http"
"strings"

"github.com/redhat-appstudio/e2e-tests/pkg/utils"
quay "github.com/redhat-appstudio/image-controller/pkg/quay"
Expand All @@ -16,25 +15,24 @@ var (
quayClient = quay.NewQuayClient(&http.Client{Transport: &http.Transport{}}, quayToken, quayApiUrl)
)

// imageURL format example: quay.io/redhat-appstudio-qe/devfile-go-rhtap-uvv7:latest
func GetDigestWithTagInQuay(imageURL string) (string, error) {
urlParts := strings.Split(imageURL, ":")
if len(urlParts) != 2 {
return "", fmt.Errorf("image URL %s has incorrect format", imageURL)
}
repoParts := strings.Split(urlParts[0], "/")
// repoURL format example: quay.io/redhat-appstudio-qe/dcmetromap
func DoesDigestExistInQuay(repoURL string, digest string) (bool, error) {
repoParts := [...]string{"quay.io", "redhat-appstudio-qe", "dcmetromap"}
if len(repoParts) <= 2 {
return "", fmt.Errorf("image URL %s is not complete", imageURL)
return false, fmt.Errorf("repo URL %s is not complete", repoURL)
}
repoName := strings.Join(repoParts[2:], "/")
tagList, _, err := quayClient.GetTagsFromPage(quayOrg, repoName, 0)

tagList, _, err := quayClient.GetTagsFromPage(repoParts[1], repoParts[2], 0)
if err != nil {
return "", err
return false, err
}

var tagDigestList string
for _, tag := range tagList {
if tag.Name == urlParts[1] {
return tag.ManifestDigest, nil
if digest == tag.ManifestDigest {
return true, nil
}
tagDigestList = tag.ManifestDigest + " "
}
return "", fmt.Errorf("no image is found")
return false, fmt.Errorf("the tagDigestList is %s", tagDigestList)
}
Loading

0 comments on commit af50683

Please sign in to comment.