setup

package
v0.27.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 CheckChef added in v0.26.0

func CheckChef(chefPath string) error

CheckChef reports why the knife credentials file at chefPath cannot be migrated, or nil if MigrateChef can migrate it. First-run setup asks this before offering the migration, so it never offers one that can only fail or migrate nothing. The reason is phrased to follow "we can't migrate it: ".

func MigrateChef

func MigrateChef(chefPath, cincPath string) (int, error)

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. For the same reason a file with no profiles is an error, not a migration of nothing.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL