Skip to content

Commit

Permalink
feat: Add HCP Packer support
Browse files Browse the repository at this point in the history
  • Loading branch information
ajax-ryzhyi-r committed Oct 20, 2023
1 parent cd2da17 commit 0249e0e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions builder/hcloud/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package hcloud
import (
"context"
"fmt"
registryimage "github.com/hashicorp/packer-plugin-sdk/packer/registry/image"
"log"
"strconv"

Expand Down Expand Up @@ -44,6 +45,14 @@ func (a *Artifact) String() string {
}

func (a *Artifact) State(name string) interface{} {
if name == registryimage.ArtifactStateURI {
img, err := registryimage.FromArtifact(a, registryimage.WithProvider("hetznercloud"))
if err != nil {
log.Printf("[DEBUG] error encountered when creating a registry image %v", err)
return nil
}
return img
}
return a.StateData[name]
}

Expand Down

0 comments on commit 0249e0e

Please sign in to comment.