Skip to content

fix: improve log on provisioner daemon started with pk #15588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Nov 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add missing test for failing case
  • Loading branch information
defelmnq committed Nov 25, 2024
commit 7ea193f567ea8df36efe9ca9ce0b3456cdfd0bbb
22 changes: 22 additions & 0 deletions enterprise/cli/provisionerdaemonstart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,28 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
require.Equal(t, proto.CurrentVersion.String(), daemons[0].APIVersion)
})

t.Run("NoProvisionerKeyFound", func(t *testing.T) {
t.Parallel()

ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
defer cancel()
client, _ := coderdenttest.New(t, &coderdenttest.Options{
ProvisionerDaemonPSK: "provisionersftw",
LicenseOptions: &coderdenttest.LicenseOptions{
Features: license.Features{
codersdk.FeatureExternalProvisionerDaemons: 1,
codersdk.FeatureMultipleOrganizations: 1,
},
},
})

inv, conf := newCLI(t, "provisionerd", "start", "--key", "ThisKeyDoesNotExist", "--name=matt-daemon")
err := conf.URL().Write(client.URL.String())
require.NoError(t, err)
err = inv.WithContext(ctx).Run()
require.ErrorContains(t, err, "unable to get provisioner key details")
})

t.Run("NoPSK", func(t *testing.T) {
t.Parallel()

Expand Down
Loading