Skip to content

Commit

Permalink
fix tunnel viper bug
Browse files Browse the repository at this point in the history
  • Loading branch information
avirtopeanu-ionos committed Nov 21, 2024
1 parent e2d0055 commit a980063
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions commands/vpn/ipsec/tunnel/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func Update() *core.Command {
func putFromJSON(c *core.CommandConfig, propertiesFromJson vpn.IPSecTunnel) error {
tunnel, _, err := client.Must().VPNClient.IPSecTunnelsApi.
IpsecgatewaysTunnelsPut(context.Background(),
viper.GetString(core.GetFlagName(c.NS, constants.FlagGatewayID)), viper.GetString(constants.FlagTunnelID)).
viper.GetString(core.GetFlagName(c.NS, constants.FlagGatewayID)), viper.GetString(core.GetFlagName(c.NS, constants.FlagTunnelID))).
IPSecTunnelEnsure(vpn.IPSecTunnelEnsure{Properties: &propertiesFromJson}).Execute()
if err != nil {
return err
Expand All @@ -88,7 +88,7 @@ func putFromJSON(c *core.CommandConfig, propertiesFromJson vpn.IPSecTunnel) erro

func putFromProperties(c *core.CommandConfig) error {
original, _, err := client.Must().VPNClient.IPSecTunnelsApi.IpsecgatewaysTunnelsFindById(context.Background(),
viper.GetString(core.GetFlagName(c.NS, constants.FlagGatewayID)), viper.GetString(constants.FlagTunnelID)).
viper.GetString(core.GetFlagName(c.NS, constants.FlagGatewayID)), viper.GetString(core.GetFlagName(c.NS, constants.FlagTunnelID))).
Execute()
if err != nil {
return err
Expand Down
1 change: 0 additions & 1 deletion test/bats/vpn/ipsec.bats
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ setup_file() {
run ionosctl vpn ipsec tunnel get --gateway-id "$gateway_id" --tunnel-id "$tunnel_id" -o json 2> /dev/null
assert_success
assert_equal "$new_name" "$(echo "$output" | jq -r '.properties.name')"
assert_equal "$new_psk" "$(echo "$output" | jq -r '.properties.auth.psk.key')"
}

teardown_file() {
Expand Down

0 comments on commit a980063

Please sign in to comment.