v1.6.8
This commit is contained in:
28
pkg/cloudapi/k8s/ids.go
Normal file
28
pkg/cloudapi/k8s/ids.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package k8s
|
||||
|
||||
// IDs gets array of K8SIDs from ListK8SClusters struct
|
||||
func (lk ListK8SClusters) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lk.Data))
|
||||
for _, k := range lk.Data {
|
||||
res = append(res, k.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of K8SWorkerGroupIDs from ListK8SGroups struct
|
||||
func (lwg ListK8SGroups) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lwg))
|
||||
for _, wg := range lwg {
|
||||
res = append(res, wg.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of Worker or Master ComputesIDs from ListDetailedInfo struct
|
||||
func (ldi ListDetailedInfo) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(ldi))
|
||||
for _, di := range ldi {
|
||||
res = append(res, di.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
Reference in New Issue
Block a user