{"record":{"id":"2371cd53e640377a","repo":"istio/istio","slug":"components-pilot-k8s-replicacount-should-not-be-se","errorCode":null,"errorMessage":"components.pilot.k8s.replicaCount should not be set when values.pilot.autoscaleEnabled is true","messagePattern":"components\\.pilot\\.k8s\\.replicaCount should not be set when values\\.pilot\\.autoscaleEnabled is true","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"operator/pkg/apis/validation/validation.go","lineNumber":294,"sourceCode":"\tfor _, validator := range validators {\n\t\tnewWarnings, newErrs := validator(values, spec)\n\t\terrs = util.AppendErrs(errs, newErrs)\n\t\twarnings = append(warnings, newWarnings...)\n\t}\n\n\treturn warnings, errs\n}\n\n// checkAutoScaleAndReplicaCount warns when autoscaleEnabled is true and k8s replicaCount is set.\nfunc checkAutoScaleAndReplicaCount(values *apis.Values, spec apis.IstioOperatorSpec) (Warnings, util.Errors) {\n\tif spec.Components == nil {\n\t\treturn nil, nil\n\t}\n\tvar warnings Warnings\n\tif values.GetPilot().GetAutoscaleEnabled().GetValue() {\n\t\tif spec.Components.Pilot != nil && spec.Components.Pilot.Kubernetes != nil && spec.Components.Pilot.Kubernetes.ReplicaCount > 1 {\n\t\t\twarnings = append(warnings,\n\t\t\t\tfmt.Errorf(\"components.pilot.k8s.replicaCount should not be set when values.pilot.autoscaleEnabled is true\"))\n\t\t}\n\t}\n\n\tvalidateGateways := func(gateways []apis.GatewayComponentSpec, gwType string) {\n\t\tconst format = \"components.%sGateways[name=%s].k8s.replicaCount should not be set when values.gateways.istio-%sgateway.autoscaleEnabled is true\"\n\t\tfor _, gw := range gateways {\n\t\t\tif gw.Kubernetes != nil && gw.Kubernetes.ReplicaCount != 0 {\n\t\t\t\twarnings = append(warnings, fmt.Errorf(format, gwType, gw.Name, gwType))\n\t\t\t}\n\t\t}\n\t}\n\n\tif values.GetGateways().GetIstioIngressgateway().GetAutoscaleEnabled().GetValue() {\n\t\tvalidateGateways(spec.Components.IngressGateways, \"ingress\")\n\t}\n\n\tif values.GetGateways().GetIstioEgressgateway().GetAutoscaleEnabled().GetValue() {\n\t\tvalidateGateways(spec.Components.EgressGateways, \"egress\")","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/istio/istio/blob/8dc789c5cf17517c64e3c36cb3288230f149dfae/operator/pkg/apis/validation/validation.go#L276-L312","documentation":"Error \"components.pilot.k8s.replicaCount should not be set when values.pilot.autoscaleEnabled is true\" thrown in istio/istio.","triggerScenarios":"Thrown at operator/pkg/apis/validation/validation.go:294 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8dc789c5cf17517c64e3c36cb3288230f149dfae","analyzedAt":"2026-08-15T15:16:55.434Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}