File tree 2 files changed +7
-9
lines changed
2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import (
10
10
"github.com/spf13/cobra"
11
11
"google.golang.org/grpc/metadata"
12
12
13
- "github.com/agntcy/dir/cli/config"
14
13
hubClient "github.com/agntcy/dir/cli/hub/client"
15
14
"github.com/agntcy/dir/cli/hub/secretstore"
16
15
contextUtils "github.com/agntcy/dir/cli/util/context"
@@ -62,7 +61,12 @@ func NewCommand() *cobra.Command {
62
61
return fmt .Errorf ("agent id is the only required argument" )
63
62
}
64
63
65
- hc , err := hubClient .New (config .DefaultHubBackendAddress )
64
+ secret , ok := contextUtils .GetCurrentHubSecretFromContext (cmd .Context ())
65
+ if ! ok {
66
+ return fmt .Errorf ("could not get current hub secret from context" )
67
+ }
68
+
69
+ hc , err := hubClient .New (secret .HubBackendAddress )
66
70
if err != nil {
67
71
return fmt .Errorf ("failed to create hub client: %w" , err )
68
72
}
@@ -72,11 +76,6 @@ func NewCommand() *cobra.Command {
72
76
return fmt .Errorf ("invalid agent id: %w" , err )
73
77
}
74
78
75
- secret , ok := contextUtils .GetCurrentHubSecretFromContext (cmd .Context ())
76
- if ! ok {
77
- return fmt .Errorf ("could not get current hub secret from context" )
78
- }
79
-
80
79
return runCmd (cmd .Context (), hc , agentId , secret )
81
80
},
82
81
}
Original file line number Diff line number Diff line change 9
9
"github.com/spf13/cobra"
10
10
"google.golang.org/grpc/metadata"
11
11
12
- "github.com/agntcy/dir/cli/config"
13
12
hubClient "github.com/agntcy/dir/cli/hub/client"
14
13
"github.com/agntcy/dir/cli/options"
15
14
"github.com/agntcy/dir/cli/util/agent"
@@ -68,7 +67,7 @@ func NewCommand(hubOpts *options.HubOptions) *cobra.Command {
68
67
return fmt .Errorf ("You need to be logged in to push to the hub.\n Use `dirctl hub login` command to login." )
69
68
}
70
69
71
- hc , err := hubClient .New (config . DefaultHubBackendAddress )
70
+ hc , err := hubClient .New (secret . HubBackendAddress )
72
71
if err != nil {
73
72
return fmt .Errorf ("failed to create hub client: %w" , err )
74
73
}
You can’t perform that action at this time.
0 commit comments