Skip to content

Commit c9349f9

Browse files
committed
Use integration API endpoints
Signed-off-by: Richard Wall <[email protected]>
1 parent dba92c3 commit c9349f9

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ predicate.json
1414
*.tgz
1515

1616
_bin
17+
.envrc

agent.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
machineHub:
2-
subdomain: adb-static
2+
subdomain: tlskp-test
33
credentialsSecretName: machinehub-credentials

pkg/agent/run.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"sigs.k8s.io/controller-runtime/pkg/manager"
3232

3333
"github.com/jetstack/preflight/pkg/internal/cyberark/identity"
34+
"github.com/jetstack/preflight/pkg/internal/cyberark/servicediscovery"
3435
"github.com/jetstack/preflight/api"
3536
"github.com/jetstack/preflight/pkg/client"
3637
"github.com/jetstack/preflight/pkg/clusteruid"
@@ -82,7 +83,9 @@ func Run(cmd *cobra.Command, args []string) (returnErr error) {
8283

8384
var caClient *client.CyberArkClient
8485
{
85-
identityClient, err := identity.New(ctx, cfg.MachineHub.Subdomain)
86+
87+
discoveryClient := servicediscovery.New(servicediscovery.WithIntegrationEndpoint())
88+
identityClient, err := identity.NewWithDiscoveryClient(ctx, discoveryClient, cfg.MachineHub.Subdomain)
8689
if err != nil {
8790
return fmt.Errorf("while creating the CyberArk identity client: %v", err)
8891
}
@@ -91,7 +94,7 @@ func Run(cmd *cobra.Command, args []string) (returnErr error) {
9194
if err := identityClient.LoginUsernamePassword(ctx, username, password); err != nil {
9295
return fmt.Errorf("while logging in: %v", err)
9396
}
94-
caClient, err = client.NewCyberArkClient(nil, cfg.MachineHub.Subdomain, identityClient.AuthenticateRequest)
97+
caClient, err = client.NewCyberArkClient(nil, os.Getenv("ARK_API_URL"), identityClient.AuthenticateRequest)
9598
if err != nil {
9699
return fmt.Errorf("while creating the CyberArk dataupload client: %v", err)
97100
}

0 commit comments

Comments
 (0)