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
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require (
github.com/manifestival/client-go-client v0.2.2
github.com/manifestival/manifestival v0.5.1-0.20200526175228-b0136214e13f
github.com/pkg/errors v0.9.1
go.opencensus.io v0.22.3
go.uber.org/zap v1.14.1
golang.org/x/mod v0.3.0
gonum.org/v1/gonum v0.0.0-20190710053202-4340aa3071a0 // indirect
Expand Down
100 changes: 0 additions & 100 deletions pkg/reconciler/knativeserving/common/stats_reporter.go

This file was deleted.

67 changes: 0 additions & 67 deletions pkg/reconciler/knativeserving/common/stats_reporter_test.go

This file was deleted.

36 changes: 1 addition & 35 deletions pkg/reconciler/knativeserving/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package knativeserving

import (
"context"
"fmt"

"github.com/go-logr/zapr"
mfc "github.com/manifestival/client-go-client"
Expand All @@ -24,13 +23,11 @@ import (
"k8s.io/client-go/tools/cache"

"knative.dev/operator/pkg/apis/operator/v1alpha1"
servingv1alpha1 "knative.dev/operator/pkg/apis/operator/v1alpha1"
operatorclient "knative.dev/operator/pkg/client/injection/client"
knativeServinginformer "knative.dev/operator/pkg/client/injection/informers/operator/v1alpha1/knativeserving"
knsreconciler "knative.dev/operator/pkg/client/injection/reconciler/operator/v1alpha1/knativeserving"
"knative.dev/operator/pkg/reconciler"
"knative.dev/operator/pkg/reconciler/common"
servingcommon "knative.dev/operator/pkg/reconciler/knativeserving/common"
kubeclient "knative.dev/pkg/client/injection/kube/client"
deploymentinformer "knative.dev/pkg/client/injection/kube/informers/apps/v1/deployment"
"knative.dev/pkg/configmap"
Expand All @@ -40,8 +37,7 @@ import (
)

const (
controllerAgentName = "knativeserving-controller"
kcomponent = "knative-serving"
kcomponent = "knative-serving"
)

// NewController initializes the controller and is called by the generated code
Expand All @@ -57,11 +53,6 @@ func NewController(ctx context.Context, cmw configmap.Watcher) *controller.Impl
logger.Fatalw("Failed to remove old resources", zap.Error(err))
}

statsReporter, err := servingcommon.NewStatsReporter(controllerAgentName)
if err != nil {
logger.Fatal(err)
}

version := common.GetLatestRelease(kcomponent)
manifestPath := common.RetrieveManifestPath(version, kcomponent)
manifest, err := mfc.NewManifest(manifestPath,
Expand Down Expand Up @@ -90,30 +81,5 @@ func NewController(ctx context.Context, cmw configmap.Watcher) *controller.Impl
Handler: controller.HandleAll(impl.EnqueueControllerOf),
})

// Reporting statistics on KnativeServing events.
knativeServingInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
AddFunc: func(newObj interface{}) {
new := newObj.(*servingv1alpha1.KnativeServing)
if new.Generation == 1 {
statsReporter.ReportKnativeservingChange(key(new), "creation")
}
},
UpdateFunc: func(oldObj interface{}, newObj interface{}) {
old := oldObj.(*servingv1alpha1.KnativeServing)
new := newObj.(*servingv1alpha1.KnativeServing)
if old.Generation < new.Generation {
statsReporter.ReportKnativeservingChange(key(new), "edit")
}
},
DeleteFunc: func(oldObj interface{}) {
old := oldObj.(*servingv1alpha1.KnativeServing)
statsReporter.ReportKnativeservingChange(key(old), "deletion")
},
})

return impl
}

func key(ks *servingv1alpha1.KnativeServing) string {
return fmt.Sprintf("%s/%s", ks.Namespace, ks.Name)
}
Loading