From fbe3a3ca8afbddfda52c30053a8e5ed6a2475d5a Mon Sep 17 00:00:00 2001 From: Knative Automation Date: Fri, 7 Jun 2024 01:50:26 +0000 Subject: [PATCH] upgrade to latest dependencies bumping knative.dev/eventing 3ee2400...9d11598: > 9d11598 fix: eventing clusterrole has correct knsubscribe permissions (# 7943) > f9156c8 JobSink: don't start informers twice (# 7964) > bff65d2 Triggering long running background jobs when events occurs (# 7954) bumping knative.dev/serving bb51203...09b4cd3: > 09b4cd3 use cgr.dev/chainguard/static:latest which is nonroot (# 15310) > 30a77d1 Add affinity-rules feature to configmap config-deployment (# 15250) > 10b9152 Update net-gateway-api nightly (# 15307) > 19055d5 upgrade to latest dependencies (# 15306) > 3e53acc Run system-internal-tls tests only for kourier (# 15299) > 5a3aa98 Update net-kourier nightly (# 15303) > 4c71c49 Update net-istio nightly (# 15301) > d3f9a04 Update net-contour nightly (# 15302) > 57d2a26 Update net-gateway-api nightly (# 15300) bumping knative.dev/pkg fce44ea...58135c2: > 58135c2 Extra logging for leases (# 3049) Signed-off-by: Knative Automation --- go.mod | 6 +- go.sum | 12 +- .../eventing/pkg/apis/sinks/constants.go | 23 +++ .../eventing/pkg/apis/sinks/register.go | 33 +++ .../eventing/pkg/apis/sinks/v1alpha1/doc.go | 20 ++ .../sinks/v1alpha1/job_sink_conversion.go | 36 ++++ .../apis/sinks/v1alpha1/job_sink_defaults.go | 24 +++ .../apis/sinks/v1alpha1/job_sink_lifecycle.go | 78 +++++++ .../pkg/apis/sinks/v1alpha1/job_sink_types.go | 89 ++++++++ .../sinks/v1alpha1/job_sink_validation.go | 37 ++++ .../pkg/apis/sinks/v1alpha1/register.go | 53 +++++ .../sinks/v1alpha1/zz_generated.deepcopy.go | 144 +++++++++++++ .../knative.dev/eventing/pkg/auth/audience.go | 7 + .../client/clientset/versioned/clientset.go | 13 ++ .../versioned/fake/clientset_generated.go | 7 + .../clientset/versioned/fake/register.go | 2 + .../clientset/versioned/scheme/register.go | 2 + .../versioned/typed/sinks/v1alpha1/doc.go | 20 ++ .../typed/sinks/v1alpha1/fake/doc.go | 20 ++ .../typed/sinks/v1alpha1/fake/fake_jobsink.go | 141 +++++++++++++ .../sinks/v1alpha1/fake/fake_sinks_client.go | 40 ++++ .../sinks/v1alpha1/generated_expansion.go | 21 ++ .../versioned/typed/sinks/v1alpha1/jobsink.go | 195 ++++++++++++++++++ .../typed/sinks/v1alpha1/sinks_client.go | 107 ++++++++++ .../eventing/pkg/eventingtls/eventingtls.go | 2 + vendor/modules.txt | 10 +- 26 files changed, 1130 insertions(+), 12 deletions(-) create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/constants.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/register.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/doc.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_conversion.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_defaults.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_lifecycle.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_types.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_validation.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/register.go create mode 100644 vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/doc.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/doc.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_jobsink.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_sinks_client.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/generated_expansion.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/jobsink.go create mode 100644 vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/sinks_client.go diff --git a/go.mod b/go.mod index 25180e1fc..e9044b195 100644 --- a/go.mod +++ b/go.mod @@ -14,10 +14,10 @@ require ( k8s.io/api v0.29.2 k8s.io/apimachinery v0.29.2 k8s.io/client-go v0.29.2 - knative.dev/eventing v0.41.1-0.20240603163018-3ee2400189c1 + knative.dev/eventing v0.41.1-0.20240606162713-9d1159862f88 knative.dev/hack v0.0.0-20240529131459-3b6d6441e7ea - knative.dev/pkg v0.0.0-20240603145758-fce44ead15bd - knative.dev/serving v0.41.1-0.20240604061953-bb512037075c + knative.dev/pkg v0.0.0-20240604134003-58135c2c0694 + knative.dev/serving v0.41.1-0.20240606173551-09b4cd3ec097 ) require ( diff --git a/go.sum b/go.sum index 67dd5c828..bf3de8146 100644 --- a/go.sum +++ b/go.sum @@ -721,16 +721,16 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/eventing v0.41.1-0.20240603163018-3ee2400189c1 h1:udSFPuiXYxyRErU4hs7EJ2G6MmR+OW1uKbniILcIkJQ= -knative.dev/eventing v0.41.1-0.20240603163018-3ee2400189c1/go.mod h1:FO0xttJnXLgKrAGdkEvEqL7hBpmnUKGu2wMqKUC4p78= +knative.dev/eventing v0.41.1-0.20240606162713-9d1159862f88 h1:dl+J/3zOsVmPvUzp+nO2HG16K+xqvHqxRBVBTtcDq1Q= +knative.dev/eventing v0.41.1-0.20240606162713-9d1159862f88/go.mod h1:FO0xttJnXLgKrAGdkEvEqL7hBpmnUKGu2wMqKUC4p78= knative.dev/hack v0.0.0-20240529131459-3b6d6441e7ea h1:iWW6SNMrVd2hI5Y+ltKIEzXVedoQLL86b23dS5fkvXs= knative.dev/hack v0.0.0-20240529131459-3b6d6441e7ea/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= knative.dev/networking v0.0.0-20240603133819-41aa2087242d h1:B0psbCJrgnQLE8fibEga8NHE04Ay6L8CctdG4a+1CaY= knative.dev/networking v0.0.0-20240603133819-41aa2087242d/go.mod h1:WS5A291Vy2unZ1L54ZSKBkz/gVzVmIy15cCcdA6PRN4= -knative.dev/pkg v0.0.0-20240603145758-fce44ead15bd h1:SxwfJkmXwxl2PT5xZjtKKHO7URgHuigOoyzelaIGb2g= -knative.dev/pkg v0.0.0-20240603145758-fce44ead15bd/go.mod h1:E5OxJHFsQiW7pL0lVJ02XEVm2QUc0ZVdSUHiarUJHrU= -knative.dev/serving v0.41.1-0.20240604061953-bb512037075c h1:22POMSdeS1m9zn3Zo6X9gu6J8qRMbZHXgz4uVXhXVTg= -knative.dev/serving v0.41.1-0.20240604061953-bb512037075c/go.mod h1:ASoO3laJpfhnxe5ofk9SOK6Pg/rZ8JWwRilmvg0RxMA= +knative.dev/pkg v0.0.0-20240604134003-58135c2c0694 h1:trbVXm0WFXxxjcuSCKrYHKQwRQCuDrE8T5+yqXAI1NA= +knative.dev/pkg v0.0.0-20240604134003-58135c2c0694/go.mod h1:E5OxJHFsQiW7pL0lVJ02XEVm2QUc0ZVdSUHiarUJHrU= +knative.dev/serving v0.41.1-0.20240606173551-09b4cd3ec097 h1:QMgemyOgb1GQJ/HS0ABNRmIj+AlFgbjCWUZVCuuWSig= +knative.dev/serving v0.41.1-0.20240606173551-09b4cd3ec097/go.mod h1:2HcdNS0hQKfa5Y1hPdqoxLNaOQAP6OXSrRFUuceUOJ8= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/constants.go b/vendor/knative.dev/eventing/pkg/apis/sinks/constants.go new file mode 100644 index 000000000..20aff4446 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/constants.go @@ -0,0 +1,23 @@ +/* +Copyright 2024 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 sinks + +const ( + JobSinkJobsLabelSelector = "sinks.knative.dev/job-sink=true" + JobSinkNameLabel = "sinks.knative.dev/job-sink-name" + JobSinkIDLabel = "sinks.knative.dev/job-sink-id" +) diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/register.go b/vendor/knative.dev/eventing/pkg/apis/sinks/register.go new file mode 100644 index 000000000..b37303c50 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/register.go @@ -0,0 +1,33 @@ +/* +Copyright 2024 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 sinks + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" +) + +const ( + GroupName = "sinks.knative.dev" +) + +var ( + // JobSinkResource respresents a Knative Eventing sink JobSink + JobSinkResource = schema.GroupResource{ + Group: GroupName, + Resource: "jobsinks", + } +) diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/doc.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/doc.go new file mode 100644 index 000000000..23def349d --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2024 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 contains API Schema definitions for the sources v1alpha1 API group. +// +k8s:deepcopy-gen=package +// +groupName=sinks.knative.dev +package v1alpha1 diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_conversion.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_conversion.go new file mode 100644 index 000000000..3944fd171 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_conversion.go @@ -0,0 +1,36 @@ +/* +Copyright 2024 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" + "fmt" + + "knative.dev/pkg/apis" +) + +// ConvertTo implements apis.Convertible +// Converts source from v1alpha1.JobSink into a higher version. +func (sink *JobSink) ConvertTo(ctx context.Context, obj apis.Convertible) error { + return fmt.Errorf("v1alpha1 is the highest known version, got: %T", sink) +} + +// ConvertFrom implements apis.Convertible +// Converts source from a higher version into v1beta2.JobSink +func (sink *JobSink) ConvertFrom(ctx context.Context, obj apis.Convertible) error { + return fmt.Errorf("v1alpha1 is the highest known version, got: %T", sink) +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_defaults.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_defaults.go new file mode 100644 index 000000000..13f62e868 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_defaults.go @@ -0,0 +1,24 @@ +/* +Copyright 2024 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" +) + +func (sink *JobSink) SetDefaults(ctx context.Context) { +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_lifecycle.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_lifecycle.go new file mode 100644 index 000000000..b0cdea216 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_lifecycle.go @@ -0,0 +1,78 @@ +/* +Copyright 2024 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 ( + "fmt" + + "k8s.io/apimachinery/pkg/runtime/schema" + "knative.dev/pkg/apis" + + "knative.dev/eventing/pkg/apis/sinks" +) + +const ( + // JobSinkConditionReady has status True when the JobSink is ready to send events. + JobSinkConditionReady = apis.ConditionReady + + JobSinkConditionAddressable apis.ConditionType = "Addressable" +) + +var JobSinkCondSet = apis.NewLivingConditionSet( + JobSinkConditionAddressable, +) + +// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface. +func (*JobSink) GetConditionSet() apis.ConditionSet { + return JobSinkCondSet +} + +// GetUntypedSpec returns the spec of the JobSink. +func (sink *JobSink) GetUntypedSpec() interface{} { + return sink.Spec +} + +// GetGroupVersionKind returns the GroupVersionKind. +func (sink *JobSink) GetGroupVersionKind() schema.GroupVersionKind { + return SchemeGroupVersion.WithKind("JobSink") +} + +// GetCondition returns the condition currently associated with the given type, or nil. +func (s *JobSinkStatus) GetCondition(t apis.ConditionType) *apis.Condition { + return JobSinkCondSet.Manage(s).GetCondition(t) +} + +// GetTopLevelCondition returns the top level Condition. +func (ps *JobSinkStatus) GetTopLevelCondition() *apis.Condition { + return JobSinkCondSet.Manage(ps).GetTopLevelCondition() +} + +// IsReady returns true if the resource is ready overall. +func (s *JobSinkStatus) IsReady() bool { + return JobSinkCondSet.Manage(s).IsHappy() +} + +// InitializeConditions sets relevant unset conditions to Unknown state. +func (s *JobSinkStatus) InitializeConditions() { + JobSinkCondSet.Manage(s).InitializeConditions() +} + +func (e *JobSink) SetJobStatusSelector() { + if e.Spec.Job != nil { + e.Status.JobStatus.Selector = fmt.Sprintf("%s=%s", sinks.JobSinkNameLabel, e.GetName()) + } +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_types.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_types.go new file mode 100644 index 000000000..501dfdf65 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_types.go @@ -0,0 +1,89 @@ +/* +Copyright 2024 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 ( + batchv1 "k8s.io/api/batch/v1" + "knative.dev/pkg/apis" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + duckv1 "knative.dev/pkg/apis/duck/v1" + "knative.dev/pkg/kmeta" +) + +// +genclient +// +genreconciler +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:defaulter-gen=true + +// JobSink is the Schema for the JobSink API. +type JobSink struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec JobSinkSpec `json:"spec,omitempty"` + Status JobSinkStatus `json:"status,omitempty"` +} + +// Check the interfaces that JobSink should be implementing. +var ( + _ runtime.Object = (*JobSink)(nil) + _ kmeta.OwnerRefable = (*JobSink)(nil) + _ apis.Validatable = (*JobSink)(nil) + _ apis.Defaultable = (*JobSink)(nil) + _ apis.HasSpec = (*JobSink)(nil) + _ duckv1.KRShaped = (*JobSink)(nil) +) + +// JobSinkSpec defines the desired state of the JobSink. +type JobSinkSpec struct { + // Job to run when an event occur. + // +optional + Job *batchv1.Job `json:"job,omitempty"` +} + +// JobSinkStatus defines the observed state of JobSink. +type JobSinkStatus struct { + duckv1.Status `json:",inline"` + + // AddressStatus is the part where the JobSink fulfills the Addressable contract. + // It exposes the endpoint as an URI to get events delivered. + // +optional + duckv1.AddressStatus `json:",inline"` + + // +optional + JobStatus JobStatus `json:"job,omitempty"` +} + +type JobStatus struct { + Selector string `json:"selector,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// JobSinkList contains a list of JobSink. +type JobSinkList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []JobSink `json:"items"` +} + +// GetStatus retrieves the status of the JobSink. Implements the KRShaped interface. +func (sink *JobSink) GetStatus() *duckv1.Status { + return &sink.Status.Status +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_validation.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_validation.go new file mode 100644 index 000000000..0fe178dc6 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_validation.go @@ -0,0 +1,37 @@ +/* +Copyright 2024 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" + + "knative.dev/pkg/apis" +) + +func (sink *JobSink) Validate(ctx context.Context) *apis.FieldError { + return sink.Spec.Validate(ctx).ViaField("spec") +} + +func (sink *JobSinkSpec) Validate(ctx context.Context) *apis.FieldError { + var errs *apis.FieldError + + if sink.Job == nil { + return errs.Also(apis.ErrMissingOneOf("job")) + } + + return errs +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/register.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/register.go new file mode 100644 index 000000000..827ebc28b --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/register.go @@ -0,0 +1,53 @@ +/* +Copyright 2024 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 ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + + "knative.dev/eventing/pkg/apis/sinks" +) + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: sinks.GroupName, Version: "v1alpha1"} + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// Adds the list of known types to Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &JobSink{}, + &JobSinkList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 000000000..8aefd015f --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,144 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +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. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/api/batch/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobSink) DeepCopyInto(out *JobSink) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSink. +func (in *JobSink) DeepCopy() *JobSink { + if in == nil { + return nil + } + out := new(JobSink) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobSink) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobSinkList) DeepCopyInto(out *JobSinkList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]JobSink, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSinkList. +func (in *JobSinkList) DeepCopy() *JobSinkList { + if in == nil { + return nil + } + out := new(JobSinkList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobSinkList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobSinkSpec) DeepCopyInto(out *JobSinkSpec) { + *out = *in + if in.Job != nil { + in, out := &in.Job, &out.Job + *out = new(v1.Job) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSinkSpec. +func (in *JobSinkSpec) DeepCopy() *JobSinkSpec { + if in == nil { + return nil + } + out := new(JobSinkSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobSinkStatus) DeepCopyInto(out *JobSinkStatus) { + *out = *in + in.Status.DeepCopyInto(&out.Status) + in.AddressStatus.DeepCopyInto(&out.AddressStatus) + out.JobStatus = in.JobStatus + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSinkStatus. +func (in *JobSinkStatus) DeepCopy() *JobSinkStatus { + if in == nil { + return nil + } + out := new(JobSinkStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobStatus) DeepCopyInto(out *JobStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobStatus. +func (in *JobStatus) DeepCopy() *JobStatus { + if in == nil { + return nil + } + out := new(JobStatus) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/knative.dev/eventing/pkg/auth/audience.go b/vendor/knative.dev/eventing/pkg/auth/audience.go index 2147ff0f6..352418650 100644 --- a/vendor/knative.dev/eventing/pkg/auth/audience.go +++ b/vendor/knative.dev/eventing/pkg/auth/audience.go @@ -30,3 +30,10 @@ func GetAudience(gvk schema.GroupVersionKind, objectMeta metav1.ObjectMeta) stri return strings.ToLower(aud) } + +// GetAudienceDirect returns the audience string for the given object in the format /// +func GetAudienceDirect(gvk schema.GroupVersionKind, ns, name string) string { + aud := fmt.Sprintf("%s/%s/%s/%s", gvk.Group, gvk.Kind, ns, name) + + return strings.ToLower(aud) +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/clientset.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/clientset.go index 19f04e8bf..169fc4b74 100644 --- a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/clientset.go +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/clientset.go @@ -31,6 +31,7 @@ import ( eventingv1beta3 "knative.dev/eventing/pkg/client/clientset/versioned/typed/eventing/v1beta3" flowsv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/flows/v1" messagingv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/messaging/v1" + sinksv1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1" sourcesv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1" sourcesv1beta2 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2" ) @@ -43,6 +44,7 @@ type Interface interface { EventingV1() eventingv1.EventingV1Interface FlowsV1() flowsv1.FlowsV1Interface MessagingV1() messagingv1.MessagingV1Interface + SinksV1alpha1() sinksv1alpha1.SinksV1alpha1Interface SourcesV1beta2() sourcesv1beta2.SourcesV1beta2Interface SourcesV1() sourcesv1.SourcesV1Interface } @@ -56,6 +58,7 @@ type Clientset struct { eventingV1 *eventingv1.EventingV1Client flowsV1 *flowsv1.FlowsV1Client messagingV1 *messagingv1.MessagingV1Client + sinksV1alpha1 *sinksv1alpha1.SinksV1alpha1Client sourcesV1beta2 *sourcesv1beta2.SourcesV1beta2Client sourcesV1 *sourcesv1.SourcesV1Client } @@ -90,6 +93,11 @@ func (c *Clientset) MessagingV1() messagingv1.MessagingV1Interface { return c.messagingV1 } +// SinksV1alpha1 retrieves the SinksV1alpha1Client +func (c *Clientset) SinksV1alpha1() sinksv1alpha1.SinksV1alpha1Interface { + return c.sinksV1alpha1 +} + // SourcesV1beta2 retrieves the SourcesV1beta2Client func (c *Clientset) SourcesV1beta2() sourcesv1beta2.SourcesV1beta2Interface { return c.sourcesV1beta2 @@ -168,6 +176,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.sinksV1alpha1, err = sinksv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.sourcesV1beta2, err = sourcesv1beta2.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -203,6 +215,7 @@ func New(c rest.Interface) *Clientset { cs.eventingV1 = eventingv1.New(c) cs.flowsV1 = flowsv1.New(c) cs.messagingV1 = messagingv1.New(c) + cs.sinksV1alpha1 = sinksv1alpha1.New(c) cs.sourcesV1beta2 = sourcesv1beta2.New(c) cs.sourcesV1 = sourcesv1.New(c) diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/clientset_generated.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/clientset_generated.go index df4eaacca..8c17bc626 100644 --- a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -37,6 +37,8 @@ import ( fakeflowsv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/flows/v1/fake" messagingv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/messaging/v1" fakemessagingv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/messaging/v1/fake" + sinksv1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1" + fakesinksv1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake" sourcesv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1" fakesourcesv1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1/fake" sourcesv1beta2 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2" @@ -123,6 +125,11 @@ func (c *Clientset) MessagingV1() messagingv1.MessagingV1Interface { return &fakemessagingv1.FakeMessagingV1{Fake: &c.Fake} } +// SinksV1alpha1 retrieves the SinksV1alpha1Client +func (c *Clientset) SinksV1alpha1() sinksv1alpha1.SinksV1alpha1Interface { + return &fakesinksv1alpha1.FakeSinksV1alpha1{Fake: &c.Fake} +} + // SourcesV1beta2 retrieves the SourcesV1beta2Client func (c *Clientset) SourcesV1beta2() sourcesv1beta2.SourcesV1beta2Interface { return &fakesourcesv1beta2.FakeSourcesV1beta2{Fake: &c.Fake} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/register.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/register.go index c9ce45387..fdd99cc38 100644 --- a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/register.go +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/fake/register.go @@ -30,6 +30,7 @@ import ( eventingv1beta3 "knative.dev/eventing/pkg/apis/eventing/v1beta3" flowsv1 "knative.dev/eventing/pkg/apis/flows/v1" messagingv1 "knative.dev/eventing/pkg/apis/messaging/v1" + sinksv1alpha1 "knative.dev/eventing/pkg/apis/sinks/v1alpha1" sourcesv1 "knative.dev/eventing/pkg/apis/sources/v1" sourcesv1beta2 "knative.dev/eventing/pkg/apis/sources/v1beta2" ) @@ -44,6 +45,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ eventingv1.AddToScheme, flowsv1.AddToScheme, messagingv1.AddToScheme, + sinksv1alpha1.AddToScheme, sourcesv1beta2.AddToScheme, sourcesv1.AddToScheme, } diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/scheme/register.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/scheme/register.go index bcfb2759d..447af7253 100644 --- a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/scheme/register.go +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/scheme/register.go @@ -30,6 +30,7 @@ import ( eventingv1beta3 "knative.dev/eventing/pkg/apis/eventing/v1beta3" flowsv1 "knative.dev/eventing/pkg/apis/flows/v1" messagingv1 "knative.dev/eventing/pkg/apis/messaging/v1" + sinksv1alpha1 "knative.dev/eventing/pkg/apis/sinks/v1alpha1" sourcesv1 "knative.dev/eventing/pkg/apis/sources/v1" sourcesv1beta2 "knative.dev/eventing/pkg/apis/sources/v1beta2" ) @@ -44,6 +45,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ eventingv1.AddToScheme, flowsv1.AddToScheme, messagingv1.AddToScheme, + sinksv1alpha1.AddToScheme, sourcesv1beta2.AddToScheme, sourcesv1.AddToScheme, } diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/doc.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/doc.go new file mode 100644 index 000000000..0b13fd8e0 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/doc.go @@ -0,0 +1,20 @@ +/* +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/doc.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/doc.go new file mode 100644 index 000000000..40528db3a --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/doc.go @@ -0,0 +1,20 @@ +/* +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_jobsink.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_jobsink.go new file mode 100644 index 000000000..596004b3a --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_jobsink.go @@ -0,0 +1,141 @@ +/* +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha1 "knative.dev/eventing/pkg/apis/sinks/v1alpha1" +) + +// FakeJobSinks implements JobSinkInterface +type FakeJobSinks struct { + Fake *FakeSinksV1alpha1 + ns string +} + +var jobsinksResource = v1alpha1.SchemeGroupVersion.WithResource("jobsinks") + +var jobsinksKind = v1alpha1.SchemeGroupVersion.WithKind("JobSink") + +// Get takes name of the jobSink, and returns the corresponding jobSink object, and an error if there is any. +func (c *FakeJobSinks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JobSink, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(jobsinksResource, c.ns, name), &v1alpha1.JobSink{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobSink), err +} + +// List takes label and field selectors, and returns the list of JobSinks that match those selectors. +func (c *FakeJobSinks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobSinkList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(jobsinksResource, jobsinksKind, c.ns, opts), &v1alpha1.JobSinkList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.JobSinkList{ListMeta: obj.(*v1alpha1.JobSinkList).ListMeta} + for _, item := range obj.(*v1alpha1.JobSinkList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested jobSinks. +func (c *FakeJobSinks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(jobsinksResource, c.ns, opts)) + +} + +// Create takes the representation of a jobSink and creates it. Returns the server's representation of the jobSink, and an error, if there is any. +func (c *FakeJobSinks) Create(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.CreateOptions) (result *v1alpha1.JobSink, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(jobsinksResource, c.ns, jobSink), &v1alpha1.JobSink{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobSink), err +} + +// Update takes the representation of a jobSink and updates it. Returns the server's representation of the jobSink, and an error, if there is any. +func (c *FakeJobSinks) Update(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.UpdateOptions) (result *v1alpha1.JobSink, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(jobsinksResource, c.ns, jobSink), &v1alpha1.JobSink{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobSink), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeJobSinks) UpdateStatus(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.UpdateOptions) (*v1alpha1.JobSink, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(jobsinksResource, "status", c.ns, jobSink), &v1alpha1.JobSink{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobSink), err +} + +// Delete takes name of the jobSink and deletes it. Returns an error if one occurs. +func (c *FakeJobSinks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(jobsinksResource, c.ns, name, opts), &v1alpha1.JobSink{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeJobSinks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(jobsinksResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.JobSinkList{}) + return err +} + +// Patch applies the patch and returns the patched jobSink. +func (c *FakeJobSinks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JobSink, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(jobsinksResource, c.ns, name, pt, data, subresources...), &v1alpha1.JobSink{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.JobSink), err +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_sinks_client.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_sinks_client.go new file mode 100644 index 000000000..f64a39a5c --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake/fake_sinks_client.go @@ -0,0 +1,40 @@ +/* +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1alpha1 "knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1" +) + +type FakeSinksV1alpha1 struct { + *testing.Fake +} + +func (c *FakeSinksV1alpha1) JobSinks(namespace string) v1alpha1.JobSinkInterface { + return &FakeJobSinks{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeSinksV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/generated_expansion.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/generated_expansion.go new file mode 100644 index 000000000..029b7bee8 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type JobSinkExpansion interface{} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/jobsink.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/jobsink.go new file mode 100644 index 000000000..71851300a --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/jobsink.go @@ -0,0 +1,195 @@ +/* +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. +*/ + +// 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/eventing/pkg/apis/sinks/v1alpha1" + scheme "knative.dev/eventing/pkg/client/clientset/versioned/scheme" +) + +// JobSinksGetter has a method to return a JobSinkInterface. +// A group's client should implement this interface. +type JobSinksGetter interface { + JobSinks(namespace string) JobSinkInterface +} + +// JobSinkInterface has methods to work with JobSink resources. +type JobSinkInterface interface { + Create(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.CreateOptions) (*v1alpha1.JobSink, error) + Update(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.UpdateOptions) (*v1alpha1.JobSink, error) + UpdateStatus(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.UpdateOptions) (*v1alpha1.JobSink, 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.JobSink, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.JobSinkList, 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.JobSink, err error) + JobSinkExpansion +} + +// jobSinks implements JobSinkInterface +type jobSinks struct { + client rest.Interface + ns string +} + +// newJobSinks returns a JobSinks +func newJobSinks(c *SinksV1alpha1Client, namespace string) *jobSinks { + return &jobSinks{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the jobSink, and returns the corresponding jobSink object, and an error if there is any. +func (c *jobSinks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JobSink, err error) { + result = &v1alpha1.JobSink{} + err = c.client.Get(). + Namespace(c.ns). + Resource("jobsinks"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of JobSinks that match those selectors. +func (c *jobSinks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.JobSinkList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.JobSinkList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("jobsinks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested jobSinks. +func (c *jobSinks) 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("jobsinks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a jobSink and creates it. Returns the server's representation of the jobSink, and an error, if there is any. +func (c *jobSinks) Create(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.CreateOptions) (result *v1alpha1.JobSink, err error) { + result = &v1alpha1.JobSink{} + err = c.client.Post(). + Namespace(c.ns). + Resource("jobsinks"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobSink). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a jobSink and updates it. Returns the server's representation of the jobSink, and an error, if there is any. +func (c *jobSinks) Update(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.UpdateOptions) (result *v1alpha1.JobSink, err error) { + result = &v1alpha1.JobSink{} + err = c.client.Put(). + Namespace(c.ns). + Resource("jobsinks"). + Name(jobSink.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobSink). + 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 *jobSinks) UpdateStatus(ctx context.Context, jobSink *v1alpha1.JobSink, opts v1.UpdateOptions) (result *v1alpha1.JobSink, err error) { + result = &v1alpha1.JobSink{} + err = c.client.Put(). + Namespace(c.ns). + Resource("jobsinks"). + Name(jobSink.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(jobSink). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the jobSink and deletes it. Returns an error if one occurs. +func (c *jobSinks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("jobsinks"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *jobSinks) 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("jobsinks"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched jobSink. +func (c *jobSinks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.JobSink, err error) { + result = &v1alpha1.JobSink{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("jobsinks"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/sinks_client.go b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/sinks_client.go new file mode 100644 index 000000000..2012a8f57 --- /dev/null +++ b/vendor/knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/sinks_client.go @@ -0,0 +1,107 @@ +/* +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "net/http" + + rest "k8s.io/client-go/rest" + v1alpha1 "knative.dev/eventing/pkg/apis/sinks/v1alpha1" + "knative.dev/eventing/pkg/client/clientset/versioned/scheme" +) + +type SinksV1alpha1Interface interface { + RESTClient() rest.Interface + JobSinksGetter +} + +// SinksV1alpha1Client is used to interact with features provided by the sinks.knative.dev group. +type SinksV1alpha1Client struct { + restClient rest.Interface +} + +func (c *SinksV1alpha1Client) JobSinks(namespace string) JobSinkInterface { + return newJobSinks(c, namespace) +} + +// NewForConfig creates a new SinksV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*SinksV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new SinksV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SinksV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &SinksV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new SinksV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *SinksV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new SinksV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *SinksV1alpha1Client { + return &SinksV1alpha1Client{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 *SinksV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/knative.dev/eventing/pkg/eventingtls/eventingtls.go b/vendor/knative.dev/eventing/pkg/eventingtls/eventingtls.go index 642c97b5b..718a744c1 100644 --- a/vendor/knative.dev/eventing/pkg/eventingtls/eventingtls.go +++ b/vendor/knative.dev/eventing/pkg/eventingtls/eventingtls.go @@ -51,6 +51,8 @@ const ( SecretCACert = "ca.crt" // IMCDispatcherServerTLSSecretName is the name of the tls secret for the imc dispatcher server IMCDispatcherServerTLSSecretName = "imc-dispatcher-server-tls" //nolint:gosec // This is not a hardcoded credential + // JobSinkDispatcherServerTLSSecretName is the name of the tls secret for the job sink dispatcher server + JobSinkDispatcherServerTLSSecretName = "job-sink-server-tls" //nolint:gosec // This is not a hardcoded credential // BrokerFilterServerTLSSecretName is the name of the tls secret for the broker filter server BrokerFilterServerTLSSecretName = "mt-broker-filter-server-tls" //nolint:gosec // This is not a hardcoded credential // BrokerIngressServerTLSSecretName is the name of the tls secret for the broker ingress server diff --git a/vendor/modules.txt b/vendor/modules.txt index f635d0bb7..02fbdae8d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -966,7 +966,7 @@ k8s.io/utils/pointer k8s.io/utils/ptr k8s.io/utils/strings/slices k8s.io/utils/trace -# knative.dev/eventing v0.41.1-0.20240603163018-3ee2400189c1 +# knative.dev/eventing v0.41.1-0.20240606162713-9d1159862f88 ## explicit; go 1.21 knative.dev/eventing/pkg/adapter/v2 knative.dev/eventing/pkg/adapter/v2/test @@ -986,6 +986,8 @@ knative.dev/eventing/pkg/apis/flows/v1 knative.dev/eventing/pkg/apis/messaging knative.dev/eventing/pkg/apis/messaging/config knative.dev/eventing/pkg/apis/messaging/v1 +knative.dev/eventing/pkg/apis/sinks +knative.dev/eventing/pkg/apis/sinks/v1alpha1 knative.dev/eventing/pkg/apis/sources knative.dev/eventing/pkg/apis/sources/config knative.dev/eventing/pkg/apis/sources/v1 @@ -1006,6 +1008,8 @@ knative.dev/eventing/pkg/client/clientset/versioned/typed/flows/v1 knative.dev/eventing/pkg/client/clientset/versioned/typed/flows/v1/fake knative.dev/eventing/pkg/client/clientset/versioned/typed/messaging/v1 knative.dev/eventing/pkg/client/clientset/versioned/typed/messaging/v1/fake +knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1 +knative.dev/eventing/pkg/client/clientset/versioned/typed/sinks/v1alpha1/fake knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1 knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1/fake knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2 @@ -1026,7 +1030,7 @@ knative.dev/hack knative.dev/networking/pkg/apis/networking knative.dev/networking/pkg/apis/networking/v1alpha1 knative.dev/networking/pkg/config -# knative.dev/pkg v0.0.0-20240603145758-fce44ead15bd +# knative.dev/pkg v0.0.0-20240604134003-58135c2c0694 ## explicit; go 1.21 knative.dev/pkg/apis knative.dev/pkg/apis/duck @@ -1090,7 +1094,7 @@ knative.dev/pkg/webhook/psbinding knative.dev/pkg/webhook/resourcesemantics knative.dev/pkg/webhook/resourcesemantics/defaulting knative.dev/pkg/webhook/resourcesemantics/validation -# knative.dev/serving v0.41.1-0.20240604061953-bb512037075c +# knative.dev/serving v0.41.1-0.20240606173551-09b4cd3ec097 ## explicit; go 1.21 knative.dev/serving/pkg/apis/autoscaling knative.dev/serving/pkg/apis/autoscaling/v1alpha1