Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate Tink worker global timeout cli flag: #605

Merged
merged 1 commit into from
Apr 13, 2022
Merged
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
15 changes: 1 addition & 14 deletions cmd/tink-worker/cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cmd

import (
"context"
"fmt"
"os"
"strings"
Expand Down Expand Up @@ -42,11 +41,8 @@ func NewRootCommand(version string, logger log.Logger) *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
retryInterval, _ := cmd.Flags().GetDuration("retry-interval")
retries, _ := cmd.Flags().GetInt("max-retry")
// TODO(displague) is log-level no longer useful?
// logLevel, _ := cmd.Flags().GetString("log-level")
workerID, _ := cmd.Flags().GetString("id")
maxFileSize, _ := cmd.Flags().GetInt64("max-file-size")
timeOut, _ := cmd.Flags().GetDuration("timeout")
user, _ := cmd.Flags().GetString("registry-username")
pwd, _ := cmd.Flags().GetString("registry-password")
registry, _ := cmd.Flags().GetString("docker-registry")
Expand All @@ -57,13 +53,6 @@ func NewRootCommand(version string, logger log.Logger) *cobra.Command {
return setupErr
}

ctx := context.Background()
if timeOut > 0 {
var cancel context.CancelFunc
ctx, cancel = context.WithTimeout(ctx, timeOut)
defer cancel()
}

conn, err := tryClientConnection(logger, retryInterval, retries)
if err != nil {
return err
Expand Down Expand Up @@ -96,7 +85,7 @@ func NewRootCommand(version string, logger log.Logger) *cobra.Command {
worker.WithLogCapture(captureActionLogs),
worker.WithPrivileged(true))

err = w.ProcessWorkflowActions(ctx)
err = w.ProcessWorkflowActions(cmd.Context())
if err != nil {
return errors.Wrap(err, "worker Finished with error")
}
Expand All @@ -114,8 +103,6 @@ func NewRootCommand(version string, logger log.Logger) *cobra.Command {

rootCmd.Flags().Bool("capture-action-logs", true, "Capture action container output as part of worker logs")

// rootCmd.Flags().String("log-level", "info", "Sets the worker log level (panic, fatal, error, warn, info, debug, trace)")

must := func(err error) {
if err != nil {
logger.Fatal(err)
Expand Down