diff --git a/composer.json b/composer.json index 8464993..765bb45 100755 --- a/composer.json +++ b/composer.json @@ -20,7 +20,8 @@ "require": { "php": ">=8.0", "utopia-php/cli": "0.19.*", - "phrity/websocket": "^3.2" + "phrity/websocket": "^3.2", + "utopia-php/system": "0.9.*" }, "require-dev": { "phpunit/phpunit": "^9.3", diff --git a/composer.lock b/composer.lock index 8f9f632..45bddc2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "971bcc46a5c062e64c47b26df4e66e3a", + "content-hash": "00e78d60d52b0280d884b3805dfd9841", "packages": [ { "name": "phrity/net-stream", @@ -597,6 +597,62 @@ "source": "https://github.com/utopia-php/servers/tree/0.1.1" }, "time": "2024-09-06T02:25:56+00:00" + }, + { + "name": "utopia-php/system", + "version": "0.9.0", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/system.git", + "reference": "8e4a7edaf2dfeb4c9524e9f766d27754f2c4b64d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/system/zipball/8e4a7edaf2dfeb4c9524e9f766d27754f2c4b64d", + "reference": "8e4a7edaf2dfeb4c9524e9f766d27754f2c4b64d", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "require-dev": { + "laravel/pint": "1.13.*", + "phpstan/phpstan": "1.10.*", + "phpunit/phpunit": "9.6.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\System\\": "src/System" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eldad Fux", + "email": "eldad@appwrite.io" + }, + { + "name": "Torsten Dittmann", + "email": "torsten@appwrite.io" + } + ], + "description": "A simple library for obtaining information about the host's system.", + "keywords": [ + "framework", + "php", + "system", + "upf", + "utopia" + ], + "support": { + "issues": "https://github.com/utopia-php/system/issues", + "source": "https://github.com/utopia-php/system/tree/0.9.0" + }, + "time": "2024-10-09T14:44:01+00:00" } ], "packages-dev": [ @@ -672,16 +728,16 @@ }, { "name": "laravel/pint", - "version": "v1.18.1", + "version": "v1.18.2", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9" + "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/35c00c05ec43e6b46d295efc0f4386ceb30d50d9", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9", + "url": "https://api.github.com/repos/laravel/pint/zipball/f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", + "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", "shasum": "" }, "require": { @@ -734,7 +790,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-09-24T17:22:50+00:00" + "time": "2024-11-20T09:33:46+00:00" }, { "name": "myclabs/deep-copy", diff --git a/src/Orchestration/Adapter/KubernetesAPI.php b/src/Orchestration/Adapter/KubernetesAPI.php index 9780841..9ba623e 100644 --- a/src/Orchestration/Adapter/KubernetesAPI.php +++ b/src/Orchestration/Adapter/KubernetesAPI.php @@ -4,6 +4,7 @@ use Utopia\App; use Utopia\Orchestration\Adapter; +use Utopia\System\System; use WebSocket; class KubernetesAPI extends Adapter @@ -103,7 +104,7 @@ public function pull(string $image): bool */ protected function call(string $url, string $method, $body = null, array $headers = [], int $timeout = -1): array { - $url = 'https://'.App::getEnv('KUBERNETES_SERVICE_HOST', 'kubernetes.default.svc').'/'.$url; + $url = 'https://'.System::getEnv('KUBERNETES_SERVICE_HOST', 'kubernetes.default.svc').'/'.$url; $token = file_get_contents('/var/run/secrets/kubernetes.io/serviceaccount/token', false); array_push($headers, 'Authorization: Bearer '.$token);