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

Finish grpc create app #207

Merged
merged 6 commits into from
Jun 19, 2017
Merged

Finish grpc create app #207

merged 6 commits into from
Jun 19, 2017

Conversation

aguerra
Copy link
Contributor

@aguerra aguerra commented Jun 7, 2017

For now I'm postponing error translation and setting the defaults on the server as this PR is already too big.

Related #203.


This change is Reviewable

if team == "" {
fmt.Fprintln(os.Stderr, "You must provide the name of the team")
return
}
Copy link
Contributor

Choose a reason for hiding this comment

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

what about simplify this validation, like this:

team, err := cmd.Flags().GetString("team")
if err != nil || team == "" {
    fmt.Fprintln(os.Stderr, "You must provide a valid name of the team")
    return
}

?
(or just ignore error and only check for blank team name)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Your snippet is better.

}

scaleMin, _ := cmd.Flags().GetInt32("scale-min")
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

- scaleMin, _ := cmd.Flags().GetInt32("scale-min")
+ scaleMin, err := cmd.Flags().GetInt32("scale-min")

Max: int64(666),
Min: int64(1),
CpuTargetUtilization: 42,
Max: 666,
Copy link
Contributor

Choose a reason for hiding this comment

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

👹

ObjectMeta: k8sv1.ObjectMeta{
Name: a.Name,
Labels: map[string]string{
"teresa.io/team": a.Team,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I found a bug on #205 .
I was getting app team for teresa.io/app annotation 😕 .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We talked and settled for using the label.

Copy link
Contributor

Choose a reason for hiding this comment

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

BTW, fixed

Copy link
Contributor

@drgarcia1986 drgarcia1986 left a comment

Choose a reason for hiding this comment

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

👏

@drgarcia1986 drgarcia1986 mentioned this pull request Jun 8, 2017
26 tasks
Copy link
Contributor

@drgarcia1986 drgarcia1986 left a comment

Choose a reason for hiding this comment

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

🔁 LGTM

CreateNamespace(*App, string) error
CreateQuota(*App) error
CreateSecret(string, string, map[string][]byte) error
CreateAutoScale(*App) error
Copy link
Contributor

Choose a reason for hiding this comment

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

💅 maybe a simple name for these args helps to understand they proposal 💅


if err := ops.Create(user, app); err == nil {
t.Errorf("expected error, got nil")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

- if err := ops.Create(user, app); err == nil {
+ if ops.Create(user, app) == nil {

}
ops.(*AppOperations).kops = &errK8sOperations{QuotaErr: errors.New("Quota Error")}

if err := ops.Create(user, app); err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

- if err := ops.Create(user, app); err == nil {
+ if ops.Create(user, app) == nil {

}
ops.(*AppOperations).kops = &errK8sOperations{AutoScaleErr: errors.New("AutoScale Error")}

if err := ops.Create(user, app); err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

- if err := ops.Create(user, app); err == nil {
+ if ops.Create(user, app) == nil {

Copy link
Contributor

@drgarcia1986 drgarcia1986 left a comment

Choose a reason for hiding this comment

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

🚀

@aguerra aguerra merged commit e3979a7 into master Jun 19, 2017
@aguerra aguerra deleted the ag-finish-create-app branch June 19, 2017 13:04
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