diff --git a/go.mod b/go.mod index 8553ca5d9..f28941851 100644 --- a/go.mod +++ b/go.mod @@ -9,10 +9,10 @@ require ( gotest.tools/v3 v3.0.3 k8s.io/apimachinery v0.19.7 k8s.io/client-go v0.19.7 - knative.dev/client v0.21.1-0.20210330082320-885f2a9bc996 - knative.dev/eventing-kafka v0.21.1-0.20210330170621-ec5dc671a6a8 + knative.dev/client v0.22.0 + knative.dev/eventing-kafka v0.22.0 knative.dev/hack v0.0.0-20210325223819-b6ab329907d3 - knative.dev/pkg v0.0.0-20210330162221-808d62257db6 + knative.dev/pkg v0.0.0-20210331065221-952fdd90dbb0 ) replace github.com/go-openapi/spec => github.com/go-openapi/spec v0.19.3 diff --git a/go.sum b/go.sum index 694a8e6b3..bcd7c8cab 100644 --- a/go.sum +++ b/go.sum @@ -1333,45 +1333,36 @@ k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 h1:0T5IaWHO3sJTEmCP6mUlBvMukxPKUQWqiI/YuiBNMiQ= k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= knative.dev/caching v0.0.0-20210215030244-1212288570f0/go.mod h1:rAPalJe9Lx3jHffJpackk5WjZYl3j2QvXUgw0GPllxQ= -knative.dev/caching v0.0.0-20210311181225-4b366c7a9f99/go.mod h1:OlAEAfCSUjHVetZp/hpMw3lzAGHfTEQyu2a5dgf/7Qo= +knative.dev/caching v0.0.0-20210331063521-5691bb38d441/go.mod h1:CfW7OVs7gzUXJj0OrIe8YlWEC4Qe0Avnq+5b81/Gw1s= knative.dev/client v0.21.0/go.mod h1:1En9uxMhk62EReWR1d66/d3tnpkot/D3vBRfmuidFNc= -knative.dev/client v0.21.1-0.20210330082320-885f2a9bc996 h1:hzBLtKkSuTw0iveImS1UkM2e98t5ACl8Aw9YBZzeBhM= -knative.dev/client v0.21.1-0.20210330082320-885f2a9bc996/go.mod h1:jNcqeBq5mEJ8Y9c6hQv7Tm/uwLx5T5KRu1da16O2OlY= +knative.dev/client v0.22.0 h1:rtTlRwnydC+DkP+u0dSXv+yW97xc3HtzDKpbvIfTHYQ= +knative.dev/client v0.22.0/go.mod h1:h0AqleNSlOqhDBhgAkhD5V4IXPcqxhCn2cfLJExqa/U= knative.dev/eventing v0.21.0/go.mod h1:JjbVEOTJJHqo9CTxbTfrMn018hG8fOr3UfBoCJ7KWaA= -knative.dev/eventing v0.21.1-0.20210312002228-3b427377abe0/go.mod h1:k/F174UcHeY70F00RAExTv2/wg8yUR20EPYX3hlD3+8= -knative.dev/eventing v0.21.1-0.20210330142021-dca8b0acf039 h1:skDjBvseFTDncrI6ZF5Vxu9dP9innYrZictqXgqtsaU= -knative.dev/eventing v0.21.1-0.20210330142021-dca8b0acf039/go.mod h1:UE4xmtZ/fZWmbFOLL9u1WuBxxnTm9GmGQceuKram4Kg= -knative.dev/eventing-kafka v0.21.1-0.20210330170621-ec5dc671a6a8 h1:iLFrRgMSo6d90B69XtaxuUXLHl+WewhP8hesxa5WEOQ= -knative.dev/eventing-kafka v0.21.1-0.20210330170621-ec5dc671a6a8/go.mod h1:uEdM0f3cao/decH+hIXWgSd4FzmRvRLz7vmhBHrE2Ig= +knative.dev/eventing v0.22.0 h1:esDaddfSmiVhLKDnUCVVunSdNeHklVEz0fsqs3NupuQ= +knative.dev/eventing v0.22.0/go.mod h1:LOG7bh0eZQkbYANcnORwke6Yy6aUu62o8GeByaOFfRQ= +knative.dev/eventing-kafka v0.22.0 h1:4Y38npo+j0OfiJbSe919Wcgdl4tNgprd2t+dsTMA+iE= +knative.dev/eventing-kafka v0.22.0/go.mod h1:9FhotJRL329R03cArNsI8fGddLMLpQwlWuyfytUU20E= knative.dev/hack v0.0.0-20210203173706-8368e1f6eacf/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= -knative.dev/hack v0.0.0-20210309141825-9b73a256fd9a/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= -knative.dev/hack v0.0.0-20210317214554-58edbdc42966/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/hack v0.0.0-20210325223819-b6ab329907d3 h1:km0Rrh0T9/wA2pivQm1hqSPVwgNgGCHC2WNn3GakZmE= knative.dev/hack v0.0.0-20210325223819-b6ab329907d3/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/hack/schema v0.0.0-20210325223819-b6ab329907d3/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0= knative.dev/networking v0.0.0-20210215030235-088986a1c2a3/go.mod h1:pmAMQjMqQUxpK0UyjE71KljMs6rwDMVIAlvrZsU3I6Y= knative.dev/networking v0.0.0-20210216014426-94bfc013982b/go.mod h1:Crdn87hxdFd3Jj6PIyrjzGnr8OGHX35k5xo9jlOrjjA= -knative.dev/networking v0.0.0-20210311182125-f51c10d6fcf0/go.mod h1:dBcp0JBxATXsbCKK43cA6LxTricz4Ur3dPHataW5J64= -knative.dev/networking v0.0.0-20210311190926-430a689490e6/go.mod h1:dBcp0JBxATXsbCKK43cA6LxTricz4Ur3dPHataW5J64= -knative.dev/networking v0.0.0-20210329132124-45fe1f5dd35e h1:KVdsfMbpNRON/IMxZJkSlcaCVS6ot9G01A9nxht0eD8= -knative.dev/networking v0.0.0-20210329132124-45fe1f5dd35e/go.mod h1:sfplBxhMqToDapZRmMK2CWvaKmmIEH9MSDCF+c1uMGE= +knative.dev/networking v0.0.0-20210331064822-999a7708876c h1:7ggsYXtltPHjbgxi76hg5g2eOtmg8KaBIP40XJsfMyA= +knative.dev/networking v0.0.0-20210331064822-999a7708876c/go.mod h1:0V6M1AaWPL/MtQLuEx0NxiwDdtb8Y4b4f7P3C8sp0zo= knative.dev/pkg v0.0.0-20210212203835-448ae657fb5f/go.mod h1:TJSdebQOWX5N2bszohOYVi0H1QtXbtlYLuMghAFBMhY= knative.dev/pkg v0.0.0-20210215165523-84c98f3c3e7a/go.mod h1:TJSdebQOWX5N2bszohOYVi0H1QtXbtlYLuMghAFBMhY= knative.dev/pkg v0.0.0-20210216013737-584933f8280b/go.mod h1:TJSdebQOWX5N2bszohOYVi0H1QtXbtlYLuMghAFBMhY= -knative.dev/pkg v0.0.0-20210310173525-bbe0bb3eb1e0/go.mod h1:pn/vClSL/iCW40TlFR91EhtmMmsyPQR2V2LavDAOOMs= -knative.dev/pkg v0.0.0-20210311174826-40488532be3f/go.mod h1:pn/vClSL/iCW40TlFR91EhtmMmsyPQR2V2LavDAOOMs= -knative.dev/pkg v0.0.0-20210318052054-dfeeb1817679/go.mod h1:o1aTlbc+h60DP9P6nd/WmP99Ny9Ls3U/JIjL4xMgqpw= knative.dev/pkg v0.0.0-20210329065222-9d92ea16c0d3/go.mod h1:PD5g8hUCXq6iR3tILjmZeJBvQfXGnHMPKryq54qHJhg= -knative.dev/pkg v0.0.0-20210330073320-3b7934e599fb h1:xZ7pyPKZTLiDWN4hBTNde5NzmuPKFaV3NVItE18qRZY= -knative.dev/pkg v0.0.0-20210330073320-3b7934e599fb/go.mod h1:PD5g8hUCXq6iR3tILjmZeJBvQfXGnHMPKryq54qHJhg= -knative.dev/pkg v0.0.0-20210330162221-808d62257db6 h1:hl6lY5ShQ7g7E0I+nPbknXwOOgaKmkJ+7TkCrCo80x0= knative.dev/pkg v0.0.0-20210330162221-808d62257db6/go.mod h1:PD5g8hUCXq6iR3tILjmZeJBvQfXGnHMPKryq54qHJhg= +knative.dev/pkg v0.0.0-20210331062321-6317ec6066f4/go.mod h1:PD5g8hUCXq6iR3tILjmZeJBvQfXGnHMPKryq54qHJhg= +knative.dev/pkg v0.0.0-20210331065221-952fdd90dbb0 h1:z05hcB4br0qz7JdwIoUSTXLTF+7ThuJ+R6NFfXd1Y4Q= +knative.dev/pkg v0.0.0-20210331065221-952fdd90dbb0/go.mod h1:PD5g8hUCXq6iR3tILjmZeJBvQfXGnHMPKryq54qHJhg= knative.dev/reconciler-test v0.0.0-20210216030508-77f50054d024/go.mod h1:RP/K5xJylB72Go6eAsXYEsQHp4zCCNMNjmsqhvq7wko= -knative.dev/reconciler-test v0.0.0-20210311161026-af80deacbe19/go.mod h1:BqljHB9eQj66yPyxOj62syip0ZZtiG0lw76XrtRe36M= -knative.dev/reconciler-test v0.0.0-20210329193624-ea6f47034b61/go.mod h1:QSd2hWDDwFh+9AHOkiECsj2ZY2DGJBKnj6aT6LITBuw= +knative.dev/reconciler-test v0.0.0-20210329214021-2a67496462a4/go.mod h1:qLfJMHc0i9ENTSet/SUp/FcQm4QVfNTX8ZC//aVQN0M= knative.dev/serving v0.21.0/go.mod h1:PU9k1Y6YMG27XQldEu5agNkcebvSafUXKXPircQYCsE= -knative.dev/serving v0.21.1-0.20210311225828-1583394c61cb h1:HX5EVjJJqIUoDAWmfulMnGvPFeKJkAC6GAuj9/y97Ig= -knative.dev/serving v0.21.1-0.20210311225828-1583394c61cb/go.mod h1:5cO/KA08FzPBPuCa5CU2lEGZOP8V/zUgvoluuPcL1lQ= +knative.dev/serving v0.22.0 h1:7l7PglDjVA2McFoQNgPvChBrn2koEsvlB+f7LU8bnJk= +knative.dev/serving v0.22.0/go.mod h1:20yuZH4F7cvoovC2Pi1uQBoIbOjllapVSKDkWAXkItA= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= diff --git a/test/e2e-tests.sh b/test/e2e-tests.sh index 81edb6d47..8daac8559 100755 --- a/test/e2e-tests.sh +++ b/test/e2e-tests.sh @@ -23,8 +23,8 @@ export PATH=$PATH:${REPO_ROOT_DIR} # Will create and delete this namespace (used for all tests, modify if you want a different one used) export KN_E2E_NAMESPACE=kne2etests -export KNATIVE_EVENTING_VERSION="0.21.0" -export KNATIVE_SERVING_VERSION="0.21.0" +export KNATIVE_EVENTING_VERSION="0.22.0" +export KNATIVE_SERVING_VERSION="0.22.0" # Strimzi installation config template used for starting up Kafka clusters. readonly STRIMZI_INSTALLATION_CONFIG_TEMPLATE="${REPO_ROOT_DIR}/test/config/100-strimzi-cluster-operator-0.20.0.yaml" @@ -42,7 +42,7 @@ readonly KAFKA_CRD_CONFIG_TEMPLATE="400-kafka-config.yaml" # Real Kafka channel CRD config , generated from the template directory and modified template file. readonly KAFKA_CRD_CONFIG_DIR="$(mktemp -d)" # Kafka channel CRD config template directory. -readonly KAFKA_SOURCE_CRD_YAML="https://github.com/knative-sandbox/eventing-kafka/releases/download/v0.21.0/source.yaml" +readonly KAFKA_SOURCE_CRD_YAML="https://github.com/knative-sandbox/eventing-kafka/releases/download/v0.22.0/source.yaml" run() { # Create cluster diff --git a/vendor/knative.dev/client/pkg/kn/commands/types.go b/vendor/knative.dev/client/pkg/kn/commands/types.go index 524c521ef..9af0a19c3 100644 --- a/vendor/knative.dev/client/pkg/kn/commands/types.go +++ b/vendor/knative.dev/client/pkg/kn/commands/types.go @@ -27,6 +27,7 @@ import ( messagingv1beta1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/messaging/v1beta1" sourcesv1alpha2client "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1alpha2" servingv1client "knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1" + servingv1alpha1client "knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1" "knative.dev/client/pkg/sources/v1alpha2" "knative.dev/client/pkg/util" @@ -36,21 +37,23 @@ import ( clienteventingv1beta1 "knative.dev/client/pkg/eventing/v1beta1" clientmessagingv1beta1 "knative.dev/client/pkg/messaging/v1beta1" clientservingv1 "knative.dev/client/pkg/serving/v1" + clientservingv1alpha1 "knative.dev/client/pkg/serving/v1alpha1" ) // KnParams for creating commands. Useful for inserting mocks for testing. type KnParams struct { - Output io.Writer - KubeCfgPath string - KubeContext string - KubeCluster string - ClientConfig clientcmd.ClientConfig - NewServingClient func(namespace string) (clientservingv1.KnServingClient, error) - NewGitopsServingClient func(namespace string, dir string) (clientservingv1.KnServingClient, error) - NewSourcesClient func(namespace string) (v1alpha2.KnSourcesClient, error) - NewEventingClient func(namespace string) (clienteventingv1beta1.KnEventingClient, error) - NewMessagingClient func(namespace string) (clientmessagingv1beta1.KnMessagingClient, error) - NewDynamicClient func(namespace string) (clientdynamic.KnDynamicClient, error) + Output io.Writer + KubeCfgPath string + KubeContext string + KubeCluster string + ClientConfig clientcmd.ClientConfig + NewServingClient func(namespace string) (clientservingv1.KnServingClient, error) + NewServingV1alpha1Client func(namespace string) (clientservingv1alpha1.KnServingClient, error) + NewGitopsServingClient func(namespace string, dir string) (clientservingv1.KnServingClient, error) + NewSourcesClient func(namespace string) (v1alpha2.KnSourcesClient, error) + NewEventingClient func(namespace string) (clienteventingv1beta1.KnEventingClient, error) + NewMessagingClient func(namespace string) (clientmessagingv1beta1.KnMessagingClient, error) + NewDynamicClient func(namespace string) (clientdynamic.KnDynamicClient, error) // General global options LogHTTP bool @@ -64,6 +67,10 @@ func (params *KnParams) Initialize() { params.NewServingClient = params.newServingClient } + if params.NewServingV1alpha1Client == nil { + params.NewServingV1alpha1Client = params.newServingClientV1alpha1 + } + if params.NewGitopsServingClient == nil { params.NewGitopsServingClient = params.newGitopsServingClient } @@ -98,6 +105,19 @@ func (params *KnParams) newServingClient(namespace string) (clientservingv1.KnSe return clientservingv1.NewKnServingClient(client, namespace), nil } +func (params *KnParams) newServingClientV1alpha1(namespace string) (clientservingv1alpha1.KnServingClient, error) { + restConfig, err := params.RestConfig() + if err != nil { + return nil, err + } + + client, err := servingv1alpha1client.NewForConfig(restConfig) + if err != nil { + return nil, err + } + return clientservingv1alpha1.NewKnServingClient(client, namespace), nil +} + func (params *KnParams) newGitopsServingClient(namespace string, dir string) (clientservingv1.KnServingClient, error) { return clientservingv1.NewKnServingGitOpsClient(namespace, dir), nil } diff --git a/vendor/knative.dev/client/pkg/serving/v1alpha1/client.go b/vendor/knative.dev/client/pkg/serving/v1alpha1/client.go new file mode 100644 index 000000000..262e9b056 --- /dev/null +++ b/vendor/knative.dev/client/pkg/serving/v1alpha1/client.go @@ -0,0 +1,166 @@ +// Copyright © 2021 The Knative 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. + +package v1alpha1 + +import ( + "context" + + duckv1 "knative.dev/pkg/apis/duck/v1" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + knerrors "knative.dev/client/pkg/errors" + "knative.dev/client/pkg/util" + servingv1alpha1 "knative.dev/serving/pkg/apis/serving/v1alpha1" + "knative.dev/serving/pkg/client/clientset/versioned/scheme" + clientv1alpha1 "knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1" +) + +// KnServingClient to work with Serving v1alpha1 resources +type KnServingClient interface { + // Namespace in which this client is operating for + Namespace() string + + // GetDomainMapping + GetDomainMapping(ctx context.Context, name string) (*servingv1alpha1.DomainMapping, error) + + // CreateDomainMapping + CreateDomainMapping(ctx context.Context, domainMapping *servingv1alpha1.DomainMapping) error + + // UpdateDomainMapping + UpdateDomainMapping(ctx context.Context, domainMapping *servingv1alpha1.DomainMapping) error + + // DeleteDomainMapping + DeleteDomainMapping(ctx context.Context, name string) error + + // ListDomainMappings + ListDomainMappings(ctx context.Context) (*servingv1alpha1.DomainMappingList, error) +} + +type knServingClient struct { + client clientv1alpha1.ServingV1alpha1Interface + namespace string +} + +// NewKnServingClient create a new client facade for the provided namespace +func NewKnServingClient(client clientv1alpha1.ServingV1alpha1Interface, namespace string) KnServingClient { + return &knServingClient{ + client: client, + namespace: namespace, + } +} + +// Namespace in which this client is operating for +func (cl *knServingClient) Namespace() string { + return cl.namespace +} + +// GetDomainMapping gets DomainMapping by name +func (cl *knServingClient) GetDomainMapping(ctx context.Context, name string) (*servingv1alpha1.DomainMapping, error) { + dm, err := cl.client.DomainMappings(cl.namespace).Get(ctx, name, v1.GetOptions{}) + if err != nil { + return nil, knerrors.GetError(err) + } + err = updateServingGvk(dm) + if err != nil { + return nil, err + } + return dm, nil +} + +// CreateDomainMapping creates provided DomainMapping +func (cl *knServingClient) CreateDomainMapping(ctx context.Context, domainMapping *servingv1alpha1.DomainMapping) error { + _, err := cl.client.DomainMappings(cl.namespace).Create(ctx, domainMapping, v1.CreateOptions{}) + if err != nil { + return knerrors.GetError(err) + } + return updateServingGvk(domainMapping) +} + +// UpdateDomainMapping updates provided DomainMapping +func (cl *knServingClient) UpdateDomainMapping(ctx context.Context, domainMapping *servingv1alpha1.DomainMapping) error { + _, err := cl.client.DomainMappings(cl.namespace).Update(ctx, domainMapping, v1.UpdateOptions{}) + if err != nil { + return knerrors.GetError(err) + } + return updateServingGvk(domainMapping) +} + +// DeleteDomainMapping deletes DomainMapping by name +func (cl *knServingClient) DeleteDomainMapping(ctx context.Context, name string) error { + err := cl.client.DomainMappings(cl.namespace).Delete(ctx, name, v1.DeleteOptions{}) + if err != nil { + return knerrors.GetError(err) + } + return nil +} + +// ListDomainMappings lists all DomainMappings +func (cl *knServingClient) ListDomainMappings(ctx context.Context) (*servingv1alpha1.DomainMappingList, error) { + domainMappingList, err := cl.client.DomainMappings(cl.namespace).List(ctx, v1.ListOptions{}) + if err != nil { + return nil, knerrors.GetError(err) + } + dmListNew := domainMappingList.DeepCopy() + err = updateServingGvk(dmListNew) + if err != nil { + return nil, err + } + dmListNew.Items = make([]servingv1alpha1.DomainMapping, len(domainMappingList.Items)) + for idx, domainMapping := range domainMappingList.Items { + domainMappingClone := domainMapping.DeepCopy() + err := updateServingGvk(domainMappingClone) + if err != nil { + return nil, err + } + dmListNew.Items[idx] = *domainMappingClone + } + return dmListNew, nil +} + +func updateServingGvk(obj runtime.Object) error { + return util.UpdateGroupVersionKindWithScheme(obj, servingv1alpha1.SchemeGroupVersion, scheme.Scheme) +} + +// DomainMappingBuilder is for building the domainMapping +type DomainMappingBuilder struct { + domainMapping *servingv1alpha1.DomainMapping +} + +// NewDomainMappingBuilder for building domainMapping object +func NewDomainMappingBuilder(name string) *DomainMappingBuilder { + return &DomainMappingBuilder{domainMapping: &servingv1alpha1.DomainMapping{ + ObjectMeta: v1.ObjectMeta{ + Name: name, + }, + }} +} + +// Namespace for domainMapping builder +func (b *DomainMappingBuilder) Namespace(ns string) *DomainMappingBuilder { + b.domainMapping.Namespace = ns + return b +} + +// Reference for domainMapping builder +func (b *DomainMappingBuilder) Reference(reference duckv1.KReference) *DomainMappingBuilder { + b.domainMapping.Spec.Ref = reference + return b +} + +// Build to return an instance of domainMapping object +func (b *DomainMappingBuilder) Build() *servingv1alpha1.DomainMapping { + return b.domainMapping +} diff --git a/vendor/knative.dev/client/pkg/serving/v1alpha1/client_mock.go b/vendor/knative.dev/client/pkg/serving/v1alpha1/client_mock.go new file mode 100644 index 000000000..036e3d1cd --- /dev/null +++ b/vendor/knative.dev/client/pkg/serving/v1alpha1/client_mock.go @@ -0,0 +1,116 @@ +// Copyright © 2021 The Knative 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. + +package v1alpha1 + +import ( + "context" + "testing" + + "knative.dev/client/pkg/util/mock" + servingv1alpha1 "knative.dev/serving/pkg/apis/serving/v1alpha1" +) + +// MockKnServingClient client mock +type MockKnServingClient struct { + t *testing.T + recorder *ServingRecorder +} + +// NewMockKnServiceClient returns a new mock instance which you need to record for +func NewMockKnServiceClient(t *testing.T, ns ...string) *MockKnServingClient { + namespace := "default" + if len(ns) > 0 { + namespace = ns[0] + } + return &MockKnServingClient{ + t: t, + recorder: &ServingRecorder{mock.NewRecorder(t, namespace)}, + } +} + +// ServingRecorder recorder for service +type ServingRecorder struct { + r *mock.Recorder +} + +// Recorder returns the record instance +func (c *MockKnServingClient) Recorder() *ServingRecorder { + return c.recorder +} + +// Validate checks that every recorded method has been called +func (sr *ServingRecorder) Validate() { + sr.r.CheckThatAllRecordedMethodsHaveBeenCalled() +} + +// Namespace of this client +func (c *MockKnServingClient) Namespace() string { + return c.recorder.r.Namespace() +} + +// GetDomainMapping mock function recorder +func (sr *ServingRecorder) GetDomainMapping(name interface{}, domainMapping *servingv1alpha1.DomainMapping, err error) { + sr.r.Add("GetDomainMapping", []interface{}{name}, []interface{}{domainMapping, err}) +} + +// GetDomainMapping mock function +func (c *MockKnServingClient) GetDomainMapping(ctx context.Context, name string) (*servingv1alpha1.DomainMapping, error) { + call := c.recorder.r.VerifyCall("GetDomainMapping", name) + return call.Result[0].(*servingv1alpha1.DomainMapping), mock.ErrorOrNil(call.Result[1]) +} + +// CreateDomainMapping recorder function +func (sr *ServingRecorder) CreateDomainMapping(domainMapping interface{}, err error) { + sr.r.Add("CreateDomainMapping", []interface{}{domainMapping}, []interface{}{err}) +} + +// CreateDomainMapping mock function +func (c *MockKnServingClient) CreateDomainMapping(ctx context.Context, domainMapping *servingv1alpha1.DomainMapping) error { + call := c.recorder.r.VerifyCall("CreateDomainMapping", domainMapping) + return mock.ErrorOrNil(call.Result[0]) +} + +// UpdateDomainMapping recorder function +func (sr *ServingRecorder) UpdateDomainMapping(domainMapping interface{}, err error) { + sr.r.Add("UpdateDomainMapping", []interface{}{domainMapping}, []interface{}{err}) +} + +// UpdateDomainMapping mock function +func (c *MockKnServingClient) UpdateDomainMapping(ctx context.Context, domainMapping *servingv1alpha1.DomainMapping) error { + call := c.recorder.r.VerifyCall("UpdateDomainMapping", domainMapping) + return mock.ErrorOrNil(call.Result[0]) +} + +// DeleteDomainMapping recorder function +func (sr *ServingRecorder) DeleteDomainMapping(name string, err error) { + sr.r.Add("DeleteDomainMapping", []interface{}{name}, []interface{}{err}) +} + +// DeleteDomainMapping mock function +func (c *MockKnServingClient) DeleteDomainMapping(ctx context.Context, name string) error { + call := c.recorder.r.VerifyCall("DeleteDomainMapping", name) + return mock.ErrorOrNil(call.Result[0]) +} + +// ListDomainMappings recorder function +func (sr *ServingRecorder) ListDomainMappings(domainMappingList *servingv1alpha1.DomainMappingList, err error) { + sr.r.Add("ListDomainMappings", nil, []interface{}{domainMappingList, err}) +} + +// ListDomainMappings mock function +func (c *MockKnServingClient) ListDomainMappings(ctx context.Context) (*servingv1alpha1.DomainMappingList, error) { + call := c.recorder.r.VerifyCall("ListDomainMappings") + return call.Result[0].(*servingv1alpha1.DomainMappingList), mock.ErrorOrNil(call.Result[1]) +} diff --git a/vendor/knative.dev/client/pkg/wait/poll_watcher.go b/vendor/knative.dev/client/pkg/wait/poll_watcher.go index bb5348fcb..86189c219 100644 --- a/vendor/knative.dev/client/pkg/wait/poll_watcher.go +++ b/vendor/knative.dev/client/pkg/wait/poll_watcher.go @@ -27,6 +27,8 @@ import ( "k8s.io/client-go/rest" ) +const pollInterval = time.Second + // PollInterval determines when you should poll. Useful to mock out, or for // replacing with exponential backoff later. type PollInterval interface { @@ -76,7 +78,7 @@ func NewWatcher(ctx context.Context, watchFunc watchF, c rest.Interface, ns stri } polling := &pollingWatcher{ c, ns, resource, name, timeout, make(chan bool), make(chan watch.Event), &sync.WaitGroup{}, - newTickerPollInterval(time.Second), nativePoll(ctx, c, ns, resource, name)} + newTickerPollInterval(pollInterval), nativePoll(ctx, c, ns, resource, name)} polling.start() return polling, nil } diff --git a/vendor/knative.dev/client/pkg/wait/wait_for_ready.go b/vendor/knative.dev/client/pkg/wait/wait_for_ready.go index 862185ed3..ba6a27c10 100644 --- a/vendor/knative.dev/client/pkg/wait/wait_for_ready.go +++ b/vendor/knative.dev/client/pkg/wait/wait_for_ready.go @@ -112,20 +112,22 @@ func NoopMessageCallback() MessageCallback { func (w *waitForReadyConfig) Wait(ctx context.Context, watcher watch.Interface, name string, options Options, msgCallback MessageCallback) (error, time.Duration) { timeout := options.timeoutWithDefault() - floatingTimeout := timeout + timeoutTimer := time.NewTimer(timeout) + defer timeoutTimer.Stop() for { start := time.Now() - retry, timeoutReached, err := w.waitForReadyCondition(ctx, watcher, start, floatingTimeout, options.errorWindowWithDefault(), msgCallback) + retry, timeoutReached, err := w.waitForReadyCondition(ctx, watcher, start, timeoutTimer, options.errorWindowWithDefault(), msgCallback) + if err != nil { return err, time.Since(start) } - floatingTimeout = floatingTimeout - time.Since(start) - if timeoutReached || floatingTimeout < 0 { + if timeoutReached { return fmt.Errorf("timeout: %s '%s' not ready after %d seconds", w.kind, name, int(timeout/time.Second)), time.Since(start) } if retry { - // restart loop + // sleep to prevent CPU pegging and restart the loop + time.Sleep(pollInterval) continue } return nil, time.Since(start) @@ -138,7 +140,9 @@ func (w *waitForReadyConfig) Wait(ctx context.Context, watcher watch.Interface, // An errorWindow can be specified which takes into account of intermediate "false" ready conditions. So before returning // an error, this methods waits for the errorWindow duration and if an "True" or "Unknown" event arrives in the meantime // for the "Ready" condition, then the method continues to wait. -func (w *waitForReadyConfig) waitForReadyCondition(ctx context.Context, watcher watch.Interface, start time.Time, timeout time.Duration, errorWindow time.Duration, msgCallback MessageCallback) (retry bool, timeoutReached bool, err error) { +func (w *waitForReadyConfig) waitForReadyCondition( + ctx context.Context, watcher watch.Interface, start time.Time, timeoutTimer *time.Timer, errorWindow time.Duration, msgCallback MessageCallback, +) (retry bool, timeoutReached bool, err error) { // channel used to transport the error that has been received errChan := make(chan error) @@ -157,7 +161,7 @@ func (w *waitForReadyConfig) waitForReadyCondition(ctx context.Context, watcher select { case <-ctx.Done(): return false, false, ctx.Err() - case <-time.After(timeout): + case <-timeoutTimer.C: // We reached a timeout without receiving a "Ready" == "True" event return false, true, nil case err = <-errChan: @@ -166,7 +170,8 @@ func (w *waitForReadyConfig) waitForReadyCondition(ctx context.Context, watcher return false, false, err case event, ok := <-watcher.ResultChan(): if !ok || event.Object == nil { - return true, false, nil + // retry only if the channel is still open + return ok, false, nil } // Check whether resource is in sync already (meta.generation == status.observedGeneration) @@ -239,7 +244,6 @@ func (w *waitForEvent) Wait(ctx context.Context, watcher watch.Interface, name s timeout := options.timeoutWithDefault() start := time.Now() // channel used to transport the error - errChan := make(chan error) timer := time.NewTimer(timeout) defer timer.Stop() for { @@ -248,8 +252,6 @@ func (w *waitForEvent) Wait(ctx context.Context, watcher watch.Interface, name s return ctx.Err(), time.Since(start) case <-timer.C: return fmt.Errorf("timeout: %s '%s' not ready after %d seconds", w.kind, name, int(timeout/time.Second)), time.Since(start) - case err := <-errChan: - return err, time.Since(start) case event := <-watcher.ResultChan(): if w.eventDone(&event) { return nil, time.Since(start) diff --git a/vendor/knative.dev/eventing-kafka/pkg/common/constants/constants.go b/vendor/knative.dev/eventing-kafka/pkg/common/constants/constants.go index 43c741803..9d0d53992 100644 --- a/vendor/knative.dev/eventing-kafka/pkg/common/constants/constants.go +++ b/vendor/knative.dev/eventing-kafka/pkg/common/constants/constants.go @@ -34,4 +34,8 @@ const ( // The name of the keys in the Data section of the eventing-kafka configmap that holds Sarama and Eventing-Kafka configuration YAML SaramaSettingsConfigKey = "sarama" + + // Default values for the cloud events connection arguments, if not overridden + DefaultMaxIdleConns = 1000 + DefaultMaxIdleConnsPerHost = 100 ) diff --git a/vendor/knative.dev/serving/pkg/apis/autoscaling/annotation_validation.go b/vendor/knative.dev/serving/pkg/apis/autoscaling/annotation_validation.go index 805047e24..3fdf2bb6a 100644 --- a/vendor/knative.dev/serving/pkg/apis/autoscaling/annotation_validation.go +++ b/vendor/knative.dev/serving/pkg/apis/autoscaling/annotation_validation.go @@ -52,7 +52,7 @@ func getIntGE0(m map[string]string, k string) (int32, *apis.FieldError) { // ValidateAnnotations verifies the autoscaling annotations. func ValidateAnnotations(ctx context.Context, config *autoscalerconfig.Config, anns map[string]string) *apis.FieldError { return validateClass(anns). - Also(validateMinMaxScale(ctx, config, anns)). + Also(validateMinMaxScale(config, anns)). Also(validateFloats(anns)). Also(validateWindow(anns)). Also(validateLastPodRetention(anns)). @@ -173,7 +173,7 @@ func validateWindow(annotations map[string]string) *apis.FieldError { return nil } -func validateMinMaxScale(ctx context.Context, config *autoscalerconfig.Config, annotations map[string]string) *apis.FieldError { +func validateMinMaxScale(config *autoscalerconfig.Config, annotations map[string]string) *apis.FieldError { min, errs := getIntGE0(annotations, MinScaleAnnotationKey) max, err := getIntGE0(annotations, MaxScaleAnnotationKey) errs = errs.Also(err) @@ -184,21 +184,30 @@ func validateMinMaxScale(ctx context.Context, config *autoscalerconfig.Config, a Paths: []string{MaxScaleAnnotationKey, MinScaleAnnotationKey}, }) } - _, exists := annotations[MaxScaleAnnotationKey] - // If max scale annotation is not set but default MaxScale is set, then max scale will not be unlimited. - if !apis.IsInCreate(ctx) || config.MaxScaleLimit == 0 || (!exists && config.MaxScale > 0) { - return errs + + if _, hasMaxScaleAnnotation := annotations[MaxScaleAnnotationKey]; hasMaxScaleAnnotation { + errs = errs.Also(validateMaxScaleWithinLimit(max, config.MaxScaleLimit)) + } + + return errs +} + +func validateMaxScaleWithinLimit(maxScale, maxScaleLimit int32) (errs *apis.FieldError) { + if maxScaleLimit == 0 { + return nil } - if max > config.MaxScaleLimit { - errs = errs.Also(apis.ErrOutOfBoundsValue( - max, 1, config.MaxScaleLimit, MaxScaleAnnotationKey)) + + if maxScale > maxScaleLimit { + errs = errs.Also(apis.ErrOutOfBoundsValue(maxScale, 1, maxScaleLimit, MaxScaleAnnotationKey)) } - if max == 0 { + + if maxScale == 0 { errs = errs.Also(&apis.FieldError{ - Message: fmt.Sprint("maxScale=0 (unlimited), must be less than ", config.MaxScaleLimit), + Message: fmt.Sprint("maxScale=0 (unlimited), must be less than ", maxScaleLimit), Paths: []string{MaxScaleAnnotationKey}, }) } + return errs } diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1/revision_lifecycle.go b/vendor/knative.dev/serving/pkg/apis/serving/v1/revision_lifecycle.go index 8335d5f5e..bc71421e4 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1/revision_lifecycle.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1/revision_lifecycle.go @@ -24,7 +24,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "knative.dev/pkg/apis" - av1alpha1 "knative.dev/serving/pkg/apis/autoscaling/v1alpha1" + autoscalingv1alpha1 "knative.dev/serving/pkg/apis/autoscaling/v1alpha1" "knative.dev/serving/pkg/apis/config" "knative.dev/serving/pkg/apis/serving" ) @@ -168,9 +168,9 @@ func (rs *RevisionStatus) PropagateDeploymentStatus(original *appsv1.DeploymentS } // PropagateAutoscalerStatus propagates autoscaler's status to the revision's status. -func (rs *RevisionStatus) PropagateAutoscalerStatus(ps *av1alpha1.PodAutoscalerStatus) { +func (rs *RevisionStatus) PropagateAutoscalerStatus(ps *autoscalingv1alpha1.PodAutoscalerStatus) { // Reflect the PA status in our own. - cond := ps.GetCondition(av1alpha1.PodAutoscalerConditionReady) + cond := ps.GetCondition(autoscalingv1alpha1.PodAutoscalerConditionReady) if cond == nil { rs.MarkActiveUnknown("Deploying", "") return diff --git a/vendor/knative.dev/serving/pkg/apis/serving/v1/revision_types.go b/vendor/knative.dev/serving/pkg/apis/serving/v1/revision_types.go index 8d401099c..1860bb5f7 100644 --- a/vendor/knative.dev/serving/pkg/apis/serving/v1/revision_types.go +++ b/vendor/knative.dev/serving/pkg/apis/serving/v1/revision_types.go @@ -157,6 +157,13 @@ type RevisionStatus struct { // ref: http://bit.ly/image-digests // +optional ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty"` + + // ActualReplicas reflects the amount of ready pods running this revision. + // +optional + ActualReplicas int32 `json:"actualReplicas,omitempty"` + // DesiredReplicas reflects the desired amount of pods running this revision. + // +optional + DesiredReplicas int32 `json:"desiredReplicas,omitempty"` } // ContainerStatus holds the information of container name and image digest value diff --git a/vendor/knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/doc.go b/vendor/knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/doc.go new file mode 100644 index 000000000..41e872fe9 --- /dev/null +++ b/vendor/knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2020 The Knative 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 client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/vendor/knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/domainmapping.go b/vendor/knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/domainmapping.go new file mode 100644 index 000000000..606935b69 --- /dev/null +++ b/vendor/knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/domainmapping.go @@ -0,0 +1,195 @@ +/* +Copyright 2020 The Knative 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 client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha1 "knative.dev/serving/pkg/apis/serving/v1alpha1" + scheme "knative.dev/serving/pkg/client/clientset/versioned/scheme" +) + +// DomainMappingsGetter has a method to return a DomainMappingInterface. +// A group's client should implement this interface. +type DomainMappingsGetter interface { + DomainMappings(namespace string) DomainMappingInterface +} + +// DomainMappingInterface has methods to work with DomainMapping resources. +type DomainMappingInterface interface { + Create(ctx context.Context, domainMapping *v1alpha1.DomainMapping, opts v1.CreateOptions) (*v1alpha1.DomainMapping, error) + Update(ctx context.Context, domainMapping *v1alpha1.DomainMapping, opts v1.UpdateOptions) (*v1alpha1.DomainMapping, error) + UpdateStatus(ctx context.Context, domainMapping *v1alpha1.DomainMapping, opts v1.UpdateOptions) (*v1alpha1.DomainMapping, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.DomainMapping, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.DomainMappingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.DomainMapping, err error) + DomainMappingExpansion +} + +// domainMappings implements DomainMappingInterface +type domainMappings struct { + client rest.Interface + ns string +} + +// newDomainMappings returns a DomainMappings +func newDomainMappings(c *ServingV1alpha1Client, namespace string) *domainMappings { + return &domainMappings{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the domainMapping, and returns the corresponding domainMapping object, and an error if there is any. +func (c *domainMappings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.DomainMapping, err error) { + result = &v1alpha1.DomainMapping{} + err = c.client.Get(). + Namespace(c.ns). + Resource("domainmappings"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DomainMappings that match those selectors. +func (c *domainMappings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.DomainMappingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.DomainMappingList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("domainmappings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested domainMappings. +func (c *domainMappings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("domainmappings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a domainMapping and creates it. Returns the server's representation of the domainMapping, and an error, if there is any. +func (c *domainMappings) Create(ctx context.Context, domainMapping *v1alpha1.DomainMapping, opts v1.CreateOptions) (result *v1alpha1.DomainMapping, err error) { + result = &v1alpha1.DomainMapping{} + err = c.client.Post(). + Namespace(c.ns). + Resource("domainmappings"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(domainMapping). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a domainMapping and updates it. Returns the server's representation of the domainMapping, and an error, if there is any. +func (c *domainMappings) Update(ctx context.Context, domainMapping *v1alpha1.DomainMapping, opts v1.UpdateOptions) (result *v1alpha1.DomainMapping, err error) { + result = &v1alpha1.DomainMapping{} + err = c.client.Put(). + Namespace(c.ns). + Resource("domainmappings"). + Name(domainMapping.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(domainMapping). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *domainMappings) UpdateStatus(ctx context.Context, domainMapping *v1alpha1.DomainMapping, opts v1.UpdateOptions) (result *v1alpha1.DomainMapping, err error) { + result = &v1alpha1.DomainMapping{} + err = c.client.Put(). + Namespace(c.ns). + Resource("domainmappings"). + Name(domainMapping.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(domainMapping). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the domainMapping and deletes it. Returns an error if one occurs. +func (c *domainMappings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("domainmappings"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *domainMappings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("domainmappings"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched domainMapping. +func (c *domainMappings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.DomainMapping, err error) { + result = &v1alpha1.DomainMapping{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("domainmappings"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/generated_expansion.go b/vendor/knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/generated_expansion.go new file mode 100644 index 000000000..ce84dcec6 --- /dev/null +++ b/vendor/knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright 2020 The Knative 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 client-gen. DO NOT EDIT. + +package v1alpha1 + +type DomainMappingExpansion interface{} diff --git a/vendor/knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/serving_client.go b/vendor/knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/serving_client.go new file mode 100644 index 000000000..1a4aa0ff9 --- /dev/null +++ b/vendor/knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/serving_client.go @@ -0,0 +1,89 @@ +/* +Copyright 2020 The Knative 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 client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + rest "k8s.io/client-go/rest" + v1alpha1 "knative.dev/serving/pkg/apis/serving/v1alpha1" + "knative.dev/serving/pkg/client/clientset/versioned/scheme" +) + +type ServingV1alpha1Interface interface { + RESTClient() rest.Interface + DomainMappingsGetter +} + +// ServingV1alpha1Client is used to interact with features provided by the serving.knative.dev group. +type ServingV1alpha1Client struct { + restClient rest.Interface +} + +func (c *ServingV1alpha1Client) DomainMappings(namespace string) DomainMappingInterface { + return newDomainMappings(c, namespace) +} + +// NewForConfig creates a new ServingV1alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*ServingV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &ServingV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new ServingV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ServingV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ServingV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *ServingV1alpha1Client { + return &ServingV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ServingV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/modules.txt b/vendor/modules.txt index cbde708f4..d861ea53a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -705,7 +705,7 @@ k8s.io/utils/buffer k8s.io/utils/integer k8s.io/utils/pointer k8s.io/utils/trace -# knative.dev/client v0.21.1-0.20210330082320-885f2a9bc996 +# knative.dev/client v0.22.0 ## explicit knative.dev/client/lib/test knative.dev/client/pkg/apis/client @@ -722,11 +722,12 @@ knative.dev/client/pkg/messaging/v1beta1 knative.dev/client/pkg/printers knative.dev/client/pkg/serving knative.dev/client/pkg/serving/v1 +knative.dev/client/pkg/serving/v1alpha1 knative.dev/client/pkg/sources/v1alpha2 knative.dev/client/pkg/util knative.dev/client/pkg/util/mock knative.dev/client/pkg/wait -# knative.dev/eventing v0.21.1-0.20210330142021-dca8b0acf039 +# knative.dev/eventing v0.22.0 knative.dev/eventing/pkg/apis/config knative.dev/eventing/pkg/apis/duck knative.dev/eventing/pkg/apis/duck/v1 @@ -753,7 +754,7 @@ knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1beta1 knative.dev/eventing/pkg/client/clientset/versioned/typed/messaging/v1beta1 knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1alpha2 knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1alpha2/fake -# knative.dev/eventing-kafka v0.21.1-0.20210330170621-ec5dc671a6a8 +# knative.dev/eventing-kafka v0.22.0 ## explicit knative.dev/eventing-kafka/pkg/apis/bindings knative.dev/eventing-kafka/pkg/apis/bindings/v1alpha1 @@ -771,11 +772,11 @@ knative.dev/eventing-kafka/pkg/common/constants # knative.dev/hack v0.0.0-20210325223819-b6ab329907d3 ## explicit knative.dev/hack -# knative.dev/networking v0.0.0-20210329132124-45fe1f5dd35e +# knative.dev/networking v0.0.0-20210331064822-999a7708876c knative.dev/networking/pkg knative.dev/networking/pkg/apis/networking knative.dev/networking/pkg/apis/networking/v1alpha1 -# knative.dev/pkg v0.0.0-20210330162221-808d62257db6 +# knative.dev/pkg v0.0.0-20210331065221-952fdd90dbb0 ## explicit knative.dev/pkg/apis knative.dev/pkg/apis/duck @@ -817,7 +818,7 @@ knative.dev/pkg/tracing/propagation knative.dev/pkg/tracing/propagation/tracecontextb3 knative.dev/pkg/tracker knative.dev/pkg/webhook/resourcesemantics -# knative.dev/serving v0.21.1-0.20210311225828-1583394c61cb +# knative.dev/serving v0.22.0 knative.dev/serving/pkg/apis/autoscaling knative.dev/serving/pkg/apis/autoscaling/v1alpha1 knative.dev/serving/pkg/apis/config @@ -829,6 +830,7 @@ knative.dev/serving/pkg/autoscaler/config/autoscalerconfig knative.dev/serving/pkg/client/clientset/versioned/scheme knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1 knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1/fake +knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1 knative.dev/serving/pkg/gc knative.dev/serving/pkg/networking knative.dev/serving/pkg/reconciler/route/config