Skip to content

Commit

Permalink
fix: Add documentation for the "myks sync" step regarding authenticat…
Browse files Browse the repository at this point in the history
…ion against protected repositories.
  • Loading branch information
Fritz Durchardt committed Jul 27, 2023
1 parent fe661ef commit bec6f89
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,14 @@ $ find
$ # Sync and render everything
$ myks all envs --log-level debug
```

### Run

#### Running `sync` against protected repositories and registries

Vendir uses `secret` resources to authenticate against protected repositories. These are references by the `vendir.yaml` with the `secretRef` key.

Myks dynamically creates these secrets based on environment variables prefixed with `VENDIR_SECRET_`.
For example, if you reference a secret named "mycreds" in your `vendir.yaml, you need to define the environment variables VENDIR_SECRET_MYCREDS_USERNAME` and `VENDIR_SECRET_MYCREDS_PASSWORD`.

These secrets are cleaned up after the sync is complete.
6 changes: 5 additions & 1 deletion cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ func init() {
cmd := &cobra.Command{
Use: "sync",
Short: "Sync vendir configs",
Long: "Sync vendir configs",
Long: `Sync vendir configs. This will run vendir sync for all applications.
For authentication against protected repositories, authentication is achieved by using environment variables prefixed with "VENDIR_SECRET_".
For example, if you reference a secret named "mycreds" in your vendir.yaml, you would need to define the environment variables "VENDIR_SECRET_MYCREDS_USERNAME" and
"VENDIR_SECRET_MYCREDS_PASSWORD".`,
Run: func(cmd *cobra.Command, args []string) {
log.Info().Msg("Syncing vendir configs")
g := myks.New(".")
Expand Down

0 comments on commit bec6f89

Please sign in to comment.