How do you set the environment variable BUILD_LOGLEVEL to 4 in the build config named phpbuild?

Prepare for the Red Hat Openshift Developer EX288 Exam. Study with comprehensive quizzes and flashcards. Each question includes hints and explanations to enhance your understanding. Ace your exam with confidence!

Multiple Choice

How do you set the environment variable BUILD_LOGLEVEL to 4 in the build config named phpbuild?

Explanation:
Setting an environment variable on a BuildConfig in OpenShift is done with the oc set env command, targeting the BuildConfig resource and providing KEY=VALUE pairs. For a BuildConfig named phpbuild, you reference the resource as buildconfig/phpbuild and assign the variable BUILD_LOGLEVEL to a string value. Quoting the value ensures it’s treated as a literal string, which is a safe and clear practice even for numeric values. So the command oc set env buildconfig/phpbuild BUILD_LOGLEVEL="4" correctly applies BUILD_LOGLEVEL with the value "4" to that BuildConfig. Using the short form bc/phpbuild or omitting quotes can work in some contexts, but the quoted, full-resource form is the most explicit and reliable.

Setting an environment variable on a BuildConfig in OpenShift is done with the oc set env command, targeting the BuildConfig resource and providing KEY=VALUE pairs. For a BuildConfig named phpbuild, you reference the resource as buildconfig/phpbuild and assign the variable BUILD_LOGLEVEL to a string value. Quoting the value ensures it’s treated as a literal string, which is a safe and clear practice even for numeric values. So the command oc set env buildconfig/phpbuild BUILD_LOGLEVEL="4" correctly applies BUILD_LOGLEVEL with the value "4" to that BuildConfig. Using the short form bc/phpbuild or omitting quotes can work in some contexts, but the quoted, full-resource form is the most explicit and reliable.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy