Skip to content

Commit

Permalink
openstack/flight: add base flight with jump dialer
Browse files Browse the repository at this point in the history
if an `openstack-host` is present in the command line, the flight will
be created with a proxy jump SSH server.

this allows to SSH into the created VMs from the devstack server and it
avoids consuming more elastic IPs

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
  • Loading branch information
tormath1 committed Aug 5, 2022
1 parent eb2236f commit 0cc977e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions platform/machine/openstack/flight.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
package openstack

import (
"fmt"

"github.com/coreos/pkg/capnslog"
ctplatform "github.com/flatcar-linux/container-linux-config-transpiler/config/platform"

"github.com/flatcar-linux/mantle/network"
"github.com/flatcar-linux/mantle/platform"
"github.com/flatcar-linux/mantle/platform/api/openstack"
)
Expand All @@ -44,9 +47,18 @@ func NewFlight(opts *openstack.Options) (platform.Flight, error) {
return nil, err
}

bf, err := platform.NewBaseFlight(opts.Options, Platform, ctplatform.OpenStackMetadata)
if err != nil {
return nil, err
var bf *platform.BaseFlight

if opts.Host != "" {
bf, err = platform.NewBaseFlightWithDialer(opts.Options, Platform, ctplatform.OpenStackMetadata, network.NewJumpDialer(opts.Host, opts.User, opts.Keyfile))
if err != nil {
return nil, fmt.Errorf("creating base flight with jump dialer: %w", err)
}
} else {
bf, err := platform.NewBaseFlight(opts.Options, Platform, ctplatform.OpenStackMetadata)
if err != nil {
return nil, err
}
}

of := &flight{
Expand Down

0 comments on commit 0cc977e

Please sign in to comment.