Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest knative.dev/pkg #4129

Merged
merged 1 commit into from
Aug 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var (
)

func main() {
cfg := sharedmain.ParseAndGetConfigOrDie()
cfg := injection.ParseAndGetRESTConfigOrDie()
controller.DefaultThreadsPerController = *threadsPerController
version.SetVersion(*versionGiven)
images := pipeline.Images{
Expand Down
3 changes: 1 addition & 2 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ func main() {
log.Fatal(http.ListenAndServe(":"+port, mux))
}()

sharedmain.WebhookMainWithConfig(ctx, serviceName,
sharedmain.ParseAndGetConfigOrDie(),
sharedmain.MainWithContext(ctx, serviceName,
certificates.NewController,
newDefaultingAdmissionController,
newValidationAdmissionController,
Expand Down
6 changes: 6 additions & 0 deletions config/200-clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,9 @@ rules:
resources: ["podsecuritypolicies"]
resourceNames: ["tekton-pipelines"]
verbs: ["use"]
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["get"]
# The webhook configured the namespace as the OwnerRef on various cluster-scoped resources,
# which requires we can Get the system namespace.
resourceNames: ["tekton-pipelines"]
13 changes: 6 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ module github.com/tektoncd/pipeline
go 1.13

require (
github.com/aws/aws-sdk-go v1.31.12 // indirect
github.com/cloudevents/sdk-go/v2 v2.1.0
github.com/docker/cli v20.10.2+incompatible // indirect
github.com/docker/docker v20.10.2+incompatible // indirect
github.com/emicklei/go-restful v2.15.0+incompatible // indirect
github.com/ghodss/yaml v1.0.0
github.com/go-openapi/spec v0.20.2
github.com/google/go-cmp v0.5.5
github.com/google/go-cmp v0.5.6
github.com/google/go-containerregistry v0.4.1-0.20210128200529-19c2b639fab1
github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20210129212729-5c4818de4025
github.com/google/uuid v1.2.0
Expand All @@ -23,20 +24,18 @@ require (
github.com/sirupsen/logrus v1.7.0 // indirect
github.com/tektoncd/plumbing v0.0.0-20210514044347-f8a9689d5bd5
go.opencensus.io v0.23.0
go.uber.org/zap v1.16.0
golang.org/x/mod v0.4.1 // indirect
golang.org/x/oauth2 v0.0.0-20210413134643-5e61552d6c78
go.uber.org/zap v1.18.1
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf // indirect
gomodules.xyz/jsonpatch/v2 v2.1.0
gomodules.xyz/jsonpatch/v2 v2.2.0
k8s.io/api v0.20.7
k8s.io/apimachinery v0.20.7
k8s.io/client-go v0.20.7
k8s.io/code-generator v0.20.7
k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027 // indirect
k8s.io/klog v1.0.0
k8s.io/kube-openapi v0.0.0-20210113233702-8566a335510f
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009
knative.dev/pkg v0.0.0-20210510175900-4564797bf3b7
knative.dev/pkg v0.0.0-20210730172132-bb4aaf09c430
)

// Knative deps (release-0.20)
Expand Down
190 changes: 77 additions & 113 deletions go.sum

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions test/artifact_bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
resourcev1alpha1 "github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
knativetest "knative.dev/pkg/test"
)

Expand Down Expand Up @@ -256,8 +257,8 @@ func TestStorageBucketPipelineRun(t *testing.T) {

// updateConfigMap updates the config map for specified @name with values. We can't use the one from knativetest because
// it assumes that Data is already a non-nil map, and by default, it isn't!
func updateConfigMap(ctx context.Context, client *knativetest.KubeClient, name string, configName string, values map[string]string) error {
configMap, err := client.GetConfigMap(name).Get(ctx, configName, metav1.GetOptions{})
func updateConfigMap(ctx context.Context, client kubernetes.Interface, name string, configName string, values map[string]string) error {
configMap, err := client.CoreV1().ConfigMaps(name).Get(ctx, configName, metav1.GetOptions{})
if err != nil {
return err
}
Expand All @@ -270,7 +271,7 @@ func updateConfigMap(ctx context.Context, client *knativetest.KubeClient, name s
configMap.Data[key] = value
}

_, err = client.GetConfigMap(name).Update(ctx, configMap, metav1.UpdateOptions{})
_, err = client.CoreV1().ConfigMaps(name).Update(ctx, configMap, metav1.UpdateOptions{})
return err
}

Expand Down
12 changes: 7 additions & 5 deletions test/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ import (
"github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1"
resourceversioned "github.com/tektoncd/pipeline/pkg/client/resource/clientset/versioned"
resourcev1alpha1 "github.com/tektoncd/pipeline/pkg/client/resource/clientset/versioned/typed/resource/v1alpha1"
"k8s.io/client-go/kubernetes"
knativetest "knative.dev/pkg/test"
)

// clients holds instances of interfaces for making requests to the Pipeline controllers.
type clients struct {
KubeClient *knativetest.KubeClient
KubeClient kubernetes.Interface

PipelineClient v1beta1.PipelineInterface
ClusterTaskClient v1beta1.ClusterTaskInterface
Expand All @@ -71,15 +72,16 @@ func newClients(t *testing.T, configPath, clusterName, namespace string) *client
var err error
c := &clients{}

c.KubeClient, err = knativetest.NewKubeClient(configPath, clusterName)
cfg, err := knativetest.BuildClientConfig(configPath, clusterName)
if err != nil {
t.Fatalf("failed to create kubeclient from config file at %s: %s", configPath, err)
t.Fatalf("failed to create configuration obj from %s for cluster %s: %s", configPath, clusterName, err)
}

cfg, err := knativetest.BuildClientConfig(configPath, clusterName)
kubeClient, err := kubernetes.NewForConfig(cfg)
if err != nil {
t.Fatalf("failed to create configuration obj from %s for cluster %s: %s", configPath, clusterName, err)
t.Fatalf("failed to create kubeclient from config file at %s: %s", configPath, err)
}
c.KubeClient = kubeClient

cs, err := versioned.NewForConfig(cfg)
if err != nil {
Expand Down
Loading