deis / builder

Git server and application builder for Deis Workflow
https://deis.com
MIT License
40 stars 41 forks source link

deis create unexpected behavior #387

Closed jdumars closed 8 years ago

jdumars commented 8 years ago

Cluster is Workflow v2.1.0 on AWS ~ provisioned with customized kube-aws:

  1. Not enough coffee and you try and create a deis app in an empty directory because you want to use deis pull
  2. Application is created but fails due to lack of it being a git repository
  3. Ok, fine, git init
  4. deis create with the same name fails, and you cannot seem to programmatically remove it

Behavior should be fail without actually creating the app.

[ec2-user@ip-172-31-21-126 test3]$ deis create pokemon
Creating Application... done, created pokemon
fatal: Not a git repository (or any of the parent directories): .git
To replace the existing git remote entry, run:
  git remote rename deis deis.old && deis git:remote -a pokemon
Error: exit status 128

[ec2-user@ip-172-31-21-126 test3]$ git init
Initialized empty Git repository in /home/ec2-user/repos/test3/.git/

[ec2-user@ip-172-31-21-126 test3]$ deis create pokemon
Creating Application... Error: App with this id already exists.

[ec2-user@ip-172-31-21-126 test3]$ deis pull jsingerdumars/hellonode
Creating build... Error: Not Found

[ec2-user@ip-172-31-21-126 test3]$ deis apps
=== Apps
valued-valkyrie
prom
testapp
test2
disco
pokemon

[ec2-user@ip-172-31-21-126 test3]$ deis destroy
 !    WARNING: Potentially Destructive Action
 !    This command will destroy the application: test3
 !    To proceed, type "test3" or re-run this command with --confirm=test3

> test3
Destroying test3...
Error: Not Found

[ec2-user@ip-172-31-21-126 test3]$ deis destroy --confirm=pokemon
Error: App test3 does not match confirm pokemon, aborting.
mboersma commented 8 years ago

The app "pokemon" was successfully created in Workflow, all that remains is to deploy code to it (a git remote isn't strictly required).

You never did the deis git:remote -a pokemon command after initializing the git repo. So there isn't a "deis" git remote entry, and the deis CLI doesn't know the implicit app name is "pokemon." It will instead default to the directory name ("test3").

The deis pull command doesn't have a -a flag to be explicit about the app, so it's trying to deploy to the nonexistent "test3" app. deis pull jsingerdumars/hellonode -a pokemon would work though.

I think this is all working as intended, but please follow up here if this is unclear or there's a detail that should be fixed.

jdumars commented 8 years ago

That makes sense. Thanks for the clarification!