From 2b51dd9fccb9ee0012bb4a82570fa30e777e1a15 Mon Sep 17 00:00:00 2001 From: Jemish Patel <37133965+jemishp@users.noreply.github.com> Date: Thu, 16 Mar 2023 10:32:10 -0700 Subject: [PATCH] error message uses correct flag (#1114) --- cloud/deployment/fromfile/fromfile.go | 4 ++-- cloud/deployment/fromfile/fromfile_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cloud/deployment/fromfile/fromfile.go b/cloud/deployment/fromfile/fromfile.go index de6b1b640..3fd84c2c5 100644 --- a/cloud/deployment/fromfile/fromfile.go +++ b/cloud/deployment/fromfile/fromfile.go @@ -98,7 +98,7 @@ func CreateOrUpdate(inputFile, action string, client astro.Client, out io.Writer // check if deployment exists if deploymentExists(existingDeployments, formattedDeployment.Deployment.Configuration.Name) { // create does not allow updating existing deployments - errHelp = fmt.Sprintf("use deployment update --from-file %s instead", inputFile) + errHelp = fmt.Sprintf("use deployment update --deployment-file %s instead", inputFile) return fmt.Errorf("deployment: %s %w: %s", formattedDeployment.Deployment.Configuration.Name, errCannotUpdateExistingDeployment, errHelp) } @@ -117,7 +117,7 @@ func CreateOrUpdate(inputFile, action string, client astro.Client, out io.Writer // check if deployment does not exist if !deploymentExists(existingDeployments, formattedDeployment.Deployment.Configuration.Name) { // update does not allow creating new deployments - errHelp = fmt.Sprintf("use deployment create --from-file %s instead", inputFile) + errHelp = fmt.Sprintf("use deployment create --deployment-file %s instead", inputFile) return fmt.Errorf("deployment: %s %w: %s", formattedDeployment.Deployment.Configuration.Name, errNotFound, errHelp) } diff --git a/cloud/deployment/fromfile/fromfile_test.go b/cloud/deployment/fromfile/fromfile_test.go index a752280bf..5ad006ea6 100644 --- a/cloud/deployment/fromfile/fromfile_test.go +++ b/cloud/deployment/fromfile/fromfile_test.go @@ -1468,7 +1468,7 @@ deployment: mockClient.On("ListClusters", orgID).Return(existingClusters, nil) mockClient.On("ListDeployments", orgID, "").Return(existingDeployments, nil) err = CreateOrUpdate("deployment.yaml", "create", mockClient, nil) - assert.ErrorContains(t, err, "deployment: test-deployment-label already exists: use deployment update --from-file deployment.yaml instead") + assert.ErrorContains(t, err, "deployment: test-deployment-label already exists: use deployment update --deployment-file deployment.yaml instead") mockClient.AssertExpectations(t) }) t.Run("returns an error if creating deployment input fails", func(t *testing.T) { @@ -2147,7 +2147,7 @@ deployment: mockClient.On("ListClusters", orgID).Return(existingClusters, nil) mockClient.On("ListDeployments", orgID, "").Return([]astro.Deployment{}, nil) err = CreateOrUpdate("deployment.yaml", "update", mockClient, nil) - assert.ErrorContains(t, err, "deployment: test-deployment-label does not exist: use deployment create --from-file deployment.yaml instead") + assert.ErrorContains(t, err, "deployment: test-deployment-label does not exist: use deployment create --deployment-file deployment.yaml instead") mockClient.AssertExpectations(t) }) t.Run("returns an error if creating update deployment input fails", func(t *testing.T) {