diff --git a/flow/flow.go b/flow/flow.go index c06e966..78bf9e6 100644 --- a/flow/flow.go +++ b/flow/flow.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "os" - "strconv" "strings" "github.com/sakajunquality/cloud-pubsub-events/gcrevent" @@ -33,7 +32,7 @@ func New(c *Config) (*Flow, error) { return f, nil } -func (f *Flow) ProcessGCREvent(ctx context.Context, e gcrevent.Event, quote bool) error { +func (f *Flow) ProcessGCREvent(ctx context.Context, e gcrevent.Event) error { if e.Action != gcrevent.ActionInsert { return nil } @@ -52,9 +51,5 @@ func (f *Flow) ProcessGCREvent(ctx context.Context, e gcrevent.Event, quote bool return fmt.Errorf("image format invalid: %s", *e.Tag) } - if quote { - version = strconv.Quote(version) - } - return f.processImage(ctx, image, version) } diff --git a/main.go b/main.go index 3f82b02..f3a7175 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,6 @@ package main import ( "context" "encoding/json" - "flag" "fmt" "io" "log" @@ -39,14 +38,7 @@ var ( f *flow.Flow ) -var ( - q *bool -) - func main() { - q = flag.Bool("q", true, "if true, the version is quoted. Default is true.") - flag.Parse() - cfg, err := getConfig() if err != nil { fmt.Fprintf(os.Stderr, "Cloud not read the file:%s.\n", err) @@ -109,7 +101,7 @@ func handlePubSubMessage(w http.ResponseWriter, r *http.Request) { return } - err = f.ProcessGCREvent(ctx, event, *q) + err = f.ProcessGCREvent(ctx, event) log.Printf("process: %s", err) res := &Response{