Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Duologic committed Nov 28, 2020
1 parent 147397e commit d31bdd2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion docs/docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ Tanka's behavior can be customized per Environment using a file called `spec.jso
"diffStrategy": "[native, subset]" | default = "auto",

// Whether to add a "tanka.dev/environment" label to each created resource.
// Required for garbage collection ("tk prune").
"injectLabels": <boolean> | default = false

// Whether to add a "tanka.dev/prune-mark" label to each created resource.
// Required for garbage collection ("tk prune").
"pruneMark": <boolean> | default = false
}
}
```
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/garbage-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ from Jsonnet.

> **Note:** This feature is **experimental**. Please report problems at https://github.com/grafana/tanka/issues.
To accomplish this, it appends the `tanka.dev/environment: <name>` label to each created
resource. This is used to identify those which are missing from the local state in the
future.
To accomplish this, it appends the `tanka.dev/prune-mark: sha256(relative_path)`
label to each created resource. This is used to identify those which are missing
from the local state in the future.

Because the label causes a `diff` for every single object in your cluster and
not everybody wants this, it needs to be explicitly enabled. To do so, add the
Expand All @@ -22,7 +22,7 @@ following field to your `spec.json`:
```diff
{
"spec": {
+ "injectLabels": true,
+ "pruneMark": true,
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion pkg/tanka/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type PruneOpts struct {
}

// Prune deletes all resources from the cluster, that are no longer present in
// Jsonnet. It uses the `tanka.dev/environment` label to identify those.
// Jsonnet. It uses the `tanka.dev/prune-mark` label to identify those.
func Prune(baseDir string, opts PruneOpts) error {
// parse jsonnet, init k8s client
p, err := load(baseDir, opts.Opts)
Expand Down

0 comments on commit d31bdd2

Please sign in to comment.