1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 15:47:14 +01:00
Files
installer/pkg/nodejoiner/monitoraddnodes.go
Richard Su f35fa62d5f AGENT-862: Extend monitor-add-nodes to support multiple nodes
Multiple IP addresses can now be specified for monitoring at the
same time.
2024-07-15 12:07:31 -04:00

32 lines
801 B
Go

package nodejoiner
import (
"context"
agentpkg "github.com/openshift/installer/pkg/agent"
"github.com/openshift/installer/pkg/asset/agent/workflow"
)
// NewMonitorAddNodesCommand creates a new command for monitor add nodes.
func NewMonitorAddNodesCommand(directory, kubeconfigPath string, ips []string) error {
err := saveParams(directory, kubeconfigPath)
if err != nil {
return err
}
// sshKey is not required parameter for monitor-add-nodes
sshKey := ""
clusters := []*agentpkg.Cluster{}
for _, ip := range ips {
cluster, err := agentpkg.NewCluster(context.Background(), directory, ip, kubeconfigPath, sshKey, workflow.AgentWorkflowTypeAddNodes)
if err != nil {
return err
}
clusters = append(clusters, cluster)
}
agentpkg.MonitorAddNodes(clusters, ips)
return nil
}