Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelvillard committed Nov 16, 2019
1 parent 5501fa4 commit 262f78c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 1 addition & 7 deletions cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package main

import (
"flag"
"fmt"
"log"
"os"
"time"
Expand Down Expand Up @@ -102,13 +101,10 @@ func main() {
func newHandler(names []string) cache.ResourceEventHandler {
return cache.FilteringResourceEventHandler{
FilterFunc: func(obj interface{}) bool {
fmt.Println("received")
if object, ok := obj.(metav1.Object); ok {
fmt.Printf("crd name %s\n", object.GetName())
if labels := object.GetLabels(); labels != nil {
if v, ok := labels["functions.knative.dev/crd"]; ok && v == "true" {
for _, name := range names {
fmt.Printf("name %s\n", name)
if name == object.GetName() {
return false
}
Expand All @@ -126,16 +122,14 @@ func newHandler(names []string) cache.ResourceEventHandler {
type restartResourceHandler struct{}

func (r restartResourceHandler) OnAdd(obj interface{}) {
fmt.Println("exit")
// TODO: close channel
os.Exit(0)
}

func (r restartResourceHandler) OnUpdate(oldObj, newObj interface{}) {
fmt.Println("exit")
os.Exit(0)
}

func (r restartResourceHandler) OnDelete(obj interface{}) {
fmt.Println("exit")
os.Exit(0)
}
2 changes: 0 additions & 2 deletions config/500-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ spec:
value: config-observability
- name: METRICS_DOMAIN
value: knative.dev/function
- name: GVR
value: "waits.v1alpha1.functions.knative.dev"
ports:
- containerPort: 9090
name: metrics
Expand Down

0 comments on commit 262f78c

Please sign in to comment.