Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
tuladhar committed Nov 7, 2023
1 parent fc6719b commit f276a1b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
6 changes: 5 additions & 1 deletion helm/teleport-operator/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ data:
# Auth Server. Prefer the address of the Teleport Proxy.
auth_server: test.teleport.giantswarm.io:443
# outputs will be filled in during the completion of an access guide.
outputs: []
outputs:
- type: identity
destination:
type: kubernetes_secret
name: identity-output
3 changes: 1 addition & 2 deletions helm/teleport-operator/templates/tbot-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,4 @@ spec:
expirationSeconds: 600
# `example.teleport.sh` must be replaced with the name of
# your Teleport cluster.
audience: test.teleport.giantwarm.io

audience: gs-teleport-test
24 changes: 19 additions & 5 deletions internal/pkg/teleport/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ func GetConfigFromSecret(ctx context.Context, ctrlClient client.Client, namespac
return nil, microerror.Mask(err)
}

identityFile, err := getSecretString(secret, key.IdentityFile)
if err != nil {
return nil, microerror.Mask(err)
}
// identityFile, err := getSecretString(secret, key.IdentityFile)
// if err != nil {
// return nil, microerror.Mask(err)
// }

managementClusterName, err := getSecretString(secret, key.ManagementClusterName)
if err != nil {
Expand All @@ -70,8 +70,22 @@ func GetConfigFromSecret(ctx context.Context, ctrlClient client.Client, namespac
return nil, microerror.Mask(err)
}

tbotSecret := &corev1.Secret{}

if err := ctrlClient.Get(ctx, types.NamespacedName{
Name: "identity-output",
Namespace: namespace,
}, tbotSecret); err != nil {
return nil, microerror.Mask(err)
}

identity, err := getSecretString(tbotSecret, "identity")
if err != nil {
return nil, microerror.Mask(err)
}

return &SecretConfig{
IdentityFile: identityFile,
IdentityFile: identity,
ProxyAddr: proxyAddr,
ManagementClusterName: managementClusterName,
TeleportVersion: teleportVersion,
Expand Down

0 comments on commit f276a1b

Please sign in to comment.