Skip to content

Establish sentinel value for Importer.Import's "importedFrom" parameter #329

@seh

Description

@seh

Per preceding discussion in vmware-archive/kubecfg#266, the Importer.Importer method's "importedFrom" parameter is not documented at present, and interpreting its value varies by Importer implementation. When importing values for external variables and TLAs, though, such as for files nominated either by the --ext-str-file, --ext-code-file, --tla-str-file, and --tla-code-file flags or in the value of the --ext-code or --tla-code flags, the "importedFrom" location is best thought of as "the top-level context of program," which often means the current working directory.

In order to allow Importer implementations to detect these special importing scenarios, @sbarzowski proposed replacing the current sentinel values passed as arguments for the "importedFrom" parameter (e.g. <extvar:example>) with the empty string, per vmware-archive/kubecfg#266 (comment). Not just that, but we would also document this contract as part of the Importer interface, so that all Importer implementations could count on receiving this value to trigger their own interpretation of "this path is being imported in the top-level context."

The pending vmware-archive/kubecfg#271 shows an Importer implementation that depends upon this proposed contract.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions