@@ -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.
119119results , err := client.ValidateState (ctx, result, snap,
120120 aicr.WithValidationKubeconfig (" /path/to/target-kubeconfig" ))
121121if 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+
129136The ` recipe ` argument to ` ValidateState ` MUST be the ` *RecipeResult `
130137returned by the same Client's ` ResolveRecipe ` (or ` LoadRecipe ` ) call —
131138the unexported internal recipe state is required for constraint
0 commit comments