×

You can find the global settings for odo in the preference.yaml file which is located by default in your $HOME/.odo directory.

You can set a different location for the preference.yaml file by exporting the GLOBALODOCONFIG variable.

Viewing the current configuration

You can view the current odo CLI configuration by using the following command:

$ odo preference view
Example output
PARAMETER             CURRENT_VALUE
UpdateNotification
NamePrefix
Timeout
BuildTimeout
PushTimeout
Ephemeral
ConsentTelemetry      true

Setting a value

You can set a value for a preference key by using the following command:

$ odo preference set <key> <value>

Preference keys are case-insensitive.

Example command
$ odo preference set updatenotification false
Example output
Global preference was successfully updated

Setting a value

You can unset a value for a preference key by using the following command:

$ odo preference unset <key>

You can use the -f flag to skip the confirmation.

Example command
$ odo preference unset updatenotification
? Do you want to unset updatenotification in the preference (y/N) y
Example output
Global preference was successfully updated

Preference key table

The following table shows the available options for setting preference keys for the odo CLI:

Preference key Description Default value

UpdateNotification

Control whether a notification to update odo is shown.

True

NamePrefix

Set a default name prefix for an odo resource. For example, component or storage.

Current directory name

Timeout

Timeout for the Kubernetes server connection check.

1 second

BuildTimeout

Timeout for waiting for a build of the git component to complete.

300 seconds

PushTimeout

Timeout for waiting for a component to start.

240 seconds

Ephemeral

Controls whether odo should create an emptyDir volume to store source code.

True

ConsentTelemetry

Controls whether odo can collect telemetry for the user’s odo usage.

False

Ignoring files or patterns

You can configure a list of files or patterns to ignore by modifying the .odoignore file in the root directory of your application. This applies to both odo push and odo watch.

If the .odoignore file does not exist, the .gitignore file is used instead for ignoring specific files and folders.

To ignore .git files, any files with the .js extension, and the folder tests, add the following to either the .odoignore or the .gitignore file:

.git
*.js
tests/

The .odoignore file allows any glob expressions.