Skip to content

Conversation

@slpsys
Copy link
Contributor

@slpsys slpsys commented Feb 25, 2017

This is definitely part of #37; create_service needs service config information that tells it about the intended load balancer, and the load balancer info requires an IAM role.

The issue is that while create-service needs it, update-service not only can't change it, but as a result, will error out if it's present. So we need one copy with, one copy without.

This doesn't have specs [yet], and also is probably not a complete list [yet].

@slpsys slpsys changed the title WIP update-safe service config WIP update-safe service config for load balancing Feb 25, 2017
@apurvis
Copy link
Contributor

apurvis commented Feb 26, 2017

specs are failing

end

def update_safe_service_config
attributes_disallowed_for_updates = %i(
Copy link
Contributor

Choose a reason for hiding this comment

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

constant? SERVICE_ATTRIBUTES_ONLY_SET_AT_INSTANTIATION?

(i don't love that name, feel free to rename, but i do think it should be a constant)

load_balancers
)

service_config.delete_if do |k, _|
Copy link
Contributor

Choose a reason for hiding this comment

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

i know reject and delete_if are identical but we mostly use reject /shrug

Copy link
Contributor

Choose a reason for hiding this comment

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

also more importantly, with activesupport i think you can just do service_config.except(attributes_disallowed_for_updates)

}
end

def update_safe_service_config
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe this could just be called update_service_config or service_config_for_updates? "safe" doesn't have much explanatory context in this power.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe updateable_service_config, even

Copy link
Contributor

Choose a reason for hiding this comment

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

(and add a comment about why these fields are stripped out)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i mean, this is where cute ruby gets close to english, but isn't english. the intent here is:

service config
vs.
update-safe service config

not "update service config, which is safe"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

going with service_config_for_update, though

@apurvis
Copy link
Contributor

apurvis commented Feb 26, 2017

@apurvis
Copy link
Contributor

apurvis commented Feb 26, 2017

i'm 👍 with these changes though the other PR i opened #84 addresses them in a slightly less draconian way (you don't need the --tag to bootstrap a service, though you do need it to bootstrap a task_definition.

kind of wonder if GLI has a way of having those two separate commands (create_task_definition which requires a --tag) and create_service (which doesn't have) but having them run as one command for when you type bootstrap (which does or doesn't require --tag depending on what is already configured.

though at the same time, all that feels like a lot of overkill.

@apurvis
Copy link
Contributor

apurvis commented Feb 26, 2017

in fact it was just 2 commits ago i removed thiswhoops after tim complained it wasn't working. 👻 on me

Copy link
Contributor

@apurvis apurvis left a comment

Choose a reason for hiding this comment

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

this is a good intermediary change no matter what we decide in the end, though i would like those variables/methods renamed slightly

@apurvis
Copy link
Contributor

apurvis commented Feb 26, 2017

Also worth giving a final shoutout to #76 which should eventually solve all ELB issues top to bottom.

@apurvis
Copy link
Contributor

apurvis commented Feb 26, 2017

i'm on board with the change except for those style nitpicks.

cc @matl33t what do you think about this

load_balancers
placement_constraints
placement_strategy
role
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@slpsys
Copy link
Contributor Author

slpsys commented Feb 27, 2017

@apurvis some of these seem like they're addressing #80 ?

@slpsys
Copy link
Contributor Author

slpsys commented Feb 27, 2017

Will wait on Matt to merge.

Copy link
Contributor

@apurvis apurvis left a comment

Choose a reason for hiding this comment

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

lgtm; let's see what @matl33t says

@matl33t
Copy link
Contributor

matl33t commented Feb 28, 2017

🆒 after some 🕶️

Copy link
Contributor

@apurvis apurvis left a comment

Choose a reason for hiding this comment

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

lgtm; i guess this is 3.0.5?

@slpsys
Copy link
Contributor Author

slpsys commented Mar 1, 2017

@apurvis just added more specs and bumped the version

@apurvis
Copy link
Contributor

apurvis commented Mar 1, 2017

do you want me to merge & release or do you have those privileges?

@slpsys slpsys merged commit 29efa83 into master Mar 1, 2017
@slpsys slpsys deleted the safe_service_update branch March 1, 2017 05:16
@slpsys
Copy link
Contributor Author

slpsys commented Mar 1, 2017

@apurvis just released

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.

4 participants