Skip to content

Adopt machine console to new metal-console - #58

Merged
Gerrit91 merged 4 commits into
mainfrom
console-adoption
Sep 9, 2026
Merged

Gerrit91 merged 4 commits into
mainfrom
console-adoption

Conversation

@majst01

@majst01 majst01 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Description

Newer metal-console requires some changes here, also added end user console access

Used AI-Tools ✨

  • None used for generation

Comment thread pkg/helpers/ssh.go Outdated
Comment on lines +9 to +10
// sshClient opens an interactive ssh session to the host on port with user, authenticated by the key.
func SShClient(user, keyfile, host string, port int, idToken, project string) error {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// sshClient opens an interactive ssh session to the host on port with user, authenticated by the key.
func SShClient(user, keyfile, host string, port int, idToken, project string) error {
// SSHClient opens an interactive ssh session to the host on port with user, authenticated by the key.
func SSHClient(user, keyfile, host string, port int, idToken, project string) error {

Comment thread cmd/admin/v2/machine.go Outdated
}

err = sshClient(id, viper.GetString("sshidentity"), parsedurl.Host, viper.GetInt("metal-console-port"), &c.c.Context.Token, true)
err = helpers.SShClient(id, viper.GetString("sshidentity"), parsedurl.Host, viper.GetInt("metal-console-port"), c.c.Context.Token, c.c.GetProject())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As project is not required for admins, I think it would be better to just omit passing the LC_METAL_STACK_PROJECT env variable (turning the func param into a pointer). This prevents passing a probably incorrect project ID along with the machine ID, which would be kind of confusing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Comment thread pkg/helpers/ssh.go Outdated
}

env := map[string]string{
"LC_METAL_STACK_OIDC_TOKEN": idToken,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's a bit unfortunate we do not expose constants for this. Would it make sense to create a pkg/contants in metal-console or put this into metal-lib?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

could be done

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@Gerrit91
Gerrit91 marked this pull request as ready for review September 9, 2026 12:31
@Gerrit91
Gerrit91 requested a review from a team as a code owner September 9, 2026 12:31
@Gerrit91
Gerrit91 requested a review from iljarotar September 9, 2026 12:31
@Gerrit91
Gerrit91 merged commit 458f558 into main Sep 9, 2026
8 checks passed
@Gerrit91
Gerrit91 deleted the console-adoption branch September 9, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants