@@ -742,7 +742,6 @@ func listAgentVersions(ctx context.Context, cmd *cli.Command) error {
742
742
743
743
func listAgents (ctx context.Context , cmd * cli.Command ) error {
744
744
var items []* lkproto.AgentInfo
745
- req := & lkproto.ListAgentsRequest {}
746
745
if cmd .IsSet ("id" ) {
747
746
for _ , agentID := range cmd .StringSlice ("id" ) {
748
747
if agentID == "" {
@@ -762,7 +761,7 @@ func listAgents(ctx context.Context, cmd *cli.Command) error {
762
761
items = append (items , res .Agents ... )
763
762
}
764
763
} else {
765
- agents , err := agentsClient .ListAgents (ctx , req )
764
+ agents , err := agentsClient .ListAgents (ctx , & lkproto. ListAgentsRequest {} )
766
765
if err != nil {
767
766
if twerr , ok := err .(twirp.Error ); ok {
768
767
if twerr .Code () == twirp .PermissionDenied {
@@ -955,7 +954,6 @@ func requireDockerfile(ctx context.Context, cmd *cli.Command, workingDir string)
955
954
956
955
if ! dockerfileExists {
957
956
var clientSettingsResponse * lkproto.ClientSettingsResponse
958
- var innerErr error
959
957
960
958
if ! cmd .Bool ("silent" ) {
961
959
if err := util .Await (
@@ -970,13 +968,13 @@ func requireDockerfile(ctx context.Context, cmd *cli.Command, workingDir string)
970
968
clientSettingsResponse , err = agentsClient .GetClientSettings (ctx , & lkproto.ClientSettingsRequest {})
971
969
}
972
970
973
- if innerErr != nil {
974
- if twerr , ok := innerErr .(twirp.Error ); ok {
971
+ if err != nil {
972
+ if twerr , ok := err .(twirp.Error ); ok {
975
973
if twerr .Code () == twirp .PermissionDenied {
976
974
return fmt .Errorf ("agent hosting is disabled for this project -- join the beta program here [%s]" , cloudAgentsBetaSignupURL )
977
975
}
978
976
}
979
- return innerErr
977
+ return err
980
978
}
981
979
982
980
settingsMap := make (map [string ]string )
0 commit comments