You could always put --context and --server flags on your "apply" call, and
source those from a config file so they cannot accidentally be used.  When
this has come up there has been a bias towards doing it that way in other
scripting scenarios.

We've talked about local context for the command line, but I'm somewhat
hesitant to bring it in.  Could this be something that you do with an
"oc-apply" bash wrapper?

On Wed, Dec 14, 2016 at 5:06 PM, Ben Parees <[email protected]> wrote:

>
>
> On Wed, Dec 14, 2016 at 4:53 PM, Clayton Coleman <[email protected]>
> wrote:
>
>> The process command does now include an "--env-file" option - so you
>> could do "oc process -f template-file.yaml --env-file .oc_env | oc apply -f
>> -"
>>
>
> ​I think Phillipe is looking for a "cluster environment definition" file
> which controls what cluster+namespace the resources are "applied" to, not
> env variable inputs to the template processing, but that's basically what
> the .kube/config file specifies/controls today (ie it controls what
> cluster+project your oc commands are going to operate against)
>
>
>
>
>>
>> On Wed, Dec 14, 2016 at 4:06 PM, Philippe Lafoucrière <
>> [email protected]> wrote:
>>
>>> Hi,
>>>
>>> We're having fun with the "oc apply" command, which solves a lot of
>>> configuration issues we've had in the past.
>>> There's just one thing I would like to have in oc: a local .oc_env file
>>> to define some defaults, like:
>>>
>>> - Current cluster url (make sure we're hitting the production cluster,
>>> not any of the test clusters)
>>> - Current namespace (to make sure apply won't fu.. up another project if
>>> we forget to specify it).
>>>
>>> Is there something we could see in the future?
>>>
>>> Thanks,
>>> Philippe
>>>
>>> --
>>> Philippe Lafoucrière - CEO
>>> http://www.tech-angels.com
>>> https://gemnasium.com
>>> France : +33 (0) 3 65 96 02 92
>>> Canada: +1 (418) 478-1175 <(418)%20478-1175>
>>> USA: +1 (954) 607-7443 <(954)%20607-7443>
>>>
>>>
>>>
>>> _______________________________________________
>>> users mailing list
>>> [email protected]
>>> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>>>
>>>
>>
>> _______________________________________________
>> users mailing list
>> [email protected]
>> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>>
>>
>
>
> --
> Ben Parees | OpenShift
>
>
_______________________________________________
users mailing list
[email protected]
http://lists.openshift.redhat.com/openshiftmm/listinfo/users

Reply via email to