WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit cc92655

Browse files
Johannestegneralexellis
authored andcommitted
Moved and changed the copy of error when fetching server by IP.
Added some comments to why a label is used on provisioned vps. Added comments about where to find information about the Plan, OS and Regions for Hetzner. Signed-off-by: Johannes Tegnér <[email protected]>
1 parent f6e8d39 commit cc92655

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

cmd/create.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,11 @@ func createHost(provider, name, region, zone, projectID, userData, inletsPort st
380380
},
381381
}, nil
382382
} else if provider == "hetzner" {
383+
// Easiest way to get the information of available images and server types is through
384+
// the Hetzner API, but it requires auth for any type of call.
385+
// Images can be fetched from https://api.hetzner.cloud/v1/images
386+
// Server types can be fetched from https://api.hetzner.cloud/v1/server_types
387+
// The regions available are hel1 (Helsinki), nur1 (Nuremberg), fsn1 (Falkenstein)
383388
return &provision.BasicHost{
384389
Name: name,
385390
Region: region,

pkg/provision/hetzner.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ func (p *HetznerProvisioner) Provision(host BasicHost) (*ProvisionedHost, error)
8989
func (p *HetznerProvisioner) List(filter ListFilter) ([]*ProvisionedHost, error) {
9090
var hosts []*ProvisionedHost
9191
hostList, err := p.client.Server.AllWithOpts(context.Background(), hcloud.ServerListOpts{
92+
// Adding a label to the VPS so that it is easier to select inlets managed servers and also
93+
// to tell the user that the server in question is managed by inlets.
9294
ListOpts: hcloud.ListOpts{
9395
LabelSelector: "managed-by=inlets",
9496
},
@@ -122,10 +124,9 @@ func (p *HetznerProvisioner) Delete(request HostDeleteRequest) error {
122124
id = instance.ID
123125
}
124126
}
125-
}
126-
127-
if len(id) <= 0 {
128-
return fmt.Errorf("failed to find server with id %s", id)
127+
if len(id) <= 0 {
128+
return fmt.Errorf("failed to find server with id with IP %s", request.IP)
129+
}
129130
}
130131

131132
idAsInt, err := strconv.Atoi(id)

0 commit comments

Comments
 (0)