Skip to content

Commit

Permalink
Merge pull request #15 from GLYASAI/V5.3
Browse files Browse the repository at this point in the history
Bug Fix: RKE config not found
  • Loading branch information
barnettZQG authored Jul 9, 2021
2 parents 1bf1360 + 19b9bd8 commit 728bae7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hack/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
args:
- --leader-elect
- --zap-log-level=4
image: registry.cn-hangzhou.aliyuncs.com/goodrain/rainbond-operator:v2.0.0
image: registry.cn-hangzhou.aliyuncs.com/goodrain/rainbond-operator:v2.0.1
imagePullPolicy: IfNotPresent
name: rainbond-operator
securityContext:
Expand Down
19 changes: 16 additions & 3 deletions internal/usecase/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -765,17 +765,30 @@ func (c *ClusterUsecase) InstallCluster(eid, clusterID string) (*model.CreateKub
logrus.Errorf("create kubernetes task failure %s", err.Error())
return nil, bcode.ServerErr
}
var nodes v1alpha1.NodeList
json.Unmarshal([]byte(cluster.NodeList), &nodes)

// get rke config
rkeConfig, err := c.getRKEConfig(eid, cluster)
if err != nil {
return nil, err
}
// validate nodes
nodeList, err := c.rkeConfigToNodeList(rkeConfig)
if err != nil {
return nil, err
}
if err := nodeList.Validate(); err != nil {
return nil, err
}

//send task
taskReq := types.KubernetesConfigMessage{
EnterpriseID: eid,
TaskID: newTask.TaskID,
KubernetesConfig: &v1alpha1.KubernetesClusterConfig{
ClusterName: newTask.Name,
Provider: newTask.Provider,
Nodes: nodes,
EnterpriseID: eid,
RKEConfig: rkeConfig,
}}
if err := c.TaskProducer.SendCreateKuerbetesTask(taskReq); err != nil {
logrus.Errorf("send create kubernetes task failure %s", err.Error())
Expand Down

0 comments on commit 728bae7

Please sign in to comment.