Skip to content

Commit 946691e

Browse files
committed
docs(sdk): made docs for SDK changes more explicit
Signed-off-by: Tjark Gunnar Rasche <trasche@nvidia.com>
1 parent b097243 commit 946691e

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

docs/integrator/go-library.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ if err != nil {
112112
}
113113

114114
// ValidateState runs the validation phases against the resolved recipe +
115-
// observed snapshot. Pass the same kubeconfig used for snapshot collection so
116-
// namespace, RBAC, ConfigMap, validator Job, and result operations all target
117-
// that cluster. With no WithValidationPhases option it runs all three phases
118-
// (Deployment, Conformance, Performance) in canonical order.
115+
// observed snapshot. Here, the same kubeconfig used for snapshot collection
116+
// ensures that namespace, RBAC, ConfigMap, validator Job, and result operations
117+
// all target that cluster. With no WithValidationPhases option it runs all three
118+
// phases (Deployment, Conformance, Performance) in canonical order.
119119
results, err := client.ValidateState(ctx, result, snap,
120120
aicr.WithValidationKubeconfig("/path/to/target-kubeconfig"))
121121
if err != nil {
@@ -126,6 +126,13 @@ for _, r := range results {
126126
}
127127
```
128128

129+
When `WithValidationKubeconfig` is omitted or passed an empty string,
130+
`ValidateState` uses the shared default Kubernetes client and its standard
131+
discovery chain: `KUBECONFIG`, `~/.kube/config`, then in-cluster configuration.
132+
When an explicit path is provided, the SDK reloads that kubeconfig and creates a
133+
fresh client for each validation run. The run reuses that client for all of its
134+
Kubernetes operations.
135+
129136
The `recipe` argument to `ValidateState` MUST be the `*RecipeResult`
130137
returned by the same Client's `ResolveRecipe` (or `LoadRecipe`) call —
131138
the unexported internal recipe state is required for constraint

0 commit comments

Comments
 (0)