Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commands/operator-sdk: check existing project #85

Merged
merged 1 commit into from
Mar 2, 2018
Merged

commands/operator-sdk: check existing project #85

merged 1 commit into from
Mar 2, 2018

Conversation

fanminshi
Copy link
Contributor

this pr allows operator-sdk new to first check if the current directory has the operator project already. if it exists, then output an error.

ref: #83

@fanminshi
Copy link
Contributor Author

Manual Testing:

$ ls
app-operator

$ operator-sdk new app-operator --api-version=app.example.com/v1alpha1 --kind=AppService
Error: project (app-operator) exists. please use a different project name or delete the existing one

@fanminshi
Copy link
Contributor Author

cc/ @hasbro17

@@ -75,6 +76,22 @@ func parse(args []string) {
}
}

// existingProject checks if the given project exists under the current diretory.
// it exits with error when the project exists.
func existingProject() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion, what about renaming it to mustBeNewProject() since that's the action the function is taking. But either way is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, the suggested naming sounds better. i'll change to that.

@hasbro17
Copy link
Contributor

hasbro17 commented Mar 2, 2018

LGTM

@fanminshi fanminshi merged commit 2c01c30 into operator-framework:master Mar 2, 2018
m1kola pushed a commit to m1kola/operator-sdk that referenced this pull request Jun 7, 2024
…-openshift-4.7

Updating o-e-(ansible|helm|sdk) builder & base images to be consistent with ART
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants