Skip to content

Commit 7c56065

Browse files
upgrade to latest dependencies
bumping knative.dev/eventing 5ad7dab...7176ce6: > 7176ce6 Add IntegrationSink CRD (# 8304) Signed-off-by: Knative Automation <[email protected]>
1 parent c5e5285 commit 7c56065

15 files changed

+758
-4
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require (
2121
k8s.io/client-go v0.30.3
2222
k8s.io/code-generator v0.30.3
2323
knative.dev/caching v0.0.0-20241118131847-a38b40d8a39c
24-
knative.dev/eventing v0.43.1-0.20241121083601-5ad7dabebd01
24+
knative.dev/eventing v0.43.1-0.20241122140302-7176ce64501b
2525
knative.dev/hack v0.0.0-20241106013728-b7995315deb5
2626
knative.dev/pkg v0.0.0-20241118074447-a7fd9b10bb9f
2727
knative.dev/reconciler-test v0.0.0-20241106013737-0619dc3ecbcf

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -1393,8 +1393,8 @@ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1
13931393
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
13941394
knative.dev/caching v0.0.0-20241118131847-a38b40d8a39c h1:fxyQ00VbltLYz+MSZ1RPjzea2gfnH3Y2HDG7PqiwmQw=
13951395
knative.dev/caching v0.0.0-20241118131847-a38b40d8a39c/go.mod h1:xcxIBx5jKR4HANCbcN4If+uNU1Y76b/tn9eV1byvJKc=
1396-
knative.dev/eventing v0.43.1-0.20241121083601-5ad7dabebd01 h1:nmYdUuubc8X9kNEKxKebdXYouVLWAhQz7SKVS1CvK9M=
1397-
knative.dev/eventing v0.43.1-0.20241121083601-5ad7dabebd01/go.mod h1:RxMFtxk903ZoxyS140MPdLLePTzBdeaGkVmBTB52t04=
1396+
knative.dev/eventing v0.43.1-0.20241122140302-7176ce64501b h1:IFyPTZfWqudFzGd0tq5MHo50M+BKdWxK0sK4y+bR1/4=
1397+
knative.dev/eventing v0.43.1-0.20241122140302-7176ce64501b/go.mod h1:RxMFtxk903ZoxyS140MPdLLePTzBdeaGkVmBTB52t04=
13981398
knative.dev/hack v0.0.0-20241106013728-b7995315deb5 h1:CfU5+6B+ylBd7mSGpvRqpzZV8H5ZQLGUwVygFzbE+1o=
13991399
knative.dev/hack v0.0.0-20241106013728-b7995315deb5/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY=
14001400
knative.dev/networking v0.0.0-20241118075147-929a5d5f19d0 h1:3vj6wR95isnuqgjQzcclyrzaodv5Jvjc7xq4Bv0yde8=

vendor/knative.dev/eventing/pkg/apis/sinks/register.go

+6
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ var (
3333
Group: GroupName,
3434
Resource: "jobsinks",
3535
}
36+
37+
// IntegrationSinkResource respresents a Knative Eventing sink IntegrationSink
38+
IntegrationSinkResource = schema.GroupResource{
39+
Group: GroupName,
40+
Resource: "integrationsinks",
41+
}
3642
)
3743

3844
type Config struct {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
Copyright 2024 The Knative Authors
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import (
20+
"context"
21+
"fmt"
22+
23+
"knative.dev/pkg/apis"
24+
)
25+
26+
// ConvertTo implements apis.Convertible
27+
// Converts source from v1alpha1.IntegrationSink into a higher version.
28+
func (sink *IntegrationSink) ConvertTo(ctx context.Context, obj apis.Convertible) error {
29+
return fmt.Errorf("v1alpha1 is the highest known version, got: %T", sink)
30+
}
31+
32+
// ConvertFrom implements apis.Convertible
33+
// Converts source from a higher version into v1beta2.IntegrationSink
34+
func (sink *IntegrationSink) ConvertFrom(ctx context.Context, obj apis.Convertible) error {
35+
return fmt.Errorf("v1alpha1 is the highest known version, got: %T", sink)
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
Copyright 2020 The Knative Authors
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import "context"
20+
21+
func (sink *IntegrationSink) SetDefaults(ctx context.Context) {
22+
sink.Spec.SetDefaults(ctx)
23+
}
24+
25+
func (sink *IntegrationSinkSpec) SetDefaults(ctx context.Context) {
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/*
2+
Copyright 2020 The Knative Authors
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import (
20+
appsv1 "k8s.io/api/apps/v1"
21+
corev1 "k8s.io/api/core/v1"
22+
"knative.dev/pkg/apis"
23+
duckv1 "knative.dev/pkg/apis/duck/v1"
24+
)
25+
26+
const (
27+
// IntegrationSinkConditionReady has status True when the IntegrationSink is ready to send events.
28+
IntegrationSinkConditionReady = apis.ConditionReady
29+
30+
IntegrationSinkConditionAddressable apis.ConditionType = "Addressable"
31+
32+
// IntegrationSinkConditionDeploymentReady has status True when the IntegrationSink has been configured with a deployment.
33+
IntegrationSinkConditionDeploymentReady apis.ConditionType = "DeploymentReady"
34+
35+
// IntegrationSinkConditionEventPoliciesReady has status True when all the applying EventPolicies for this
36+
// IntegrationSink are ready.
37+
IntegrationSinkConditionEventPoliciesReady apis.ConditionType = "EventPoliciesReady"
38+
)
39+
40+
var IntegrationSinkCondSet = apis.NewLivingConditionSet(
41+
IntegrationSinkConditionAddressable,
42+
IntegrationSinkConditionDeploymentReady,
43+
IntegrationSinkConditionEventPoliciesReady,
44+
)
45+
46+
// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.
47+
func (*IntegrationSink) GetConditionSet() apis.ConditionSet {
48+
return IntegrationSinkCondSet
49+
}
50+
51+
// GetCondition returns the condition currently associated with the given type, or nil.
52+
func (s *IntegrationSinkStatus) GetCondition(t apis.ConditionType) *apis.Condition {
53+
return IntegrationSinkCondSet.Manage(s).GetCondition(t)
54+
}
55+
56+
// GetTopLevelCondition returns the top level Condition.
57+
func (ps *IntegrationSinkStatus) GetTopLevelCondition() *apis.Condition {
58+
return IntegrationSinkCondSet.Manage(ps).GetTopLevelCondition()
59+
}
60+
61+
// IsReady returns true if the resource is ready overall.
62+
func (s *IntegrationSinkStatus) IsReady() bool {
63+
return IntegrationSinkCondSet.Manage(s).IsHappy()
64+
}
65+
66+
// InitializeConditions sets relevant unset conditions to Unknown state.
67+
func (s *IntegrationSinkStatus) InitializeConditions() {
68+
IntegrationSinkCondSet.Manage(s).InitializeConditions()
69+
}
70+
71+
// MarkAddressableReady marks the Addressable condition to True.
72+
func (s *IntegrationSinkStatus) MarkAddressableReady() {
73+
IntegrationSinkCondSet.Manage(s).MarkTrue(IntegrationSinkConditionAddressable)
74+
}
75+
76+
// MarkEventPoliciesFailed marks the EventPoliciesReady condition to False with the given reason and message.
77+
func (s *IntegrationSinkStatus) MarkEventPoliciesFailed(reason, messageFormat string, messageA ...interface{}) {
78+
IntegrationSinkCondSet.Manage(s).MarkFalse(IntegrationSinkConditionEventPoliciesReady, reason, messageFormat, messageA...)
79+
}
80+
81+
// MarkEventPoliciesUnknown marks the EventPoliciesReady condition to Unknown with the given reason and message.
82+
func (s *IntegrationSinkStatus) MarkEventPoliciesUnknown(reason, messageFormat string, messageA ...interface{}) {
83+
IntegrationSinkCondSet.Manage(s).MarkUnknown(IntegrationSinkConditionEventPoliciesReady, reason, messageFormat, messageA...)
84+
}
85+
86+
// MarkEventPoliciesTrue marks the EventPoliciesReady condition to True.
87+
func (s *IntegrationSinkStatus) MarkEventPoliciesTrue() {
88+
IntegrationSinkCondSet.Manage(s).MarkTrue(IntegrationSinkConditionEventPoliciesReady)
89+
}
90+
91+
// MarkEventPoliciesTrueWithReason marks the EventPoliciesReady condition to True with the given reason and message.
92+
func (s *IntegrationSinkStatus) MarkEventPoliciesTrueWithReason(reason, messageFormat string, messageA ...interface{}) {
93+
IntegrationSinkCondSet.Manage(s).MarkTrueWithReason(IntegrationSinkConditionEventPoliciesReady, reason, messageFormat, messageA...)
94+
}
95+
96+
func (s *IntegrationSinkStatus) PropagateDeploymentStatus(d *appsv1.DeploymentStatus) {
97+
deploymentAvailableFound := false
98+
for _, cond := range d.Conditions {
99+
if cond.Type == appsv1.DeploymentAvailable {
100+
deploymentAvailableFound = true
101+
if cond.Status == corev1.ConditionTrue {
102+
IntegrationSinkCondSet.Manage(s).MarkTrue(IntegrationSinkConditionDeploymentReady)
103+
} else if cond.Status == corev1.ConditionFalse {
104+
IntegrationSinkCondSet.Manage(s).MarkFalse(IntegrationSinkConditionDeploymentReady, cond.Reason, cond.Message)
105+
} else if cond.Status == corev1.ConditionUnknown {
106+
IntegrationSinkCondSet.Manage(s).MarkUnknown(IntegrationSinkConditionDeploymentReady, cond.Reason, cond.Message)
107+
}
108+
}
109+
}
110+
if !deploymentAvailableFound {
111+
IntegrationSinkCondSet.Manage(s).MarkUnknown(IntegrationSinkConditionDeploymentReady, "DeploymentUnavailable", "The Deployment '%s' is unavailable.", d)
112+
}
113+
}
114+
115+
func (s *IntegrationSinkStatus) SetAddress(address *duckv1.Addressable) {
116+
s.Address = address
117+
if address == nil || address.URL.IsEmpty() {
118+
IntegrationSinkCondSet.Manage(s).MarkFalse(IntegrationSinkConditionAddressable, "EmptyHostname", "hostname is the empty string")
119+
} else {
120+
IntegrationSinkCondSet.Manage(s).MarkTrue(IntegrationSinkConditionAddressable)
121+
122+
}
123+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
/*
2+
Copyright 2024 The Knative Authors
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
"k8s.io/apimachinery/pkg/runtime"
22+
"k8s.io/apimachinery/pkg/runtime/schema"
23+
"knative.dev/eventing/pkg/apis/common/integration/v1alpha1"
24+
eventingduckv1 "knative.dev/eventing/pkg/apis/duck/v1"
25+
"knative.dev/pkg/apis"
26+
duckv1 "knative.dev/pkg/apis/duck/v1"
27+
"knative.dev/pkg/kmeta"
28+
)
29+
30+
// +genclient
31+
// +genreconciler
32+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
33+
// +k8s:defaulter-gen=true
34+
35+
// IntegrationSink is the Schema for the IntegrationSink API.
36+
type IntegrationSink struct {
37+
metav1.TypeMeta `json:",inline"`
38+
metav1.ObjectMeta `json:"metadata,omitempty"`
39+
40+
Spec IntegrationSinkSpec `json:"spec,omitempty"`
41+
Status IntegrationSinkStatus `json:"status,omitempty"`
42+
}
43+
44+
// Check the interfaces that JobSink should be implementing.
45+
var (
46+
_ runtime.Object = (*IntegrationSink)(nil)
47+
_ kmeta.OwnerRefable = (*IntegrationSink)(nil)
48+
_ apis.Validatable = (*IntegrationSink)(nil)
49+
_ apis.Defaultable = (*IntegrationSink)(nil)
50+
_ apis.HasSpec = (*IntegrationSink)(nil)
51+
_ duckv1.KRShaped = (*IntegrationSink)(nil)
52+
_ apis.Convertible = (*JobSink)(nil)
53+
)
54+
55+
type IntegrationSinkSpec struct {
56+
Aws *Aws `json:"aws,omitempty"` // AWS source configuration
57+
Log *Log `json:"log,omitempty"` // Log sink configuration
58+
}
59+
60+
type Log struct {
61+
LoggerName string `json:"loggerName,omitempty" default:"log-sink"` // Name of the logging category to use
62+
Level string `json:"level,omitempty" default:"INFO"` // Logging level to use
63+
LogMask bool `json:"logMask,omitempty" default:"false"` // Mask sensitive information in the log
64+
Marker string `json:"marker,omitempty"` // An optional Marker name to use
65+
Multiline bool `json:"multiline,omitempty" default:"false"` // If enabled, outputs each information on a newline
66+
ShowAllProperties bool `json:"showAllProperties,omitempty" default:"false"` // Show all of the exchange properties (both internal and custom)
67+
ShowBody bool `json:"showBody,omitempty" default:"true"` // Show the message body
68+
ShowBodyType bool `json:"showBodyType,omitempty" default:"true"` // Show the body Java type
69+
ShowExchangePattern bool `json:"showExchangePattern,omitempty" default:"true"` // Show the Message Exchange Pattern (MEP)
70+
ShowHeaders bool `json:"showHeaders,omitempty" default:"false"` // Show the headers received
71+
ShowProperties bool `json:"showProperties,omitempty" default:"false"` // Show the exchange properties (only custom)
72+
ShowStreams bool `json:"showStreams,omitempty" default:"false"` // Show the stream bodies
73+
ShowCachedStreams bool `json:"showCachedStreams,omitempty" default:"true"` // Show cached stream bodies
74+
}
75+
76+
type Aws struct {
77+
S3 *v1alpha1.AWSS3 `json:"s3,omitempty"` // S3 source configuration
78+
SQS *v1alpha1.AWSSQS `json:"sqs,omitempty"` // SQS source configuration
79+
Auth *v1alpha1.Auth `json:"auth,omitempty"`
80+
}
81+
82+
type IntegrationSinkStatus struct {
83+
duckv1.Status `json:",inline"`
84+
85+
// AddressStatus is the part where the JobSink fulfills the Addressable contract.
86+
// It exposes the endpoint as an URI to get events delivered.
87+
// +optional
88+
duckv1.AddressStatus `json:",inline"`
89+
90+
// AppliedEventPoliciesStatus contains the list of EventPolicies which apply to this JobSink
91+
// +optional
92+
eventingduckv1.AppliedEventPoliciesStatus `json:",inline"`
93+
}
94+
95+
// GetGroupVersionKind returns the GroupVersionKind.
96+
func (*IntegrationSink) GetGroupVersionKind() schema.GroupVersionKind {
97+
return SchemeGroupVersion.WithKind("IntegrationSink")
98+
}
99+
100+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
101+
102+
// IntegrationSinkList contains a list of IntegrationSink
103+
type IntegrationSinkList struct {
104+
metav1.TypeMeta `json:",inline"`
105+
metav1.ListMeta `json:"metadata,omitempty"`
106+
Items []IntegrationSink `json:"items"`
107+
}
108+
109+
// GetUntypedSpec returns the spec of the IntegrationSink.
110+
func (c *IntegrationSink) GetUntypedSpec() interface{} {
111+
return c.Spec
112+
}
113+
114+
// GetStatus retrieves the status of the IntegrationSink. Implements the KRShaped interface.
115+
func (c *IntegrationSink) GetStatus() *duckv1.Status {
116+
return &c.Status.Status
117+
}

0 commit comments

Comments
 (0)