You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cmdError.ExitWithError(cmdError.ExitBadArgs, errors.New("--kind must start with an uppercase letter"))
85
+
}
86
+
ifstrings.Count(apiVersion, "/") !=1 {
87
+
cmdError.ExitWithError(cmdError.ExitBadArgs, fmt.Errorf("api-version has wrong format (%v); format must be $GROUP_NAME/$VERSION (e.g app.example.com/v1alpha1)", apiVersion))
88
+
}
89
+
}
90
+
91
+
// verifyCrdDeployPath checks if the path <project-name>/deploy sub-directory is exists, and that is rooted under $GOPATH
92
+
funcverifyCrdDeployPath() {
93
+
// check if $GOPATH env exists
94
+
gp:=os.Getenv(goDir)
95
+
iflen(gp) ==0 {
96
+
cmdError.ExitWithError(cmdError.ExitError, fmt.Errorf("$GOPATH env not set"))
97
+
}
98
+
wd, err:=os.Getwd()
99
+
iferr!=nil {
100
+
cmdError.ExitWithError(cmdError.ExitError, fmt.Errorf("failed to determine the full path of the current directory: %v", err))
101
+
}
102
+
// check if this project's repository path is rooted under $GOPATH
103
+
if!strings.HasPrefix(wd, gp) {
104
+
cmdError.ExitWithError(cmdError.ExitError, fmt.Errorf("project's repository path (%v) is not rooted under GOPATH (%v)", wd, gp))
105
+
}
106
+
// check if the deploy sub-directory exist
107
+
_, err=os.Stat(filepath.Join(wd, deployCrdDir))
108
+
iferr!=nil {
109
+
cmdError.ExitWithError(cmdError.ExitError, fmt.Errorf("the path (./%v) does not exist. run this command in your project directory", deployCrdDir))
0 commit comments