This commit is contained in:
sbyrd 2020-12-07 16:50:41 -05:00
parent 26d53bc593
commit 82f5126c34
1 changed files with 15 additions and 2 deletions

View File

@ -11,8 +11,11 @@ class image extends objectStructs
public $annotations;
/** @var imageConfig */
public $config;
/** @var string name of image */
public $image;
/** @var string name of hte image*/
public $imageName;
/** @var string name of image after the registry domain -- /image:latest */
public $shortName;
public function __construct($vars)
{
@ -21,6 +24,16 @@ class image extends objectStructs
$this->imageName = (isset($vars['image']) ? $vars['image'] :
(isset($vars['name']) ? $vars['name'] :
(isset($vars['imageName']) ? $vars['imageName'] : "" ) ) ) ;
if (empty($this->imageName))
throw new \Exception(__FUNCTION__ . " Image name is empty");
list($RegistryDomain, $ImageShortName) = explode('/',$this->imageName,2);
if (!$ImageShortName)
throw new \Exception(__FUNCTION__ . " Image short name not valid");
else
$this->shortName = $ImageShortName;
if (isset( $vars['imageBasic']->annotations) )
$annotations = $vars['imageBasic']->annotations;
elseif (isset($vars['annotations']))