-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <automation@knative.team>
- Loading branch information
1 parent
946f160
commit fbe3a3c
Showing
26 changed files
with
1,130 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
} | ||
) |
20 changes: 20 additions & 0 deletions
20
vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/doc.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
36 changes: 36 additions & 0 deletions
36
vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_conversion.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} |
24 changes: 24 additions & 0 deletions
24
vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_defaults.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) { | ||
} |
78 changes: 78 additions & 0 deletions
78
vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_lifecycle.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()) | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_types.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
37 changes: 37 additions & 0 deletions
37
vendor/knative.dev/eventing/pkg/apis/sinks/v1alpha1/job_sink_validation.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
Oops, something went wrong.