Skip to content
  • Silvio Ankermann's avatar
    Make sourcing lib.sh side-effect free · 8290d815
    Silvio Ankermann authored and Silvio Ankermann's avatar Silvio Ankermann committed
    Currently, sourcing lib.sh has side effects:
    
    1. It tries to access multiple files (eg. config.toml) and fails if they
    are not present
    2. It creates a file in vault/container-name (which is not even needed
    in production clusters)
    
    That's not typical behaviour for a library and makes it hard to re-use.
    
    This commit capsules all commands that read from certain files into the
    new function load_conf_vars that is now run immediately after each
    import of lib.sh where the variables are needed.
    
    It also introduces a new function load_vault_container_name that is only
    run when the container name is actually needed.
    8290d815