From 61526b73f8933763048bd91046cb728e026353ec Mon Sep 17 00:00:00 2001 From: Kim Tsao <84398375+kim-tsao@users.noreply.github.com> Date: Fri, 15 Sep 2023 12:43:09 -0400 Subject: [PATCH] Private Repo Support (#386) * Private Repo Support Signed-off-by: Kim Tsao * address review comments Signed-off-by: Kim Tsao * address review comments - add role.yaml Signed-off-by: Kim Tsao * Address review comments - update docs, fix numbering and remove namespace from example Signed-off-by: Kim Tsao --------- Signed-off-by: Kim Tsao --- cdq-analysis/go.mod | 5 +- cdq-analysis/go.sum | 4 +- cdq-analysis/main.go | 14 +- cdq-analysis/pkg/componentdetectionquery.go | 136 +++++++-- .../pkg/componentdetectionquery_test.go | 117 +++++--- cdq-analysis/pkg/detect.go | 37 ++- cdq-analysis/pkg/detect_test.go | 14 +- cdq-analysis/pkg/devfile.go | 87 +++++- cdq-analysis/pkg/devfile_test.go | 32 +- cdq-analysis/pkg/util.go | 24 +- cdq-analysis/pkg/util_test.go | 12 +- config/rbac/role.yaml | 20 ++ controllers/application_controller.go | 9 +- .../application_controller_finalizer.go | 7 +- .../application_controller_finalizer_test.go | 13 +- controllers/application_controller_test.go | 31 +- ...onsnapshotenvironmentbinding_controller.go | 28 +- ...pshotenvironmentbinding_controller_test.go | 2 +- controllers/component_controller.go | 94 +++--- controllers/component_controller_finalizer.go | 10 +- .../component_controller_finalizer_test.go | 8 +- controllers/component_controller_test.go | 109 +++---- .../componentdetectionquery_controller.go | 46 +-- ...componentdetectionquery_controller_test.go | 22 +- controllers/start_test_env.go | 8 +- controllers/update.go | 9 +- controllers/update_test.go | 4 +- docs/private-git-repos.md | 66 ++-- go.mod | 62 ++-- go.sum | 283 +++++++----------- main.go | 9 +- pkg/devfile/devfile.go | 8 +- pkg/devfile/devfile_test.go | 8 +- pkg/spi/spi.go | 125 ++++++-- pkg/spi/spi_mock.go | 6 +- pkg/spi/spi_test.go | 27 +- 36 files changed, 844 insertions(+), 652 deletions(-) diff --git a/cdq-analysis/go.mod b/cdq-analysis/go.mod index 92106aa55..dcdf42274 100644 --- a/cdq-analysis/go.mod +++ b/cdq-analysis/go.mod @@ -4,11 +4,12 @@ go 1.19 require ( github.com/devfile/api/v2 v2.2.1-alpha.0.20230413012049-a6c32fca0dbd - github.com/devfile/library/v2 v2.2.1-0.20230418160146-e75481b7eebd + github.com/devfile/library/v2 v2.2.1-0.20230821212346-99a3776c0b1e github.com/devfile/registry-support/index/generator v0.0.0-20221018203505-df96d34d4273 github.com/devfile/registry-support/registry-library v0.0.0-20221018213054-47b3ffaeadba github.com/go-logr/logr v1.2.3 github.com/hashicorp/go-multierror v1.1.1 + github.com/pkg/errors v0.9.1 github.com/redhat-developer/alizer/go v0.0.0-20230516215932-135a2bb3fb90 github.com/spf13/afero v1.8.0 github.com/stretchr/testify v1.8.1 @@ -33,6 +34,7 @@ require ( github.com/containerd/typeurl v1.0.2 // indirect github.com/creack/pty v1.1.17 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/distribution/distribution/v3 v3.0.0-20211118083504-a29a3c99a684 // indirect github.com/docker/cli v20.10.13+incompatible // indirect github.com/docker/distribution v2.8.1+incompatible // indirect github.com/docker/docker v20.10.11+incompatible // indirect @@ -91,7 +93,6 @@ require ( github.com/openshift/api v0.0.0-20210503193030-25175d9d392d // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pjbgf/sha1cd v0.2.3 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.14.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect diff --git a/cdq-analysis/go.sum b/cdq-analysis/go.sum index 9fac3e82c..620626e6e 100644 --- a/cdq-analysis/go.sum +++ b/cdq-analysis/go.sum @@ -312,8 +312,8 @@ github.com/devfile/api/v2 v2.2.1-alpha.0.20230413012049-a6c32fca0dbd/go.mod h1:q github.com/devfile/library v1.2.1-0.20211104222135-49d635cb492f/go.mod h1:uFZZdTuRqA68FVe/JoJHP92CgINyQkyWnM2Qyiim+50= github.com/devfile/library v1.2.1-0.20220308191614-f0f7e11b17de/go.mod h1:GSPfJaBg0+bBjBHbwBE5aerJLH6tWGQu2q2rHYd9czM= github.com/devfile/library/v2 v2.0.1/go.mod h1:paJ0PARAVy0br13VpBEQ4fO3rZVDxWtooQ29+23PNBk= -github.com/devfile/library/v2 v2.2.1-0.20230418160146-e75481b7eebd h1:YHSwUdfWsG9Qk7Vn+NfafELv6+G6a43RRE/NjS0TfK0= -github.com/devfile/library/v2 v2.2.1-0.20230418160146-e75481b7eebd/go.mod h1:jXIVOBkEqh7YJddFcZ+vak47rlbCW//f+qqG5hUozhM= +github.com/devfile/library/v2 v2.2.1-0.20230821212346-99a3776c0b1e h1:ozHGZOXlBvtf4YqZRrMiSNH6q6gjw6XaUisMhWG4Vwg= +github.com/devfile/library/v2 v2.2.1-0.20230821212346-99a3776c0b1e/go.mod h1:7oEhkC6GW6OKmAP8HbxbaQ+nFbnACQuU7anYhJroltQ= github.com/devfile/registry-support/index/generator v0.0.0-20220222194908-7a90a4214f3e/go.mod h1:iRPBxs+ZjfLEduVXpCCIOzdD2588Zv9OCs/CcXMcCCY= github.com/devfile/registry-support/index/generator v0.0.0-20220527155645-8328a8a883be/go.mod h1:1fyDJL+fPHtcrYA6yjSVWeLmXmjCNth0d5Rq1rvtryc= github.com/devfile/registry-support/index/generator v0.0.0-20221018203505-df96d34d4273 h1:DXENQSRTEDsk9com38njPg5511DD12HPIgzyFUErnpM= diff --git a/cdq-analysis/main.go b/cdq-analysis/main.go index 8773b7d4a..7c5ad703b 100644 --- a/cdq-analysis/main.go +++ b/cdq-analysis/main.go @@ -36,13 +36,11 @@ func main() { gitToken := os.Getenv("GITHUB_TOKEN") // Parse all of the possible command-line flags for the tool - var contextPath, URL, name, devfilePath, dockerfilePath, Revision, namespace, DevfileRegistryURL string + var contextPath, URL, name, Revision, namespace, DevfileRegistryURL string var isDevfilePresent, isDockerfilePresent, createK8sJob bool flag.StringVar(&name, "name", "", "The ComponentDetectionQuery name") flag.StringVar(&contextPath, "contextPath", "./", "The context path for the cdq analysis") flag.StringVar(&URL, "URL", "", "The URL for the git repository") - flag.StringVar(&devfilePath, "devfilePath", "", "The devfile path if the devfile present") - flag.StringVar(&dockerfilePath, "dockerfilePath", "", "The dockerfile path if the dockerfile present") flag.StringVar(&Revision, "revision", "", "The revision of the git repo to run cdq analysis against with") flag.StringVar(&DevfileRegistryURL, "devfileRegistryURL", pkg.DevfileRegistryEndpoint, "The devfile registry URL") flag.StringVar(&namespace, "namespace", "", "The namespace from which to fetch resources") @@ -80,7 +78,15 @@ func main() { Log: log, CreateK8sJob: createK8sJob, } - pkg.CloneAndAnalyze(k8sInfoClient, gitToken, namespace, name, contextPath, devfilePath, dockerfilePath, URL, Revision, DevfileRegistryURL, isDevfilePresent, isDockerfilePresent) + + cdqInfo := &pkg.CDQInfoClient{ + DevfileRegistryURL: DevfileRegistryURL, + GitURL: pkg.GitURL{RepoURL: URL, Revision: Revision, Token: gitToken}, + } + + /* #nosec G104 -- the main.go is triggerred by docker image, and the result as well as the error will be send by the k8s job*/ + pkg.CloneAndAnalyze(k8sInfoClient, namespace, name, contextPath, cdqInfo) + } // validateVariables ensures that all of the necessary variables passed in are set to valid values diff --git a/cdq-analysis/pkg/componentdetectionquery.go b/cdq-analysis/pkg/componentdetectionquery.go index 1fdd8b5b3..7c725a901 100644 --- a/cdq-analysis/pkg/componentdetectionquery.go +++ b/cdq-analysis/pkg/componentdetectionquery.go @@ -22,6 +22,8 @@ import ( "fmt" "path" + "github.com/spf13/afero" + "github.com/go-logr/logr" "github.com/redhat-developer/alizer/go/pkg/apis/model" corev1 "k8s.io/api/core/v1" @@ -36,61 +38,141 @@ type K8sInfoClient struct { CreateK8sJob bool } -// CDQ analyzer -// return values are for testing purpose -func CloneAndAnalyze(k K8sInfoClient, gitToken, namespace, name, context, devfilePath, dockerfilePath, URL, Revision, DevfileRegistryURL string, isDevfilePresent, isDockerfilePresent bool) (map[string][]byte, map[string]string, map[string]string, map[string][]int, string, error) { +type ClonedInfo struct { + ClonedPath string // For locally cloned git repos + ComponentPath string // For locally cloned git repos + Fs afero.Afero // For locally cloned git repos +} + +// CDQInfoClient is a struct that contains the relevant information to 1) clone and search a given git repo for the presence of a devfile or dockerfile and 2) search for matching samples in the devfile +// registry if no devfile or dockerfiles are found. + +type CDQInfoClient struct { + DevfileRegistryURL string + GitURL GitURL + ClonedRepo ClonedInfo + devfilePath string // A resolved devfile; one of DevfileName, HiddenDevfileName, HiddenDevfileDir or HiddenDirHiddenDevfile + dockerfilePath string // A resolved dockerfile +} + +func GetDevfileAndDockerFilePaths(client CDQInfoClient) (string, string) { + return client.devfilePath, client.dockerfilePath +} + +func (cdqInfo *CDQInfoClient) clone(k K8sInfoClient, namespace, name, context string) error { log := k.Log var clonePath, componentPath string - alizerClient := AlizerClient{} + var err error devfilesMap := make(map[string][]byte) devfilesURLMap := make(map[string]string) dockerfileContextMap := make(map[string]string) componentPortsMap := make(map[string][]int) Fs := NewFilesystem() - var err error - - var components []model.Component - if context == "" { - context = "./" - } - + cdqInfo.ClonedRepo.Fs = Fs clonePath, err = CreateTempPath(name, Fs) if err != nil { log.Error(err, fmt.Sprintf("Unable to create a temp path %s for cloning %v", clonePath, namespace)) k.SendBackDetectionResult(devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, name, namespace, err) - return nil, nil, nil, nil, "", err + return err } - err = CloneRepo(clonePath, URL, Revision, gitToken) + revision := cdqInfo.GitURL.Revision + repoURL := cdqInfo.GitURL.RepoURL + gitToken := cdqInfo.GitURL.Token + + err = CloneRepo(clonePath, GitURL{RepoURL: repoURL, Revision: revision, Token: gitToken}) if err != nil { - log.Error(err, fmt.Sprintf("Unable to clone repo %s to path %s, exiting reconcile loop %v", URL, clonePath, namespace)) + log.Error(err, fmt.Sprintf("Unable to clone repo %s to path %s, exiting reconcile loop %v", repoURL, clonePath, namespace)) k.SendBackDetectionResult(devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, name, namespace, err) - return nil, nil, nil, nil, "", err + return err } - log.Info(fmt.Sprintf("cloned from %s to path %s... %v", URL, clonePath, namespace)) + log.Info(fmt.Sprintf("cloned from %s to path %s... %v", repoURL, clonePath, namespace)) componentPath = clonePath if context != "" { componentPath = path.Join(clonePath, context) } - if Revision == "" { - Revision, err = GetBranchFromRepo(componentPath) + if revision == "" { + revision, err = GetBranchFromRepo(componentPath) if err != nil { - log.Error(err, fmt.Sprintf("Unable to clone repo %s to path %s, exiting reconcile loop %v", URL, clonePath, namespace)) + log.Error(err, fmt.Sprintf("Unable to get branch from cloned repo for component path %s, exiting reconcile loop %v", componentPath, namespace)) k.SendBackDetectionResult(devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, name, namespace, err) - return nil, nil, nil, nil, "", err + return err } } + cdqInfo.ClonedRepo.ClonedPath = clonePath + cdqInfo.ClonedRepo.ComponentPath = componentPath + cdqInfo.GitURL.Revision = revision + return nil + +} + +// CDQ analyzer +// return values are for testing purpose +func CloneAndAnalyze(k K8sInfoClient, namespace, name, context string, cdqInfo *CDQInfoClient) (map[string][]byte, map[string]string, map[string]string, map[string][]int, string, error) { + log := k.Log + var clonePath, componentPath string + alizerClient := AlizerClient{} + devfilesMap := make(map[string][]byte) + devfilesURLMap := make(map[string]string) + dockerfileContextMap := make(map[string]string) + componentPortsMap := make(map[string][]int) + var Fs afero.Afero + var err error + + var components []model.Component + + repoURL := cdqInfo.GitURL.RepoURL + gitToken := cdqInfo.GitURL.Token + registryURL := cdqInfo.DevfileRegistryURL + + err = cdqInfo.clone(k, namespace, name, context) + if err != nil { + return nil, nil, nil, nil, "", err + } + + // search the cloned repo for valid devfile locations + devfileBytes, err := FindValidDevfiles(cdqInfo) + if err != nil { + log.Error(err, fmt.Sprintf("Unable to find from any known devfile locations from %s ", cdqInfo.GitURL)) + } + + // search the cloned repo for valid dockerfile locations + dockerfileBytes, err := FindValidDockerfile(cdqInfo) + if err != nil { + log.Error(err, fmt.Sprintf("Unable to find from any known devfile locations from %s ", cdqInfo.GitURL)) + } + + isDevfilePresent := len(devfileBytes) != 0 + isDockerfilePresent := len(dockerfileBytes) != 0 + + // the following values come from the previous step when the repo was cloned + Fs = cdqInfo.ClonedRepo.Fs + componentPath = cdqInfo.ClonedRepo.ComponentPath + clonePath = cdqInfo.ClonedRepo.ClonedPath + revision := cdqInfo.GitURL.Revision + devfilePath := cdqInfo.devfilePath + dockerfilePath := cdqInfo.dockerfilePath + + if context == "" { + context = "./" + } + + //search for devfiles + isMultiComponent := false if isDevfilePresent { - updatedLink, err := UpdateGitLink(URL, Revision, path.Join(context, devfilePath)) + // devfilePath is the resolved, valid devfile location set in FindValidDevfiles + updatedLink, err := UpdateGitLink(repoURL, revision, path.Join(context, devfilePath)) + log.Info(fmt.Sprintf("updatedLink %s ", updatedLink)) if err != nil { log.Error(err, fmt.Sprintf("Unable to update the devfile link for CDQ %v... %v", name, namespace)) k.SendBackDetectionResult(devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, name, namespace, err) return nil, nil, nil, nil, "", err } - shouldIgnoreDevfile, devfileBytes, err := ValidateDevfile(log, updatedLink) + + shouldIgnoreDevfile, devfileBytes, err := ValidateDevfile(log, updatedLink, gitToken) if err != nil { k.SendBackDetectionResult(devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, name, namespace, err) return nil, nil, nil, nil, "", err @@ -115,7 +197,7 @@ func CloneAndAnalyze(k K8sInfoClient, gitToken, namespace, name, context, devfil if !isDevfilePresent { components, err = alizerClient.DetectComponents(componentPath) if err != nil { - log.Error(err, fmt.Sprintf("Unable to detect components using Alizer for repo %v, under path %v... %v ", URL, componentPath, namespace)) + log.Error(err, fmt.Sprintf("Unable to detect components using Alizer for repo %v, under path %v... %v ", repoURL, componentPath, namespace)) k.SendBackDetectionResult(devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, name, namespace, err) return nil, nil, nil, nil, "", err } @@ -132,17 +214,17 @@ func CloneAndAnalyze(k K8sInfoClient, gitToken, namespace, name, context, devfil // Logic to read multiple components in from git if isMultiComponent { log.Info(fmt.Sprintf("Since this is a multi-component, attempt will be made to read only level 1 dir for devfiles... %v", namespace)) - devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, err = ScanRepo(log, alizerClient, componentPath, DevfileRegistryURL, URL, Revision, context) + devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, err = ScanRepo(log, alizerClient, componentPath, context, *cdqInfo) if err != nil { if _, ok := err.(*NoDevfileFound); !ok { - log.Error(err, fmt.Sprintf("Unable to find devfile(s) in repo %s due to an error %s, exiting reconcile loop %v", URL, err.Error(), namespace)) + log.Error(err, fmt.Sprintf("Unable to find devfile(s) in repo %s due to an error %s, exiting reconcile loop %v", repoURL, err.Error(), namespace)) k.SendBackDetectionResult(devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, name, namespace, err) return nil, nil, nil, nil, "", err } } } else { log.Info(fmt.Sprintf("Since this is not a multi-component, attempt will be made to read devfile at the root dir... %v", namespace)) - err := AnalyzePath(log, alizerClient, componentPath, context, DevfileRegistryURL, devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, isDevfilePresent, isDockerfilePresent) + err := AnalyzePath(log, alizerClient, componentPath, context, registryURL, devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, isDevfilePresent, isDockerfilePresent, gitToken) if err != nil { log.Error(err, fmt.Sprintf("Unable to analyze path %s for a devfile, Dockerfile or Containerfile %v", componentPath, namespace)) k.SendBackDetectionResult(devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, name, namespace, err) @@ -159,7 +241,7 @@ func CloneAndAnalyze(k K8sInfoClient, gitToken, namespace, name, context, devfil } k.SendBackDetectionResult(devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, name, namespace, nil) - return devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, Revision, nil + return devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, revision, nil } func (k K8sInfoClient) SendBackDetectionResult(devfilesMap map[string][]byte, devfilesURLMap map[string]string, dockerfileContextMap map[string]string, componentPortsMap map[string][]int, name, namespace string, completeError error) { diff --git a/cdq-analysis/pkg/componentdetectionquery_test.go b/cdq-analysis/pkg/componentdetectionquery_test.go index 0dd69693a..e1219beb7 100644 --- a/cdq-analysis/pkg/componentdetectionquery_test.go +++ b/cdq-analysis/pkg/componentdetectionquery_test.go @@ -46,10 +46,11 @@ func TestCloneAndAnalyze(t *testing.T) { compName := "testComponent" namespaceName := "testNamespace" springSampleURL := "https://github.com/devfile-samples/devfile-sample-java-springboot-basic" - springNoDevfileURL := "https://github.com/yangcao77/devfile-sample-java-springboot-basic-no-devfile" privateRepoURL := "https://github.com/johnmcollier/private-repo-test" multiComponentRepoURL := "https://github.com/maysunfaisal/multi-components-dockerfile" - + springNoDevfileNoDockerfileURL := "https://github.com/kim-tsao/devfile-sample-java-springboot-basic-no-devfile-no-dockerfile" + springNoDevfileURL := "https://github.com/yangcao77/devfile-sample-java-springboot-basic-no-devfile" + multiComponentWithNoDevfileAndDockerfileURL := "https://github.com/redhat-appstudio/quality-dashboard" failedToCloneRepoErr := "failed to clone the repo.*" springDevfileContext := ` @@ -85,7 +86,6 @@ func TestCloneAndAnalyze(t *testing.T) { tests := []struct { testCase string context string - devfilePath string URL string Revision string DevfileRegistryURL string @@ -100,12 +100,9 @@ func TestCloneAndAnalyze(t *testing.T) { wantBranch string }{ { - testCase: "repo with devfile - should successfully detect spring component", - URL: springSampleURL, - DevfileRegistryURL: DevfileRegistryEndpoint, - devfilePath: "devfile.yaml", - isDevfilePresent: true, - isDockerfilePresent: false, + testCase: "repo with devfile - should successfully detect spring component", + URL: springSampleURL, + DevfileRegistryURL: DevfileRegistryEndpoint, wantDevfilesMap: map[string][]byte{ "./": []byte(springDevfileContext), }, @@ -117,11 +114,9 @@ func TestCloneAndAnalyze(t *testing.T) { wantBranch: "main", }, { - testCase: "repo without devfile and dockerfile - should successfully detect spring component", - URL: springNoDevfileURL, - DevfileRegistryURL: DevfileRegistryEndpoint, - isDevfilePresent: false, - isDockerfilePresent: false, + testCase: "repo without devfile and dockerfile - should successfully detect spring component", + URL: springNoDevfileNoDockerfileURL, + DevfileRegistryURL: DevfileRegistryEndpoint, wantDevfilesMap: map[string][]byte{ "./": []byte(springDevfileContext), }, @@ -131,17 +126,26 @@ func TestCloneAndAnalyze(t *testing.T) { wantDockerfileContextMap: map[string]string{ "./": "https://raw.githubusercontent.com/devfile-samples/devfile-sample-java-springboot-basic/main/docker/Dockerfile", }, - wantComponentsPortMap: map[string][]int{ - "./": {8081}, + wantComponentsPortMap: map[string][]int{}, + wantBranch: "main", + }, + { + testCase: "multi-component repo without devfile and dockerfile - should successfully detect dockerfiles", + URL: multiComponentWithNoDevfileAndDockerfileURL, + DevfileRegistryURL: DevfileRegistryEndpoint, + wantDevfilesMap: map[string][]byte{}, + wantDevfilesURLMap: map[string]string{}, + wantDockerfileContextMap: map[string]string{ + "backend": "Dockerfile", + "frontend": "Dockerfile", }, - wantBranch: "main", + wantComponentsPortMap: map[string][]int{}, //empty because repo does not have a dockerfile with a specified port + wantBranch: "main", }, { testCase: "private repo - should error out with no token provided", URL: privateRepoURL, DevfileRegistryURL: DevfileRegistryEndpoint, - isDevfilePresent: false, - isDockerfilePresent: false, wantDevfilesMap: map[string][]byte{}, wantDevfilesURLMap: map[string]string{}, wantDockerfileContextMap: map[string]string{}, @@ -152,8 +156,6 @@ func TestCloneAndAnalyze(t *testing.T) { testCase: "private repo - should error out with invalid token provided", URL: privateRepoURL, DevfileRegistryURL: DevfileRegistryEndpoint, - isDevfilePresent: false, - isDockerfilePresent: false, gitToken: "fakeToken", wantDevfilesMap: map[string][]byte{}, wantDevfilesURLMap: map[string]string{}, @@ -162,11 +164,9 @@ func TestCloneAndAnalyze(t *testing.T) { wantErr: failedToCloneRepoErr, }, { - testCase: "should successfully detect multi-component with dockerfile present", - URL: multiComponentRepoURL, - DevfileRegistryURL: DevfileRegistryEndpoint, - isDevfilePresent: false, - isDockerfilePresent: false, + testCase: "should successfully detect multi-component with dockerfile present", + URL: multiComponentRepoURL, + DevfileRegistryURL: DevfileRegistryEndpoint, wantDevfilesMap: map[string][]byte{ "devfile-sample-java-springboot-basic": []byte(springDevfileContext), "devfile-sample-nodejs-basic": []byte(nodeJSDevfileContext), @@ -191,13 +191,10 @@ func TestCloneAndAnalyze(t *testing.T) { wantBranch: "main", }, { - testCase: "should successfully detect single component when context is provided", - context: "devfile-sample-nodejs-basic", - URL: multiComponentRepoURL, - DevfileRegistryURL: DevfileRegistryEndpoint, - devfilePath: "devfile.yaml", - isDevfilePresent: true, - isDockerfilePresent: false, + testCase: "should successfully detect single component when context is provided", + context: "devfile-sample-nodejs-basic", + URL: multiComponentRepoURL, + DevfileRegistryURL: DevfileRegistryEndpoint, wantDevfilesMap: map[string][]byte{ "devfile-sample-nodejs-basic": []byte(nodeJSDevfileContext), }, @@ -212,11 +209,29 @@ func TestCloneAndAnalyze(t *testing.T) { }, wantBranch: "main", }, + { + testCase: "repo without devfile, with dockerfile - should successfully detect dockerfile", + URL: springNoDevfileURL, + DevfileRegistryURL: DevfileRegistryEndpoint, + wantDevfilesMap: map[string][]byte{}, + wantDevfilesURLMap: map[string]string{}, + wantDockerfileContextMap: map[string]string{ + "./": "docker/Dockerfile", + }, + wantComponentsPortMap: map[string][]int{ + "./": {8081}, + }, + wantBranch: "main", + }, } for _, tt := range tests { t.Run(tt.testCase, func(t *testing.T) { - devfilesMap, devfilesURLMap, dockerfileContextMap, componentsPortMap, branch, err := CloneAndAnalyze(k8sClient, tt.gitToken, namespaceName, compName, tt.context, tt.devfilePath, "", tt.URL, tt.Revision, tt.DevfileRegistryURL, tt.isDevfilePresent, tt.isDockerfilePresent) + cdqInfo := &CDQInfoClient{ + DevfileRegistryURL: tt.DevfileRegistryURL, + GitURL: GitURL{RepoURL: tt.URL, Revision: tt.Revision, Token: tt.gitToken}, + } + devfilesMap, devfilesURLMap, dockerfileContextMap, componentsPortMap, branch, err := CloneAndAnalyze(k8sClient, namespaceName, compName, tt.context, cdqInfo) if (err != nil) != (tt.wantErr != "") { t.Errorf("got unexpected error %v", err) } else if err == nil { @@ -225,7 +240,7 @@ func TestCloneAndAnalyze(t *testing.T) { // also check if correct context has been detected if devfilesMap != nil { if len(devfilesMap) != len(tt.wantDevfilesMap) { - t.Errorf("Expected devfilesMap lenth: %+v, Got: %+v, devfileMap is %+v", len(tt.wantDevfilesMap), len(devfilesMap), devfilesMap) + t.Errorf("Expected devfilesMap length: %+v, Got: %+v, devfileMap is %+v", len(tt.wantDevfilesMap), len(devfilesMap), devfilesMap) } else { for key := range tt.wantDevfilesMap { if _, ok := devfilesMap[key]; !ok { @@ -365,3 +380,35 @@ metadata: }) } } + +func TestGetDevfileAndDockerFilePaths(t *testing.T) { + tests := []struct { + testCase string + cdqInfo CDQInfoClient + wantDevfilePath string + wantDockerfilePath string + }{ + { + testCase: "Unset dockerfilepath and devfilepath", + cdqInfo: CDQInfoClient{}, + wantDevfilePath: "", + wantDockerfilePath: "", + }, + { + testCase: "Set dockerfilepath and devfilepath", + cdqInfo: CDQInfoClient{dockerfilePath: "/dockerfile", devfilePath: "devfile.yml"}, + wantDevfilePath: "devfile.yml", + wantDockerfilePath: "/dockerfile", + }, + } + + for _, tt := range tests { + t.Run(tt.testCase, func(t *testing.T) { + devfilePath, dockerfilePath := GetDevfileAndDockerFilePaths(tt.cdqInfo) + if devfilePath != tt.wantDevfilePath || dockerfilePath != tt.wantDockerfilePath { + t.Errorf("devfilepath %s or dockerfile %s path does not match expected values wantDevfilePath %s, wantDockerfilePath %s", devfilePath, dockerfilePath, tt.wantDevfilePath, tt.wantDockerfilePath) + } + }) + } + +} diff --git a/cdq-analysis/pkg/detect.go b/cdq-analysis/pkg/detect.go index f29656230..aea83a8c9 100644 --- a/cdq-analysis/pkg/detect.go +++ b/cdq-analysis/pkg/detect.go @@ -22,6 +22,8 @@ import ( "reflect" "strings" + "github.com/devfile/library/v2/pkg/devfile/parser" + "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/library/v2/pkg/devfile/parser/data/v2/common" "github.com/go-logr/logr" @@ -45,13 +47,18 @@ type AlizerClient struct { // Map 2 returns a context to the matched devfileURL from the github repository. If no devfile was present, then a link to a matching devfile in the devfile registry will be used instead. // Map 3 returns a context to the Dockerfile uri or a matched DockerfileURL from the devfile registry if no Dockerfile is present in the context // Map 4 returns a context to the list of ports that were detected by alizer in the source code, at that given context -func search(log logr.Logger, a Alizer, localpath string, devfileRegistryURL string, URL string, revision string, srcContext string) (map[string][]byte, map[string]string, map[string]string, map[string][]int, error) { +func search(log logr.Logger, a Alizer, localpath string, srcContext string, cdqInfo CDQInfoClient) (map[string][]byte, map[string]string, map[string]string, map[string][]int, error) { devfileMapFromRepo := make(map[string][]byte) devfilesURLMapFromRepo := make(map[string]string) dockerfileContextMapFromRepo := make(map[string]string) componentPortsMapFromRepo := make(map[string][]int) + URL := cdqInfo.GitURL.RepoURL + revision := cdqInfo.GitURL.Revision + token := cdqInfo.GitURL.Token + devfileRegistryURL := cdqInfo.DevfileRegistryURL + files, err := os.ReadDir(localpath) if err != nil { return nil, nil, nil, nil, err @@ -78,7 +85,7 @@ func search(log logr.Logger, a Alizer, localpath string, devfileRegistryURL stri if err != nil { return nil, nil, nil, nil, err } - shouldIgnoreDevfile, devfileBytes, err := ValidateDevfile(log, devfilePath) + shouldIgnoreDevfile, devfileBytes, err := ValidateDevfile(log, devfilePath, token) if err != nil { return nil, nil, nil, nil, err } @@ -109,7 +116,7 @@ func search(log logr.Logger, a Alizer, localpath string, devfileRegistryURL stri if err != nil { return nil, nil, nil, nil, err } - shouldIgnoreDevfile, devfileBytes, err := ValidateDevfile(log, devfilePath) + shouldIgnoreDevfile, devfileBytes, err := ValidateDevfile(log, devfilePath, token) if err != nil { return nil, nil, nil, nil, err } @@ -165,7 +172,7 @@ func search(log logr.Logger, a Alizer, localpath string, devfileRegistryURL stri } if (!isDevfilePresent && !isDockerfilePresent) || (isDevfilePresent && !isDockerfilePresent) { - err := AnalyzePath(log, a, curPath, context, devfileRegistryURL, devfileMapFromRepo, devfilesURLMapFromRepo, dockerfileContextMapFromRepo, componentPortsMapFromRepo, isDevfilePresent, isDockerfilePresent) + err := AnalyzePath(log, a, curPath, context, devfileRegistryURL, devfileMapFromRepo, devfilesURLMapFromRepo, dockerfileContextMapFromRepo, componentPortsMapFromRepo, isDevfilePresent, isDockerfilePresent, token) if err != nil { return nil, nil, nil, nil, err } @@ -187,11 +194,11 @@ func search(log logr.Logger, a Alizer, localpath string, devfileRegistryURL stri // devfilesURLMapFromRepo: a context to the matched devfileURL from the github repository. If no devfile was present, then a link to a matching devfile in the devfile registry will be used instead. // dockerfileContextMapFromRepo: a context to the Dockerfile uri or a matched DockerfileURL from the devfile registry if no Dockerfile is present in the context // componentPortsMapFromRepo: a context to the list of ports that were detected by alizer in the source code, at that given context -func AnalyzePath(log logr.Logger, a Alizer, localpath, context, devfileRegistryURL string, devfileMapFromRepo map[string][]byte, devfilesURLMapFromRepo, dockerfileContextMapFromRepo map[string]string, componentPortsMapFromRepo map[string][]int, isDevfilePresent, isDockerfilePresent bool) error { +func AnalyzePath(log logr.Logger, a Alizer, localpath, context, devfileRegistryURL string, devfileMapFromRepo map[string][]byte, devfilesURLMapFromRepo, dockerfileContextMapFromRepo map[string]string, componentPortsMapFromRepo map[string][]int, isDevfilePresent, isDockerfilePresent bool, token string) error { if isDevfilePresent { // If devfile is present, check to see if we can determine a Dockerfile from it devfileBytes := devfileMapFromRepo[context] - dockerfileImage, err := SearchForDockerfile(devfileBytes) + dockerfileImage, err := SearchForDockerfile(devfileBytes, token) if err != nil { return err } @@ -230,7 +237,7 @@ func AnalyzePath(log logr.Logger, a Alizer, localpath, context, devfileRegistryU return err } - dockerfileImage, err := SearchForDockerfile(detectedDevfile) + dockerfileImage, err := SearchForDockerfile(detectedDevfile, token) if err != nil { return err } @@ -269,14 +276,13 @@ func AnalyzePath(log logr.Logger, a Alizer, localpath, context, devfileRegistryU // SearchForDockerfile searches for a Dockerfile from a devfile image component. // If no Dockerfile is found, nil will be returned. -func SearchForDockerfile(devfileBytes []byte) (*v1alpha2.DockerfileImage, error) { +// token is required if the devfile has a parent reference to a private repo +func SearchForDockerfile(devfileBytes []byte, token string) (*v1alpha2.DockerfileImage, error) { if len(devfileBytes) == 0 { return nil, nil } - devfileSrc := DevfileSrc{ - Data: string(devfileBytes), - } - devfileData, err := ParseDevfile(devfileSrc) + devfileData, err := ParseDevfileWithParserArgs(&parser.ParserArgs{Data: devfileBytes, Token: token}) + if err != nil { return nil, err } @@ -365,10 +371,9 @@ func AnalyzeAndDetectDevfile(a Alizer, path, devfileRegistryURL string) ([]byte, return nil, "", "", nil, err } - devfileSrc := DevfileSrc{ - URL: detectedDevfileEndpoint, - } - compDevfileData, err := ParseDevfile(devfileSrc) + // This is the community registry we are parsing the sample from, so we don't need to pass in the git token + compDevfileData, err := ParseDevfileWithParserArgs(&parser.ParserArgs{URL: detectedDevfileEndpoint}) + if err != nil { return nil, "", "", nil, err } diff --git a/cdq-analysis/pkg/detect_test.go b/cdq-analysis/pkg/detect_test.go index 9e816d193..2d891f1d8 100644 --- a/cdq-analysis/pkg/detect_test.go +++ b/cdq-analysis/pkg/detect_test.go @@ -104,7 +104,11 @@ func TestAnalyzeAndDetectDevfile(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - err := CloneRepo(tt.clonePath, tt.repo, tt.revision, tt.token) + err := CloneRepo(tt.clonePath, GitURL{ + RepoURL: tt.repo, + Revision: tt.revision, + Token: tt.token, + }) if err != nil { t.Errorf("got unexpected error %v", err) } else { @@ -183,7 +187,11 @@ func TestSelectDevfileFromTypes(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { os.RemoveAll(tt.clonePath) - err := CloneRepo(tt.clonePath, tt.repo, "main", "") + err := CloneRepo(tt.clonePath, GitURL{ + RepoURL: tt.repo, + Revision: "main", + Token: "", + }) if err != nil { t.Errorf("got unexpected error %v", err) } @@ -245,7 +253,7 @@ components: for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { devfileBytes := []byte(tt.devfileString) - dockerfileImage, err := SearchForDockerfile(devfileBytes) + dockerfileImage, err := SearchForDockerfile(devfileBytes, "") if !tt.wantErr && err != nil { t.Errorf("Unexpected err: %+v", err) } else if tt.wantErr && err == nil { diff --git a/cdq-analysis/pkg/devfile.go b/cdq-analysis/pkg/devfile.go index b9faaaa24..144cd5307 100644 --- a/cdq-analysis/pkg/devfile.go +++ b/cdq-analysis/pkg/devfile.go @@ -21,6 +21,8 @@ import ( "path" "strings" + "github.com/pkg/errors" + "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" devfileValidation "github.com/devfile/api/v2/pkg/validation" devfilePkg "github.com/devfile/library/v2/pkg/devfile" @@ -70,6 +72,12 @@ const ( DevfileStageRegistryEndpoint = "https://registry.stage.devfile.io" ) +var ValidDevfileLocations = []string{Devfile, HiddenDevfile, HiddenDirDevfile, HiddenDirHiddenDevfile} + +var ValidDockerfileLocations = []string{Dockerfile, DockerDirDockerfile, HiddenDirDockerfile, BuildDirDockerfile, + AlternateDockerfile, DockerDirAlternateDockerfile, HiddenDirAlternateDockerfile, BuildDirAlternateDockerfile, + Containerfile, DockerDirContainerfile, HiddenDirContainerfile, BuildDirContainerfile} + // ScanRepo attempts to read and return devfiles and dockerfiles from the local path upto the specified depth // Iterate through each sub-folder under first level, and scan for component. (devfile, dockerfile, then Alizer) // If no devfile(s) or dockerfile(s) are found in sub-folders of the root directory, then the Alizer tool is used to detect and match a devfile/dockerfile from the devfile registry @@ -78,8 +86,8 @@ const ( // Map 2 returns a context to the matched devfileURL from the devfile registry if no devfile is present in the context. // Map 3 returns a context to the Dockerfile uri or a matched DockerfileURL from the devfile registry if no Dockerfile/Containerfile is present in the context // Map 4 returns a context to the list of ports that were detected by alizer in the source code, at that given context -func ScanRepo(log logr.Logger, a Alizer, localpath string, devfileRegistryURL string, URL, revision, srcContext string) (map[string][]byte, map[string]string, map[string]string, map[string][]int, error) { - return search(log, a, localpath, devfileRegistryURL, URL, revision, srcContext) +func ScanRepo(log logr.Logger, a Alizer, localpath string, srcContext string, cdqInfo CDQInfoClient) (map[string][]byte, map[string]string, map[string]string, map[string][]int, error) { + return search(log, a, localpath, srcContext, cdqInfo) } // ValidateDevfile parse and validate a devfile from it's URL, returns if the devfile should be ignored, the devfile raw content and an error if devfile is invalid @@ -87,21 +95,18 @@ func ScanRepo(log logr.Logger, a Alizer, localpath string, devfileRegistryURL st // If no kubernetes components being defined in devfile, then it's not a valid outerloop devfile, the devfile should be ignored. // If more than one kubernetes components in the devfile, but no deploy commands being defined. return an error // If more than one image components in the devfile, but no apply commands being defined. return an error -func ValidateDevfile(log logr.Logger, URL string) (shouldIgnoreDevfile bool, devfileBytes []byte, err error) { +func ValidateDevfile(log logr.Logger, URL string, token string) (shouldIgnoreDevfile bool, devfileBytes []byte, err error) { log.Info(fmt.Sprintf("Validating devfile from %s...", URL)) shouldIgnoreDevfile = false - var devfileSrc DevfileSrc + parserArgs := &parser.ParserArgs{Token: token} if strings.HasPrefix(URL, "http://") || strings.HasPrefix(URL, "https://") { - devfileSrc = DevfileSrc{ - URL: URL, - } + parserArgs.URL = URL } else { - devfileSrc = DevfileSrc{ - Path: URL, - } + parserArgs.Path = URL } - devfileData, err := ParseDevfile(devfileSrc) + devfileData, err := ParseDevfileWithParserArgs(parserArgs) + if err != nil { var newErr error if merr, ok := err.(*multierror.Error); ok { @@ -189,7 +194,7 @@ func ValidateDevfile(log logr.Logger, URL string) (shouldIgnoreDevfile bool, dev // image uri _, err = CurlEndpoint(dockerfileURI) } else { - if devfileSrc.Path != "" { + if parserArgs.Path != "" { // local devfile src with relative Dockerfile uri dockerfileURI = path.Join(path.Dir(URL), dockerfileURI) err = parserUtil.ValidateFile(dockerfileURI) @@ -235,8 +240,26 @@ type DevfileSrc struct { Path string } +// ParseDevfileWithParserArgs is an alternative implementation of ParseDevfile which gives the client the flexibility to call the devfile parser with custom parser arguments. +// The default httpTimeout is set to 10. To override this value, specify the preferred value in parserArgs.HTTPTimeout +func ParseDevfileWithParserArgs(parserArgs *parser.ParserArgs) (data.DevfileData, error) { + + if parserArgs.HTTPTimeout == nil { + httpTimeout := 10 + parserArgs.HTTPTimeout = &httpTimeout + } + + if len(parserArgs.Data) == 0 && parserArgs.URL == "" && parserArgs.Path == "" { + return nil, fmt.Errorf("cannot parse devfile without a src") + } + + devfileObj, _, err := devfilePkg.ParseDevfileAndValidate(*parserArgs) + return devfileObj.Data, err +} + // ParseDevfile calls the devfile library's parse and returns the devfile data. // Provide either a Data src or the URL src +// Deprecated, use ParseDevfileWithParserArgs instead func ParseDevfile(src DevfileSrc) (data.DevfileData, error) { httpTimeout := 10 @@ -258,3 +281,43 @@ func ParseDevfile(src DevfileSrc) (data.DevfileData, error) { devfileObj, _, err := devfilePkg.ParseDevfileAndValidate(parserArgs) return devfileObj.Data, err } + +// FindValidDevfiles will search through the list of valid devfile locations and update the DevfileInfo object if a valid devfilepath is found +func FindValidDevfiles(cdqInfo *CDQInfoClient) ([]byte, error) { + var devfileBytes []byte + Fs := cdqInfo.ClonedRepo.Fs + if isExist, _ := IsExisting(cdqInfo.ClonedRepo.Fs, cdqInfo.ClonedRepo.ClonedPath); isExist { + for _, path := range ValidDevfileLocations { + devfileTempPath := cdqInfo.ClonedRepo.ComponentPath + "/" + path + if isExist, _ := IsExisting(Fs, devfileTempPath); isExist { + cdqInfo.devfilePath = path + //read contents + devfileBytes, err := Fs.ReadFile(devfileTempPath) + if err != nil { + return nil, errors.Wrapf(err, "failed to read yaml from path %q", devfileTempPath) + } + return devfileBytes, nil + } + } + } + return devfileBytes, &NoDevfileFound{Location: cdqInfo.ClonedRepo.ClonedPath} +} + +func FindValidDockerfile(cdqInfo *CDQInfoClient) ([]byte, error) { + var dockerfileBytes []byte + Fs := cdqInfo.ClonedRepo.Fs + for _, path := range ValidDockerfileLocations { + dockerfileTempPath := cdqInfo.ClonedRepo.ComponentPath + "/" + path + if isExist, _ := IsExisting(cdqInfo.ClonedRepo.Fs, dockerfileTempPath); isExist { + cdqInfo.dockerfilePath = path + //read contents + dockerfileBytes, err := Fs.ReadFile(dockerfileTempPath) + if err != nil { + return nil, errors.Wrapf(err, "failed to read yaml from path %q", dockerfileTempPath) + } + return dockerfileBytes, nil + } + } + + return dockerfileBytes, &NoDockerfileFound{Location: cdqInfo.ClonedRepo.ClonedPath} +} diff --git a/cdq-analysis/pkg/devfile_test.go b/cdq-analysis/pkg/devfile_test.go index c68fc581b..1dfe7308a 100644 --- a/cdq-analysis/pkg/devfile_test.go +++ b/cdq-analysis/pkg/devfile_test.go @@ -126,21 +126,15 @@ schemaVersion: 2.2.0` for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - var devfileSrc DevfileSrc + parserArgs := &parser.ParserArgs{} if tt.devfileString != "" { - devfileSrc = DevfileSrc{ - Data: tt.devfileString, - } + parserArgs.Data = []byte(tt.devfileString) } else if tt.devfileURL != "" { - devfileSrc = DevfileSrc{ - URL: tt.devfileURL, - } + parserArgs.URL = tt.devfileURL } else if tt.devfilePath != "" { - devfileSrc = DevfileSrc{ - Path: tt.devfilePath, - } + parserArgs.Path = tt.devfilePath } - devfile, err := ParseDevfile(devfileSrc) + devfile, err := ParseDevfileWithParserArgs(parserArgs) if err != nil { t.Errorf("TestParseDevfileModel() unexpected error: %v", err) } else { @@ -280,12 +274,20 @@ func TestScanRepo(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { logger = ctrl.Log.WithName("TestScanRepo") - err := CloneRepo(tt.clonePath, tt.repo, tt.revision, tt.token) + err := CloneRepo(tt.clonePath, GitURL{ + RepoURL: tt.repo, + Revision: tt.revision, + Token: tt.token, + }) URL := tt.repo if err != nil { t.Errorf("got unexpected error %v", err) } else { - devfileMap, devfileURLMap, dockerfileMap, portsMap, err := ScanRepo(logger, alizerClient, tt.clonePath, DevfileStageRegistryEndpoint, URL, "", "") + devfileInfo := CDQInfoClient{ + DevfileRegistryURL: DevfileStageRegistryEndpoint, + GitURL: GitURL{RepoURL: URL}, + } + devfileMap, devfileURLMap, dockerfileMap, portsMap, err := ScanRepo(logger, alizerClient, tt.clonePath, "", devfileInfo) if tt.wantErr && (err == nil) { t.Error("wanted error but got nil") } else if !tt.wantErr && err != nil { @@ -339,6 +341,8 @@ func TestValidateDevfile(t *testing.T) { ConvertKubernetesContentInUri: &convert, } + parserArgs.DevfileUtilsClient = parser.NewMockDevfileUtilsClient() + springDevfileParser := parserArgs springDevfileParser.URL = "https://raw.githubusercontent.com/devfile-samples/devfile-sample-java-springboot-basic/main/devfile.yaml" @@ -423,7 +427,7 @@ func TestValidateDevfile(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - shouldIgnoreDevfile, devfileBytes, err := ValidateDevfile(logger, tt.url) + shouldIgnoreDevfile, devfileBytes, err := ValidateDevfile(logger, tt.url, "") if (err != nil) != tt.wantErr { t.Errorf("TestValidateDevfile() unexpected error: %v", err) } diff --git a/cdq-analysis/pkg/util.go b/cdq-analysis/pkg/util.go index 1cb13a447..d82ec4499 100644 --- a/cdq-analysis/pkg/util.go +++ b/cdq-analysis/pkg/util.go @@ -32,19 +32,25 @@ import ( "github.com/redhat-developer/alizer/go/pkg/apis/model" ) -// CloneRepo clones the repoURL to clonePath -func CloneRepo(clonePath, repoURL string, revision string, token string) error { +type GitURL struct { + RepoURL string // the repo URL where the devfile is located + Revision string + Token string +} + +// CloneRepo clones the repoURL to specfied clonePath +func CloneRepo(clonePath string, gitURL GitURL) error { exist, err := IsExist(clonePath) if !exist || err != nil { os.MkdirAll(clonePath, 0750) } - cloneURL := repoURL + cloneURL := gitURL.RepoURL // Execute does an exec.Command on the specified command - if token != "" { - tempStr := strings.Split(repoURL, "https://") + if gitURL.Token != "" { + tempStr := strings.Split(gitURL.RepoURL, "https://") // e.g. https://token:@github.com/owner/repoName.git - cloneURL = fmt.Sprintf("https://token:%s@%s", token, tempStr[1]) + cloneURL = fmt.Sprintf("https://token:%s@%s", gitURL.Token, tempStr[1]) } c := exec.Command("git", "clone", cloneURL, clonePath) c.Dir = clonePath @@ -58,13 +64,13 @@ func CloneRepo(clonePath, repoURL string, revision string, token string) error { return fmt.Errorf("failed to clone the repo: %v", err) } - if revision != "" { - c = exec.Command("git", "checkout", revision) + if gitURL.Revision != "" { + c = exec.Command("git", "checkout", gitURL.Revision) c.Dir = clonePath _, err = c.CombinedOutput() if err != nil { - return fmt.Errorf("failed to checkout the revision %q: %v", revision, err) + return fmt.Errorf("failed to checkout the revision %q: %v", gitURL.Revision, err) } } diff --git a/cdq-analysis/pkg/util_test.go b/cdq-analysis/pkg/util_test.go index ea8d809f8..5419665ab 100644 --- a/cdq-analysis/pkg/util_test.go +++ b/cdq-analysis/pkg/util_test.go @@ -166,7 +166,11 @@ func TestCloneRepo(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - err := CloneRepo(tt.clonePath, tt.repo, tt.revision, tt.token) + err := CloneRepo(tt.clonePath, GitURL{ + RepoURL: tt.repo, + Revision: tt.revision, + Token: tt.token, + }) if tt.wantErr && (err == nil) { t.Error("wanted error but got nil") } else if !tt.wantErr && err != nil { @@ -214,7 +218,11 @@ func TestGetBranchFromRepo(t *testing.T) { t.Run(tt.name, func(t *testing.T) { os.RemoveAll(tt.clonePath) if tt.name != "Repo not exist" { - CloneRepo(tt.clonePath, tt.repo, tt.revision, tt.token) + CloneRepo(tt.clonePath, GitURL{ + RepoURL: tt.repo, + Revision: tt.revision, + Token: tt.token, + }) } branch, err := GetBranchFromRepo(tt.clonePath) diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index ff5c25214..2503301c3 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -125,6 +125,26 @@ rules: - get - list - watch +- apiGroups: + - appstudio.redhat.com + resources: + - spifilecontentrequests + verbs: + - create + - get + - list +- apiGroups: + - appstudio.redhat.com + resources: + - spifilecontentrequests/finalizers + verbs: + - update +- apiGroups: + - appstudio.redhat.com + resources: + - spifilecontentrequests/status + verbs: + - get - apiGroups: - "" resources: diff --git a/controllers/application_controller.go b/controllers/application_controller.go index 81e45a513..ba6af8765 100644 --- a/controllers/application_controller.go +++ b/controllers/application_controller.go @@ -22,6 +22,8 @@ import ( "reflect" "time" + "github.com/devfile/library/v2/pkg/devfile/parser" + "github.com/prometheus/client_golang/prometheus" cdqanalysis "github.com/redhat-appstudio/application-service/cdq-analysis/pkg" "github.com/redhat-appstudio/application-service/pkg/metrics" @@ -206,10 +208,9 @@ func (r *ApplicationReconciler) Reconcile(ctx context.Context, req ctrl.Request) } else { // If the model already exists, see if either the displayname or description need updating // Get the devfile of the hasApp CR - devfileSrc := cdqanalysis.DevfileSrc{ - Data: application.Status.Devfile, - } - devfileData, err := cdqanalysis.ParseDevfile(devfileSrc) + + // Token can be empty since we are passing in generated devfile data, so we won't be dealing with private repos + devfileData, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(application.Status.Devfile)}) if err != nil { r.SetUpdateConditionAndUpdateCR(ctx, req, &application, err) log.Error(err, fmt.Sprintf("Unable to parse devfile model, exiting reconcile loop %v", req.NamespacedName)) diff --git a/controllers/application_controller_finalizer.go b/controllers/application_controller_finalizer.go index 9695b50e9..8696e7bdf 100644 --- a/controllers/application_controller_finalizer.go +++ b/controllers/application_controller_finalizer.go @@ -21,6 +21,8 @@ import ( "strconv" "strings" + "github.com/devfile/library/v2/pkg/devfile/parser" + "github.com/prometheus/client_golang/prometheus" appstudiov1alpha1 "github.com/redhat-appstudio/application-api/api/v1alpha1" cdqanalysis "github.com/redhat-appstudio/application-service/cdq-analysis/pkg" @@ -50,10 +52,7 @@ func (r *ApplicationReconciler) AddFinalizer(ctx context.Context, application *a // Finalize deletes the corresponding GitOps repo for the given Application CR. func (r *ApplicationReconciler) Finalize(ctx context.Context, application *appstudiov1alpha1.Application, ghClient *github.GitHubClient) error { // Get the GitOps repository URL - devfileSrc := cdqanalysis.DevfileSrc{ - Data: application.Status.Devfile, - } - devfileObj, err := cdqanalysis.ParseDevfile(devfileSrc) + devfileObj, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(application.Status.Devfile)}) if err != nil { return err } diff --git a/controllers/application_controller_finalizer_test.go b/controllers/application_controller_finalizer_test.go index a58530e28..ffc33e732 100644 --- a/controllers/application_controller_finalizer_test.go +++ b/controllers/application_controller_finalizer_test.go @@ -20,6 +20,8 @@ import ( "context" "testing" + "github.com/devfile/library/v2/pkg/devfile/parser" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/prometheus/client_golang/prometheus" @@ -63,10 +65,7 @@ var _ = Describe("Application controller finalizer counter tests", func() { beforeDeleteFailedReqs := testutil.ToFloat64(metrics.ApplicationDeletionFailed) // Create a simple Application CR and get its devfile fetchedApp := createAndFetchSimpleApp(AppName, AppNamespace, DisplayName, Description) - devfileSrc := cdqanalysis.DevfileSrc{ - Data: fetchedApp.Status.Devfile, - } - curDevfile, err := cdqanalysis.ParseDevfile(devfileSrc) + curDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(fetchedApp.Status.Devfile)}) // Make sure the devfile model was properly set Expect(fetchedApp.Status.Devfile).Should(Not(Equal(""))) @@ -110,10 +109,8 @@ var _ = Describe("Application controller finalizer counter tests", func() { // Create an Application resource and get its devfile fetchedHasApp := createAndFetchSimpleApp(AppName, AppNamespace, DisplayName, Description) Expect(fetchedHasApp.Status.Devfile).Should(Not(Equal(""))) - devfileSrc := cdqanalysis.DevfileSrc{ - Data: fetchedHasApp.Status.Devfile, - } - curDevfile, err := cdqanalysis.ParseDevfile(devfileSrc) + curDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(fetchedHasApp.Status.Devfile)}) + Expect(err).ToNot(HaveOccurred()) // Set an invalid gitops URL and update the status of the resource diff --git a/controllers/application_controller_test.go b/controllers/application_controller_test.go index b44f9d087..7572fd010 100644 --- a/controllers/application_controller_test.go +++ b/controllers/application_controller_test.go @@ -20,6 +20,8 @@ import ( "context" "time" + "github.com/devfile/library/v2/pkg/devfile/parser" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" appstudiov1alpha1 "github.com/redhat-appstudio/application-api/api/v1alpha1" @@ -82,10 +84,7 @@ var _ = Describe("Application controller", func() { // Make sure the devfile model was properly set Expect(createdHasApp.Status.Devfile).Should(Not(Equal(""))) - devfileSrc := cdqanalysis.DevfileSrc{ - Data: createdHasApp.Status.Devfile, - } - devfile, err := cdqanalysis.ParseDevfile(devfileSrc) + devfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasApp.Status.Devfile)}) Expect(err).Should(Not(HaveOccurred())) // gitOpsRepo and appModelRepo should both be set @@ -130,10 +129,8 @@ var _ = Describe("Application controller", func() { // Make sure the devfile model was properly set Expect(createdHasApp.Status.Devfile).Should(Not(Equal(""))) - devfileSrc := cdqanalysis.DevfileSrc{ - Data: createdHasApp.Status.Devfile, - } - devfile, err := cdqanalysis.ParseDevfile(devfileSrc) + devfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasApp.Status.Devfile)}) + Expect(err).Should(Not(HaveOccurred())) // gitOpsRepo and appModelRepo should both be set @@ -183,10 +180,8 @@ var _ = Describe("Application controller", func() { // Make sure the devfile model was properly set Expect(createdHasApp.Status.Devfile).Should(Not(Equal(""))) - devfileSrc := cdqanalysis.DevfileSrc{ - Data: createdHasApp.Status.Devfile, - } - devfile, err := cdqanalysis.ParseDevfile(devfileSrc) + devfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasApp.Status.Devfile)}) + Expect(err).Should(Not(HaveOccurred())) // gitOpsRepo and appModelRepo should both be set @@ -238,10 +233,8 @@ var _ = Describe("Application controller", func() { // Make sure the devfile model was properly set Expect(createdHasApp.Status.Devfile).Should(Not(Equal(""))) - devfileSrc := cdqanalysis.DevfileSrc{ - Data: createdHasApp.Status.Devfile, - } - devfile, err := cdqanalysis.ParseDevfile(devfileSrc) + devfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasApp.Status.Devfile)}) + Expect(err).Should(Not(HaveOccurred())) // gitOpsRepo and appModelRepo should both be set @@ -304,10 +297,8 @@ var _ = Describe("Application controller", func() { return fetchedHasApp.Status.Conditions[len(fetchedHasApp.Status.Conditions)-1].Type == "Updated" }, timeout, interval).Should(BeTrue()) - devfileSrc := cdqanalysis.DevfileSrc{ - Data: fetchedHasApp.Status.Devfile, - } - devfile, err := cdqanalysis.ParseDevfile(devfileSrc) + devfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(fetchedHasApp.Status.Devfile)}) + Expect(err).Should(Not(HaveOccurred())) Expect(string(devfile.GetMetadata().Name)).Should(Equal("newname")) Expect(string(devfile.GetMetadata().Description)).Should(Equal("New Description")) diff --git a/controllers/applicationsnapshotenvironmentbinding_controller.go b/controllers/applicationsnapshotenvironmentbinding_controller.go index e128d0e49..bef9302e1 100644 --- a/controllers/applicationsnapshotenvironmentbinding_controller.go +++ b/controllers/applicationsnapshotenvironmentbinding_controller.go @@ -33,8 +33,8 @@ import ( devfileParser "github.com/devfile/library/v2/pkg/devfile/parser" "github.com/go-logr/logr" appstudiov1alpha1 "github.com/redhat-appstudio/application-api/api/v1alpha1" - devfile "github.com/redhat-appstudio/application-service/pkg/devfile" - github "github.com/redhat-appstudio/application-service/pkg/github" + "github.com/redhat-appstudio/application-service/pkg/devfile" + "github.com/redhat-appstudio/application-service/pkg/github" logutil "github.com/redhat-appstudio/application-service/pkg/log" "github.com/redhat-appstudio/application-service/pkg/util" "github.com/redhat-appstudio/application-service/pkg/util/ioutils" @@ -201,10 +201,28 @@ func (r *SnapshotEnvironmentBindingReconciler) Reconcile(ctx context.Context, re return ctrl.Result{}, err } - devfileSrc := cdqanalysis.DevfileSrc{ - Data: hasComponent.Status.Devfile, + parserArgs := &devfileParser.ParserArgs{Data: []byte(hasComponent.Status.Devfile)} + var gitToken string + //get the token to pass into the parser + if hasComponent.Spec.Secret != "" { + gitSecret := corev1.Secret{} + namespacedName := types.NamespacedName{ + Name: hasComponent.Spec.Secret, + Namespace: hasComponent.Namespace, + } + + err = r.Client.Get(ctx, namespacedName, &gitSecret) + if err != nil { + log.Error(err, fmt.Sprintf("Unable to retrieve Git secret %v, exiting reconcile loop %v", hasComponent.Spec.Secret, req.NamespacedName)) + r.SetConditionAndUpdateCR(ctx, req, &appSnapshotEnvBinding, err) + return ctrl.Result{}, err + } + + gitToken = string(gitSecret.Data["password"]) } - compDevfileData, err := cdqanalysis.ParseDevfile(devfileSrc) + + parserArgs.Token = gitToken + compDevfileData, err := cdqanalysis.ParseDevfileWithParserArgs(parserArgs) if err != nil { errMsg := fmt.Sprintf("Unable to parse the devfile from Component status, exiting reconcile loop %v", req.NamespacedName) log.Error(err, errMsg) diff --git a/controllers/applicationsnapshotenvironmentbinding_controller_test.go b/controllers/applicationsnapshotenvironmentbinding_controller_test.go index be3e82980..2a4c9ee2e 100644 --- a/controllers/applicationsnapshotenvironmentbinding_controller_test.go +++ b/controllers/applicationsnapshotenvironmentbinding_controller_test.go @@ -2510,7 +2510,7 @@ schemaVersion: 2.2.0` Eventually(func() bool { k8sClient.Get(context.Background(), hasCompLookupKey, updatedHasComp) return updatedHasComp.Status.Devfile == kubernetesInlinedDevfileDeploy - }, timeout, interval).Should(BeTrue()) + }, timeout20s, interval).Should(BeTrue()) appSnapshot := &appstudiov1alpha1.Snapshot{ TypeMeta: metav1.TypeMeta{ diff --git a/controllers/component_controller.go b/controllers/component_controller.go index 03425e71f..46ea10e91 100644 --- a/controllers/component_controller.go +++ b/controllers/component_controller.go @@ -24,10 +24,11 @@ import ( "reflect" "time" + corev1 "k8s.io/api/core/v1" + "github.com/prometheus/client_golang/prometheus" cdqanalysis "github.com/redhat-appstudio/application-service/cdq-analysis/pkg" "github.com/redhat-appstudio/application-service/pkg/metrics" - corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -83,6 +84,9 @@ const ( //+kubebuilder:rbac:groups=appstudio.redhat.com,resources=components/finalizers,verbs=update //+kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch //+kubebuilder:rbac:groups=core,resources=secrets,verbs=get;list;watch +//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=spifilecontentrequests,verbs=get;list;create +//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=spifilecontentrequests/status,verbs=get +//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=spifilecontentrequests/finalizers,verbs=update // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state. @@ -136,6 +140,25 @@ func (r *ComponentReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( // Add the Go-GitHub client name to the context ctx = context.WithValue(ctx, github.GHClientKey, ghClient.TokenName) + var gitToken string + //get the token to pass into the parser + if component.Spec.Secret != "" { + gitSecret := corev1.Secret{} + namespacedName := types.NamespacedName{ + Name: component.Spec.Secret, + Namespace: component.Namespace, + } + + err = r.Client.Get(ctx, namespacedName, &gitSecret) + if err != nil { + log.Error(err, fmt.Sprintf("Unable to retrieve Git secret %v, exiting reconcile loop %v", component.Spec.Secret, req.NamespacedName)) + _ = r.SetCreateConditionAndUpdateCR(ctx, req, &component, err) + return ctrl.Result{}, err + } + + gitToken = string(gitSecret.Data["password"]) + } + // Check if the Component CR is under deletion // If so: Remove the project from the Application devfile, remove the component dir from the Gitops repo and remove the finalizer. if component.ObjectMeta.DeletionTimestamp.IsZero() { @@ -159,7 +182,7 @@ func (r *ComponentReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( if hasApplication.Status.Devfile != "" && len(component.Status.Conditions) > 0 && component.Status.Conditions[len(component.Status.Conditions)-1].Status == metav1.ConditionTrue && containsString(component.GetFinalizers(), compFinalizerName) { // only attempt to finalize and update the gitops repo if an Application is present & the previous Component status is good // A finalizer is present for the Component CR, so make sure we do the necessary cleanup steps - if err := r.Finalize(ctx, &component, &hasApplication, ghClient); err != nil { + if err := r.Finalize(ctx, &component, &hasApplication, ghClient, gitToken); err != nil { if errors.IsConflict(err) { //conflict means we just retry, we are updating the shared application so conflicts are not unexpected return ctrl.Result{}, err @@ -190,10 +213,7 @@ func (r *ComponentReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( if condition.Type == "GitOpsResourcesGenerated" && condition.Reason == "GenerateError" && condition.Status == metav1.ConditionFalse { log.Info(fmt.Sprintf("Re-attempting GitOps generation for %s", component.Name)) // Parse the Component Devfile - devfileSrc := cdqanalysis.DevfileSrc{ - Data: component.Status.Devfile, - } - compDevfileData, err := cdqanalysis.ParseDevfile(devfileSrc) + compDevfileData, err := cdqanalysis.ParseDevfileWithParserArgs(&devfileParser.ParserArgs{Data: []byte(component.Status.Devfile), Token: gitToken}) if err != nil { errMsg := fmt.Sprintf("Unable to parse the devfile from Component status and re-attempt GitOps generation, exiting reconcile loop %v", req.NamespacedName) log.Error(err, errMsg) @@ -233,7 +253,6 @@ func (r *ComponentReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( } // If the devfile hasn't been populated, the CR was just created - var gitToken string if component.Status.Devfile == "" { source := component.Spec.Source @@ -246,22 +265,6 @@ func (r *ComponentReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( context := source.GitSource.Context // If a Git secret was passed in, retrieve it for use in our Git operations // The secret needs to be in the same namespace as the Component - if component.Spec.Secret != "" { - gitSecret := corev1.Secret{} - namespacedName := types.NamespacedName{ - Name: component.Spec.Secret, - Namespace: component.Namespace, - } - - err = r.Client.Get(ctx, namespacedName, &gitSecret) - if err != nil { - log.Error(err, fmt.Sprintf("Unable to retrieve Git secret %v, exiting reconcile loop %v", component.Spec.Secret, req.NamespacedName)) - _ = r.SetCreateConditionAndUpdateCR(ctx, req, &component, err) - return ctrl.Result{}, err - } - - gitToken = string(gitSecret.Data["password"]) - } if source.GitSource.Revision == "" { sourceURL := source.GitSource.URL @@ -310,13 +313,23 @@ func (r *ComponentReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( devfileLocation = gitURL + string(os.PathSeparator) + devfileLocation } else { + //cannot use converted URLs in SPI because it's not supported. Need to convert later for parsing + gitURL = source.GitSource.URL // Use SPI to retrieve the devfile from the private repository - devfileBytes, err = spi.DownloadDevfileUsingSPI(r.SPIClient, ctx, component.Namespace, source.GitSource.URL, source.GitSource.Revision, context) + devfileBytes, devfileLocation, err = spi.DownloadDevfileUsingSPI(r.SPIClient, ctx, component, gitURL, source.GitSource.Revision, context) + if err != nil { + log.Error(err, fmt.Sprintf("Unable to download from any known devfile locations from %s %v", gitURL, req.NamespacedName)) + _ = r.SetCreateConditionAndUpdateCR(ctx, req, &component, err) + return ctrl.Result{}, err + } + + convertedGitURL, err := util.ConvertGitHubURL(source.GitSource.URL, source.GitSource.Revision, context) if err != nil { - log.Error(err, fmt.Sprintf("Unable to download from any known devfile locations from %s %v", source.GitSource.URL, req.NamespacedName)) + log.Error(err, fmt.Sprintf("Unable to convert Github URL to raw format, exiting reconcile loop %v", req.NamespacedName)) _ = r.SetCreateConditionAndUpdateCR(ctx, req, &component, err) return ctrl.Result{}, err } + devfileLocation = convertedGitURL + string(os.PathSeparator) + devfileLocation } } else if source.GitSource.DevfileURL != "" { @@ -370,10 +383,8 @@ func (r *ComponentReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( if devfileLocation != "" { // Parse the Component Devfile - devfileSrc := cdqanalysis.DevfileSrc{ - URL: devfileLocation, - } - compDevfileData, err = cdqanalysis.ParseDevfile(devfileSrc) + compDevfileData, err = cdqanalysis.ParseDevfileWithParserArgs(&devfileParser.ParserArgs{URL: devfileLocation, Token: gitToken}) + if err != nil { log.Error(err, fmt.Sprintf("Unable to parse the devfile from Component devfile location, exiting reconcile loop %v", req.NamespacedName)) _ = r.SetCreateConditionAndUpdateCR(ctx, req, &component, err) @@ -381,10 +392,9 @@ func (r *ComponentReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( } } else { // Parse the Component Devfile - devfileSrc := cdqanalysis.DevfileSrc{ - Data: string(devfileBytes), - } - compDevfileData, err = cdqanalysis.ParseDevfile(devfileSrc) + + compDevfileData, err = cdqanalysis.ParseDevfileWithParserArgs(&devfileParser.ParserArgs{Data: devfileBytes, Token: gitToken}) + if err != nil { log.Error(err, fmt.Sprintf("Unable to parse the devfile from Component, exiting reconcile loop %v", req.NamespacedName)) _ = r.SetCreateConditionAndUpdateCR(ctx, req, &component, err) @@ -401,10 +411,8 @@ func (r *ComponentReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( if hasApplication.Status.Devfile != "" { // Get the devfile of the hasApp CR - devfileSrc := cdqanalysis.DevfileSrc{ - Data: hasApplication.Status.Devfile, - } - hasAppDevfileData, err := cdqanalysis.ParseDevfile(devfileSrc) + hasAppDevfileData, err := cdqanalysis.ParseDevfileWithParserArgs(&devfileParser.ParserArgs{Data: []byte(hasApplication.Status.Devfile), Token: gitToken}) + if err != nil { log.Error(err, fmt.Sprintf("Unable to parse the devfile from Application, exiting reconcile loop %v", req.NamespacedName)) _ = r.SetCreateConditionAndUpdateCR(ctx, req, &component, err) @@ -458,10 +466,8 @@ func (r *ComponentReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( log.Info(fmt.Sprintf("Checking if the Component has been updated %v", req.NamespacedName)) // Parse the Component Devfile - devfileSrc := cdqanalysis.DevfileSrc{ - Data: component.Status.Devfile, - } - hasCompDevfileData, err := cdqanalysis.ParseDevfile(devfileSrc) + hasCompDevfileData, err := cdqanalysis.ParseDevfileWithParserArgs(&devfileParser.ParserArgs{Data: []byte(component.Status.Devfile), Token: gitToken}) + if err != nil { log.Error(err, fmt.Sprintf("Unable to parse the devfile from Component status, exiting reconcile loop %v", req.NamespacedName)) _ = r.SetUpdateConditionAndUpdateCR(ctx, req, &component, err) @@ -476,10 +482,8 @@ func (r *ComponentReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( } // Read the devfile again to compare it with any updates - devfileSrc = cdqanalysis.DevfileSrc{ - Data: component.Status.Devfile, - } - oldCompDevfileData, err := cdqanalysis.ParseDevfile(devfileSrc) + oldCompDevfileData, err := cdqanalysis.ParseDevfileWithParserArgs(&devfileParser.ParserArgs{Data: []byte(component.Status.Devfile), Token: gitToken}) + if err != nil { log.Error(err, fmt.Sprintf("Unable to parse the devfile from Component status, exiting reconcile loop %v", req.NamespacedName)) _ = r.SetUpdateConditionAndUpdateCR(ctx, req, &component, err) diff --git a/controllers/component_controller_finalizer.go b/controllers/component_controller_finalizer.go index 8437744c6..866c9c88d 100644 --- a/controllers/component_controller_finalizer.go +++ b/controllers/component_controller_finalizer.go @@ -20,6 +20,8 @@ import ( "context" "fmt" + "github.com/devfile/library/v2/pkg/devfile/parser" + "k8s.io/apimachinery/pkg/api/errors" ctrl "sigs.k8s.io/controller-runtime" @@ -42,12 +44,10 @@ func (r *ComponentReconciler) AddFinalizer(ctx context.Context, component *appst // Finalize deletes the corresponding devfile project or the devfile attribute entry from the Application CR and also deletes the corresponding GitOps repo's Component dir // & updates the parent kustomize for the given Component CR. -func (r *ComponentReconciler) Finalize(ctx context.Context, component *appstudiov1alpha1.Component, application *appstudiov1alpha1.Application, ghClient *github.GitHubClient) error { +func (r *ComponentReconciler) Finalize(ctx context.Context, component *appstudiov1alpha1.Component, application *appstudiov1alpha1.Application, ghClient *github.GitHubClient, token string) error { // Get the Application CR devfile - devfileSrc := cdqanalysis.DevfileSrc{ - Data: application.Status.Devfile, - } - devfileObj, err := cdqanalysis.ParseDevfile(devfileSrc) + devfileObj, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(application.Status.Devfile), Token: token}) + if err != nil { return err } diff --git a/controllers/component_controller_finalizer_test.go b/controllers/component_controller_finalizer_test.go index 5a57e674d..fa297216b 100644 --- a/controllers/component_controller_finalizer_test.go +++ b/controllers/component_controller_finalizer_test.go @@ -19,6 +19,8 @@ import ( "context" "strings" + "github.com/devfile/library/v2/pkg/devfile/parser" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "sigs.k8s.io/yaml" @@ -182,10 +184,8 @@ var _ = Describe("Application controller finalizer counter tests", func() { Expect(createdHasApp.Status.Devfile).Should(Not(Equal(""))) // delete the project so that the component delete finalizer fails - devfileSrc := cdqanalysis.DevfileSrc{ - Data: createdHasApp.Status.Devfile, - } - appDevfile, err := cdqanalysis.ParseDevfile(devfileSrc) + appDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasApp.Status.Devfile)}) + Expect(err).ToNot(HaveOccurred()) err = appDevfile.DeleteProject(ComponentName) diff --git a/controllers/component_controller_test.go b/controllers/component_controller_test.go index 19ebfb696..c4858e6ac 100644 --- a/controllers/component_controller_test.go +++ b/controllers/component_controller_test.go @@ -22,6 +22,8 @@ import ( "strings" "testing" + "github.com/devfile/library/v2/pkg/devfile/parser" + "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/api/v2/pkg/attributes" data "github.com/devfile/library/v2/pkg/devfile/parser/data" @@ -52,6 +54,7 @@ var _ = Describe("Component controller", func() { Description = "Simple petclinic app" ComponentName = "backend" SampleRepoLink = "https://github.com/devfile-samples/devfile-sample-java-springboot-basic" + gitToken = "" //empty for public repo test ) Context("Create Component with basic field set", func() { @@ -115,17 +118,12 @@ var _ = Describe("Component controller", func() { Expect(createdHasApp.Status.Devfile).Should(Not(Equal(""))) // Check the Component devfile - devfileSrc := cdqanalysis.DevfileSrc{ - Data: createdHasComp.Status.Devfile, - } - _, err := cdqanalysis.ParseDevfile(devfileSrc) + _, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasComp.Status.Devfile)}) Expect(err).Should(Not(HaveOccurred())) // Check the HAS Application devfile - devfileSrc = cdqanalysis.DevfileSrc{ - Data: createdHasApp.Status.Devfile, - } - hasAppDevfile, err := cdqanalysis.ParseDevfile(devfileSrc) + hasAppDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasApp.Status.Devfile)}) + Expect(err).Should(Not(HaveOccurred())) // gitOpsRepo and appModelRepo should both be set @@ -221,20 +219,16 @@ var _ = Describe("Component controller", func() { Expect(createdHasApp.Status.Devfile).Should(Not(Equal(""))) // Check the Component devfile - devfileSrc := cdqanalysis.DevfileSrc{ - Data: createdHasComp.Status.Devfile, - } - hasCompDevfile, err := cdqanalysis.ParseDevfile(devfileSrc) + hasCompDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasComp.Status.Devfile)}) + Expect(err).Should(Not(HaveOccurred())) // Check if its Liberty Expect(string(hasCompDevfile.GetMetadata().DisplayName)).Should(ContainSubstring("Liberty")) // Check the HAS Application devfile - devfileSrc = cdqanalysis.DevfileSrc{ - Data: createdHasApp.Status.Devfile, - } - hasAppDevfile, err := cdqanalysis.ParseDevfile(devfileSrc) + hasAppDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasApp.Status.Devfile)}) + Expect(err).Should(Not(HaveOccurred())) // gitOpsRepo and appModelRepo should both be set @@ -519,10 +513,7 @@ var _ = Describe("Component controller", func() { Expect(createdHasApp.Status.Devfile).Should(Not(Equal(""))) // Check the Component devfile - devfileSrc := cdqanalysis.DevfileSrc{ - Data: createdHasComp.Status.Devfile, - } - hasCompDevfile, err := cdqanalysis.ParseDevfile(devfileSrc) + hasCompDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasComp.Status.Devfile)}) Expect(err).Should(Not(HaveOccurred())) checklist := updateChecklist{ @@ -536,10 +527,7 @@ var _ = Describe("Component controller", func() { verifyHASComponentUpdates(hasCompDevfile, checklist, nil) // Check the HAS Application devfile - devfileSrc = cdqanalysis.DevfileSrc{ - Data: createdHasApp.Status.Devfile, - } - hasAppDevfile, err := cdqanalysis.ParseDevfile(devfileSrc) + hasAppDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasApp.Status.Devfile)}) Expect(err).Should(Not(HaveOccurred())) // gitOpsRepo and appModelRepo should both be set @@ -587,10 +575,8 @@ var _ = Describe("Component controller", func() { Expect(updatedHasComp.Status.Devfile).Should(Not(Equal(""))) // Check the Component updated devfile - devfileSrc = cdqanalysis.DevfileSrc{ - Data: updatedHasComp.Status.Devfile, - } - hasCompUpdatedDevfile, err := cdqanalysis.ParseDevfile(devfileSrc) + hasCompUpdatedDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(updatedHasComp.Status.Devfile)}) + Expect(err).Should(Not(HaveOccurred())) checklist = updateChecklist{ @@ -667,10 +653,8 @@ var _ = Describe("Component controller", func() { Expect(createdHasApp.Status.Devfile).Should(Not(Equal(""))) // Check the Component devfile - devfileSrc := cdqanalysis.DevfileSrc{ - Data: createdHasComp.Status.Devfile, - } - _, err := cdqanalysis.ParseDevfile(devfileSrc) + _, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasComp.Status.Devfile)}) + Expect(err).Should(Not(HaveOccurred())) // Make sure the component's built image is included in the status @@ -921,10 +905,9 @@ var _ = Describe("Component controller", func() { componentName := HASCompName + "10" hasApp := createAndFetchSimpleApp(applicationName, HASAppNamespace, DisplayName, Description) - devfileSrc := cdqanalysis.DevfileSrc{ - Data: hasApp.Status.Devfile, - } - curDevfile, err := cdqanalysis.ParseDevfile(devfileSrc) + curDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{ + Data: []byte(hasApp.Status.Devfile), + }) Expect(err).ToNot(HaveOccurred()) // Remove the gitops URL and update the status of the resource @@ -1161,8 +1144,9 @@ var _ = Describe("Component controller", func() { }) }) - Context("Create Component with git secret field set to valid secret", func() { - It("Should create successfully", func() { + Context("Create Component with git secret field set to an invalid secret", func() { + It("Should error out due parse error", func() { + // the secret exists but it's not a real one that we can use to access a live repo ctx := context.Background() applicationName := HASAppName + "14" @@ -1216,13 +1200,14 @@ var _ = Describe("Component controller", func() { createdHasComp := &appstudiov1alpha1.Component{} Eventually(func() bool { k8sClient.Get(context.Background(), hasCompLookupKey, createdHasComp) - return len(createdHasComp.Status.Conditions) > 1 + return len(createdHasComp.Status.Conditions) == 1 }, timeout, interval).Should(BeTrue()) - // Make sure no err was set - Expect(createdHasComp.Status.Devfile).Should(Not(Equal(""))) - Expect(createdHasComp.Status.Conditions[len(createdHasComp.Status.Conditions)-1].Status).Should(Equal(metav1.ConditionTrue)) - + // Make sure the err was set + Expect(createdHasComp.Status.Devfile).Should(Equal("")) + Expect(createdHasComp.Status.Conditions[len(createdHasComp.Status.Conditions)-1].Status).Should(Equal(metav1.ConditionFalse)) + // This test case uses an invalid token with a public URL. The Devfile library expects an unset token and will error out trying to retrieve the devfile since it assumes it's from a private repo + Expect(strings.ToLower(createdHasComp.Status.Conditions[len(createdHasComp.Status.Conditions)-1].Message)).Should(ContainSubstring("component create failed: failed to populateandparsedevfile: error getting devfile info from url: failed to retrieve")) hasAppLookupKey := types.NamespacedName{Name: applicationName, Namespace: HASAppNamespace} // Delete the specified HASComp resource @@ -1511,10 +1496,8 @@ var _ = Describe("Component controller", func() { Expect(createdHasApp.Status.Devfile).Should(Not(Equal(""))) // Check the Component devfile - devfileSrc := cdqanalysis.DevfileSrc{ - Data: createdHasComp.Status.Devfile, - } - hasCompDevfile, err := cdqanalysis.ParseDevfile(devfileSrc) + hasCompDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasComp.Status.Devfile)}) + Expect(err).Should(Not(HaveOccurred())) dockerfileComponents, err := hasCompDevfile.GetComponents(common.DevfileOptions{}) @@ -1532,10 +1515,7 @@ var _ = Describe("Component controller", func() { } // Check the HAS Application devfile - devfileSrc = cdqanalysis.DevfileSrc{ - Data: createdHasApp.Status.Devfile, - } - hasAppDevfile, err := cdqanalysis.ParseDevfile(devfileSrc) + hasAppDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasApp.Status.Devfile)}) Expect(err).Should(Not(HaveOccurred())) // gitOpsRepo and appModelRepo should both be set @@ -1701,10 +1681,7 @@ var _ = Describe("Component controller", func() { Expect(createdHasApp.Status.Devfile).Should(Not(Equal(""))) // Check the Component devfile - src := cdqanalysis.DevfileSrc{ - Data: createdHasComp.Status.Devfile, - } - hasCompDevfile, err := cdqanalysis.ParseDevfile(src) + hasCompDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasComp.Status.Devfile)}) Expect(err).Should(Not(HaveOccurred())) devfileComponents, err := hasCompDevfile.GetComponents(common.DevfileOptions{}) @@ -1719,10 +1696,8 @@ var _ = Describe("Component controller", func() { } // Check the HAS Application devfile - src = cdqanalysis.DevfileSrc{ - Data: createdHasApp.Status.Devfile, - } - hasAppDevfile, err := cdqanalysis.ParseDevfile(src) + hasAppDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(createdHasApp.Status.Devfile)}) + Expect(err).Should(Not(HaveOccurred())) // gitOpsRepo and appModelRepo should both be set @@ -1776,9 +1751,7 @@ var _ = Describe("Component controller", func() { return fetchedHasApp.Status.Devfile != "" }, timeout, interval).Should(BeTrue()) - hasAppDevfile, err := cdqanalysis.ParseDevfile(cdqanalysis.DevfileSrc{ - Data: fetchedHasApp.Status.Devfile, - }) + hasAppDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(fetchedHasApp.Status.Devfile)}) Expect(err).Should(Not(HaveOccurred())) // Update the GitOps Repo to a URI that mocked API returns a dummy err @@ -1792,9 +1765,7 @@ var _ = Describe("Component controller", func() { fetchedHasApp = &appstudiov1alpha1.Application{} Eventually(func() bool { k8sClient.Get(context.Background(), hasAppLookupKey, fetchedHasApp) - hasAppDevfile, err := cdqanalysis.ParseDevfile(cdqanalysis.DevfileSrc{ - Data: fetchedHasApp.Status.Devfile, - }) + hasAppDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(fetchedHasApp.Status.Devfile)}) Expect(err).Should(Not(HaveOccurred())) gitOpsRepoURL := hasAppDevfile.GetMetadata().Attributes.GetString("gitOpsRepository.url", &err) Expect(err).Should(Not(HaveOccurred())) @@ -1891,8 +1862,8 @@ var _ = Describe("Component controller", func() { return fetchedHasApp.Status.Devfile != "" }, timeout, interval).Should(BeTrue()) - hasAppDevfile, err := cdqanalysis.ParseDevfile(cdqanalysis.DevfileSrc{ - Data: fetchedHasApp.Status.Devfile, + hasAppDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{ + Data: []byte(fetchedHasApp.Status.Devfile), }) Expect(err).Should(Not(HaveOccurred())) @@ -1907,8 +1878,8 @@ var _ = Describe("Component controller", func() { fetchedHasApp = &appstudiov1alpha1.Application{} Eventually(func() bool { k8sClient.Get(context.Background(), hasAppLookupKey, fetchedHasApp) - hasAppDevfile, err := cdqanalysis.ParseDevfile(cdqanalysis.DevfileSrc{ - Data: fetchedHasApp.Status.Devfile, + hasAppDevfile, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{ + Data: []byte(fetchedHasApp.Status.Devfile), }) Expect(err).Should(Not(HaveOccurred())) gitOpsRepoURL := hasAppDevfile.GetMetadata().Attributes.GetString("gitOpsRepository.url", &err) diff --git a/controllers/componentdetectionquery_controller.go b/controllers/componentdetectionquery_controller.go index b61e90653..c2a4ae144 100644 --- a/controllers/componentdetectionquery_controller.go +++ b/controllers/componentdetectionquery_controller.go @@ -27,11 +27,9 @@ import ( "github.com/prometheus/client_golang/prometheus" appstudiov1alpha1 "github.com/redhat-appstudio/application-api/api/v1alpha1" cdqanalysis "github.com/redhat-appstudio/application-service/cdq-analysis/pkg" - devfile "github.com/redhat-appstudio/application-service/pkg/devfile" "github.com/redhat-appstudio/application-service/pkg/github" logutil "github.com/redhat-appstudio/application-service/pkg/log" "github.com/redhat-appstudio/application-service/pkg/metrics" - "github.com/redhat-appstudio/application-service/pkg/spi" "github.com/redhat-appstudio/application-service/pkg/util" "github.com/redhat-appstudio/application-service/pkg/util/ioutils" "github.com/spf13/afero" @@ -52,7 +50,6 @@ import ( type ComponentDetectionQueryReconciler struct { client.Client Scheme *runtime.Scheme - SPIClient spi.SPI Log logr.Logger GitHubTokenClient github.GitHubToken DevfileRegistryURL string @@ -134,8 +131,7 @@ func (r *ComponentDetectionQueryReconciler) Reconcile(ctx context.Context, req c ctx = context.WithValue(ctx, github.GHClientKey, ghClient.TokenName) source := componentDetectionQuery.Spec.GitSource - var devfileBytes, dockerfileBytes []byte - var clonePath, devfilePath, dockerfilePath string + var clonePath, devfilePath string devfilesMap := make(map[string][]byte) devfilesURLMap := make(map[string]string) dockerfileContextMap := make(map[string]string) @@ -160,42 +156,29 @@ func (r *ComponentDetectionQueryReconciler) Reconcile(ctx context.Context, req c } if source.DevfileURL == "" { - isDockerfilePresent := false - isDevfilePresent := false log.Info(fmt.Sprintf("Attempting to read a devfile from the URL %s... %v", source.URL, req.NamespacedName)) - // check if the project is multi-component or single-component - if gitToken == "" { - gitURL, err := util.ConvertGitHubURL(source.URL, source.Revision, context) - if err != nil { - log.Error(err, fmt.Sprintf("Unable to convert Github URL to raw format, exiting reconcile loop %v", req.NamespacedName)) - r.SetCompleteConditionAndUpdateCR(ctx, req, &componentDetectionQuery, copiedCDQ, err) - return ctrl.Result{}, nil - } - log.Info(fmt.Sprintf("Look for devfile, Dockerfile or Containerfile at the URL %s... %v", gitURL, req.NamespacedName)) - devfileBytes, devfilePath, dockerfileBytes, dockerfilePath = devfile.DownloadDevfileAndDockerfile(gitURL) - } else { - // Use SPI to retrieve the devfile from the private repository - // TODO - maysunfaisal also search for Dockerfile - devfileBytes, err = spi.DownloadDevfileUsingSPI(r.SPIClient, ctx, componentDetectionQuery.Namespace, source.URL, source.Revision, context) - if err != nil { - log.Error(err, fmt.Sprintf("Unable to curl for any known devfile locations from %s %v", source.URL, req.NamespacedName)) - } - } - isDevfilePresent = len(devfileBytes) != 0 - isDockerfilePresent = len(dockerfileBytes) != 0 k8sInfoClient := cdqanalysis.K8sInfoClient{ Log: log, CreateK8sJob: false, } - devfilesMapReturned, devfilesURLMapReturned, dockerfileContextMapReturned, componentPortsMapReturned, branch, err := cdqanalysis.CloneAndAnalyze(k8sInfoClient, gitToken, req.Namespace, req.Name, context, devfilePath, dockerfilePath, source.URL, source.Revision, r.DevfileRegistryURL, isDevfilePresent, isDockerfilePresent) + cdqInfo := &cdqanalysis.CDQInfoClient{ + DevfileRegistryURL: r.DevfileRegistryURL, + GitURL: cdqanalysis.GitURL{RepoURL: source.URL, Revision: source.Revision, Token: gitToken}, + } + + devfilesMapReturned, devfilesURLMapReturned, dockerfileContextMapReturned, componentPortsMapReturned, branch, err := cdqanalysis.CloneAndAnalyze(k8sInfoClient, req.Namespace, req.Name, context, cdqInfo) componentDetectionQuery.Spec.GitSource.Revision = branch if err != nil { log.Error(err, fmt.Sprintf("Error running cdq analysis... %v", req.NamespacedName)) r.SetCompleteConditionAndUpdateCR(ctx, req, &componentDetectionQuery, copiedCDQ, err) return ctrl.Result{}, nil } + + clonePath = cdqInfo.ClonedRepo.ClonedPath + devfilePath, _ = cdqanalysis.GetDevfileAndDockerFilePaths(*cdqInfo) + maps.Copy(devfilesMap, devfilesMapReturned) maps.Copy(dockerfileContextMap, dockerfileContextMapReturned) maps.Copy(devfilesURLMap, devfilesURLMapReturned) @@ -231,7 +214,7 @@ func (r *ComponentDetectionQueryReconciler) Reconcile(ctx context.Context, req c // set in the CDQ spec componentDetectionQuery.Spec.GitSource.Revision = source.Revision - shouldIgnoreDevfile, devfileBytes, err := cdqanalysis.ValidateDevfile(log, source.DevfileURL) + shouldIgnoreDevfile, devfileBytes, err := cdqanalysis.ValidateDevfile(log, source.DevfileURL, gitToken) if err != nil { // if a direct devfileURL is provided and errors out, we dont do an alizer detection log.Error(err, fmt.Sprintf("Unable to GET %s, exiting reconcile loop %v", source.DevfileURL, req.NamespacedName)) @@ -265,7 +248,8 @@ func (r *ComponentDetectionQueryReconciler) Reconcile(ctx context.Context, req c if _, ok := devfilesURLMap[context]; !ok { updatedLink, err := cdqanalysis.UpdateGitLink(source.URL, source.Revision, path.Join(context, devfilePath)) if err != nil { - log.Error(err, fmt.Sprintf("Unable to update the devfile link %v", req.NamespacedName)) + log.Error(err, fmt.Sprintf( + "Unable to update the devfile link %v", req.NamespacedName)) r.SetCompleteConditionAndUpdateCR(ctx, req, &componentDetectionQuery, copiedCDQ, err) return ctrl.Result{}, nil } @@ -274,7 +258,7 @@ func (r *ComponentDetectionQueryReconciler) Reconcile(ctx context.Context, req c } // only update the componentStub when a component has been detected if len(devfilesMap) != 0 || len(devfilesURLMap) != 0 || len(dockerfileContextMap) != 0 { - err = r.updateComponentStub(req, ctx, &componentDetectionQuery, devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap) + err = r.updateComponentStub(req, ctx, &componentDetectionQuery, devfilesMap, devfilesURLMap, dockerfileContextMap, componentPortsMap, gitToken) if err != nil { log.Error(err, fmt.Sprintf("Unable to update the component stub %v", req.NamespacedName)) r.SetCompleteConditionAndUpdateCR(ctx, req, &componentDetectionQuery, copiedCDQ, err) diff --git a/controllers/componentdetectionquery_controller_test.go b/controllers/componentdetectionquery_controller_test.go index 353772209..2eb9671fd 100644 --- a/controllers/componentdetectionquery_controller_test.go +++ b/controllers/componentdetectionquery_controller_test.go @@ -225,7 +225,7 @@ var _ = Describe("Component Detection Query controller", func() { Eventually(func() bool { k8sClient.Get(context.Background(), hasCompDetQueryLookupKey, createdHasCompDetectionQuery) return len(createdHasCompDetectionQuery.Status.Conditions) > 1 - }, timeout, interval).Should(BeTrue()) + }, timeout20s, interval).Should(BeTrue()) // Make sure the a devfile is detected Expect(len(createdHasCompDetectionQuery.Status.ComponentDetected)).Should(Equal(2)) @@ -371,7 +371,7 @@ var _ = Describe("Component Detection Query controller", func() { Eventually(func() bool { k8sClient.Get(context.Background(), hasCompDetQueryLookupKey, createdHasCompDetectionQuery) return len(createdHasCompDetectionQuery.Status.Conditions) > 1 - }, timeout, interval).Should(BeTrue()) + }, timeout20s, interval).Should(BeTrue()) // Make sure the right err is set Expect(createdHasCompDetectionQuery.Status.Conditions[1].Message).Should(ContainSubstring("ComponentDetectionQuery has successfully finished")) @@ -671,7 +671,7 @@ var _ = Describe("Component Detection Query controller", func() { Spec: appstudiov1alpha1.ComponentDetectionQuerySpec{ Secret: queryName, GitSource: appstudiov1alpha1.GitSource{ - URL: "https://github.com/test-repo/test-error-response", + URL: "https://github.com/test-repo/valid-repo-invalid-token", Revision: "main", }, }, @@ -686,10 +686,11 @@ var _ = Describe("Component Detection Query controller", func() { Eventually(func() bool { k8sClient.Get(context.Background(), hasCompDetQueryLookupKey, createdHasCompDetectionQuery) return len(createdHasCompDetectionQuery.Status.Conditions) > 1 - }, timeout, interval).Should(BeTrue()) + }, timeout40s, interval).Should(BeTrue()) // index is 1 because of CDQ status condition Processing Expect(createdHasCompDetectionQuery.Status.Conditions[1].Status).Should(Equal(metav1.ConditionFalse)) + // we passed in a bad token so git clone should fail Expect(createdHasCompDetectionQuery.Status.Conditions[1].Message).Should(ContainSubstring("failed to clone the repo")) // Delete the specified Detection Query resource @@ -730,7 +731,6 @@ var _ = Describe("Component Detection Query controller", func() { k8sClient.Get(context.Background(), hasCompDetQueryLookupKey, createdHasCompDetectionQuery) return len(createdHasCompDetectionQuery.Status.Conditions) > 1 }, timeout, interval).Should(BeTrue()) - // Make sure the a devfile is detected Expect(createdHasCompDetectionQuery.Status.Conditions[1].Status).Should(Equal(metav1.ConditionFalse)) Expect(createdHasCompDetectionQuery.Status.Conditions[1].Message).Should(ContainSubstring(fmt.Sprintf("ComponentDetectionQuery failed: Secret %q not found", queryName))) @@ -1237,7 +1237,7 @@ var _ = Describe("Component Detection Query controller", func() { Eventually(func() bool { k8sClient.Get(context.Background(), hasCompDetQueryLookupKey, createdHasCompDetectionQuery) return len(createdHasCompDetectionQuery.Status.Conditions) > 1 - }, timeout, interval).Should(BeTrue()) + }, timeout20s, interval).Should(BeTrue()) // Make sure the a devfile is detected Expect(len(createdHasCompDetectionQuery.Status.ComponentDetected)).Should(Equal(1)) @@ -1485,14 +1485,14 @@ var _ = Describe("Component Detection Query controller", func() { Eventually(func() bool { k8sClient.Get(context.Background(), hasCompDetQueryLookupKey, createdHasCompDetectionQuery) return len(createdHasCompDetectionQuery.Status.Conditions) > 1 - }, timeout, interval).Should(BeTrue()) + }, timeout20s, interval).Should(BeTrue()) // Make sure the a devfile is detected Expect(len(createdHasCompDetectionQuery.Status.ComponentDetected)).Should(Equal(2)) - for devfileName, devfileDesc := range createdHasCompDetectionQuery.Status.ComponentDetected { - Expect(devfileName).Should(Or(ContainSubstring("backend-quality-dashboard"), ContainSubstring("frontend-quality-dashboard"))) - Expect(devfileDesc.ComponentStub.Source.GitSource.DockerfileURL).Should(Equal("Dockerfile")) + for dockerFileName, dockerFileDesc := range createdHasCompDetectionQuery.Status.ComponentDetected { + Expect(dockerFileName).Should(Or(ContainSubstring("backend-quality-dashboard"), ContainSubstring("frontend-quality-dashboard"))) + Expect(dockerFileDesc.ComponentStub.Source.GitSource.DockerfileURL).Should(Equal("Dockerfile")) } // Delete the specified Detection Query resource @@ -1532,7 +1532,7 @@ var _ = Describe("Component Detection Query controller", func() { Eventually(func() bool { k8sClient.Get(context.Background(), hasCompDetQueryLookupKey, createdHasCompDetectionQuery) return len(createdHasCompDetectionQuery.Status.Conditions) > 1 - }, timeout, interval).Should(BeTrue()) + }, timeout20s, interval).Should(BeTrue()) // Make sure the a devfile is detected Expect(len(createdHasCompDetectionQuery.Status.ComponentDetected)).Should(Equal(2)) diff --git a/controllers/start_test_env.go b/controllers/start_test_env.go index 7616ace09..155ea1ea3 100644 --- a/controllers/start_test_env.go +++ b/controllers/start_test_env.go @@ -20,6 +20,8 @@ import ( "go/build" "path/filepath" + spiapi "github.com/redhat-appstudio/service-provider-integration-operator/api/v1beta1" + "github.com/redhat-appstudio/application-service/gitops" ginkgo "github.com/onsi/ginkgo" @@ -54,12 +56,14 @@ func setupTestEnv() { ctx, cancel = context.WithCancel(context.TODO()) applicationAPIDepVersion := "v0.0.0-20230616144210-9dad8e40e3ed" + spiAPIDepVersion := "v0.2023.22-0.20230713080056-eae17aa8c172" ginkgo.By("bootstrapping test environment") testEnv = &envtest.Environment{ CRDDirectoryPaths: []string{ filepath.Join("..", "hack", "routecrd"), filepath.Join(build.Default.GOPATH, "pkg", "mod", "github.com", "redhat-appstudio", "application-api@"+applicationAPIDepVersion, "manifests"), + filepath.Join(build.Default.GOPATH, "pkg", "mod", "github.com", "redhat-appstudio", "service-provider-integration-operator@"+spiAPIDepVersion, "config", "crd", "bases"), }, ErrorIfCRDPathMissing: true, } @@ -74,6 +78,9 @@ func setupTestEnv() { err = routev1.AddToScheme(scheme.Scheme) gomega.Expect(err).NotTo(gomega.HaveOccurred()) + err = spiapi.AddToScheme(scheme.Scheme) + gomega.Expect(err).NotTo(gomega.HaveOccurred()) + //+kubebuilder:scaffold:scheme k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) @@ -112,7 +119,6 @@ func setupTestEnv() { Client: k8sManager.GetClient(), Scheme: k8sManager.GetScheme(), Log: ctrl.Log.WithName("controllers").WithName("ComponentDetectionQuery"), - SPIClient: spi.MockSPIClient{}, GitHubTokenClient: mockGhTokenClient, DevfileRegistryURL: cdqanalysis.DevfileStageRegistryEndpoint, // Use the staging devfile registry for tests AppFS: ioutils.NewMemoryFilesystem(), diff --git a/controllers/update.go b/controllers/update.go index 766c8d0f8..5849f3da1 100644 --- a/controllers/update.go +++ b/controllers/update.go @@ -23,6 +23,8 @@ import ( "strings" "unicode" + "github.com/devfile/library/v2/pkg/devfile/parser" + "github.com/brianvoe/gofakeit/v6" devfileAPIV1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/api/v2/pkg/attributes" @@ -303,7 +305,7 @@ func (r *ApplicationReconciler) getAndAddComponentApplicationsToModel(log logr.L return nil } -func (r *ComponentDetectionQueryReconciler) updateComponentStub(req ctrl.Request, ctx context.Context, componentDetectionQuery *appstudiov1alpha1.ComponentDetectionQuery, devfilesMap map[string][]byte, devfilesURLMap map[string]string, dockerfileContextMap map[string]string, componentPortsMap map[string][]int) error { +func (r *ComponentDetectionQueryReconciler) updateComponentStub(req ctrl.Request, ctx context.Context, componentDetectionQuery *appstudiov1alpha1.ComponentDetectionQuery, devfilesMap map[string][]byte, devfilesURLMap map[string]string, dockerfileContextMap map[string]string, componentPortsMap map[string][]int, token string) error { if componentDetectionQuery == nil { return fmt.Errorf("componentDetectionQuery is nil") @@ -320,10 +322,7 @@ func (r *ComponentDetectionQueryReconciler) updateComponentStub(req ctrl.Request for context, devfileBytes := range devfilesMap { log.Info(fmt.Sprintf("Currently reading the devfile for context %v", context)) // Parse the Component Devfile - devfileSrc := cdqanalysis.DevfileSrc{ - Data: string(devfileBytes), - } - compDevfileData, err := cdqanalysis.ParseDevfile(devfileSrc) + compDevfileData, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: devfileBytes, Token: token}) if err != nil { return err } diff --git a/controllers/update_test.go b/controllers/update_test.go index f068ef7f9..ab1bd8196 100644 --- a/controllers/update_test.go +++ b/controllers/update_test.go @@ -1748,9 +1748,9 @@ func TestUpdateComponentStub(t *testing.T) { } var err error if tt.isNil { - err = r.updateComponentStub(ctrl.Request{}, ctx, nil, devfilesMap, nil, nil, nil) + err = r.updateComponentStub(ctrl.Request{}, ctx, nil, devfilesMap, nil, nil, nil, "") } else { - err = r.updateComponentStub(ctrl.Request{}, ctx, &componentDetectionQuery, devfilesMap, tt.devfilesURLMap, tt.dockerfileURLMap, tt.componentPortsMap) + err = r.updateComponentStub(ctrl.Request{}, ctx, &componentDetectionQuery, devfilesMap, tt.devfilesURLMap, tt.dockerfileURLMap, tt.componentPortsMap, "") } if tt.wantErr && (err == nil) { diff --git a/docs/private-git-repos.md b/docs/private-git-repos.md index 413607424..f26456509 100644 --- a/docs/private-git-repos.md +++ b/docs/private-git-repos.md @@ -2,55 +2,34 @@ ## Configuring SPI -In order to use HAS resources (e.g. `Applications`, `Components`, `ComponentDetectionQuery`) with private git repositories, SPI must be installed on the same cluster as HAS: +In order to use HAS resources (e.g. `Applications`, `Components`, `ComponentDetectionQuery`) with private git repositories, SPI must be installed on the same cluster as HAS (TODO review HAS install instructions): -1) Set up `infra-deployments`. Minimally: +1) Clone the [SPI operator repo](https://github.com/redhat-appstudio/service-provider-integration-operator) and run the [make command ](https://github.com/redhat-appstudio/service-provider-integration-operator/blob/main/docs/DEVELOP.md#running-in-cluster) corresponding to your target cluster type e.g. `make deploy_openshift` - a) Install RBAC for App Studio: `kustomize build openshift-gitops/cluster-rbac | oc apply -f -` - - b) Install Build component`oc apply -n openshift-gitops -f argo-cd-apps/base/build.yaml` - - c) Install SPI component`oc apply -n openshift-gitops -f argo-cd-apps/base/spi.yaml` 2) Set up SPI - a) Get SPI oauth route URL from `spi-system` namespace + a) Get SPI oauth route URL from `spi-system` namespace `oc get routes -n spi-system` b) Create oauth app in GitHub (`Settings` -> `Developer Settings` -> `OAuth Apps`) - Use the SPI oauth url as the Application Callback URL. - Homepage URL does not matter - Record the Client ID and Client Secret values - - c) Open `components/spi/config.yaml` from `infra-deployments` in an editor and change the following values: - - `sharedSecret` -> Can be a random string, doesn't matter what you put - - `clientId` -> Client ID value from previous step - - `clientSecret` -> Client secret value from previous step - - `baseUrl` -> SPI oauth URL - - **For example**: - ```yaml - sharedSecret: fsdfsdfsdfdsf - serviceProviders: - - type: GitHub - clientId: fake-client-id - clientSecret: fake-client-secret - baseUrl: https://spi-oauth-route-spi-system.apps.mycluster.com - ``` - - d) Create the secret in the `spi-system` namespace: `kubectl create secret generic oauth-config --from-file=components/spi/config.yaml -n spi-system` -## Creating a Token + c) To set up a Github Oauth app with SPI, modify the overlay in your cloned SPI repo that corresponds with the cluster type e.g. in config/overlays/openshift_vault/config.yaml, replace the `clientId` and `clientSecret` with the values from the oauth app you created in step 2. Run ` kustomize build config/overlays/openshift_vault | kubectl apply -f -` to update the `shared-configuration-file` secret -To create a token to use with HAS: -1) Create an `SPIAccessTokenBinding` resource with the following contents: + +## Creating a Token + +1) In Github, generate a new classic token with User and Repo scope +2) To create a token to use with HAS, create an `SPIAccessTokenBinding` resource with the following contents: ```yaml apiVersion: appstudio.redhat.com/v1beta1 kind: SPIAccessTokenBinding metadata: name: test-access-token-binding - namespace: default spec: permissions: required: @@ -61,17 +40,18 @@ To create a token to use with HAS: name: token-secret type: kubernetes.io/basic-auth ``` - -2) Create the resource in the namespace you will be creating HAS resources in - -3) Run `oc get spiaccesstokenbinding test-access-token-binding -o jsonpath="oAuthUrl: {.status.oAuthUrl}"` to get the oauth url - - - Alternatively, you can just get the oauth url by running `oc get spiaccesstokenbinding -o yaml` and viewing the status directly. - -4) Access the oauth url in your browser. Log in if needed. - -5) Run `oc get secrets` in the namespace you created the `SPIAccessTokenBinding` in to verify that the secret was created successfully. - + +3) Create the resource in the namespace you will be creating HAS resources in. Upon successful creation, the CR will be in `AwaitingTokenData` phase status and a corresponding SPIAccessToken CR will be created in the same namespace. + +3) Upload the token: + 1) Set the TARGET_NAMESPACE to where your CRs instances are. Run `UPLOAD_URL=$(kubectl get spiaccesstokenbinding/test-access-token-binding -n $TARGET_NAMESPACE -o json | jq -r .status.uploadUrl)` + 2) Inject the token where TOKEN is the console admin secret and GITHUB_TOKEN is the token created in step 1) + + `curl -v -H 'Content-Type: application/json' -H "Authorization: bearer "$TOKEN -d "{ \"access_token\": \"$GITHUB_TOKEN\" }" $UPLOAD_URL` + 3) The state of the SPIAccessTokenBinding should change to `Injected` and the state of the SPIAccessToken should be `Ready` + 4) This will also create a K8s secret corresponding to the name of the secret that was specified in the SPIAccessTokenBinding created in step 2. + + ## Using Private Git Repositories Now, with the token secret created for the git repository, when creating HAS resources (`Components`, `ComponentDetectionQueries`) that need to access that Git repository, just pass in the token secret to the resource: @@ -90,7 +70,7 @@ spec: source: git: url: https://github.com/johnmcollier/devfile-private.git - secret: token-multi-secret + secret: token-multi-secret ``` **ComponentDetectionQuery** @@ -104,5 +84,5 @@ spec: isMultiComponent: true git: url: https://github.com/johnmcollier/multi-component-private.git - secret: token-multi-secret + secret: token-multi-secret ``` \ No newline at end of file diff --git a/go.mod b/go.mod index c8c8e3088..0a63b0a3d 100644 --- a/go.mod +++ b/go.mod @@ -5,32 +5,32 @@ go 1.19 require ( github.com/brianvoe/gofakeit/v6 v6.9.0 github.com/devfile/api/v2 v2.2.1-alpha.0.20230413012049-a6c32fca0dbd - github.com/devfile/library/v2 v2.2.1-0.20230418160146-e75481b7eebd - github.com/go-logr/logr v1.2.3 + github.com/devfile/library/v2 v2.2.1-0.20230821212346-99a3776c0b1e + github.com/go-logr/logr v1.2.4 github.com/gofri/go-github-ratelimit v1.0.3-0.20230428184158-a500e14de53f github.com/golang/mock v1.6.0 github.com/google/go-github/v52 v52.0.1-0.20230514113659-60429b4ba0ba - github.com/migueleliasweb/go-github-mock v0.0.17 + github.com/migueleliasweb/go-github-mock v0.0.19 github.com/mitchellh/go-homedir v1.1.0 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.24.1 + github.com/onsi/gomega v1.27.8 github.com/openshift-pipelines/pipelines-as-code v0.0.0-20220622161720-2a6007e17200 - github.com/openshift/api v0.0.0-20210503193030-25175d9d392d + github.com/openshift/api v0.0.0-20220912161038-458ad9ca9ca5 github.com/pact-foundation/pact-go/v2 v2.0.0-beta.23 - github.com/prometheus/client_golang v1.14.0 + github.com/prometheus/client_golang v1.16.0 github.com/redhat-appstudio/application-api v0.0.0-20230704143842-035c661f115f github.com/redhat-appstudio/application-service/cdq-analysis v0.0.0 - github.com/redhat-appstudio/service-provider-integration-scm-file-retriever v0.8.3 + github.com/redhat-appstudio/service-provider-integration-operator v0.2023.22-0.20230713080056-eae17aa8c172 github.com/redhat-developer/gitops-generator v0.0.0-20230801134438-01747a27dcbf github.com/spf13/afero v1.9.5 - github.com/stretchr/testify v1.8.3 + github.com/stretchr/testify v1.8.4 go.uber.org/zap v1.24.0 golang.org/x/exp v0.0.0-20230206171751-46f607a40771 golang.org/x/oauth2 v0.10.0 k8s.io/api v0.26.1 - k8s.io/apimachinery v0.26.1 + k8s.io/apimachinery v0.27.3 k8s.io/client-go v0.26.1 - sigs.k8s.io/controller-runtime v0.14.4 + sigs.k8s.io/controller-runtime v0.14.6 sigs.k8s.io/yaml v1.3.0 ) @@ -51,13 +51,13 @@ require ( github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bluekeyes/go-gitdiff v0.7.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cheekybits/genny v1.0.0 // indirect github.com/cloudflare/circl v1.3.3 // indirect github.com/containerd/containerd v1.6.10 // indirect github.com/containerd/typeurl v1.0.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/devfile/registry-support/index/generator v0.0.0-20221018203505-df96d34d4273 // indirect github.com/devfile/registry-support/registry-library v0.0.0-20221018213054-47b3ffaeadba // indirect + github.com/distribution/distribution/v3 v3.0.0-20211118083504-a29a3c99a684 // indirect github.com/docker/cli v20.10.13+incompatible // indirect github.com/docker/distribution v2.8.1+incompatible // indirect github.com/docker/docker v20.10.11+incompatible // indirect @@ -69,16 +69,15 @@ require ( github.com/emirpasic/gods v1.18.1 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect - github.com/fatih/color v1.13.0 // indirect + github.com/fatih/color v1.14.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-git/gcfg v1.5.0 // indirect github.com/go-git/go-billy/v5 v5.4.1 // indirect github.com/go-git/go-git/v5 v5.5.1 // indirect - github.com/go-logr/zapr v1.2.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect + github.com/go-logr/zapr v1.2.4 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.1 // indirect github.com/go-openapi/swag v0.22.3 // indirect - github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect @@ -86,7 +85,7 @@ require ( github.com/google/btree v1.0.1 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-cmp v0.5.9 // indirect - github.com/google/go-github/v50 v50.0.0 // indirect + github.com/google/go-github/v53 v53.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/s2a-go v0.1.4 // indirect @@ -103,7 +102,6 @@ require ( github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/imdario/mergo v0.3.15 // indirect - github.com/imroc/req/v3 v3.26.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jenkins-x/go-scm v1.11.35 // indirect @@ -112,16 +110,10 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/klauspost/compress v1.16.7 // indirect - github.com/lucas-clemente/quic-go v0.28.1 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/marten-seemann/qpack v0.2.1 // indirect - github.com/marten-seemann/qtls-go1-16 v0.1.5 // indirect - github.com/marten-seemann/qtls-go1-17 v0.1.2 // indirect - github.com/marten-seemann/qtls-go1-18 v0.1.2 // indirect - github.com/marten-seemann/qtls-go1-19 v0.1.0-beta.1 // indirect - github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect @@ -140,9 +132,9 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect - github.com/redhat-appstudio/service-provider-integration-operator v0.8.3 // indirect + github.com/prometheus/common v0.42.0 // indirect + github.com/prometheus/procfs v0.10.1 // indirect + github.com/redhat-appstudio/remote-secret v0.0.0-20230713072146-a6094c712436 // indirect github.com/redhat-developer/alizer/go v0.0.0-20230516215932-135a2bb3fb90 // indirect github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect github.com/sergi/go-diff v1.3.1 // indirect @@ -169,7 +161,7 @@ require ( golang.org/x/term v0.10.0 // indirect golang.org/x/text v0.11.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.8.0 // indirect + golang.org/x/tools v0.9.1 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/api v0.130.0 // indirect @@ -187,13 +179,13 @@ require ( k8s.io/apiextensions-apiserver v0.26.1 // indirect k8s.io/component-base v0.26.1 // indirect k8s.io/klog v1.0.0 // indirect - k8s.io/klog/v2 v2.80.1 // indirect - k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect + k8s.io/klog/v2 v2.100.1 // indirect + k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect k8s.io/pod-security-admission v0.26.1 // indirect - k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect + k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect knative.dev/pkg v0.0.0-20221011175852-714b7630a836 // indirect oras.land/oras-go v1.1.0 // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) diff --git a/go.sum b/go.sum index efdf7d804..973878203 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,6 @@ bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= @@ -75,6 +73,7 @@ cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQH cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg= cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= @@ -194,12 +193,7 @@ cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoIS code.gitea.io/gitea-vet v0.2.1/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE= code.gitea.io/sdk/gitea v0.15.1 h1:WJreC7YYuxbn0UDaPuWIe/mtiNKTvLN8MLkaw71yx/M= code.gitea.io/sdk/gitea v0.15.1/go.mod h1:klY2LVI3s3NChzIk/MzMn7G1FHrfU7qd63iSMVoHRBA= -dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= -dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= -dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= -git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v56.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= @@ -253,6 +247,7 @@ github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMo github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= github.com/ProtonMail/go-crypto v0.0.0-20230417170513-8ee5748c52b5 h1:QXMwHM/lB4ZQhdEF7JUTNgYOJR/gWoFbgQ/2Aj1h3Dk= github.com/ProtonMail/go-crypto v0.0.0-20230417170513-8ee5748c52b5/go.mod h1:8TI4H3IbrackdNgv+92dI+rhpCaLqM0IfpgCgenFvRE= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -306,14 +301,12 @@ github.com/bluekeyes/go-gitdiff v0.7.0 h1:w4SrRFcufU0/tEpWx3VurDBAnWfpxsmwS7yWr1 github.com/bluekeyes/go-gitdiff v0.7.0/go.mod h1:QpfYYO1E0fTVHVZAZKiRjtSGY9823iCdvGXBcEzHGbM= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/brianvoe/gofakeit/v6 v6.9.0 h1:UCGhPCKLiqBc910TKS7LcOGf74NozftibFCbGIS6GZQ= github.com/brianvoe/gofakeit/v6 v6.9.0/go.mod h1:palrJUk4Fyw38zIFB/uBZqsgzW5VsNllhHKKwAebzew= github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= github.com/bshuster-repo/logrus-logstash-hook v1.0.0 h1:e+C0SB5R1pu//O4MQ3f9cFuPGoOVeF2fE4Og9otCc70= github.com/bshuster-repo/logrus-logstash-hook v1.0.0/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd h1:rFt+Y/IK1aEZkEHchZRSq9OQbsSzIT/OrI8YFFmRIng= github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= @@ -322,17 +315,15 @@ github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0Bsq github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0 h1:nvj0OLI3YqYXer/kZD8Ri1aaunCxIEsOst1BVJswV0o= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= -github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= -github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -457,7 +448,6 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= @@ -477,6 +467,11 @@ github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7hqDjlFjiygg= +github.com/dave/dst v0.26.2/go.mod h1:UMDJuIRPfyUCC78eFuB+SV/WI8oDeyFDvM/JR6NI3IU= +github.com/dave/gopackages v0.0.0-20170318123100-46e7023ec56e/go.mod h1:i00+b/gKdIDIxuLDFob7ustLAVqhsZRk2qVZrArELGQ= +github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= +github.com/dave/kerr v0.0.0-20170318121727-bc25dd6abe8e/go.mod h1:qZqlPyPvfsDJt+3wHJ1EvSXDuVjFTK0j2p/ca+gtsb8= +github.com/dave/rebecca v0.9.1/go.mod h1:N6XYdMD/OKw3lkF3ywh8Z6wPGuwNFDNtWYEMFWEmXBA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -490,8 +485,8 @@ github.com/devfile/api/v2 v2.2.1-alpha.0.20230413012049-a6c32fca0dbd/go.mod h1:q github.com/devfile/library v1.2.1-0.20211104222135-49d635cb492f/go.mod h1:uFZZdTuRqA68FVe/JoJHP92CgINyQkyWnM2Qyiim+50= github.com/devfile/library v1.2.1-0.20220308191614-f0f7e11b17de/go.mod h1:GSPfJaBg0+bBjBHbwBE5aerJLH6tWGQu2q2rHYd9czM= github.com/devfile/library/v2 v2.0.1/go.mod h1:paJ0PARAVy0br13VpBEQ4fO3rZVDxWtooQ29+23PNBk= -github.com/devfile/library/v2 v2.2.1-0.20230418160146-e75481b7eebd h1:YHSwUdfWsG9Qk7Vn+NfafELv6+G6a43RRE/NjS0TfK0= -github.com/devfile/library/v2 v2.2.1-0.20230418160146-e75481b7eebd/go.mod h1:jXIVOBkEqh7YJddFcZ+vak47rlbCW//f+qqG5hUozhM= +github.com/devfile/library/v2 v2.2.1-0.20230821212346-99a3776c0b1e h1:ozHGZOXlBvtf4YqZRrMiSNH6q6gjw6XaUisMhWG4Vwg= +github.com/devfile/library/v2 v2.2.1-0.20230821212346-99a3776c0b1e/go.mod h1:7oEhkC6GW6OKmAP8HbxbaQ+nFbnACQuU7anYhJroltQ= github.com/devfile/registry-support/index/generator v0.0.0-20220222194908-7a90a4214f3e/go.mod h1:iRPBxs+ZjfLEduVXpCCIOzdD2588Zv9OCs/CcXMcCCY= github.com/devfile/registry-support/index/generator v0.0.0-20220527155645-8328a8a883be/go.mod h1:1fyDJL+fPHtcrYA6yjSVWeLmXmjCNth0d5Rq1rvtryc= github.com/devfile/registry-support/index/generator v0.0.0-20221018203505-df96d34d4273 h1:DXENQSRTEDsk9com38njPg5511DD12HPIgzyFUErnpM= @@ -562,28 +557,25 @@ github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQL github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= +github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= +github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= @@ -603,7 +595,7 @@ github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3I github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -612,34 +604,36 @@ github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7 github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= -github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= +github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= +github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= @@ -668,7 +662,6 @@ github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -724,12 +717,10 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-github/v50 v50.0.0 h1:gdO1AeuSZZK4iYWwVbjni7zg8PIQhp7QfmPunr016Jk= -github.com/google/go-github/v50 v50.0.0/go.mod h1:Ev4Tre8QoKiolvbpOSG3FIi4Mlon3S2Nt9W5JYqKiwA= github.com/google/go-github/v52 v52.0.1-0.20230514113659-60429b4ba0ba h1:8QmMN6yn+KeJNAzor+pFN7ZpK0Ov5OZ5uD7Tl2NS0Sc= github.com/google/go-github/v52 v52.0.1-0.20230514113659-60429b4ba0ba/go.mod h1:qxrsBJ0Yqsc2dZ2/2NO1GOvt51TkTXFS+DbHXJsMyyQ= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-github/v53 v53.0.0 h1:T1RyHbSnpHYnoF0ZYKiIPSgPtuJ8G6vgc0MKodXsQDQ= +github.com/google/go-github/v53 v53.0.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -742,6 +733,7 @@ github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIG github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/pprof v0.0.0-20181127221834-b4f47329b966/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -756,6 +748,7 @@ github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= @@ -771,8 +764,6 @@ github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM= github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w= -github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= -github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -805,7 +796,6 @@ github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:Fecb github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -861,16 +851,12 @@ github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= -github.com/imroc/req/v3 v3.26.0 h1:do0VnXH+AcUMoodjPQCkRc2a9If2vrXVu+cZ8TvfFMU= -github.com/imroc/req/v3 v3.26.0/go.mod h1:EluRnkfh8A39BmrCARYhcUrfGyR8qPw+O0BZyTy4j9k= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= -github.com/jarcoal/httpmock v1.2.0 h1:gSvTxxFR/MEMfsGrvRbdfpRUMBStovlSRLw0Ep1bwwc= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/jenkins-x/go-scm v1.11.35 h1:DcxonfFMf8jqqSWZHCsj40Cp1++hTAmlFtIf7IEl3vk= github.com/jenkins-x/go-scm v1.11.35/go.mod h1:JyL6p5dNNeJZt41yfysDTBe0Q51cLa5MVK0du7JnXt0= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -919,9 +905,8 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -929,58 +914,44 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= -github.com/lucas-clemente/quic-go v0.28.1 h1:Uo0lvVxWg5la9gflIF9lwa39ONq85Xq2D91YNEIslzU= -github.com/lucas-clemente/quic-go v0.28.1/go.mod h1:oGz5DKK41cJt5+773+BSO9BXDsREY4HLf7+0odGAPO0= github.com/lucasjones/reggen v0.0.0-20200904144131-37ba4fa293bb/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= -github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= -github.com/marten-seemann/qpack v0.2.1 h1:jvTsT/HpCn2UZJdP+UUB53FfUUgeOyG5K1ns0OJOGVs= -github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= -github.com/marten-seemann/qtls-go1-16 v0.1.5 h1:o9JrYPPco/Nukd/HpOHMHZoBDXQqoNtUCmny98/1uqQ= -github.com/marten-seemann/qtls-go1-16 v0.1.5/go.mod h1:gNpI2Ol+lRS3WwSOtIUUtRwZEQMXjYK+dQSBFbethAk= -github.com/marten-seemann/qtls-go1-17 v0.1.2 h1:JADBlm0LYiVbuSySCHeY863dNkcpMmDR7s0bLKJeYlQ= -github.com/marten-seemann/qtls-go1-17 v0.1.2/go.mod h1:C2ekUKcDdz9SDWxec1N/MvcXBpaX9l3Nx67XaR84L5s= -github.com/marten-seemann/qtls-go1-18 v0.1.2 h1:JH6jmzbduz0ITVQ7ShevK10Av5+jBEKAHMntXmIV7kM= -github.com/marten-seemann/qtls-go1-18 v0.1.2/go.mod h1:mJttiymBAByA49mhlNZZGrH5u1uXYZJ+RW28Py7f4m4= -github.com/marten-seemann/qtls-go1-19 v0.1.0-beta.1 h1:7m/WlWcSROrcK5NxuXaxYD32BZqe/LEEnBrWcH/cOqQ= -github.com/marten-seemann/qtls-go1-19 v0.1.0-beta.1/go.mod h1:5HTDWtVudo/WFsHKRNuOhWlbdjrfs5JHrYb0wIJqGpI= github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/matttproud/golang_protobuf_extensions v1.0.2 h1:hAHbPm5IJGijwng3PWk09JkG9WeqChjprR5s9bBZ+OM= -github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= -github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/migueleliasweb/go-github-mock v0.0.17 h1:IJMM3hj87vTA4Q+W/GFJZTkv85aOM4k9ZpMekFEJZrU= -github.com/migueleliasweb/go-github-mock v0.0.17/go.mod h1:CjrgPd8s5sf5g3XSESAQqxufae+PZbgM/F317C3uD7g= +github.com/migueleliasweb/go-github-mock v0.0.19 h1:z/88f6wPqZVFnE7s9DbwXMhCtmV/0FofNxc4M7FuSdU= +github.com/migueleliasweb/go-github-mock v0.0.19/go.mod h1:dBoCB3W9NjzyABhoGkfI0iSlFpzulAXhI7M+9A4ONYI= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= @@ -1031,8 +1002,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= -github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249/go.mod h1:mpRZBD8SJ55OIICQ3iWH0Yz3cjzA61JdqMLoWXeB2+8= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -1050,11 +1019,10 @@ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.6.0 h1:9t9b9vRUbFq3C4qKFCGkVuq/fIHji802N1nrtkh1mNc= +github.com/onsi/ginkgo/v2 v2.9.7 h1:06xGQy5www2oN160RtEZoTvnP2sPhEfePYmCDc2szss= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -1063,10 +1031,9 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E= -github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM= +github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= +github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -1097,11 +1064,10 @@ github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xA github.com/openshift-pipelines/pipelines-as-code v0.0.0-20220622161720-2a6007e17200 h1:zu9Z85uKHVMEg/nAd0J9xNLUnu6C3mtRf5l7xJiTilM= github.com/openshift-pipelines/pipelines-as-code v0.0.0-20220622161720-2a6007e17200/go.mod h1:C2xZcwv55w1W74LjkEN7NRp2z0UOj0/VXMi8ZuNBPGI= github.com/openshift/api v0.0.0-20200930075302-db52bc4ef99f/go.mod h1:Si/I9UGeRR3qzg01YWPmtlr0GeGk2fnuggXJRmjAZ6U= -github.com/openshift/api v0.0.0-20210503193030-25175d9d392d h1:eKs5lGkavtfolWeUBJCyirqopVSheGPHgikqlfVmq1s= -github.com/openshift/api v0.0.0-20210503193030-25175d9d392d/go.mod h1:dZ4kytOo3svxJHNYd0J55hwe/6IQG5gAUHUE0F3Jkio= +github.com/openshift/api v0.0.0-20220912161038-458ad9ca9ca5 h1:M42Vl3QcuzhX4IgRNIQU+ACdd8/ZTya3GvGWwh4Gl6M= +github.com/openshift/api v0.0.0-20220912161038-458ad9ca9ca5/go.mod h1:LEnw1IVscIxyDnltE3Wi7bQb/QzIM8BfPNKoGA1Qlxw= github.com/openshift/build-machinery-go v0.0.0-20200819073603-48aa266c95f7/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= -github.com/openshift/build-machinery-go v0.0.0-20210209125900-0da259a2c359/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= -github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= +github.com/openshift/build-machinery-go v0.0.0-20211213093930-7e33a7eb4ce3/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= github.com/pact-foundation/pact-go/v2 v2.0.0-beta.23 h1:C+VVrGscTLUFfqm8yr2rvoeS5+zQkjT50oO4qBO1j5s= github.com/pact-foundation/pact-go/v2 v2.0.0-beta.23/go.mod h1:y8gF0j+X2sKd2wyyXeZn0AW0JtHeki+1Rmpu8hl0ytw= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -1127,16 +1093,14 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1145,18 +1109,15 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1167,16 +1128,15 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= +github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/redhat-appstudio/application-api v0.0.0-20230704143842-035c661f115f h1:XeHZfA9nZQjLBfjwWo2EvL8TiF3vUZLj7AlY19yTUoM= github.com/redhat-appstudio/application-api v0.0.0-20230704143842-035c661f115f/go.mod h1:LpcTNLCDMf1CUNTw2bgTiz8M49sUsN2F9T7bOSKcJEo= -github.com/redhat-appstudio/service-provider-integration-operator v0.8.3 h1:Q2mzasHJr3PmXjPscUCx6JDH9Ku39Y2h3T53zb5MU0o= -github.com/redhat-appstudio/service-provider-integration-operator v0.8.3/go.mod h1:o4C4n36pkQhmICnySJyAvmyj/SD97wwvQNkb+Rhiimg= -github.com/redhat-appstudio/service-provider-integration-scm-file-retriever v0.8.3 h1:w6Z2olvMMBONiFTPHh3lNJTuOvgiRXZTrwOYUt7WTXQ= -github.com/redhat-appstudio/service-provider-integration-scm-file-retriever v0.8.3/go.mod h1:nGIC0XrYoMm63q1qHS7h/7ktUliMzgQcOOd2XLpNDbA= +github.com/redhat-appstudio/remote-secret v0.0.0-20230713072146-a6094c712436 h1:6XYknDslXDSVpNqEKnI+gKj3Uu4afK2S+IIH3KogX1E= +github.com/redhat-appstudio/remote-secret v0.0.0-20230713072146-a6094c712436/go.mod h1:QlcxNg0q63QFGr9ceI3dH7a7vO6gGh+2TJrbTiMf9DE= +github.com/redhat-appstudio/service-provider-integration-operator v0.2023.22-0.20230713080056-eae17aa8c172 h1:Zibq2RBTzcoDgZcTfM5k2o1qrKuix3YPtYQ/NuP039Y= +github.com/redhat-appstudio/service-provider-integration-operator v0.2023.22-0.20230713080056-eae17aa8c172/go.mod h1:FGHbzLSIpXZKFVKKQr1sSrgN3+wBpJw0wTTjTRNNm+k= github.com/redhat-developer/alizer/go v0.0.0-20230516215932-135a2bb3fb90 h1:pFKn+Vqg3xXrueGboXYRkmKPJ6ObaVBNbKF1M7NG/mA= github.com/redhat-developer/alizer/go v0.0.0-20230516215932-135a2bb3fb90/go.mod h1:y7XToX/Yq1ASZY8hatAkmXJSzEXlHZV8lf59wliUfOw= github.com/redhat-developer/gitops-generator v0.0.0-20230801134438-01747a27dcbf h1:uRlhXqcVhbvp9YawKoggQoMLZwRP0/kpdLE3wkzqMuI= @@ -1185,7 +1145,6 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -1201,33 +1160,11 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= -github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= -github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= -github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0= github.com/shurcooL/githubv4 v0.0.0-20190718010115-4ba037080260 h1:xKXiRdBUtMVp64NaxACcyX4kvfmHJ9KrLU+JvyB1mdM= github.com/shurcooL/githubv4 v0.0.0-20190718010115-4ba037080260/go.mod h1:hAF0iLZy4td2EX+/8Tw+4nodhlMrwN3HupfaXj3zkGo= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw= -github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI= github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f h1:tygelZueB1EtXkPI6mQ4o9DQ0+FKW41hTbunoXZCTqk= github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f/go.mod h1:AuYgA5Kyo4c7HfUmvRGs/6rGlMMV/6B1bVnB9JxJEEg= -github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= -github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag= -github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg= -github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw= -github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y= -github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q= -github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ= -github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I= -github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0= -github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= -github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk= -github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= -github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -1244,8 +1181,6 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1 github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= -github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= @@ -1292,13 +1227,12 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -1310,8 +1244,6 @@ github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= -github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= @@ -1337,6 +1269,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43 h1:+lm10QQTNSBd8DVTNGHx7o/IKu9HYDvLMffDhbyLccI= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= @@ -1353,7 +1286,6 @@ go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQc go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= -go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1370,6 +1302,7 @@ go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= @@ -1378,26 +1311,21 @@ go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95a go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= -golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= +golang.org/x/arch v0.0.0-20180920145803-b19384d3c130/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8= golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1413,6 +1341,7 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= @@ -1430,7 +1359,6 @@ golang.org/x/exp v0.0.0-20230206171751-46f607a40771 h1:xP7rWLUr1e1n2xkK5YB4LI0hP golang.org/x/exp v0.0.0-20230206171751-46f607a40771/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1455,6 +1383,7 @@ golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hM golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= @@ -1464,15 +1393,12 @@ golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1515,8 +1441,8 @@ golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5o golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220107192237-5cfca573fb4d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1528,7 +1454,6 @@ golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= @@ -1536,11 +1461,10 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1566,9 +1490,9 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= +golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= -golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1588,16 +1512,15 @@ golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1687,13 +1610,12 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1708,7 +1630,7 @@ golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220731174439-a90be440212d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1716,6 +1638,7 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -1727,6 +1650,7 @@ golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1742,6 +1666,7 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1755,10 +1680,8 @@ golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1801,6 +1724,7 @@ golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224/go.mod h1:Sl4aGygMT6LrqrWc golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -1824,10 +1748,11 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y= -golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= +golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= +golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1840,9 +1765,6 @@ golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNq gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1895,8 +1817,6 @@ google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB google.golang.org/api v0.130.0 h1:A50ujooa1h9iizvfzA4rrJr2B7uRmWexwbekQ2+5FPQ= google.golang.org/api v0.130.0/go.mod h1:J/LCJMYSDFvAVREGCbrESb53n4++NMBDetSHGL5I5RY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -1906,10 +1826,6 @@ google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6 google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= -google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -2025,9 +1941,6 @@ google.golang.org/genproto/googleapis/api v0.0.0-20230706204954-ccb25ca9f130/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 h1:2FZP5XuJY9zQyGM5N0rtovnoXjiMUEIUMvw0m9wlpLc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:8mL13HKkDa+IuJ8yruA3ci0q+0vsUz4m//+ottjwS5o= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -2111,6 +2024,7 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/src-d/go-billy.v4 v4.3.0/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= @@ -2136,8 +2050,6 @@ gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81 gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= gotest.tools/v3 v3.1.0 h1:rVV8Tcg/8jHUkPUorwjaMTtemIMVXfIPKiOqnhEhakk= -grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -2149,8 +2061,8 @@ k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= -k8s.io/api v0.21.0-rc.0/go.mod h1:Dkc/ZauWJrgZhjOjeBgW89xZQiTBJA2RaBKYHXPsi2Y= k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= +k8s.io/api v0.24.0/go.mod h1:5Jl90IUrJHUJYEMANRURMiVvJ0g7Ax7r3R1bqO8zx8I= k8s.io/api v0.26.1 h1:f+SWYiPd/GsiWwVRz+NbFyCgvv75Pk9NK6dlkZgpCRQ= k8s.io/api v0.26.1/go.mod h1:xd/GBNgR0f707+ATNyPmQ1oyKSgndzXij81FzWGsejg= k8s.io/apiextensions-apiserver v0.21.3/go.mod h1:kl6dap3Gd45+21Jnh6utCx8Z2xxLm8LGDkprcd+KbsE= @@ -2160,10 +2072,10 @@ k8s.io/apimachinery v0.19.0/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlm k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= -k8s.io/apimachinery v0.21.0-rc.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= -k8s.io/apimachinery v0.26.1 h1:8EZ/eGJL+hY/MYCNwhmDzVqq2lPl3N3Bo8rvweJwXUQ= -k8s.io/apimachinery v0.26.1/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= +k8s.io/apimachinery v0.24.0/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= +k8s.io/apimachinery v0.27.3 h1:Ubye8oBufD04l9QnNtW05idcOe9Z3GQN8+7PqmuVcUM= +k8s.io/apimachinery v0.27.3/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= @@ -2176,8 +2088,8 @@ k8s.io/client-go v0.26.1 h1:87CXzYJnAMGaa/IDDfRdhTzxk/wzGZ+/HUQpqgVSZXU= k8s.io/client-go v0.26.1/go.mod h1:IWNSglg+rQ3OcvDkhY6+QLeasV4OYHDjdqeWkDQZwGE= k8s.io/code-generator v0.19.0/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= -k8s.io/code-generator v0.21.0-rc.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= k8s.io/code-generator v0.21.3/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo= +k8s.io/code-generator v0.24.0/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= @@ -2192,26 +2104,32 @@ k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8 k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= -k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= +k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= +k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/pod-security-admission v0.26.1 h1:EDIxsYFeKMzNvN/JB0PgQcuwBP6fIkIG2O8ZWJhzOp4= k8s.io/pod-security-admission v0.26.1/go.mod h1:hCbYTG5UtLlivmukkMPjAWf23PUBUHzEvR60xNVWN4c= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y= -k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= +k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= knative.dev/pkg v0.0.0-20221011175852-714b7630a836 h1:0N7Zo/O+xeUUebJPm9keBaGclrUoEbljr3J1MsqtaIM= knative.dev/pkg v0.0.0-20221011175852-714b7630a836/go.mod h1:DMTRDJ5WRxf/DrlOPzohzfhSuJggscLZ8EavOq9O/x8= oras.land/oras-go v1.1.0 h1:tfWM1RT7PzUwWphqHU6ptPU3ZhwVnSw/9nEGf519rYg= @@ -2223,20 +2141,19 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyz sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/controller-runtime v0.9.5/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= -sigs.k8s.io/controller-runtime v0.14.4 h1:Kd/Qgx5pd2XUL08eOV2vwIq3L9GhIbJ5Nxengbd4/0M= -sigs.k8s.io/controller-runtime v0.14.4/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/controller-runtime v0.14.6 h1:oxstGVvXGNnMvY7TAESYk+lzr6S3V5VFxQ6d92KcwQA= +sigs.k8s.io/controller-runtime v0.14.6/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0= +sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= -sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= -sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= diff --git a/main.go b/main.go index 52cf4077f..fedcad9f0 100644 --- a/main.go +++ b/main.go @@ -23,6 +23,8 @@ import ( "net/http" "os" + spiapi "github.com/redhat-appstudio/service-provider-integration-operator/api/v1beta1" + gitopsgen "github.com/redhat-developer/gitops-generator/pkg" // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) @@ -62,6 +64,8 @@ func init() { utilruntime.Must(appstudiov1alpha1.AddToScheme(scheme)) + utilruntime.Must(spiapi.AddToScheme(scheme)) + //+kubebuilder:scaffold:scheme } @@ -156,7 +160,9 @@ func main() { Generator: gitopsgen.NewGitopsGen(), AppFS: ioutils.NewFilesystem(), GitHubTokenClient: ghTokenClient, - SPIClient: spi.SPIClient{}, + SPIClient: spi.SPIClient{ + K8sClient: mgr.GetClient(), + }, }).SetupWithManager(ctx, mgr); err != nil { setupLog.Error(err, "unable to create controller", "controller", "Component") os.Exit(1) @@ -165,7 +171,6 @@ func main() { Client: mgr.GetClient(), Scheme: mgr.GetScheme(), Log: ctrl.Log.WithName("controllers").WithName("ComponentDetectionQuery"), - SPIClient: spi.SPIClient{}, GitHubTokenClient: ghTokenClient, DevfileRegistryURL: devfileRegistryURL, AppFS: ioutils.NewFilesystem(), diff --git a/pkg/devfile/devfile.go b/pkg/devfile/devfile.go index 9021604ea..ca71e4e85 100644 --- a/pkg/devfile/devfile.go +++ b/pkg/devfile/devfile.go @@ -744,9 +744,8 @@ func getMatchLabel(name string) map[string]string { func FindAndDownloadDevfile(dir string) ([]byte, string, error) { var devfileBytes []byte var err error - validDevfileLocations := []string{cdqanalysis.Devfile, cdqanalysis.HiddenDevfile, cdqanalysis.HiddenDirDevfile, cdqanalysis.HiddenDirHiddenDevfile} - for _, path := range validDevfileLocations { + for _, path := range cdqanalysis.ValidDevfileLocations { devfilePath := dir + "/" + path devfileBytes, err = DownloadFile(devfilePath) if err == nil { @@ -763,11 +762,8 @@ func FindAndDownloadDockerfile(dir string) ([]byte, string, error) { var dockerfileBytes []byte var err error // Containerfile is an alternate name for Dockerfile - validDockerfileLocations := []string{cdqanalysis.Dockerfile, cdqanalysis.DockerDirDockerfile, cdqanalysis.HiddenDirDockerfile, cdqanalysis.BuildDirDockerfile, - cdqanalysis.AlternateDockerfile, cdqanalysis.DockerDirAlternateDockerfile, cdqanalysis.HiddenDirAlternateDockerfile, cdqanalysis.BuildDirAlternateDockerfile, - cdqanalysis.Containerfile, cdqanalysis.DockerDirContainerfile, cdqanalysis.HiddenDirContainerfile, cdqanalysis.BuildDirContainerfile} - for _, path := range validDockerfileLocations { + for _, path := range cdqanalysis.ValidDockerfileLocations { dockerfilePath := dir + "/" + path dockerfileBytes, err = DownloadFile(dockerfilePath) if err == nil { diff --git a/pkg/devfile/devfile_test.go b/pkg/devfile/devfile_test.go index d2a5dd0b6..517924a33 100644 --- a/pkg/devfile/devfile_test.go +++ b/pkg/devfile/devfile_test.go @@ -3686,14 +3686,8 @@ schemaVersion: 2.2.0` for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - var devfileSrc cdqanalysis.DevfileSrc - if tt.devfileString != "" { - devfileSrc = cdqanalysis.DevfileSrc{ - Data: tt.devfileString, - } - } + devfileData, err := cdqanalysis.ParseDevfileWithParserArgs(&parser.ParserArgs{Data: []byte(tt.devfileString)}) - devfileData, err := cdqanalysis.ParseDevfile(devfileSrc) if err != nil { t.Errorf("TestGetResourceFromDevfile() unexpected parse error: %v", err) } diff --git a/pkg/spi/spi.go b/pkg/spi/spi.go index 10f73dc0b..ba756c0a3 100644 --- a/pkg/spi/spi.go +++ b/pkg/spi/spi.go @@ -16,49 +16,126 @@ package spi import ( + "bytes" "context" + "encoding/base64" + "fmt" "io" "path/filepath" + "strconv" + + "github.com/redhat-appstudio/application-api/api/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/go-logr/logr" + "k8s.io/apimachinery/pkg/types" + + ctrl "sigs.k8s.io/controller-runtime" + + spiapi "github.com/redhat-appstudio/service-provider-integration-operator/api/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "sigs.k8s.io/controller-runtime/pkg/client" cdqanalysis "github.com/redhat-appstudio/application-service/cdq-analysis/pkg" "github.com/redhat-appstudio/application-service/pkg/devfile" - "github.com/redhat-appstudio/service-provider-integration-scm-file-retriever/gitfile" ) type SPI interface { - GetFileContents(ctx context.Context, namespace string, repoUrl string, filepath string, ref string, callback func(ctx context.Context, url string)) (io.ReadCloser, error) + GetFileContents(ctx context.Context, name string, component v1alpha1.Component, repoUrl string, filepath string, ref string) (io.ReadCloser, error) } +const ( + SPIFCR_waiting_for_delivered_phase = "File content request status has not been delivered" + SPIFCR_prefix = "spi-fcr-" +) + type SPIClient struct { + K8sClient client.Client +} + +// SPIFileContentRequestError returns an internal error +type SPIFileContentRequestError struct { + Message string +} + +func (e *SPIFileContentRequestError) Error() string { + return "SPIFileContentRequest failed " + e.Message } +var ValidDevfileLocations = []string{cdqanalysis.Devfile, cdqanalysis.HiddenDevfile, cdqanalysis.HiddenDirDevfile, cdqanalysis.HiddenDirHiddenDevfile} + // GetFileContents is a wrapper call to scm file retriever's GetFileContents() -func (s SPIClient) GetFileContents(ctx context.Context, namespace string, repoUrl string, filepath string, ref string, callback func(ctx context.Context, url string)) (io.ReadCloser, error) { - return gitfile.Default().GetFileContents(ctx, namespace, repoUrl, filepath, ref, callback) +func (s SPIClient) GetFileContents(ctx context.Context, name string, component v1alpha1.Component, repoUrl string, filepath string, ref string) (io.ReadCloser, error) { + log := ctrl.LoggerFrom(ctx) + spiFCRLookupKey := types.NamespacedName{Name: SPIFCR_prefix + name, Namespace: component.Namespace} //We'll use a unique component name and filepath to construct the name + spiFCR := &spiapi.SPIFileContentRequest{} + log.Info("Looking up SPIFileContentRequest CR", "name", spiFCRLookupKey.Name, "namespace", spiFCRLookupKey.Namespace) + err := s.K8sClient.Get(ctx, spiFCRLookupKey, spiFCR) + if err != nil { + if errors.IsNotFound(err) { + spiFCR.Name = spiFCRLookupKey.Name + spiFCR.Namespace = spiFCRLookupKey.Namespace + spiFCR.Spec.RepoUrl = repoUrl + spiFCR.Spec.FilePath = filepath + spiFCR.Spec.Ref = ref + //add an owner reference + ownerReference := metav1.OwnerReference{ + APIVersion: component.APIVersion, + Kind: component.Kind, + Name: component.Name, + UID: component.UID, + } + spiFCR.SetOwnerReferences(append(spiFCR.GetOwnerReferences(), ownerReference)) + + log.Info("SPIFileContentRequest CR not found, creating a new request", "name", spiFCR.Name, "namespace", spiFCR.Namespace) + err = s.K8sClient.Create(ctx, spiFCR) + if err != nil { + log.Error(err, "Unable to create an SPIFileContentRequest CR", "name", spiFCR.Name, "namespace", spiFCR.Namespace) + return nil, &SPIFileContentRequestError{fmt.Sprintf("Failed to create an SPIFileContentRequest CR: %s", err.Error())} + } + } + } + + return getFileContentFromSPIFCR(*spiFCR, log) } -func DownloadDevfileUsingSPI(s SPI, ctx context.Context, namespace string, repoURL string, ref string, path string) ([]byte, error) { - validDevfileLocations := []string{cdqanalysis.Devfile, cdqanalysis.HiddenDevfile, cdqanalysis.HiddenDirDevfile, cdqanalysis.HiddenDirHiddenDevfile} +func getFileContentFromSPIFCR(fcr spiapi.SPIFileContentRequest, log logr.Logger) (io.ReadCloser, error) { + + if fcr.Status.Phase == spiapi.SPIFileContentRequestPhaseDelivered { + fcrName := fcr.Name + //get contents and decode them + fileContent := fcr.Status.Content + decodedFileContent, err := base64.StdEncoding.DecodeString(fileContent) + if err != nil { + return nil, &SPIFileContentRequestError{fmt.Sprintf("Failed to decode file content %s ", err)} + } - for _, filename := range validDevfileLocations { - devfileBytes, err := DownloadFileUsingSPI(s, ctx, namespace, repoURL, ref, filepath.Join("/", path, filename)) + log.Info("SPIFileContentRequest: Decoded file contents successfully ", "name", fcrName, "namespace", fcr.Namespace) + return io.NopCloser(bytes.NewBuffer(decodedFileContent)), nil + } else { + log.Info("SPI Phase delivered not reached") + return nil, &SPIFileContentRequestError{SPIFCR_waiting_for_delivered_phase} + } + +} + +func DownloadDevfileUsingSPI(s SPI, ctx context.Context, component v1alpha1.Component, repoURL string, ref string, path string) ([]byte, string, error) { + for i, filename := range ValidDevfileLocations { + devfileBytes, err := DownloadFileUsingSPI(s, ctx, component.Name+strconv.Itoa(i), component, repoURL, ref, filepath.Join("/", path, filename)) //pass in unique name so SPIFileContentRequest can be created for each valid devfile location type if err == nil { - return devfileBytes, nil + return devfileBytes, filename, nil } else { if _, ok := err.(*devfile.NoFileFound); !ok { - return nil, err + return nil, filename, err } } } - - return nil, &cdqanalysis.NoDevfileFound{Location: repoURL} + return nil, "", &cdqanalysis.NoDevfileFound{Location: repoURL} } -func DownloadFileUsingSPI(s SPI, ctx context.Context, namespace string, repoURL string, ref string, filepath string) ([]byte, error) { - - // Call out to SPI via scm-file-retriever to get the file from the given repository - // Hardcode the callback function to nil - no way for us to handle this right now - r, err := s.GetFileContents(ctx, namespace, repoURL, filepath, ref, func(ctx context.Context, url string) {}) +func DownloadFileUsingSPI(s SPI, ctx context.Context, fcrName string, component v1alpha1.Component, repoURL string, ref string, filepath string) ([]byte, error) { + // Call out to SPI via SPIFileContentRequests + r, err := s.GetFileContents(ctx, fcrName, component, repoURL, filepath, ref) if err == nil { fileBytes, err := io.ReadAll(r) if err != nil { @@ -67,24 +144,24 @@ func DownloadFileUsingSPI(s SPI, ctx context.Context, namespace string, repoURL return fileBytes, nil } - return nil, &devfile.NoFileFound{Location: repoURL} + return nil, &devfile.NoFileFound{Location: repoURL, Err: err} } -func DownloadDevfileandDockerfileUsingSPI(s SPI, ctx context.Context, namespace string, repoURL string, ref string, path string) ([]byte, []byte, error) { +func DownloadDevfileandDockerfileUsingSPI(s SPI, ctx context.Context, name string, component v1alpha1.Component, repoURL string, ref string, path string) ([]byte, []byte, string, error) { - devfileBytes, err := DownloadDevfileUsingSPI(s, ctx, namespace, repoURL, ref, path) + devfileBytes, filename, err := DownloadDevfileUsingSPI(s, ctx, component, repoURL, ref, path) if err != nil { if _, ok := err.(*cdqanalysis.NoDevfileFound); !ok { - return nil, nil, err + return nil, nil, filename, err } } - dockerfileBytes, err := DownloadFileUsingSPI(s, ctx, namespace, repoURL, ref, filepath.Join("/", path, "Dockerfile")) + dockerfileBytes, err := DownloadFileUsingSPI(s, ctx, name, component, repoURL, ref, filepath.Join("/", path, "Dockerfile")) if err != nil { if _, ok := err.(*devfile.NoFileFound); !ok { - return nil, nil, err + return nil, nil, "", err } } - return devfileBytes, dockerfileBytes, nil + return devfileBytes, dockerfileBytes, filename, nil } diff --git a/pkg/spi/spi_mock.go b/pkg/spi/spi_mock.go index 9f42b0114..6e3c7b0a8 100644 --- a/pkg/spi/spi_mock.go +++ b/pkg/spi/spi_mock.go @@ -21,6 +21,8 @@ import ( "io" "strings" + "github.com/redhat-appstudio/application-api/api/v1alpha1" + "github.com/stretchr/testify/mock" ) @@ -144,7 +146,7 @@ CMD [ "waitress-serve", "--port=8081", "app:app"] // GetFileContents mocks the GetFileContents function from SPI // If "repoURL" parameter contains "test-error-response", then an error value will be returned, // otherwise we return a mock devfile that can be read. -func (s MockSPIClient) GetFileContents(ctx context.Context, namespace string, repoURL string, filepath string, ref string, callback func(ctx context.Context, url string)) (io.ReadCloser, error) { +func (s MockSPIClient) GetFileContents(ctx context.Context, name string, component v1alpha1.Component, repoURL string, filepath string, ref string) (io.ReadCloser, error) { if strings.Contains(repoURL, "test-error-response") { return nil, fmt.Errorf("file not found") } else if strings.Contains(repoURL, "test-parse-error") || (strings.Contains(repoURL, "test-error-dockerfile-response") && strings.Contains(filepath, "Dockerfile")) { @@ -156,6 +158,8 @@ func (s MockSPIClient) GetFileContents(ctx context.Context, namespace string, re stringReader := strings.NewReader(mockDockerfile) stringReadCloser := io.NopCloser(stringReader) return stringReadCloser, nil + } else if strings.Contains(filepath, "valid-repo-invalid-token") { + return nil, fmt.Errorf("unable to fetch the SPIAccessToken") } else { stringReader := strings.NewReader(mockDevfile) stringReadCloser := io.NopCloser(stringReader) diff --git a/pkg/spi/spi_test.go b/pkg/spi/spi_test.go index 0d347744f..d9f3d382f 100644 --- a/pkg/spi/spi_test.go +++ b/pkg/spi/spi_test.go @@ -18,14 +18,20 @@ package spi import ( "context" "testing" + + "github.com/redhat-appstudio/application-api/api/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +const testNamespace = "test-namespace" + // TestDownloadDevfileFromSPI uses the Mock SPI client to test the DownloadDevfileFromSPI function // Since SPI does not support running outside of Kube, we cannot unit test the non-mock SPI client at this moment func TestDownloadDevfileFromSPI(t *testing.T) { var mock MockSPIClient tests := []struct { + comp v1alpha1.Component name string repoUrl string path string @@ -33,23 +39,23 @@ func TestDownloadDevfileFromSPI(t *testing.T) { wantErr bool }{ { - name: "Successfully retrieve devfile, no context/path set", + comp: v1alpha1.Component{ObjectMeta: v1.ObjectMeta{Name: "Successfully retrieve devfile, no context/path set", Namespace: testNamespace}}, repoUrl: "https://github.com/testrepo/test-private-repo", want: mockDevfile, }, { - name: "Successfully retrieve devfile, context/path set", + comp: v1alpha1.Component{ObjectMeta: v1.ObjectMeta{Name: "Successfully retrieve devfile, context/path set", Namespace: testNamespace}}, repoUrl: "https://github.com/testrepo/test-private-repo", path: "/test", want: mockDevfile, }, { - name: "Unable to retrieve devfile", + comp: v1alpha1.Component{ObjectMeta: v1.ObjectMeta{Name: "Unable to retrieve devfile", Namespace: testNamespace}}, repoUrl: "https://github.com/testrepo/test-error-response", wantErr: true, }, { - name: "Error reading devfile", + comp: v1alpha1.Component{ObjectMeta: v1.ObjectMeta{Name: "Error reading devfile", Namespace: testNamespace}}, repoUrl: "https://github.com/testrepo/test-parse-error", wantErr: true, }, @@ -58,7 +64,7 @@ func TestDownloadDevfileFromSPI(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // Convert the hasApp resource to a devfile - devfileBytes, err := DownloadDevfileUsingSPI(mock, context.Background(), "test-namespace", tt.repoUrl, "main", tt.path) + devfileBytes, _, err := DownloadDevfileUsingSPI(mock, context.Background(), tt.comp, tt.repoUrl, "main", tt.path) if (err != nil) != tt.wantErr { t.Errorf("unexpected error return value: %v", err) } @@ -75,6 +81,7 @@ func TestDownloadDevfileandDockerfileUsingSPI(t *testing.T) { var mock MockSPIClient tests := []struct { + comp v1alpha1.Component name string repoUrl string path string @@ -83,25 +90,25 @@ func TestDownloadDevfileandDockerfileUsingSPI(t *testing.T) { wantErr bool }{ { - name: "Successfully retrieve devfile, no context/path set", + comp: v1alpha1.Component{ObjectMeta: v1.ObjectMeta{Name: "Successfully retrieve devfile, no context/path set", Namespace: testNamespace}}, repoUrl: "https://github.com/testrepo/test-private-repo", wantDevfile: mockDevfile, wantDockerfile: mockDockerfile, }, { - name: "Successfully retrieve devfile, context/path set", + comp: v1alpha1.Component{ObjectMeta: v1.ObjectMeta{Name: "Successfully retrieve devfile, context/path set", Namespace: testNamespace}}, repoUrl: "https://github.com/testrepo/test-private-repo", path: "/test", wantDevfile: mockDevfile, wantDockerfile: mockDockerfile, }, { - name: "Error reading devfile", + comp: v1alpha1.Component{ObjectMeta: v1.ObjectMeta{Name: "Error reading devfile", Namespace: testNamespace}}, repoUrl: "https://github.com/testrepo/test-parse-error", wantErr: true, }, { - name: "Error reading Dockerfile", + comp: v1alpha1.Component{ObjectMeta: v1.ObjectMeta{Name: "Error reading devfile", Namespace: testNamespace}}, repoUrl: "https://github.com/testrepo/test-error-dockerfile-response", wantErr: true, }, @@ -109,7 +116,7 @@ func TestDownloadDevfileandDockerfileUsingSPI(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - devfileBytes, dockerfileBytes, err := DownloadDevfileandDockerfileUsingSPI(mock, context.Background(), "test-namespace", tt.repoUrl, "main", tt.path) + devfileBytes, dockerfileBytes, _, err := DownloadDevfileandDockerfileUsingSPI(mock, context.Background(), tt.name, tt.comp, tt.repoUrl, "main", tt.path) if (err != nil) != tt.wantErr { t.Errorf("unexpected error return value: %v", err) return