From 29c8cf20e0ceada04f50c9a391faf3cb90167429 Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Thu, 14 Mar 2024 15:11:29 -0500 Subject: [PATCH] fix: handle CLI default organization when none exists in ' to select an organization to use") + if len(orgs) == 1 { + // If there is no "isDefault", but only 1 org is present. We can just + // assume the single organization is correct. This is mainly a helper + // for cli hitting an old instance, or a user that belongs to a single + // org that is not the default. + return orgs[0], nil + } + return codersdk.Organization{}, xerrors.Errorf("unable to determine current organization. Use 'coder org set ' to select an organization to use") } return orgs[index], nil