Skip to content

Commit

Permalink
AWS EKS 인터페이스 오류 처리 / 현재 AccessInfo.Kubeconfig와 AddonsInfo는 미구현
Browse files Browse the repository at this point in the history
  • Loading branch information
dev4unet committed Dec 16, 2022
1 parent 1d48cae commit 40e98ca
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ func handleCluster() {
Network: irs.NetworkInfo{
VpcIID: irs.IID{SystemId: "vpc-0c4d36a3ac3924419"},
//SubnetIID: [irs.IID{SystemId: "subnet-262d6d7a"},irs.IID{SystemId: "vpc-c0479cab"}],
SubnetIID: subnets,
SubnetIIDs: subnets,
},
} // nlbReqInfo

Expand Down Expand Up @@ -1546,25 +1546,27 @@ func handleCluster() {
cblogger.Infof("[%s] Cluster Delete 성공 : [%s]", clusterReqInfo.IId.NameId, result)
}

case 5:
cblogger.Infof("[%s] ListNodeGroup 테스트", clusterReqInfo.IId)
result, err := handler.ListNodeGroup(clusterReqInfo.IId)
if err != nil {
cblogger.Infof("[%s] ListNodeGroup 실패 : ", clusterReqInfo.IId.NameId, err)
} else {
cblogger.Infof("[%s] ListNodeGroup 성공 : [%s]", clusterReqInfo.IId.NameId, result)
if cblogger.Level.String() == "debug" {
spew.Dump(result)
}

cblogger.Info("출력 결과 수 : ", len(result))

//조회및 삭제 테스트를 위해 리스트의 첫번째 정보의 ID를 요청ID로 자동 갱신함.
if len(result) > 0 {
reqNodeGroupInfo.IId = result[0].IId // 조회 및 삭제를 위해 생성된 ID로 변경
cblogger.Info("---> Req IID 변경 : ", reqNodeGroupInfo.IId)
/*
case 5:
cblogger.Infof("[%s] ListNodeGroup 테스트", clusterReqInfo.IId)
result, err := handler.ListNodeGroup(clusterReqInfo.IId)
if err != nil {
cblogger.Infof("[%s] ListNodeGroup 실패 : ", clusterReqInfo.IId.NameId, err)
} else {
cblogger.Infof("[%s] ListNodeGroup 성공 : [%s]", clusterReqInfo.IId.NameId, result)
if cblogger.Level.String() == "debug" {
spew.Dump(result)
}
cblogger.Info("출력 결과 수 : ", len(result))
//조회및 삭제 테스트를 위해 리스트의 첫번째 정보의 ID를 요청ID로 자동 갱신함.
if len(result) > 0 {
reqNodeGroupInfo.IId = result[0].IId // 조회 및 삭제를 위해 생성된 ID로 변경
cblogger.Info("---> Req IID 변경 : ", reqNodeGroupInfo.IId)
}
}
}
*/

case 6:
cblogger.Infof("[%s] AddNodeGroup 테스트", clusterReqInfo.IId)
Expand Down Expand Up @@ -1625,7 +1627,7 @@ func main() {
//handleKeyPair()
//handlePublicIP() // PublicIP 생성 후 conf
//handleSecurity()
handleVM()
//handleVM()

//handleImage() //AMI
//handleVNic() //Lancard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (ClusterHandler *AwsClusterHandler) CreateCluster(clusterReqInfo irs.Cluste
securityGroupIds = append(securityGroupIds, aws.String(securityGroupIID.SystemId))
}

reqSubnetIds := clusterReqInfo.Network.SubnetIID
reqSubnetIds := clusterReqInfo.Network.SubnetIIDs
var subnetIds []*string
for _, subnetIID := range reqSubnetIds {
subnetIds = append(subnetIds, aws.String(subnetIID.SystemId))
Expand Down Expand Up @@ -346,6 +346,7 @@ func (ClusterHandler *AwsClusterHandler) GetCluster(clusterIID irs.IID) (irs.Clu
Version: *result.Cluster.Version,
CreatedTime: *result.Cluster.CreatedAt,
Status: irs.ClusterStatus(*result.Cluster.Status),
AccessInfo: irs.AccessInfo{Endpoint: *result.Cluster.Endpoint},
}
/*
NodeGroupList []NodeGroupInfo
Expand All @@ -359,7 +360,7 @@ func (ClusterHandler *AwsClusterHandler) GetCluster(clusterIID irs.IID) (irs.Clu
//SubnetIds: ["subnet-0d30ee6b367974a39","subnet-06d5c04b32019b81f","subnet-05c5d26bd2f014591"],
if len(result.Cluster.ResourcesVpcConfig.SubnetIds) > 0 {
for _, curSubnetId := range result.Cluster.ResourcesVpcConfig.SubnetIds {
clusterInfo.Network.SubnetIID = append(clusterInfo.Network.SubnetIID, irs.IID{SystemId: *curSubnetId})
clusterInfo.Network.SubnetIIDs = append(clusterInfo.Network.SubnetIIDs, irs.IID{SystemId: *curSubnetId})
}
}

Expand Down Expand Up @@ -513,7 +514,7 @@ func (ClusterHandler *AwsClusterHandler) AddNodeGroup(clusterIID irs.IID, nodeGr

networkInfo := clusterInfo.Network
var subnetList []*string
for _, subnet := range networkInfo.SubnetIID {
for _, subnet := range networkInfo.SubnetIIDs {
subnetId := subnet.SystemId // 포인터라서 subnet.SystemId를 직접 Append하면 안 됨.
subnetList = append(subnetList, &subnetId)
}
Expand Down Expand Up @@ -934,7 +935,7 @@ func (NodeGroupHandler *AwsClusterHandler) convertNodeGroup(nodeGroupOutput *eks
return irs.NodeGroupInfo{}, errNodeList
}

nodeGroupInfo.NodeList = nodeList
nodeGroupInfo.Nodes = nodeList

nodeGroupInfo.DesiredNodeSize = int(*scalingConfig.DesiredSize)
nodeGroupInfo.MinNodeSize = int(*scalingConfig.MinSize)
Expand Down

0 comments on commit 40e98ca

Please sign in to comment.