openshift / origin

Conformance test suite for OpenShift
http://www.openshift.org
Apache License 2.0
8.48k stars 4.7k forks source link

oc create should support creating buildconfigs #14138

Closed soltysh closed 7 years ago

soltysh commented 7 years ago

Our oc create supports several resources, but no buildConfigs, as of yet. The only CLI for creating BC is oc new-app or oc new-build which aside from the BC creates a few additional resources.

bparees commented 7 years ago

this is going to require a huge number of flags to be useful (even worse than new-build/new-app today).... can you give me a use case for why new-build/new-app are not the right answer?

soltysh commented 7 years ago

Simplicity of usage, I want to create BC and only that, without any other accompanying resources. I don't want to create BC by hand because I don't remember the yaml structure and I'm lazy to do it everytime I want to create a BC. With reasonable flags I should be able to create a sketch of a BC with oc create buildconfig and pick from there to do more when I need.

bparees commented 7 years ago

With reasonable flags I should be able to create a sketch of a BC with oc create buildconfig and pick from there to do more when I need.

i disagree that this is possible with anything less than a half dozen flags.

for a minimal buildconfig you need:

1) a source repo 2) a builder image a) is it an imagestream or a dockerimage reference? 3) a destination for the output a) is it an imagestream or a dockerimage reference? 4) a build strategy

i'll create the card, but i'm worried we're just creating another version of new-app where every person who goes to use it is going to come back and say "can you add a flag so i can specify X on my buildconfig? i don't want to edit it afterwards".

bparees commented 7 years ago

trello'd https://trello.com/c/vqI6QomG

soltysh commented 7 years ago

From what you've pointed out is just 4 flags where source repo is the required param. By definition oc create should be simple, that's the whole point, if you need more use oc new-app/new-build :)

bparees commented 7 years ago

From what you've pointed out is just 4 flags where source repo is the required param.

they're all required parameters. just the source repo is not sufficient for us to do anything.

And it's 6 flags because for flag (2) and (3) we either need:

--from-image-stream/--from-docker-image --to-image-stream/--to-docker-image

or --from-image --as-imagestream/--as-dockerimage

or some other disambiguation as to whether the user is pointing us to a docker image, or an imagestream, for both the --to and --from fields. Otherwise you get into the searching/matching/guessing madness that new-app currently does.

Unless you're proposing that when creating a buildconfig you can only reference imagestreams (or only reference dockerimages).

soltysh commented 7 years ago

Only docker images, if you care about IS you'd use oc new-app.

bparees commented 7 years ago

Only docker images, if you care about IS you'd use oc new-app.

that seems silly. I don't want to introduce a command that creates buildconfigs that follow a structure we'd never recommend. imagestreams are the right tool for the job. Buildconfigs that don't use imagestreams are painful:

1) you can't imagechangetrigger them 2) you almost certainly need to add docker credential secrets because you're not going to be able to push the output anywhere

bparees commented 7 years ago

The most likely combination is:

from a docker image to an imagestream