pipeline/pkg/client/injection/client/fake/fake.go
Vincent Demeester 5021e4d18b Bump github.com/knative/pkg dependency and deps…
… and update import path as it is now `knative.dev/pkg` (as all
knative projects)

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
2019-07-25 06:09:55 -05:00

55 lines
1.6 KiB
Go
Generated

/*
Copyright 2019 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by injection-gen. DO NOT EDIT.
package fake
import (
"context"
fake "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/fake"
client "github.com/tektoncd/pipeline/pkg/client/injection/client"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
injection "knative.dev/pkg/injection"
logging "knative.dev/pkg/logging"
)
func init() {
injection.Fake.RegisterClient(withClient)
}
func withClient(ctx context.Context, cfg *rest.Config) context.Context {
ctx, _ = With(ctx)
return ctx
}
func With(ctx context.Context, objects ...runtime.Object) (context.Context, *fake.Clientset) {
cs := fake.NewSimpleClientset(objects...)
return context.WithValue(ctx, client.Key{}, cs), cs
}
// Get extracts the Kubernetes client from the context.
func Get(ctx context.Context) *fake.Clientset {
untyped := ctx.Value(client.Key{})
if untyped == nil {
logging.FromContext(ctx).Fatalf(
"Unable to fetch %T from context.", (*fake.Clientset)(nil))
}
return untyped.(*fake.Clientset)
}