Skip to content

[supervisor] expose control service over REST #18411

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 2 commits into from
Aug 2, 2023
Merged

Conversation

akosyakov
Copy link
Member

@akosyakov akosyakov commented Aug 2, 2023

Description

It is a missing part of #18405

Summary generated by Copilot

🤖 Generated by Copilot at 11ddec8

Add a method to register the REST info service for the supervisor's control service. This allows accessing the control service via HTTP for debugging and testing.

Related Issue(s)

Fixes #

How to test

  • Open this PR in gitpod.io
  • Run ./validate.sh from components/supervisor
  • In newly started workspace run curl localhost:22999/_supervisor/v1/ssh_keys/create. It should return a private key.

Documentation

Preview status

gitpod:summary

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@akosyakov
Copy link
Member Author

/unhold

@akosyakov akosyakov marked this pull request as draft August 2, 2023 14:01
@akosyakov akosyakov marked this pull request as ready for review August 2, 2023 14:32
@akosyakov akosyakov requested review from iQQBot and mustard-mh August 2, 2023 14:32
to let clients to do fingerpring checking
@@ -800,8 +807,23 @@ func (ss *ControlService) CreateSSHKeyPair(ctx context.Context, req *api.CreateS
}
ss.privateKey = string(generated.PrivateKey)
ss.publicKey = string(generated.PublicKey)

hostKey, err := os.ReadFile("/.supervisor/ssh/sshkey.pub")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We get keys another place like this

sshkey := filepath.Join(filepath.Dir(bin), "ssh", "sshkey")
. It can be improved but no-block

Copy link
Contributor

@mustard-mh mustard-mh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, LGTM

@akosyakov
Copy link
Member Author

/unhold

@roboquat roboquat merged commit 8f85d82 into main Aug 2, 2023
@roboquat roboquat deleted the ak/sup_control_rest branch August 2, 2023 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants