This commit is contained in:
2023-12-19 16:37:50 +03:00
parent 20050bc169
commit f49d9f8860
150 changed files with 12582 additions and 11709 deletions

View File

@@ -106,7 +106,7 @@ func flattenWorkerComputes(cluster *k8s.RecordK8S) []map[string]interface{} {
}
func flattenAclList(aclList k8s.ListACL) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len (aclList))
res := make([]map[string]interface{}, 0, len(aclList))
for _, acl := range aclList {
temp := map[string]interface{}{
"explicit": acl.Explicit,
@@ -134,7 +134,7 @@ func flattenAcl(acl k8s.RecordACL) []map[string]interface{} {
}
func flattenInterfaces(interfaces compute.ListInterfaces) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len (interfaces))
res := make([]map[string]interface{}, 0, len(interfaces))
for _, interfaceCompute := range interfaces {
temp := map[string]interface{}{
"def_gw": interfaceCompute.DefGW,
@@ -147,7 +147,7 @@ func flattenInterfaces(interfaces compute.ListInterfaces) []map[string]interface
}
func flattenDetailedInfo(detailedInfoList k8s.ListDetailedInfo, computes []compute.RecordCompute) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len (detailedInfoList))
res := make([]map[string]interface{}, 0, len(detailedInfoList))
if computes != nil {
for i, detailedInfo := range detailedInfoList {
temp := map[string]interface{}{
@@ -247,6 +247,7 @@ func flattenK8sData(d *schema.ResourceData, cluster k8s.RecordK8S, masters []com
d.Set("workers", flattenK8sGroup(cluster.K8SGroups.Workers, workers))
d.Set("lb_id", cluster.LBID)
d.Set("name", cluster.Name)
d.Set("network_plugin", cluster.NetworkPlugin)
d.Set("rg_id", cluster.RGID)
d.Set("rg_name", cluster.RGName)
d.Set("status", cluster.Status)
@@ -267,7 +268,7 @@ func flattenServiceAccount(serviceAccount k8s.RecordServiceAccount) []map[string
}
func flattenWorkersGroup(workersGroups k8s.ListK8SGroups) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len (workersGroups))
res := make([]map[string]interface{}, 0, len(workersGroups))
for _, worker := range workersGroups {
temp := map[string]interface{}{
"annotations": worker.Annotations,
@@ -288,11 +289,11 @@ func flattenWorkersGroup(workersGroups k8s.ListK8SGroups) []map[string]interface
}
func flattenK8sItems(k8sItems *k8s.ListK8SClusters) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len (k8sItems.Data))
res := make([]map[string]interface{}, 0, len(k8sItems.Data))
for _, item := range k8sItems.Data {
temp := map[string]interface{}{
"account_id": item.AccountID,
"account_name": item.Name,
"account_name": item.AccountName,
"acl": item.ACL,
"bservice_id": item.BServiceID,
"ci_id": item.CIID,
@@ -308,6 +309,7 @@ func flattenK8sItems(k8sItems *k8s.ListK8SClusters) []map[string]interface{} {
"lb_id": item.LBID,
"milestones": item.Milestones,
"k8s_name": item.Name,
"network_plugin": item.NetworkPlugin,
"rg_id": item.RGID,
"rg_name": item.RGName,
"service_account": flattenServiceAccount(item.ServiceAccount),