Hi Pieter--
Instead of using "oc get -o yaml", consider using "oc export -o yaml". If you are using the latest version of oc (v1.3.0-akpha.3), then you can also use "--as-template" so that the export output can be made more flexible with parameter variables.

The "export" output is not totally clean; for instance, each object may contain a "status" structure and some "metadata" group entries which you probably don't want to preserve. However, it should still be better for your purposes than "oc get"

Cheers,
Harrison

On Thu, Aug 25, 2016 at 8:45 AM, Pieter Nagel <[email protected]> wrote:
I'm trying to figure out how to manage OpenShift apps from an "Infrastructure as code" perspective.

The obvious place to start is by keeping the yaml or json representation of all OpenShift objects as files under source control.

But people can still edit objects via the Web console (and sometimes that will be the most convenient route in development).

So at some point you will need to get the yaml files in source control up-to-date.

The problem is, `oc get -o yaml` has a lot of output that one wouldn't want to keep under source control. For example creationTimestamp, resourceVersion, selfLink and uid seem redundant to me - if I need to recreate the same logical app from source, or update testing to look like development, I don't care if the objects have the same timestamps and uids they used to have.

So you need to postprocess the output of `oc get` to transform it into suitable source, you can't just pipe the output of `oc get` to overwrite your source files.

Before I reinvent the wheel on anything, does anyone know if there are existing solutions?

--
Pieter Nagel
Lautus Solutions (Pty) Ltd
Building 27, The Woodlands, 20 Woodlands Drive, Woodmead, Gauteng
0832587540
_______________________________________________
dev mailing list
[email protected]
http://lists.openshift.redhat.com/openshiftmm/listinfo/dev

Reply via email to