// Exists checks whether a project with the name `projectName` exists and returns an error if any
Exists checks whether a project with the name `projectName` exists and returns an error if any
// Exists checks whether a project with the name ` projectName ` exists and returns an error if any
func Exists(context *genericclioptions.Context, projectName string) (bool, error) {
	projectSupport, err := context.Client.IsProjectSupported()
	if err != nil {
		return false, errors.Wrap(err, "unable to detect project support")
	}
	if projectSupport {
		project, err := context.Client.GetProject(projectName)
		if err != nil || project == nil {
			return false, err
		}
	} else {
		namespace, err := context.KClient.GetNamespace(projectName)
		if err != nil || namespace == nil {
			return false, err
		}
	}
	return true, nil
}
func Exists ( context * genericclioptions . Context , projectName string ) ( bool , error ) { projectSupport , err := context . Client . IsProjectSupported ( ) if err != nil { return false , errors . Wrap ( err , " " ) } if projectSupport { project , err := context . Client . GetProject ( projectName ) if err != nil || project == nil { return false , err } } else { namespace , err := context . KClient . GetNamespace ( projectName ) if err != nil || namespace == nil { return false , err } } return true , nil }
Exists checks whether a project with the name `projectName` exists and returns an error if any
Exists checks whether a project with the name ` projectName ` exists and returns an error if any