add volumes to container as map

This commit is contained in:
mr 2024-10-01 10:17:22 +02:00
parent e621fb616a
commit 4ec32bafa7
2 changed files with 5 additions and 6 deletions

View File

@ -158,6 +158,10 @@ func SetConfig(mongoUrl string, database string, natsUrl string, lokiUrl string,
Type: "string",
ReadOnly: false,
}
m["volumes"] = resource_model.Model{
Type: "map[string]string",
ReadOnly: false,
}
}
accessor.StoreOne(&resource_model.ResourceModel{
ResourceType: model,

View File

@ -9,17 +9,12 @@ import (
"cloud.o-forge.io/core/oc-lib/tools"
)
type Volume struct {
Name string `json:"name,omitempty" bson:"name,omitempty"` // Name is the volume name
Path string `json:"path,omitempty" bson:"path,omitempty"` // Path is the volume path
}
type Container struct {
Image string `json:"image,omitempty" bson:"image,omitempty"` // Image is the container image
Command string `json:"command,omitempty" bson:"command,omitempty"` // Command is the container command
Args string `json:"args,omitempty" bson:"args,omitempty"` // Args is the container arguments
Env map[string]string `json:"env,omitempty" bson:"env,omitempty"` // Env is the container environment variables
Volumes []Volume
Volumes map[string]string `json:"volumes,omitempty" bson:"volumes,omitempty"` // Volumes is the container volumes
}
type Expose struct {