mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
* [api/devstate] Add volumes to Devfile content * Add Volume related endpoints to API * Create/Delete volumes from the Volumes Tab * Update UI static files * API Devstate returns VolumeMounts * Display volume mounts in containers * [api] Add VolumeMounts to containers * [ui] Define container's volume mounts * [ui] e2e tests * Update UI static files * [ui] create volumes from container / exec command creation * Update UI static files * Update container display * Update UI static files * Regenerate UI static files
45 lines
1.1 KiB
Go
Generated
45 lines
1.1 KiB
Go
Generated
/*
|
|
* odo dev
|
|
*
|
|
* API interface for 'odo dev'
|
|
*
|
|
* API version: 0.1
|
|
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
*/
|
|
|
|
package openapi
|
|
|
|
type Volume struct {
|
|
Name string `json:"name"`
|
|
|
|
Ephemeral bool `json:"ephemeral,omitempty"`
|
|
|
|
Size string `json:"size,omitempty"`
|
|
}
|
|
|
|
// AssertVolumeRequired checks if the required fields are not zero-ed
|
|
func AssertVolumeRequired(obj Volume) error {
|
|
elements := map[string]interface{}{
|
|
"name": obj.Name,
|
|
}
|
|
for name, el := range elements {
|
|
if isZero := IsZeroValue(el); isZero {
|
|
return &RequiredError{Field: name}
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// AssertRecurseVolumeRequired recursively checks if required fields are not zero-ed in a nested slice.
|
|
// Accepts only nested slice of Volume (e.g. [][]Volume), otherwise ErrTypeAssertionError is thrown.
|
|
func AssertRecurseVolumeRequired(objSlice interface{}) error {
|
|
return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
|
|
aVolume, ok := obj.(Volume)
|
|
if !ok {
|
|
return ErrTypeAssertionError
|
|
}
|
|
return AssertVolumeRequired(aVolume)
|
|
})
|
|
}
|