Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Added support for cmd-like auth #205

Merged
merged 5 commits into from
Mar 7, 2022
Merged

[fix] Added support for cmd-like auth #205

merged 5 commits into from
Mar 7, 2022

Conversation

rennokki
Copy link
Member

@rennokki rennokki commented Mar 7, 2022

Some clusters like GKE authenticates users by renewing a token at specific intervals. For example, in the following kubeconfig file, the user token in kubectl is taken from a CLI response:

users:
- name: gke_cluster
    user:
        auth-provider:
            config:
                cmd-args: config config-helper --format=json
                cmd-path: S:\GCSDK\google-cloud-sdk\bin\gcloud.cmd
                expiry-key: '{.credential.token_expiry}'
                token-key: '{.credential.access_token}'
            name: gcp

With this PR, the package will run the cmd-path and cmd-args with Symfony Process to retrieve the token and authenticate the requests.

@codecov
Copy link

codecov bot commented Mar 7, 2022

Codecov Report

Merging #205 (52f1769) into master (8b21b67) will decrease coverage by 0.00%.
The diff coverage is 94.11%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #205      +/-   ##
============================================
- Coverage     94.99%   94.98%   -0.01%     
- Complexity      696      700       +4     
============================================
  Files            70       70              
  Lines          1697     1714      +17     
============================================
+ Hits           1612     1628      +16     
- Misses           85       86       +1     
Impacted Files Coverage Δ
src/Kinds/K8sPod.php 94.30% <ø> (ø)
src/Traits/Cluster/MakesHttpCalls.php 100.00% <ø> (ø)
src/Traits/Cluster/AuthenticatesCluster.php 97.77% <90.90%> (-2.23%) ⬇️
src/Traits/Cluster/LoadsFromKubeConfig.php 93.75% <100.00%> (+0.41%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b21b67...52f1769. Read the comment docs.

@rennokki rennokki merged commit 52039c5 into master Mar 7, 2022
@rennokki rennokki deleted the feature/cmd-auth branch March 7, 2022 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant