From 32ebe5817fc530951b01de03e2ae8a507c727283 Mon Sep 17 00:00:00 2001
From: Phillip Stagnet
Date: Wed, 18 Sep 2024 11:24:54 +0200
Subject: [PATCH] Remove default replicas amount
Instead make it required to either have replicas set or max replicas.
This should ensure that users that didn't set replicas before get an
appropriate warning.
---
metakube/resource_node_deployment_schema.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/metakube/resource_node_deployment_schema.go b/metakube/resource_node_deployment_schema.go
index ae1e968..75be134 100644
--- a/metakube/resource_node_deployment_schema.go
+++ b/metakube/resource_node_deployment_schema.go
@@ -25,9 +25,9 @@ func metakubeResourceNodeDeploymentSpecFields() map[string]*schema.Schema {
"replicas": {
Type: schema.TypeInt,
Optional: true,
- Default: 3,
Description: "Number of replicas",
ConflictsWith: []string{"spec.0.min_replicas", "spec.0.max_replicas"},
+ ExactlyOneOf: []string{"spec.0.replicas", "spec.0.max_replicas"},
DiffSuppressFunc: func(_, _, _ string, d *schema.ResourceData) bool {
minv, ok1 := d.GetOk("spec.0.min_replicas")
maxv, ok2 := d.GetOk("spec.0.max_replicas")