ENV, Input, Outpu Expose, Container change of rules
This commit is contained in:
@@ -44,6 +44,15 @@ func (abs *StorageResource) ConvertToPricedResource(t tools.DataType, selectedIn
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (ri *StorageResource) StoreDraftDefault() {
|
||||
ri.AbstractObject.StoreDraftDefault()
|
||||
ri.Env = append(ri.Env, models.Param{
|
||||
Attr: "source",
|
||||
Value: "[resource]instance.source",
|
||||
Readonly: true,
|
||||
})
|
||||
}
|
||||
|
||||
type StorageResourceInstance struct {
|
||||
ResourceInstance[*StorageResourcePartnership]
|
||||
Source string `bson:"source,omitempty" json:"source,omitempty"` // Source is the source of the storage
|
||||
@@ -72,30 +81,6 @@ func NewStorageResourceInstance(name string, peerID string) ResourceInstanceITF
|
||||
}
|
||||
}
|
||||
|
||||
func (ri *StorageResourceInstance) ClearEnv() {
|
||||
ri.Env = []models.Param{}
|
||||
ri.Inputs = []models.Param{}
|
||||
ri.Outputs = []models.Param{}
|
||||
}
|
||||
|
||||
func (ri *StorageResourceInstance) StoreDraftDefault() {
|
||||
found := false
|
||||
for _, p := range ri.ResourceInstance.Env {
|
||||
if p.Attr == "source" {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
ri.ResourceInstance.Env = append(ri.ResourceInstance.Env, models.Param{
|
||||
Attr: "source",
|
||||
Value: ri.Source,
|
||||
Readonly: true,
|
||||
})
|
||||
}
|
||||
ri.ResourceInstance.StoreDraftDefault()
|
||||
}
|
||||
|
||||
type StorageResourcePartnership struct {
|
||||
ResourcePartnerShip[*StorageResourcePricingProfile]
|
||||
MaxSizeGBAllowed float64 `json:"allowed_gb,omitempty" bson:"allowed_gb,omitempty"`
|
||||
@@ -121,7 +106,7 @@ func (t PrivilegeStoragePricingStrategy) String() string {
|
||||
type StorageResourcePricingStrategy int
|
||||
|
||||
const (
|
||||
PER_DATA_STORED StorageResourcePricingStrategy = iota + 6
|
||||
PER_DATA_STORED StorageResourcePricingStrategy = iota + 7
|
||||
PER_TB_STORED
|
||||
PER_GB_STORED
|
||||
PER_MB_STORED
|
||||
|
||||
Reference in New Issue
Block a user