Skip to content

strip_host_domain_name source option set via environment variable crashes with "Source <value> option 'type' is undefined" #517

Description

@thost96

Setting the source option strip_host_domain_name via an environment variable (NBS_SOURCE__strip_host_domain_name) causes a fatal error during startup, regardless of the value assigned (true or false). The crash appears to treat the value of this option as if it were a source name/index, and then fails because that phantom source has no type defined.

Steps to reproduce:

Minimal docker-compose.yml environment:

yaml
environment:

  • NBS_COMMON_LOG_LEVEL=INFO
  • NBS_NETBOX_HOST_FQDN=netbox
  • NBS_NETBOX_PORT=8080
  • NBS_NETBOX_DISABLE_TLS=true
  • NBS_NETBOX_API_TOKEN=xxx
  • NBS_SOURCE_1_enabled=true
  • NBS_SOURCE_1_type=vmware
  • NBS_SOURCE_1_name=my-vcenter
  • NBS_SOURCE_1_host_fqdn=vcenter.example.com
  • NBS_SOURCE_1_username=readonly
  • NBS_SOURCE_1_password=secret
  • NBS_SOURCE_1_strip_host_domain_name=true

Observed behavior:

ERROR: Source true option 'type' is undefined

Changing the value to false reproduces the same error, just with the phantom source name matching:

ERROR: Source false option 'type' is undefined

Removing the NBS_SOURCE_1_strip_host_domain_name line entirely resolves the error and the sync proceeds normally.

Expected behavior:

strip_host_domain_name should be applied as a normal boolean option for the source it's defined on, without creating a spurious additional "source" from the value string.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions