Skip to content

Commit

Permalink
Merge pull request #80 from sakajunquality/revert-77-add-quote
Browse files Browse the repository at this point in the history
Revert "add quote"
  • Loading branch information
sakajunquality authored Apr 23, 2024
2 parents 45cacc7 + 31ef1f8 commit 3445e25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
7 changes: 1 addition & 6 deletions flow/flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"os"
"strconv"
"strings"

"github.com/sakajunquality/cloud-pubsub-events/gcrevent"
Expand Down Expand Up @@ -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
}
Expand All @@ -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)
}
10 changes: 1 addition & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"io"
"log"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 3445e25

Please sign in to comment.