diff --git a/pkg/skaffold/config/util.go b/pkg/skaffold/config/util.go index 9fa8544f8d7..d5f736e3875 100644 --- a/pkg/skaffold/config/util.go +++ b/pkg/skaffold/config/util.go @@ -372,11 +372,7 @@ func lessThan(date string, duration time.Duration) bool { return current().Sub(t) < duration } -func UpdateGlobalSurveyTaken(configFile string, id string) error { - if id != constants.HaTS { - return fmt.Errorf("unexpected survey id %q. Please report an issue at "+constants.GithubIssueLink, id) - } - +func UpdateGlobalSurveyTaken(configFile string) error { // Today's date today := current().Format(time.RFC3339) ai := fmt.Sprintf(updateLastTaken, today) @@ -404,10 +400,7 @@ func UpdateGlobalSurveyTaken(configFile string, id string) error { return err } -func UpdateGlobalSurveyPrompted(configFile string, id string) error { - if id != constants.HaTS { - return fmt.Errorf("unexpected survey id %q. Please report an issue at "+constants.GithubIssueLink, id) - } +func UpdateGlobalSurveyPrompted(configFile string) error { // Today's date today := current().Format(time.RFC3339) ai := fmt.Sprintf(updateLastPrompted, today) diff --git a/pkg/skaffold/config/util_test.go b/pkg/skaffold/config/util_test.go index 9d4ca1bb0b8..cae36f0306c 100644 --- a/pkg/skaffold/config/util_test.go +++ b/pkg/skaffold/config/util_test.go @@ -25,7 +25,6 @@ import ( "time" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/cluster" - "github.com/GoogleContainerTools/skaffold/pkg/skaffold/constants" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/util" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/yaml" "github.com/GoogleContainerTools/skaffold/testutil" @@ -694,7 +693,7 @@ kubeContexts: []`, }) // update the time - err := UpdateGlobalSurveyTaken(cfg, constants.HaTS) + err := UpdateGlobalSurveyTaken(cfg) t.CheckNoError(err) actualConfig, cfgErr := ReadConfigFile(cfg) @@ -754,7 +753,7 @@ kubeContexts: []`, }) // update the time - err := UpdateGlobalSurveyPrompted(cfg, constants.HaTS) + err := UpdateGlobalSurveyPrompted(cfg) t.CheckNoError(err) actualConfig, cfgErr := ReadConfigFile(cfg) diff --git a/pkg/skaffold/survey/survey.go b/pkg/skaffold/survey/survey.go index 07afad6f8a8..d8880791be2 100644 --- a/pkg/skaffold/survey/survey.go +++ b/pkg/skaffold/survey/survey.go @@ -60,7 +60,7 @@ func (s *Runner) DisplaySurveyPrompt(out io.Writer) error { if isStdOut(out) { output.Green.Fprintf(out, hats.prompt()) } - return updateConfig(s.configFile, hats.id) + return updateConfig(s.configFile) } func (s *Runner) OpenSurveyForm(_ context.Context, out io.Writer, id string) error { @@ -78,5 +78,5 @@ func (s *Runner) OpenSurveyForm(_ context.Context, out io.Writer, id string) err } // Currently we will only update the global survey taken // When prompting for the survey, we need to use the same field. - return sConfig.UpdateGlobalSurveyTaken(s.configFile, id) + return sConfig.UpdateGlobalSurveyTaken(s.configFile) } diff --git a/pkg/skaffold/survey/survey_test.go b/pkg/skaffold/survey/survey_test.go index 2e5668055cc..fd5182831ac 100644 --- a/pkg/skaffold/survey/survey_test.go +++ b/pkg/skaffold/survey/survey_test.go @@ -46,7 +46,7 @@ func TestDisplaySurveyForm(t *testing.T) { t.Override(&isStdOut, mock) mockOpen := func(string) error { return nil } t.Override(&open, mockOpen) - t.Override(&updateConfig, func(_, _ string) error { return nil }) + t.Override(&updateConfig, func(_ string) error { return nil }) var buf bytes.Buffer New("test").DisplaySurveyPrompt(&buf) t.CheckDeepEqual(test.expected, buf.String())