Added new route to retrieve the host's kubeconfig with the execution's SA token

This commit is contained in:
pb
2025-02-28 14:07:45 +01:00
parent 7b27945493
commit f75499d827
4 changed files with 183 additions and 5 deletions

View File

@@ -174,6 +174,9 @@ func (k *KubernetesService) DeleteNamespace(ctx context.Context, ns string) erro
return nil
}
// Returns the string representing the token generated for the serviceAccount
// in the namespace identified by the value `ns` with the name sa-`ns`, which is valid for
// `duration` seconds
func (k *KubernetesService) GenerateToken(ctx context.Context, ns string, duration int) (string, error) {
// Define TokenRequest (valid for 1 hour)
d := int64(duration)