Skip to content

Commit

Permalink
upgrade to latest dependencies
Browse files Browse the repository at this point in the history
bumping knative.dev/eventing 5ad7dab...366ff26:
  > 366ff26 IntegrationSink: rek-test templating support for bool annotations (# 8342)
  > 7176ce6 Add IntegrationSink CRD  (# 8304)

Signed-off-by: Knative Automation <[email protected]>
  • Loading branch information
knative-automation committed Nov 25, 2024
1 parent c5e5285 commit d93de2c
Show file tree
Hide file tree
Showing 15 changed files with 758 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
k8s.io/client-go v0.30.3
k8s.io/code-generator v0.30.3
knative.dev/caching v0.0.0-20241118131847-a38b40d8a39c
knative.dev/eventing v0.43.1-0.20241121083601-5ad7dabebd01
knative.dev/eventing v0.43.1-0.20241125081805-366ff26b10d6
knative.dev/hack v0.0.0-20241106013728-b7995315deb5
knative.dev/pkg v0.0.0-20241118074447-a7fd9b10bb9f
knative.dev/reconciler-test v0.0.0-20241106013737-0619dc3ecbcf
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1393,8 +1393,8 @@ k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/caching v0.0.0-20241118131847-a38b40d8a39c h1:fxyQ00VbltLYz+MSZ1RPjzea2gfnH3Y2HDG7PqiwmQw=
knative.dev/caching v0.0.0-20241118131847-a38b40d8a39c/go.mod h1:xcxIBx5jKR4HANCbcN4If+uNU1Y76b/tn9eV1byvJKc=
knative.dev/eventing v0.43.1-0.20241121083601-5ad7dabebd01 h1:nmYdUuubc8X9kNEKxKebdXYouVLWAhQz7SKVS1CvK9M=
knative.dev/eventing v0.43.1-0.20241121083601-5ad7dabebd01/go.mod h1:RxMFtxk903ZoxyS140MPdLLePTzBdeaGkVmBTB52t04=
knative.dev/eventing v0.43.1-0.20241125081805-366ff26b10d6 h1:/8Cq+ZgwU4Fb4MWVQ1jggNGA8wedH6agbgyhfkEDLbk=
knative.dev/eventing v0.43.1-0.20241125081805-366ff26b10d6/go.mod h1:RxMFtxk903ZoxyS140MPdLLePTzBdeaGkVmBTB52t04=
knative.dev/hack v0.0.0-20241106013728-b7995315deb5 h1:CfU5+6B+ylBd7mSGpvRqpzZV8H5ZQLGUwVygFzbE+1o=
knative.dev/hack v0.0.0-20241106013728-b7995315deb5/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY=
knative.dev/networking v0.0.0-20241118075147-929a5d5f19d0 h1:3vj6wR95isnuqgjQzcclyrzaodv5Jvjc7xq4Bv0yde8=
Expand Down
6 changes: 6 additions & 0 deletions vendor/knative.dev/eventing/pkg/apis/sinks/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ var (
Group: GroupName,
Resource: "jobsinks",
}

// IntegrationSinkResource respresents a Knative Eventing sink IntegrationSink
IntegrationSinkResource = schema.GroupResource{
Group: GroupName,
Resource: "integrationsinks",
}
)

type Config struct {
Expand Down
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.IntegrationSink into a higher version.
func (sink *IntegrationSink) 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.IntegrationSink
func (sink *IntegrationSink) ConvertFrom(ctx context.Context, obj apis.Convertible) error {
return fmt.Errorf("v1alpha1 is the highest known version, got: %T", sink)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
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.
*/

package v1alpha1

import "context"

func (sink *IntegrationSink) SetDefaults(ctx context.Context) {
sink.Spec.SetDefaults(ctx)
}

func (sink *IntegrationSinkSpec) SetDefaults(ctx context.Context) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/*
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.
*/

package v1alpha1

import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"knative.dev/pkg/apis"
duckv1 "knative.dev/pkg/apis/duck/v1"
)

const (
// IntegrationSinkConditionReady has status True when the IntegrationSink is ready to send events.
IntegrationSinkConditionReady = apis.ConditionReady

IntegrationSinkConditionAddressable apis.ConditionType = "Addressable"

// IntegrationSinkConditionDeploymentReady has status True when the IntegrationSink has been configured with a deployment.
IntegrationSinkConditionDeploymentReady apis.ConditionType = "DeploymentReady"

// IntegrationSinkConditionEventPoliciesReady has status True when all the applying EventPolicies for this
// IntegrationSink are ready.
IntegrationSinkConditionEventPoliciesReady apis.ConditionType = "EventPoliciesReady"
)

var IntegrationSinkCondSet = apis.NewLivingConditionSet(
IntegrationSinkConditionAddressable,
IntegrationSinkConditionDeploymentReady,
IntegrationSinkConditionEventPoliciesReady,
)

// GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.
func (*IntegrationSink) GetConditionSet() apis.ConditionSet {
return IntegrationSinkCondSet
}

// GetCondition returns the condition currently associated with the given type, or nil.
func (s *IntegrationSinkStatus) GetCondition(t apis.ConditionType) *apis.Condition {
return IntegrationSinkCondSet.Manage(s).GetCondition(t)
}

// GetTopLevelCondition returns the top level Condition.
func (ps *IntegrationSinkStatus) GetTopLevelCondition() *apis.Condition {
return IntegrationSinkCondSet.Manage(ps).GetTopLevelCondition()
}

// IsReady returns true if the resource is ready overall.
func (s *IntegrationSinkStatus) IsReady() bool {
return IntegrationSinkCondSet.Manage(s).IsHappy()
}

// InitializeConditions sets relevant unset conditions to Unknown state.
func (s *IntegrationSinkStatus) InitializeConditions() {
IntegrationSinkCondSet.Manage(s).InitializeConditions()
}

// MarkAddressableReady marks the Addressable condition to True.
func (s *IntegrationSinkStatus) MarkAddressableReady() {
IntegrationSinkCondSet.Manage(s).MarkTrue(IntegrationSinkConditionAddressable)
}

// MarkEventPoliciesFailed marks the EventPoliciesReady condition to False with the given reason and message.
func (s *IntegrationSinkStatus) MarkEventPoliciesFailed(reason, messageFormat string, messageA ...interface{}) {
IntegrationSinkCondSet.Manage(s).MarkFalse(IntegrationSinkConditionEventPoliciesReady, reason, messageFormat, messageA...)
}

// MarkEventPoliciesUnknown marks the EventPoliciesReady condition to Unknown with the given reason and message.
func (s *IntegrationSinkStatus) MarkEventPoliciesUnknown(reason, messageFormat string, messageA ...interface{}) {
IntegrationSinkCondSet.Manage(s).MarkUnknown(IntegrationSinkConditionEventPoliciesReady, reason, messageFormat, messageA...)
}

// MarkEventPoliciesTrue marks the EventPoliciesReady condition to True.
func (s *IntegrationSinkStatus) MarkEventPoliciesTrue() {
IntegrationSinkCondSet.Manage(s).MarkTrue(IntegrationSinkConditionEventPoliciesReady)
}

// MarkEventPoliciesTrueWithReason marks the EventPoliciesReady condition to True with the given reason and message.
func (s *IntegrationSinkStatus) MarkEventPoliciesTrueWithReason(reason, messageFormat string, messageA ...interface{}) {
IntegrationSinkCondSet.Manage(s).MarkTrueWithReason(IntegrationSinkConditionEventPoliciesReady, reason, messageFormat, messageA...)
}

func (s *IntegrationSinkStatus) PropagateDeploymentStatus(d *appsv1.DeploymentStatus) {
deploymentAvailableFound := false
for _, cond := range d.Conditions {
if cond.Type == appsv1.DeploymentAvailable {
deploymentAvailableFound = true
if cond.Status == corev1.ConditionTrue {
IntegrationSinkCondSet.Manage(s).MarkTrue(IntegrationSinkConditionDeploymentReady)
} else if cond.Status == corev1.ConditionFalse {
IntegrationSinkCondSet.Manage(s).MarkFalse(IntegrationSinkConditionDeploymentReady, cond.Reason, cond.Message)
} else if cond.Status == corev1.ConditionUnknown {
IntegrationSinkCondSet.Manage(s).MarkUnknown(IntegrationSinkConditionDeploymentReady, cond.Reason, cond.Message)
}
}
}
if !deploymentAvailableFound {
IntegrationSinkCondSet.Manage(s).MarkUnknown(IntegrationSinkConditionDeploymentReady, "DeploymentUnavailable", "The Deployment '%s' is unavailable.", d)
}
}

func (s *IntegrationSinkStatus) SetAddress(address *duckv1.Addressable) {
s.Address = address
if address == nil || address.URL.IsEmpty() {
IntegrationSinkCondSet.Manage(s).MarkFalse(IntegrationSinkConditionAddressable, "EmptyHostname", "hostname is the empty string")
} else {
IntegrationSinkCondSet.Manage(s).MarkTrue(IntegrationSinkConditionAddressable)

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
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/common/integration/v1alpha1"
eventingduckv1 "knative.dev/eventing/pkg/apis/duck/v1"
"knative.dev/pkg/apis"
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

// IntegrationSink is the Schema for the IntegrationSink API.
type IntegrationSink struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec IntegrationSinkSpec `json:"spec,omitempty"`
Status IntegrationSinkStatus `json:"status,omitempty"`
}

// Check the interfaces that JobSink should be implementing.
var (
_ runtime.Object = (*IntegrationSink)(nil)
_ kmeta.OwnerRefable = (*IntegrationSink)(nil)
_ apis.Validatable = (*IntegrationSink)(nil)
_ apis.Defaultable = (*IntegrationSink)(nil)
_ apis.HasSpec = (*IntegrationSink)(nil)
_ duckv1.KRShaped = (*IntegrationSink)(nil)
_ apis.Convertible = (*JobSink)(nil)
)

type IntegrationSinkSpec struct {
Aws *Aws `json:"aws,omitempty"` // AWS source configuration
Log *Log `json:"log,omitempty"` // Log sink configuration
}

type Log struct {
LoggerName string `json:"loggerName,omitempty" default:"log-sink"` // Name of the logging category to use
Level string `json:"level,omitempty" default:"INFO"` // Logging level to use
LogMask bool `json:"logMask,omitempty" default:"false"` // Mask sensitive information in the log
Marker string `json:"marker,omitempty"` // An optional Marker name to use
Multiline bool `json:"multiline,omitempty" default:"false"` // If enabled, outputs each information on a newline
ShowAllProperties bool `json:"showAllProperties,omitempty" default:"false"` // Show all of the exchange properties (both internal and custom)
ShowBody bool `json:"showBody,omitempty" default:"true"` // Show the message body
ShowBodyType bool `json:"showBodyType,omitempty" default:"true"` // Show the body Java type
ShowExchangePattern bool `json:"showExchangePattern,omitempty" default:"true"` // Show the Message Exchange Pattern (MEP)
ShowHeaders bool `json:"showHeaders,omitempty" default:"false"` // Show the headers received
ShowProperties bool `json:"showProperties,omitempty" default:"false"` // Show the exchange properties (only custom)
ShowStreams bool `json:"showStreams,omitempty" default:"false"` // Show the stream bodies
ShowCachedStreams bool `json:"showCachedStreams,omitempty" default:"true"` // Show cached stream bodies
}

type Aws struct {
S3 *v1alpha1.AWSS3 `json:"s3,omitempty"` // S3 source configuration
SQS *v1alpha1.AWSSQS `json:"sqs,omitempty"` // SQS source configuration
Auth *v1alpha1.Auth `json:"auth,omitempty"`
}

type IntegrationSinkStatus 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"`

// AppliedEventPoliciesStatus contains the list of EventPolicies which apply to this JobSink
// +optional
eventingduckv1.AppliedEventPoliciesStatus `json:",inline"`
}

// GetGroupVersionKind returns the GroupVersionKind.
func (*IntegrationSink) GetGroupVersionKind() schema.GroupVersionKind {
return SchemeGroupVersion.WithKind("IntegrationSink")
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// IntegrationSinkList contains a list of IntegrationSink
type IntegrationSinkList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []IntegrationSink `json:"items"`
}

// GetUntypedSpec returns the spec of the IntegrationSink.
func (c *IntegrationSink) GetUntypedSpec() interface{} {
return c.Spec
}

// GetStatus retrieves the status of the IntegrationSink. Implements the KRShaped interface.
func (c *IntegrationSink) GetStatus() *duckv1.Status {
return &c.Status.Status
}
Loading

0 comments on commit d93de2c

Please sign in to comment.