From 17a51ec3bab02a26d4bbdca64dea4efa7ef14491 Mon Sep 17 00:00:00 2001 From: sbyrd Date: Thu, 17 Dec 2020 22:27:46 -0500 Subject: [PATCH 1/6] roles --- podmanImageManager.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/podmanImageManager.php b/podmanImageManager.php index c0e3811..f478711 100644 --- a/podmanImageManager.php +++ b/podmanImageManager.php @@ -130,6 +130,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; } From d8797fa0d761a4d5f3ec9e15588a907defb7c0d8 Mon Sep 17 00:00:00 2001 From: sbyrd Date: Thu, 17 Dec 2020 22:31:41 -0500 Subject: [PATCH 2/6] roles --- image.php | 1 + podmanImageManager.php | 1 + 2 files changed, 2 insertions(+) diff --git a/image.php b/image.php index 30d76ff..23d606b 100644 --- a/image.php +++ b/image.php @@ -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'] : diff --git a/podmanImageManager.php b/podmanImageManager.php index f478711..e30f17b 100644 --- a/podmanImageManager.php +++ b/podmanImageManager.php @@ -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 "
image maniest
".print_r($ImageRaw,true)."
"; + } catch (\Exception $e) { From d894c98d669c79ccfdfabdd17cc2ca472a3dafd4 Mon Sep 17 00:00:00 2001 From: sbyrd Date: Thu, 17 Dec 2020 22:36:23 -0500 Subject: [PATCH 3/6] roles --- image.php | 2 ++ imageAnnotations.php | 1 + 2 files changed, 3 insertions(+) diff --git a/image.php b/image.php index 23d606b..535101f 100644 --- a/image.php +++ b/image.php @@ -39,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'])) diff --git a/imageAnnotations.php b/imageAnnotations.php index 2411590..cfa028e 100644 --- a/imageAnnotations.php +++ b/imageAnnotations.php @@ -21,6 +21,7 @@ class imageAnnotations extends objectStructs parent::__construct($Result); if ($this->roles and empty($this->roles) ) { + $this->Log(__FUNCTION__ . " We have roles, lets explode"); $this->roles = explode(',',$this->roles); } } From ec016387bdec5e082a1d5c9332ef6e5525ba072f Mon Sep 17 00:00:00 2001 From: sbyrd Date: Thu, 17 Dec 2020 22:37:58 -0500 Subject: [PATCH 4/6] roles --- imageAnnotations.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/imageAnnotations.php b/imageAnnotations.php index cfa028e..20d303b 100644 --- a/imageAnnotations.php +++ b/imageAnnotations.php @@ -19,6 +19,8 @@ class imageAnnotations extends objectStructs public function __construct($Result = null) { parent::__construct($Result); + + $this->Log(__FUNCTION__ . " Load imageAnnotations with".print_r($Result,true)); if ($this->roles and empty($this->roles) ) { $this->Log(__FUNCTION__ . " We have roles, lets explode"); From f90e9fcf5a5b2bcd984cbd3f25d5dce0dba78e3f Mon Sep 17 00:00:00 2001 From: sbyrd Date: Thu, 17 Dec 2020 22:40:48 -0500 Subject: [PATCH 5/6] roles --- imageAnnotations.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/imageAnnotations.php b/imageAnnotations.php index 20d303b..e9b5c11 100644 --- a/imageAnnotations.php +++ b/imageAnnotations.php @@ -21,11 +21,9 @@ class imageAnnotations extends objectStructs parent::__construct($Result); $this->Log(__FUNCTION__ . " Load imageAnnotations with".print_r($Result,true)); - if ($this->roles and empty($this->roles) ) - { - $this->Log(__FUNCTION__ . " We have roles, lets explode"); + if (!is_array($this->roles)) $this->roles = explode(',',$this->roles); - } + } public function hasRole( string $Role) From b5c0c0e180bf377588b08d54d3e511fa1b57ca4f Mon Sep 17 00:00:00 2001 From: sbyrd Date: Thu, 17 Dec 2020 22:45:44 -0500 Subject: [PATCH 6/6] roles --- imageAnnotations.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/imageAnnotations.php b/imageAnnotations.php index e9b5c11..821d1df 100644 --- a/imageAnnotations.php +++ b/imageAnnotations.php @@ -21,8 +21,9 @@ class imageAnnotations extends objectStructs parent::__construct($Result); $this->Log(__FUNCTION__ . " Load imageAnnotations with".print_r($Result,true)); - if (!is_array($this->roles)) - $this->roles = explode(',',$this->roles); + if (is_string($Result->roles)) + $this->roles = explode(',',$Result->roles); + }