You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CLI: command to set deployment hooks on a deployment config #9040
The goal of this command is to make it straightforward to set (pre/mid/post) deployment hook commands on deployment configs.
Basic form:
oc set deployment-hook [dc/]DEPLOYMENT_CONFIG --pre|--mid|--post [options] -- COMMAND
Options:
--remove - removes the specified hook (any combination of --pre / --mid / --post ) is allowed
-e --env - sets the environment for the hook
-c --container - sets the container for the hook (if not specified, the first container is used)
-v --volumes - (comma-separated list) set the volumes from the pod template to use in the hook
--on-failure - set the failure policy, one of abort, retry, ignore
Notes:
The command only applies to deployment configs --pre, --mid, and --post are mutually exclusive, except when --remove is specified.
If --remove is specified, other options besides --pre,--mid and --post are not allowed.
Not only deployment configs will have hooks. oc set hook or oc set hooks. I still don't like that we have --remove on other set commands, is it time for a oc unset command?
Not only deployment configs will have hooks. oc set hook or oc set hooks
that becomes problematic when not everything has the same hook names. DCs have pre/mid/post. Buildconfigs have post (and that's really post-commit, as opposed to post build or post push).
Or use subcommands (again)? oc set hook build, oc set hook deploy, oc set hook container, etc. I don't know if I like subcommands less or more than polluting set with different kinds of commands just for hooks. For example, oc create route has subcommands for the different types of tls termination.
@csrwng does this proposal align with the existing oc set triggers and oc set probe commands?
sort of ... oc set-probe lets you select multiple objects to set a probe on (either through --all or using a --selector). I wasn't sure that it made sense to do the same for the deployment hooks.
I would expect a different command - oc set build-hooks. That's not
unreasonable, build hooks are != deployment hooks, while build and
deployment triggers should be aligned (there is nothing special about
either trigger - they merely mutate fields)
On Thu, May 26, 2016 at 1:39 PM, Cesar Wong [email protected]
wrote:
Or use subcommands (again)? oc set hook build, oc set hook deploy, oc set
hook container
I'm not sure that I'd prefer that as an end-user. It makes it harder to
discover what kinds of things I can set.
—
You are receiving this because you were assigned.
Reply to this email directly or view it on GitHub #9040 (comment)
I'm ok with having them as separate commands like oc set deployment-hook|build-hook given they are different enough in terms of command symmetry (different hooks, with different args and flags, etc). It's much less problematic to have a composed command name when it's not at the top level (like under set here). It's also much less problematic when it's "noun-noun" like deployment-hook and build-hook because we can have the same names under a different top-level verb, like unset.
That said the only thing I really don't like here is to have one more command using the set --remove pattern. I think it's really time for an oc unset and I opened #9087 to track it.
The command should also take a -f or --filename argument like oc set probe does. Objects that it does not modify should be allowed to pass through. Other oc set commands should be fixed to allow objects to pass through.
For now the behavior of -f will be the same as for oc set probe. Objects will be taken from the input file and not read from the server (as in oc patch).
Activity
csrwng commentedon May 26, 2016
@bparees @jwforres @fabianofranz @Kargakis @smarterclayton any feedback on this command is greatly appreciated.
0xmichalis commentedon May 26, 2016
Not only deployment configs will have hooks.
oc set hookoroc set hooks. I still don't like that we have --remove on other set commands, is it time for aoc unsetcommand?bparees commentedon May 26, 2016
@csrwng the command is also going to be used to set buildconfig hooks (or rather, a symmetrical command will exist for that, anyway).
bparees commentedon May 26, 2016
@csrwng does this proposal align with the existing
oc set triggersandoc set probecommands?bparees commentedon May 26, 2016
that becomes problematic when not everything has the same hook names. DCs have pre/mid/post. Buildconfigs have post (and that's really post-commit, as opposed to post build or post push).
0xmichalis commentedon May 26, 2016
ouch
General question: what happens if someone wants to set a container hook inside their dc template? There are pre(stop) and post(start)
bparees commentedon May 26, 2016
not sure why "ouch", it's the logical step in the build lifecycle to let people take action, for our use case.
guessing we'd add an
oc set container-hookcommand with --pre-stop and --post-start args?0xmichalis commentedon May 26, 2016
Or use subcommands (again)?
oc set hook build,oc set hook deploy,oc set hook container, etc. I don't know if I like subcommands less or more than pollutingsetwith different kinds of commands just for hooks. For example,oc create routehas subcommands for the different types of tls termination.csrwng commentedon May 26, 2016
sort of ...
oc set-probelets you select multiple objects to set a probe on (either through --all or using a --selector). I wasn't sure that it made sense to do the same for the deployment hooks.csrwng commentedon May 26, 2016
Yes, I was going to use a separate issue for that :) The options there are much simpler.
csrwng commentedon May 26, 2016
I'm not sure that I'd prefer that as an end-user. It makes it harder to discover what kinds of things I can set.
smarterclayton commentedon May 26, 2016
I would expect a different command - oc set build-hooks. That's not
unreasonable, build hooks are != deployment hooks, while build and
deployment triggers should be aligned (there is nothing special about
either trigger - they merely mutate fields)
On Thu, May 26, 2016 at 1:39 PM, Cesar Wong [email protected]
wrote:
fabianofranz commentedon May 30, 2016
I'm ok with having them as separate commands like
oc set deployment-hook|build-hookgiven they are different enough in terms of command symmetry (different hooks, with different args and flags, etc). It's much less problematic to have a composed command name when it's not at the top level (like undersethere). It's also much less problematic when it's "noun-noun" likedeployment-hookandbuild-hookbecause we can have the same names under a different top-level verb, likeunset.That said the only thing I really don't like here is to have one more command using the
set --removepattern. I think it's really time for anoc unsetand I opened #9087 to track it.csrwng commentedon May 31, 2016
oc set probe--selector and --all should apply to this case as wellcsrwng commentedon May 31, 2016
The command should also take a
-for--filenameargument likeoc set probedoes. Objects that it does not modify should be allowed to pass through. Otheroc setcommands should be fixed to allow objects to pass through.csrwng commentedon May 31, 2016
For now the behavior of
-fwill be the same as foroc set probe. Objects will be taken from the input file and not read from the server (as inoc patch).csrwng commentedon Jun 10, 2016
Implemented by #9817