Skip to content

Commit

Permalink
Use CertificateUsedByRefType
Browse files Browse the repository at this point in the history
  • Loading branch information
fhofherr committed Mar 30, 2021
1 parent c77bd86 commit fccc902
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ require (
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2
)

replace github.com/hetznercloud/hcloud-go => hetzner.cloud/integrations/hcloud-go v1.25.0-rc.3 // TODO: Remove before release
replace github.com/hetznercloud/hcloud-go => hetzner.cloud/integrations/hcloud-go v1.25.0-rc.4 // TODO: Remove before release

go 1.16
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
hetzner.cloud/integrations/hcloud-go v1.25.0-rc.3 h1:2kDlaD8D7E8P7NWVkQjK34py0kfn4DG6xLlESsWccs4=
hetzner.cloud/integrations/hcloud-go v1.25.0-rc.3/go.mod h1:2C5uMtBiMoFr3m7lBFPf7wXTdh33CevmZpQIIDPGYJI=
hetzner.cloud/integrations/hcloud-go v1.25.0-rc.4 h1:5UJyVKZPV53avqwewf4ry9xaeIuImwnf2wrod1V9g0w=
hetzner.cloud/integrations/hcloud-go v1.25.0-rc.4/go.mod h1:2C5uMtBiMoFr3m7lBFPf7wXTdh33CevmZpQIIDPGYJI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/certificate/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func describeText(cli *state.State, cert *hcloud.Certificate) error {
// Currently certificates can be only attached to load balancers.
// If we ever get something that is not a load balancer fall back
// to printing the ID.
if ub.Type != "load_balancer" {
if ub.Type != hcloud.CertificateUsedByRefTypeLoadBalancer {
fmt.Printf(" - ID: %d", ub.ID)
continue
}
Expand Down
5 changes: 4 additions & 1 deletion internal/cmd/certificate/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ func runList(cli *state.State, cmd *cobra.Command, args []string) error {
if len(cert.UsedBy) > 0 {
certSchema.UsedBy = make([]schema.CertificateUsedByRef, len(cert.UsedBy))
for i, ub := range cert.UsedBy {
certSchema.UsedBy[i] = schema.CertificateUsedByRef{ID: ub.ID, Type: ub.Type}
certSchema.UsedBy[i] = schema.CertificateUsedByRef{
ID: ub.ID,
Type: string(ub.Type),
}
}
}
certSchemas = append(certSchemas, certSchema)
Expand Down

0 comments on commit fccc902

Please sign in to comment.