Skip to content

Commit 3d1ad04

Browse files
author
Steven Smith
committed
Adds import mode to new app docs
1 parent 69317aa commit 3d1ad04

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

modules/applications-create-using-cli-modify.adoc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The second one represents the output image. If a container image was specified a
3030

3131
|===
3232

33+
[id="specifying-environment-variables"]
3334
== Specifying environment variables
3435

3536
When generating applications from a template, source, or an image, you can use the `-e|--env` argument to pass environment variables to the application container at run time:
@@ -70,6 +71,7 @@ $ cat postgresql.env | oc new-app openshift/postgresql-92-centos7 --env-file=-
7071
Any `BuildConfig` objects created as part of `new-app` processing are not updated with environment variables passed with the `-e|--env` or `--env-file` argument.
7172
====
7273

74+
[id="specifying-build-environment-variables"]
7375
== Specifying build environment variables
7476

7577
When generating applications from a template, source, or an image, you can use the `--build-env` argument to pass environment variables to the build container at run time:
@@ -103,6 +105,7 @@ Additionally, environment variables can be given on standard input by using `--b
103105
$ cat ruby.env | oc new-app openshift/ruby-23-centos7 --build-env-file=-
104106
----
105107

108+
[id="specifying-labels"]
106109
== Specifying labels
107110

108111
When generating applications from source, images, or templates, you can use the `-l|--label` argument to add labels to the created objects. Labels make it easy to collectively select, configure, and delete objects associated with the application.
@@ -112,6 +115,7 @@ When generating applications from source, images, or templates, you can use the
112115
$ oc new-app https://github.com/openshift/ruby-hello-world -l name=hello-world
113116
----
114117

118+
[id="viewing-output-without-creation"]
115119
== Viewing the output without creation
116120

117121
To see a dry-run of running the `new-app` command, you can use the `-o|--output` argument with a `yaml` or `json` value. You can then use the output to preview the objects that are created or redirect it to a file that you can edit. After you are satisfied, you can use `oc create` to create the {product-title} objects.
@@ -138,6 +142,7 @@ Create a new application by referencing the file:
138142
$ oc create -f myapp.yaml
139143
----
140144

145+
[id="creating-objects-different-names"]
141146
== Creating objects with different names
142147

143148
Objects created by `new-app` are normally named after the source repository, or the image used to generate them. You can set the name of the objects produced by adding a `--name` flag to the command:
@@ -147,6 +152,7 @@ Objects created by `new-app` are normally named after the source repository, or
147152
$ oc new-app https://github.com/openshift/ruby-hello-world --name=myapp
148153
----
149154

155+
[id="creating-objects-different-project"]
150156
== Creating objects in a different project
151157

152158
Normally, `new-app` creates objects in the current project. However, you can create objects in a different project by using the `-n|--namespace` argument:
@@ -156,6 +162,7 @@ Normally, `new-app` creates objects in the current project. However, you can cre
156162
$ oc new-app https://github.com/openshift/ruby-hello-world -n myproject
157163
----
158164

165+
[id="creating-multiple-objects"]
159166
== Creating multiple objects
160167

161168
The `new-app` command allows creating multiple applications specifying multiple parameters to `new-app`. Labels specified in the command line apply to all objects created by the single command. Environment variables apply to all components created from source or images.
@@ -172,6 +179,7 @@ $ oc new-app https://github.com/openshift/ruby-hello-world mysql
172179
If a source code repository and a builder image are specified as separate arguments, `new-app` uses the builder image as the builder for the source code repository. If this is not the intent, specify the required builder image for the source using the `~` separator.
173180
====
174181

182+
[id="grouping-images-source-single-pod"]
175183
== Grouping images and source in a single pod
176184

177185
The `new-app` command allows deploying multiple images together in a single pod. To specify which images to group together, use the `+` separator. The `--group` command line argument can also be used to specify the images that should be grouped together. To group the image built from a source repository with other images, specify its builder image in the group:
@@ -191,6 +199,7 @@ $ oc new-app \
191199
--group=ruby+mysql
192200
----
193201

202+
[id="searching-for-images-templates-other-inputs"]
194203
== Searching for images, templates, and other inputs
195204

196205
To search for images, templates, and other inputs for the `oc new-app` command, add the `--search` and `--list` flags. For example, to find all of the images or templates that include PHP:
@@ -199,3 +208,18 @@ To search for images, templates, and other inputs for the `oc new-app` command,
199208
----
200209
$ oc new-app --search php
201210
----
211+
212+
[id="setting-the-import-mode"]
213+
== Setting the import mode
214+
215+
To set the import mode when using `oc new-app`, add the `--import-mode` flag. This flag can be appended with `Legacy` or `PreserveOriginal`, which provides users the option to create image streams using a single sub-manifest, or all manifests, respectively.
216+
217+
[souce,terminal]
218+
----
219+
$ oc new-app --image=registry.redhat.io/ubi8/httpd-24:latest --import-mode=Legacy --name=test
220+
----
221+
222+
[source,terminal]
223+
----
224+
$ oc new-app --image=registry.redhat.io/ubi8/httpd-24:latest --import-mode=PreserveOriginal --name=test
225+
----

0 commit comments

Comments
 (0)