Documentation
¶
Overview ¶
Package setup handles first-run credential migration for cinc. It detects an existing ~/.chef/credentials file and writes the equivalent ~/.cinc/credentials file by delegating to cli/config. Guided setup of a fresh profile is handled separately by the `cinc config create` command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrateChef ¶
MigrateChef reads chefPath and writes the equivalent credentials file to cincPath. Each profile is built via config.NewProfile (which validates client name, key path, and either a Chef server URL or a Supermarket site) and then persisted via config.WriteProfileWithExtras, so the keys cinc manages come out exactly as `cinc config create` would write them, chef_server_url renamed to cinc_server_url. Every other key in the profile is copied verbatim. Returns the number of profiles migrated.
Migration is all-or-nothing: every profile is resolved and validated before any of them is written. A half-migrated file would be worse than none at all, because the first-run flow only offers to migrate while ~/.cinc/credentials is still absent, so a partial write would strand the user with some profiles missing and no prompt to finish.
Types ¶
This section is empty.