-
Notifications
You must be signed in to change notification settings - Fork 43
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
bug(cmd): add more advanced handling of app urls #110
Conversation
@mboersma, @krancour and @ngauthier are potential reviewers of this pull request based on my analysis of |
119b2ad
to
46f2de6
Compare
I'm not sure I like this change. This makes it so |
@bacongobbler This doesn't affect the behavior of |
Ah sorry, now that I've read it more thoroughly I see what you're trying to do. 👍 |
fmt.Printf("=== %s Application\n", app.ID) | ||
fmt.Println("updated: ", app.Updated) | ||
fmt.Println("uuid: ", app.UUID) | ||
fmt.Println("created: ", app.Created) | ||
fmt.Println("url: ", app.URL) | ||
fmt.Println("url: ", url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we shouldn't be changing this because the server fills out this field for us. If the server is returning us false information when the app has no domain, then we should fix this in the controller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, this adds an additional API request to this command which we try to avoid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't from the controller.... it's from the SDK, which is making the URL assumption of appname.cluster.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intend to remove app.URL
from the SDK after this is merged.
46f2de6
to
f4d7c7d
Compare
@bacongobbler Fixed the issues you brought up! |
f4d7c7d
to
db05381
Compare
@@ -276,3 +284,33 @@ func AppTransfer(appID, username string) error { | |||
|
|||
return nil | |||
} | |||
|
|||
var errNoDomain error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove this error from package-global scope? if it needs to be package-global, then make it a struct
moving out of the 2.2 milestone |
db05381
to
7579512
Compare
@arschles I refactored the code to instead check for a empty string rather than an error, removing the need to a package level error. |
Previously, we took a very naive approach to determining the app url. We did appID
deis.cluster.comThis approach has a problem however, because you can assign subdomains to an app that mask another app:
Now,
apps:open
andapps:info
use the app's first domain, usually the one that is assigned by default. If the app doesn't have any domains, likea
in the example does, it'll print that the app doesn't have any domains.This also allows me to remove
api.Apps.URL
from the SDK laster, removing the naive behavior in a way that doesn't break anything.