Skip to content

Commit

Permalink
[Bump versions] Use hcloud-go v2 since v1 is not supported.
Browse files Browse the repository at this point in the history
  • Loading branch information
antony-jr committed Nov 9, 2024
1 parent 08f6c10 commit bc1cc51
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 143 deletions.
34 changes: 18 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/antony-jr/ham

go 1.17
go 1.21

toolchain go1.23.2

require (
github.com/charmbracelet/bubbles v0.14.0
Expand All @@ -10,13 +12,13 @@ require (
github.com/creack/pty v1.1.17
github.com/fatih/color v1.13.0
github.com/go-git/go-git/v5 v5.4.2
github.com/hetznercloud/hcloud-go v1.37.0
github.com/hetznercloud/hcloud-go/v2 v2.16.0
github.com/kyokomi/emoji/v2 v2.2.8
github.com/mkideal/cli v0.2.7
github.com/pkg/sftp v1.13.5
github.com/sevlyar/go-daemon v0.1.5
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
golang.org/x/crypto v0.28.0
gopkg.in/yaml.v3 v3.0.1
)

require (
Expand All @@ -28,49 +30,49 @@ require (
github.com/aymanbagabas/go-osc52 v1.0.3 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/charmbracelet/harmonica v0.2.0 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/dlclark/regexp2 v1.4.0 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.3.1 // indirect
github.com/golang/protobuf v1.4.3 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/kr/fs v0.1.0 // indirect
github.com/labstack/gommon v0.3.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.9 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/microcosm-cc/bluemonday v1.0.21 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mkideal/expr v0.1.0 // indirect
github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.13.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/prometheus/client_golang v1.11.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sahilm/fuzzy v0.1.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/xanzy/ssh-agent v0.3.0 // indirect
github.com/yuin/goldmark v1.5.2 // indirect
github.com/yuin/goldmark-emoji v1.0.1 // indirect
golang.org/x/net v0.0.0-20221002022538-bcab6841153b // indirect
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/protobuf v1.26.0-rc.1 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
157 changes: 40 additions & 117 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"os"

"github.com/antony-jr/ham/internal/cmd/clean"
"github.com/antony-jr/ham/internal/cmd/genkey"
"github.com/antony-jr/ham/internal/cmd/get"
"github.com/antony-jr/ham/internal/cmd/initialize"
"github.com/antony-jr/ham/internal/cmd/genkey"
)

type rootT struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/antony-jr/ham/internal/core"
"github.com/antony-jr/ham/internal/helpers"

"github.com/hetznercloud/hcloud-go/hcloud"
"github.com/hetznercloud/hcloud-go/v2/hcloud"

"github.com/mkideal/cli"
"github.com/sevlyar/go-daemon"
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/build/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func NewTerminal(UniqueID string) (Terminal, error) {

if size >= 1024*1024*5 {
size = 0
logFile.Close()
logFile.Close()
os.Remove(filePath)
logFile, err = os.Create(filePath)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/clean/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/antony-jr/ham/internal/core"
"github.com/antony-jr/ham/internal/helpers"
"github.com/hetznercloud/hcloud-go/hcloud"
"github.com/hetznercloud/hcloud-go/v2/hcloud"
"github.com/mkideal/cli"
)

Expand Down
5 changes: 3 additions & 2 deletions internal/cmd/get/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/antony-jr/ham/internal/banner"
"github.com/antony-jr/ham/internal/core"
"github.com/antony-jr/ham/internal/helpers"
"github.com/hetznercloud/hcloud-go/hcloud"
"github.com/hetznercloud/hcloud-go/v2/hcloud"
)

const (
Expand Down Expand Up @@ -407,7 +407,7 @@ Local Recipe:
_ = tuiSpinnerMsg.StopMessage()
fmt.Printf(" %s Created Server\n", checkMark)
}

volDevice, err := helpers.GetVolumeLinuxDeviceForServer(client, serverName)
if err != nil {
return err
Expand Down Expand Up @@ -788,6 +788,7 @@ func doInitialize(ipAddr string,
for {
tries++
if err != nil {
fmt.Println("Retrying Exec Error: ", err.Error())
if tries > 20 {
return "", err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/get/server_pricing.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"strings"

"github.com/hetznercloud/hcloud-go/hcloud"
"github.com/hetznercloud/hcloud-go/v2/hcloud"
)

func GrossServerPriceForServerWithHighestPerformance(client *hcloud.Client) (float64, *hcloud.ServerType, error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/initialize/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/antony-jr/ham/internal/banner"
"github.com/antony-jr/ham/internal/core"
"github.com/antony-jr/ham/internal/helpers"
"github.com/hetznercloud/hcloud-go/hcloud"
"github.com/hetznercloud/hcloud-go/v2/hcloud"
"github.com/mkideal/cli"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/core/create_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"time"

"github.com/hetznercloud/hcloud-go/hcloud"
"github.com/hetznercloud/hcloud-go/v2/hcloud"
)

// Change this if needed in the future when
Expand Down
3 changes: 2 additions & 1 deletion internal/helpers/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"encoding/json"
"io/ioutil"

"github.com/hetznercloud/hcloud-go/hcloud"
"github.com/hetznercloud/hcloud-go/v2/hcloud"
)

// Short SHA256 Sum is used since sha256 sum is simply too
Expand Down Expand Up @@ -87,6 +87,7 @@ func TryDeleteServer(client *hcloud.Client, serverName string, maxTries int, int
if err == nil {
break
}
fmt.Println("Volume Destroy Error: ", err.Error())

tries++
fmt.Println("Destroying Volume Failed. Retrying... ")
Expand Down

0 comments on commit bc1cc51

Please sign in to comment.