Skip to content

Commit

Permalink
add only distinct nodes to the network nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Eslam-Nawara committed Jul 29, 2024
1 parent c6ed018 commit 2dfefb9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion grid-cli/internal/cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"fmt"
"net"
"slices"

"github.com/pkg/errors"
"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -58,10 +59,11 @@ func DeployKubernetesCluster(ctx context.Context, t deployer.TFPluginClient, mas
projectName := fmt.Sprintf("kubernetes/%s", master.Name)
networkNodes := []uint32{master.Node}
for _, worker := range workers {
if worker.Node != master.Node {
if !slices.Contains(networkNodes, worker.Node) {
networkNodes = append(networkNodes, worker.Node)
}
}

network, err := buildNetwork(networkName, projectName, networkNodes, len(master.MyceliumIPSeed) != 0)
if err != nil {
return workloads.K8sCluster{}, err
Expand Down

0 comments on commit 2dfefb9

Please sign in to comment.