Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/in_memory/channel_dispatcher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func main() {

// Setup zipkin tracing.
if err = tracing.SetupDynamicZipkinPublishing(logger, opt.ConfigMapWatcher, "imc-dispatcher"); err != nil {
logger.Fatal("Error setting up Zipkin publishing", zap.Error(err))
logger.Fatalw("Error setting up Zipkin publishing", zap.Error(err))
}

if err := opt.ConfigMapWatcher.Start(stopCh); err != nil {
Expand Down
4 changes: 4 additions & 0 deletions contrib/gcppubsub/pkg/controller/channel/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ const (
topicDeleteFailed = "TopicDeleteFailed"
subscriptionSyncFailed = "SubscriptionSyncFailed"
subscriptionDeleteFailed = "SubscriptionDeleteFailed"

deprecatedMessage = "The `gcp-pubsub` ClusterChannelProvisioner is deprecated and will be removed in 0.8. Recommended replacement is using `PubSubChannel` CRD from https://github.com/GoogleCloudPlatform/cloud-run-events."
)

// reconciler reconciles GCP-PubSub Channels by creating the K8s Service (ExternalName)
Expand Down Expand Up @@ -162,6 +164,8 @@ func ShouldReconcile(c *eventingv1alpha1.Channel) bool {
func (r *reconciler) reconcile(ctx context.Context, c *eventingv1alpha1.Channel) (bool, error) {
c.Status.InitializeConditions()

c.Status.MarkDeprecated("ClusterChannelProvisionerDeprecated", deprecatedMessage)

// We are syncing the following:
// - The K8s Service to talk to this Channel.
// - The GCP PubSub Topic (one for the Channel).
Expand Down
5 changes: 5 additions & 0 deletions contrib/gcppubsub/pkg/controller/channel/reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,7 @@ func makeChannelWithSubscribersAndFinalizerAndPCSAndAddress() *eventingv1alpha1.
func makeChannelWithFinalizer() *eventingv1alpha1.Channel {
c := makeChannel()
c.Finalizers = []string{finalizerName}
c.Status.MarkDeprecated("ClusterChannelProvisionerDeprecated", deprecatedMessage)
return c
}

Expand Down Expand Up @@ -869,24 +870,28 @@ func makeDeletingChannelWithoutPCS() *eventingv1alpha1.Channel {
func makeDeletingChannelWithoutFinalizer() *eventingv1alpha1.Channel {
c := makeDeletingChannel()
c.Finalizers = nil
c.Status.MarkDeprecated("ClusterChannelProvisionerDeprecated", deprecatedMessage)
return c
}

func makeDeletingChannelWithoutFinalizerOrPCS() *eventingv1alpha1.Channel {
c := makeDeletingChannelWithoutFinalizer()
c.Status.Internal = nil
c.Status.MarkDeprecated("ClusterChannelProvisionerDeprecated", deprecatedMessage)
return c
}

func makeDeletingChannelWithSubscribers() *eventingv1alpha1.Channel {
c := makeDeletingChannel()
addSubscribers(c, subscribers)
c.Status.MarkDeprecated("ClusterChannelProvisionerDeprecated", deprecatedMessage)
return c
}

func makeDeletingChannelWithSubscribersWithoutFinalizer() *eventingv1alpha1.Channel {
c := makeDeletingChannelWithSubscribers()
c.Finalizers = nil
c.Status.MarkDeprecated("ClusterChannelProvisionerDeprecated", deprecatedMessage)
return c
}

Expand Down
4 changes: 4 additions & 0 deletions contrib/kafka/pkg/controller/channel/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const (
// Name of the corev1.Events emitted from the reconciliation process
dispatcherReconcileFailed = "DispatcherReconcileFailed"
dispatcherUpdateStatusFailed = "DispatcherUpdateStatusFailed"

deprecatedMessage = "The `kafka` ClusterChannelProvisioner is deprecated and will be removed in 0.8. Recommended replacement is using `KafkaChannel` CRD."
)

type channelArgs struct {
Expand Down Expand Up @@ -90,6 +92,8 @@ func (r *reconciler) Reconcile(request reconcile.Request) (reconcile.Result, err

channel.Status.InitializeConditions()

channel.Status.MarkDeprecated("ClusterChannelProvisionerDeprecated", deprecatedMessage)

var requeue = false
if clusterChannelProvisioner.Status.IsReady() {
// Reconcile this copy of the Channel and then write back any status
Expand Down
3 changes: 3 additions & 0 deletions contrib/kafka/pkg/controller/channel/reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ func getNewChannelWithFinalizer(name, provisioner string) *eventingv1alpha1.Chan
func getNewChannelWithStatusAndFinalizer(name, provisioner string) *eventingv1alpha1.Channel {
c := getNewChannelWithFinalizer(name, provisioner)
c.Status.InitializeConditions()
c.Status.MarkDeprecated("ClusterChannelProvisionerDeprecated", deprecatedMessage)
return c
}

Expand All @@ -469,6 +470,7 @@ func getNewChannelWithArgs(name string, args map[string]interface{}) *eventingv1
func getNewChannelProvisionedStatus(name, provisioner string) *eventingv1alpha1.Channel {
c := getNewChannel(name, provisioner)
c.Status.InitializeConditions()
c.Status.MarkDeprecated("ClusterChannelProvisionerDeprecated", deprecatedMessage)
c.Status.SetAddress(&apis.URL{
Scheme: "http",
Host: serviceAddress,
Expand All @@ -487,6 +489,7 @@ func getNewChannelDeleted(name, provisioner string) *eventingv1alpha1.Channel {
func getNewChannelNotProvisionedStatus(name, provisioner, msg string) *eventingv1alpha1.Channel {
c := getNewChannel(name, provisioner)
c.Status.InitializeConditions()
c.Status.MarkDeprecated("ClusterChannelProvisionerDeprecated", deprecatedMessage)
c.Status.MarkNotProvisioned("NotProvisioned", msg)
return c
}
Expand Down
6 changes: 6 additions & 0 deletions contrib/natss/pkg/controller/channel/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ import (
eventingv1alpha1 "github.com/knative/eventing/pkg/apis/eventing/v1alpha1"
)

const (
deprecatedMessage = "The `natss` ClusterChannelProvisioner is deprecated and will be removed in 0.8. Recommended replacement is using `NatssChannel` CRD."
)

type reconciler struct {
client client.Client
recorder record.EventRecorder
Expand Down Expand Up @@ -114,6 +118,8 @@ func (r *reconciler) shouldReconcile(c *eventingv1alpha1.Channel) bool {
func (r *reconciler) reconcile(ctx context.Context, c *eventingv1alpha1.Channel) error {
c.Status.InitializeConditions()

c.Status.MarkDeprecated("ClusterChannelProvisionerDeprecated", deprecatedMessage)

// We are syncing two things:
// 1. The K8s Service to talk to this Channel.

Expand Down
1 change: 1 addition & 0 deletions contrib/natss/pkg/controller/channel/reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ func makeNewChannel(name, provisioner string) *eventingv1alpha1.Channel {
func makeNewChannelProvisionedStatus(name, provisioner string) *eventingv1alpha1.Channel {
c := makeNewChannel(name, provisioner)
c.Status.InitializeConditions()
c.Status.MarkDeprecated("ClusterChannelProvisionerDeprecated", deprecatedMessage)
c.Status.SetAddress(&apis.URL{
Scheme: "http",
Host: serviceAddress,
Expand Down
4 changes: 4 additions & 0 deletions pkg/provisioners/inmemory/channel/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const (
channelReconciled = "ChannelReconciled"
channelUpdateStatusFailed = "ChannelUpdateStatusFailed"
k8sServiceCreateFailed = "K8sServiceCreateFailed"

deprecatedMessage = "The `in-memory` ClusterChannelProvisioner is deprecated and will be removed in 0.8. Recommended replacement is using `InMemoryChannel` CRD."
)

type reconciler struct {
Expand Down Expand Up @@ -129,6 +131,8 @@ func (r *reconciler) reconcile(ctx context.Context, c *eventingv1alpha1.Channel)

c.Status.InitializeConditions()

c.Status.MarkDeprecated("ClusterChannelProvisionerDeprecated", deprecatedMessage)

// We are syncing K8s Service to talk to this Channel.
svc, err := util.CreateK8sService(ctx, r.client, c, util.ExternalService(c))
if err != nil {
Expand Down