roles
This commit is contained in:
parent
26d53bc593
commit
82f5126c34
17
image.php
17
image.php
|
@ -11,8 +11,11 @@ class image extends objectStructs
|
||||||
public $annotations;
|
public $annotations;
|
||||||
/** @var imageConfig */
|
/** @var imageConfig */
|
||||||
public $config;
|
public $config;
|
||||||
/** @var string name of image */
|
/** @var string name of hte image*/
|
||||||
public $image;
|
public $imageName;
|
||||||
|
/** @var string name of image after the registry domain -- /image:latest */
|
||||||
|
public $shortName;
|
||||||
|
|
||||||
|
|
||||||
public function __construct($vars)
|
public function __construct($vars)
|
||||||
{
|
{
|
||||||
|
@ -21,6 +24,16 @@ class image extends objectStructs
|
||||||
$this->imageName = (isset($vars['image']) ? $vars['image'] :
|
$this->imageName = (isset($vars['image']) ? $vars['image'] :
|
||||||
(isset($vars['name']) ? $vars['name'] :
|
(isset($vars['name']) ? $vars['name'] :
|
||||||
(isset($vars['imageName']) ? $vars['imageName'] : "" ) ) ) ;
|
(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) )
|
if (isset( $vars['imageBasic']->annotations) )
|
||||||
$annotations = $vars['imageBasic']->annotations;
|
$annotations = $vars['imageBasic']->annotations;
|
||||||
elseif (isset($vars['annotations']))
|
elseif (isset($vars['annotations']))
|
||||||
|
|
Loading…
Reference in New Issue