@@ -19,6 +19,7 @@ package cmd
1919import (
2020 "context"
2121 "encoding/json"
22+ "errors"
2223 "fmt"
2324 "os"
2425 "path/filepath"
@@ -185,13 +186,13 @@ func GetCreateOptions(ctx context.Context, clusterStackPath string) (*CreateOpti
185186 }
186187 case customMode :
187188 if clusterStackVersion == "" {
188- return nil , fmt . Errorf ("please specify a semver for custom version with --cluster-stack-version flag" )
189+ return nil , errors . New ("please specify a semver for custom version with --cluster-stack-version flag" )
189190 }
190191 if clusterAddonVersion == "" {
191- return nil , fmt . Errorf ("please specify a semver for custom version with --cluster-addon-version flag" )
192+ return nil , errors . New ("please specify a semver for custom version with --cluster-addon-version flag" )
192193 }
193194 if nodeImageVersion == "" {
194- return nil , fmt . Errorf ("please specify a semver for custom version with --node-image-version flag" )
195+ return nil , errors . New ("please specify a semver for custom version with --node-image-version flag" )
195196 }
196197
197198 createOption .Metadata , err = clusterstack .HandleCustomMode (createOption .Config .Config .KubernetesVersion , clusterStackVersion , clusterAddonVersion , nodeImageVersion )
@@ -222,7 +223,7 @@ func createAction(cmd *cobra.Command, args []string) error {
222223 defer cleanTmpDirectory ()
223224
224225 if len (args ) != 1 {
225- return fmt . Errorf ("please provide a valid command, create only accept one argument to path to the cluster stacks" )
226+ return errors . New ("please provide a valid command, create only accept one argument to path to the cluster stacks" )
226227 }
227228 clusterStackPath := args [0 ]
228229
@@ -253,7 +254,7 @@ func (c *CreateOptions) validateHash() error {
253254 if c .CurrentReleaseHash .ClusterAddonDir == c .LatestReleaseHash .ClusterAddonDir &&
254255 c .CurrentReleaseHash .ClusterAddonValues == c .LatestReleaseHash .ClusterAddonValues &&
255256 c .CurrentReleaseHash .NodeImageDir == c .LatestReleaseHash .NodeImageDir {
256- return fmt . Errorf ("no change in the cluster stack" )
257+ return errors . New ("no change in the cluster stack" )
257258 }
258259
259260 return nil
@@ -351,7 +352,7 @@ func (c *CreateOptions) generateRelease(ctx context.Context) error {
351352
352353 if publish {
353354 if remote != "oci" {
354- return fmt . Errorf ("not pushing assets. --publish is only implemented for remote OCI" )
355+ return errors . New ("not pushing assets. --publish is only implemented for remote OCI" )
355356 }
356357
357358 ociClient , err := oci .NewClient ()
@@ -410,7 +411,7 @@ func overwriteVersionInFile(chartYaml, newVersion string) error {
410411 v := m ["version" ]
411412 oldVersion , ok := v .(string )
412413 if ! ok {
413- return fmt . Errorf ("failed to read version in yaml" )
414+ return errors . New ("failed to read version in yaml" )
414415 }
415416
416417 m ["version" ] = newVersion
0 commit comments