good first issueteam/collie
Repository metrics
- Stars
- (886 stars)
- PR merge metrics
- (PR metrics pending)
Description
Since we are using a simple fmt.Sprintf to create the configration yaml for the virtual and shared agents, without checking the values this could lead to some possible misconfiguration:
func virtualAgentData(serviceIP, token string) string {
return fmt.Sprintf(`server: https://%s:6443
token: %s
with-node-id: true`, serviceIP, token)
}
func sharedAgentData(cluster *v1alpha1.Cluster, serviceName, token, ip string) string {
version := cluster.Spec.Version
if cluster.Spec.Version == "" {
version = cluster.Status.HostVersion
}
return fmt.Sprintf(`clusterName: %s
clusterNamespace: %s
serverIP: %s
serviceName: %s
token: %s
version: %s`,
cluster.Name, cluster.Namespace, ip, serviceName, token, version)
}