crio configuration

The crio files are normally available to rules as a list of CrioConf objects.

class insights.combiners.crio_conf.AllCrioConf(crio_confs)[source]

Bases: object

Combiner for accessing all the crio configuration files. There may be multi files for crio configuration, and the main config file is crio.conf. In the situation that the same section is both in crio.conf and other configuration files, the item in crio.conf has the lowest precedence. Files in the directory,’/etc/crio/crio.conf.d/’, are sorted by name in lexical order and applied in that order. If multiple configuration files specify the same configuration option the setting specified in the file sorted last takes precedence over any other value. This combiner will parse all the CrioConf objects and return a dictionary containing all valid data.

Sample files:

/etc/crio/crio.conf:

    [crio]
    storage_driver = "overlay"
    storage_option = [
            "overlay.override_kernel_check=1",
    ]

    [crio.runtime]
    selinux = true

    [crio.network]
    plugin_dirs = [
            "/usr/libexec/cni",
    ]
    [crio.metrics]

/etc/crio/crio.conf.d/00-conmon.conf

    [crio]
    internal_wipe = true
    storage_driver = "device mapper"

/etc/crio/crio.conf.d/99-conmon.conf

    [crio]
    storage_driver = "overlay2"

    [crio.api]
    stream_address = ""
    stream_port = "10010"

    [crio.runtime]
    selinux = true
    conmon = ""
    conmon_cgroup = "pod"
    default_env = [
        "NSS_SDB_USE_CACHE=no",
    ]
    log_level = "info"
    cgroup_manager = "systemd"

Examples

>>> all_crio_conf.sections()
['crio', 'crio.runtime', 'crio.api', 'crio.network', 'crio.metrics']
>>> all_crio_conf.options('crio.api')
['stream_address', 'stream_port']
>>> all_crio_conf.files
['/etc/crio/crio.conf', '/etc/crio/crio.conf.d/00-conmon.conf',
 '/etc/crio/crio.conf.d/99-conmon.conf']
>>> all_crio_conf.get('crio', 'storage_driver')
'"overlay2"'
files

The list of configuration file names.

Type:

list

get(section, option)[source]
Parameters:
  • section (str) -- The section str to search for.

  • option (str) -- The option str to search for.

Returns:

Returns the value of the option in the specified section.

Return type:

str

has_option(section, option)[source]

Check for the existence of a given option in a given section. Return True if the given option is present, and False if not present.

has_section(section)[source]

Indicate whether the named section is present in the configuration. Return True if the given section is present, and False if not present.

options(section)[source]

Return a list of option names for the given section name.

sections()[source]

Return a list of section names.