openshift-evangelists / oc-cluster-wrapper

oc cluster up bash wrapper
Apache License 2.0
144 stars 72 forks source link

Sending arguments to bring the cluster up for a second time does not work #14

Closed bjartek closed 7 years ago

bjartek commented 7 years ago

Not sure what the intention is here, but the way it is setup now sending aditional arguments when setting up a cluster for the second time does not work .

./oc-cluster up testing -e TEST=true

This is the content that is put into the run script (reformated for clarity)

oc cluster up --public-hostname '127.0.0.1' --host-data-dir '/Users/bjartek/.oc/profiles/testing/data' --host-config-dir '/Users/bjartek/.oc/profiles/testing/config' --routing-suffix '' --use-existing-config -e TEST=true

When i then take it down and up again with ./oc-cluster down && oc-cluster up testing -e TEST2=true /Users/bjartek/.oc/profiles/testing/run -e TEST2=true is run the output of that ( running with bash -x) is: oc cluster up --public-hostname 127.0.0.1 --host-data-dir /Users/bjartek/.oc/profiles/testing/data --host-config-dir /Users/bjartek/.oc/profiles/testing/config --routing-suffix '' --use-existing-config -e TEST=true

In other words TEST2=true is not sent to the cluster.

I see two possible solutions here

  1. this is the intended behavior
  2. the intended behavior is that new arguments are sent to run aswell. We need to append '$@' at the end of the run script.

Either way it makes no difference to add $@ as an argument after sourcing run in line 80.

jorgemoralespou commented 7 years ago

Not sure what to do here. The idea would be to have the ability to create a profile, and make only some values changeable, as some should not change, as data and volume dirs and ip, as these are set in the config when created. There's an upstream change that will have "oc cluster up" not re-executing some commands when bringing an already existent cluster up, like creating the test project, logging in developer, https://github.com/openshift/origin/issues/10999

I'll add some ideas I want to provide to this script, so if you're fancy to contribute will have some ideas on our intentions

bjartek commented 7 years ago

Please add ideas and I will contribute.

Regards Bjarte

Sent from my iPhone

On 8 Oct 2016, at 14:24, Jorge Morales Pou notifications@github.com wrote:

Not sure what to do here. The idea would be to have the ability to create a profile, and make only some values changeable, as some should not change, as data and volume dirs and ip, as these are set in the config when created. There's an upstream change that will have "oc cluster up" not re-executing some commands when bringing an already existent cluster up, like creating the test project, logging in developer, openshift/origin#10999

I'll add some ideas I want to provide to this script, so if you're fancy to contribute will have some ideas on our intentions

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

GrahamDumpleton commented 7 years ago

@bjartek What is the use case for setting environment variables? Are you specifically debugging issues with OpenShift itself?

I can't see that these get passed through to any deployed application container. Does the OpenShift container honour certain environment variables?

bjartek commented 7 years ago

I think this issue is based upon a misunderstanding from my side. The way profiles is implemented is a little bit different then what i though initially. Feel free to just discard this since i do not have any use case with the current profile implementation.