Merge remote-tracking branch 'origin/master'

This commit is contained in:
sbyrd 2020-12-18 22:10:12 -05:00
commit f14b92ad46
3 changed files with 12 additions and 4 deletions

View File

@ -19,6 +19,7 @@ class image extends objectStructs
public function __construct($vars)
{
$this->Log(__FUNCTION__ . " load image object with: ".print_r($vars,true));
if (is_array($vars))
{
$this->imageName = (isset($vars['image']) ? $vars['image'] :
@ -38,6 +39,8 @@ class image extends objectStructs
$annotations = $vars['imageBasic']->annotations;
elseif (isset($vars['annotations']))
$annotations = $vars['annotations'];
else
$annotations = array();
$this->annotations = new imageAnnotations($annotations);
if (isset($vars['imageConfig']))

View File

@ -19,10 +19,12 @@ class imageAnnotations extends objectStructs
public function __construct($Result = null)
{
parent::__construct($Result);
if ($this->roles and empty($this->roles) )
{
$this->roles = explode(',',$this->roles);
}
$this->Log(__FUNCTION__ . " Load imageAnnotations with".print_r($Result,true));
if (is_string($Result->roles))
$this->roles = explode(',',$Result->roles);
}
public function hasRole( string $Role)

View File

@ -114,6 +114,7 @@ class podmanImageManager implements podmanImageManagerInterface
try {
$ImageRaw = $this->doRequest($ImageManifestURL, null, array('Accept: application/vnd.oci.image.manifest.v1+json'),true);
// echo "<br> image maniest<br><pre>".print_r($ImageRaw,true)."</pre>";
}
catch (\Exception $e)
{
@ -130,6 +131,8 @@ class podmanImageManager implements podmanImageManagerInterface
$Image = new image( array('name'=>$ImageNameComplete, 'imageBasic'=>$ImageRaw, 'imageConfig'=>$ImageConfigRaw));
if ($Image)
{
file_put_contents('/var/www/vhosts/whmcsbeta.u2-web.com/httpdocs/modules/servers/iniApp_WHMCS/log.txt', "image: ".print_r($Image,true), FILE_APPEND);
if ($imageTag === $tag )
return $Image;
}