adding inputs output struct based on argo naming for now

This commit is contained in:
mr 2025-01-28 13:38:31 +01:00
parent db85d1a48b
commit bf1d4a4001

View File

@ -5,6 +5,7 @@ import (
"time" "time"
"cloud.o-forge.io/core/oc-lib/models/common/enum" "cloud.o-forge.io/core/oc-lib/models/common/enum"
"cloud.o-forge.io/core/oc-lib/models/common/models"
"cloud.o-forge.io/core/oc-lib/models/common/pricing" "cloud.o-forge.io/core/oc-lib/models/common/pricing"
"cloud.o-forge.io/core/oc-lib/models/utils" "cloud.o-forge.io/core/oc-lib/models/utils"
"cloud.o-forge.io/core/oc-lib/tools" "cloud.o-forge.io/core/oc-lib/tools"
@ -52,8 +53,22 @@ type StorageResourceInstance struct {
Throughput string `bson:"throughput,omitempty" json:"throughput,omitempty"` // Throughput is the throughput of the storage Throughput string `bson:"throughput,omitempty" json:"throughput,omitempty"` // Throughput is the throughput of the storage
} }
func (i *StorageResourceInstance) GetID() string { func (ri *StorageResourceInstance) StoreDraftDefault() {
return i.UUID found := false
for _, p := range ri.ResourceInstance.Outputs {
if p.Attr == "source" {
found = true
break
}
}
if !found {
ri.ResourceInstance.Outputs = append(ri.ResourceInstance.Outputs, models.Param{
Attr: "source",
Value: ri.Source,
Readonly: true,
})
}
ri.ResourceInstance.StoreDraftDefault()
} }
type StorageResourcePartnership struct { type StorageResourcePartnership struct {