Skip to content

Commit 15ad5f9

Browse files
committed
device-agent: compare with the requested tenant
1 parent e5b0abe commit 15ad5f9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/device-agent/deviceagent.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ import (
99

1010
"github.com/google/uuid"
1111
"github.com/hashicorp/go-multierror"
12-
"github.com/nais/device/pkg/notify"
1312
log "github.com/sirupsen/logrus"
1413
"google.golang.org/grpc/codes"
1514
"google.golang.org/grpc/status"
1615

16+
"github.com/nais/device/pkg/notify"
17+
1718
"github.com/nais/device/pkg/device-agent/config"
1819
"github.com/nais/device/pkg/device-agent/runtimeconfig"
1920
"github.com/nais/device/pkg/pb"
@@ -132,7 +133,7 @@ func (das *DeviceAgentServer) SetActiveTenant(ctx context.Context, req *pb.SetAc
132133
}
133134

134135
for i, tenant := range das.rc.Tenants {
135-
if strings.ToLower(tenant.Name) == strings.ToLower(tenant.Name) {
136+
if strings.ToLower(tenant.Name) == strings.ToLower(req.Name) {
136137
das.rc.Tenants[i].Active = true
137138
das.stateChange <- pb.AgentState_Disconnecting
138139
log.Infof("activated tenant: %s", tenant.Name)

0 commit comments

Comments
 (0)