Skip to content

Commit

Permalink
Merge pull request #162 from SiebeVE/patch-1
Browse files Browse the repository at this point in the history
[3.x] Allow cluster URL to be edited when using in cluster authentication
  • Loading branch information
rennokki authored Nov 16, 2021
2 parents 60e9dde + 071fb38 commit de21cb2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Traits/Cluster/AuthenticatesCluster.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@ public function withoutSslChecks()
* Load the in-cluster configuration to run the code
* under a Pod in a cluster.
*
* @param string $url
* @return $this
*/
public static function inClusterConfiguration()
public static function inClusterConfiguration(string $url = 'https://kubernetes.default.svc')
{
$cluster = new static('https://kubernetes.default.svc');
$cluster = new static($url);

if (file_exists($tokenPath = '/var/run/secrets/kubernetes.io/serviceaccount/token')) {
$cluster->loadTokenFromFile($tokenPath);
Expand Down

0 comments on commit de21cb2

Please sign in to comment.