github.com/redhat-appstudio/e2e-tests@v0.0.0-20240520140907-9709f6f59323/pkg/clients/tekton/repository.go (about)

     1  package tekton
     2  
     3  import (
     4  	"context"
     5  
     6  	pacv1alpha1 "github.com/openshift-pipelines/pipelines-as-code/pkg/apis/pipelinesascode/v1alpha1"
     7  	"k8s.io/apimachinery/pkg/types"
     8  )
     9  
    10  // GetRepositoryParams returns a repository params list
    11  func (t *TektonController) GetRepositoryParams(name, namespace string) ([]pacv1alpha1.Params, error) {
    12  	ctx := context.Background()
    13  	repositoryObj := &pacv1alpha1.Repository{}
    14  	err := t.KubeRest().Get(ctx, types.NamespacedName{Name: name, Namespace: namespace}, repositoryObj)
    15  	if err != nil {
    16  		return nil, err
    17  	}
    18  	return *repositoryObj.Spec.Params, nil
    19  }