Codebase cleanup & optimization (#1493)

Remove old v1 types that are no longer used and move fetcher structs to fetcher directory.
This commit is contained in:
Ta-Ching Chen
2020-01-16 16:47:32 +08:00
committed by GitHub
parent 574fb55fcf
commit bb3e6d6907
37 changed files with 305 additions and 498 deletions
+2 -3
View File
@@ -28,12 +28,11 @@ import (
sarama "github.com/Shopify/sarama"
cluster "github.com/bsm/sarama-cluster"
"github.com/fission/fission/pkg/types"
"github.com/fission/fission/pkg/utils"
"github.com/pkg/errors"
"go.uber.org/zap"
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
"github.com/fission/fission/pkg/utils"
)
type (
@@ -202,7 +201,7 @@ func (kafka Kafka) unsubscribe(subscription messageQueueSubscription) error {
func kafkaMsgHandler(kafka *Kafka, producer sarama.SyncProducer, trigger *fv1.MessageQueueTrigger, msg *sarama.ConsumerMessage, consumer *cluster.Consumer) {
var value string = string(msg.Value[:])
// Support other function ref types
if trigger.Spec.FunctionReference.Type != types.FunctionReferenceTypeFunctionName {
if trigger.Spec.FunctionReference.Type != fv1.FunctionReferenceTypeFunctionName {
kafka.logger.Fatal("unsupported function reference type for trigger",
zap.Any("function_reference_type", trigger.Spec.FunctionReference.Type),
zap.String("trigger", trigger.ObjectMeta.Name))