Skip to content
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

Expose SSH Private Keys #91

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions charts/region/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ description: A Helm chart for deploying Unikorn's Region Controller

type: application

version: v0.1.47-rc4
appVersion: v0.1.47-rc4
version: v0.1.47-rc5
appVersion: v0.1.47-rc5

icon: https://raw.githubusercontent.com/unikorn-cloud/assets/main/images/logos/dark-on-light/icon.png

Expand Down
7 changes: 7 additions & 0 deletions pkg/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,19 @@ func (h *Handler) convertIdentity(ctx context.Context, in *unikornv1.Identity) *
var openstackIdentity unikornv1.OpenstackIdentity

if err := h.client.Get(ctx, client.ObjectKey{Namespace: in.Namespace, Name: in.Name}, &openstackIdentity); err == nil {
var sshPrivateKey *string

if len(openstackIdentity.Spec.SSHPrivateKey) > 0 {
sshPrivateKey = ptr.To(string(openstackIdentity.Spec.SSHPrivateKey))
}

out.Spec.Openstack = &openapi.IdentitySpecOpenStack{
Cloud: openstackIdentity.Spec.Cloud,
UserId: openstackIdentity.Spec.UserID,
ProjectId: openstackIdentity.Spec.ProjectID,
ServerGroupId: openstackIdentity.Spec.ServerGroupID,
SshKeyName: openstackIdentity.Spec.SSHKeyName,
SshPrivateKey: sshPrivateKey,
}

if openstackIdentity.Spec.CloudConfig != nil {
Expand Down
161 changes: 81 additions & 80 deletions pkg/openapi/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pkg/openapi/server.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,9 @@ components:
sshKeyName:
description: Ephemeral SSH key generated for the identity.
type: string
sshPrivateKey:
description: Ephemeral SSH private key to be used by higher order services.
type: string
identitySpec:
description: |-
A provider specific identity, while the client can list regions to infer the
Expand Down
3 changes: 3 additions & 0 deletions pkg/openapi/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading