Skip to content

Commit

Permalink
updated to 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
rennokki committed Feb 4, 2021
1 parent 9cc4d8f commit 1ae3c8b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
],
"require": {
"renoki-co/php-k8s": "^1.12"
"renoki-co/php-k8s": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down
6 changes: 2 additions & 4 deletions config/k8s.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@

'http' => [
'driver' => 'http',
'host' => env('KUBE_HOST', '127.0.0.1'),
'port' => env('KUBE_PORT', 8080),
'host' => env('KUBE_HOST', 'http://127.0.0.1:8080'),
'ssl' => [
'certificate' => env('KUBE_CERTIFICATE_PATH', null),
'key' => env('KUBE_KEY_PATH', null),
Expand All @@ -71,8 +70,7 @@

'token' => [
'driver' => 'token',
'host' => env('KUBE_HOST', '127.0.0.1'),
'port' => env('KUBE_PORT', 8080),
'host' => env('KUBE_HOST', 'http://127.0.0.1:8080'),
'ssl' => [
'certificate' => env('KUBE_CERTIFICATE_PATH', null),
'key' => env('KUBE_KEY_PATH', null),
Expand Down
10 changes: 3 additions & 7 deletions src/KubernetesCluster.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function connection(string $connection)
*/
protected function loadFromConfig(array $config)
{
$this->cluster = new PhpK8sCluster('http://127.0.0.1', 8080);
$this->cluster = new PhpK8sCluster('http://127.0.0.1:8080');

switch ($config['driver'] ?? null) {
case 'kubeconfig': $this->configureWithKubeConfigFile($config); break;
Expand Down Expand Up @@ -78,9 +78,7 @@ protected function configureWithKubeConfigFile(array $config)
*/
protected function configureWithHttpAuth(array $config)
{
$this->cluster = new PhpK8sCluster(
$config['host'], $config['port']
);
$this->cluster = new PhpK8sCluster($config['host']);

if ($config['ssl']['verify'] ?? true) {
$this->cluster->withCertificate(
Expand Down Expand Up @@ -112,9 +110,7 @@ protected function configureWithHttpAuth(array $config)
*/
protected function configureWithToken(array $config)
{
$this->cluster = new PhpK8sCluster(
$config['host'], $config['port']
);
$this->cluster = new PhpK8sCluster($config['host']);

if ($config['ssl']['verify'] ?? true) {
$this->cluster->withCertificate(
Expand Down

0 comments on commit 1ae3c8b

Please sign in to comment.