Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
3d6865fa
Commit
3d6865fa
authored
Nov 24, 2014
by
Cheah Chu Yeow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/digitalocean: use DigitalOcean image ID for artifact Id().
parent
289fdc62
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
builder/digitalocean/artifact.go
builder/digitalocean/artifact.go
+2
-2
builder/digitalocean/artifact_test.go
builder/digitalocean/artifact_test.go
+11
-1
No files found.
builder/digitalocean/artifact.go
View file @
3d6865fa
...
...
@@ -3,6 +3,7 @@ package digitalocean
import
(
"fmt"
"log"
"strconv"
)
type
Artifact
struct
{
...
...
@@ -29,8 +30,7 @@ func (*Artifact) Files() []string {
}
func
(
a
*
Artifact
)
Id
()
string
{
// mimicing the aws builder
return
fmt
.
Sprintf
(
"%s:%s"
,
a
.
regionName
,
a
.
snapshotName
)
return
strconv
.
FormatUint
(
uint64
(
a
.
snapshotId
),
10
)
}
func
(
a
*
Artifact
)
String
()
string
{
...
...
builder/digitalocean/artifact_test.go
View file @
3d6865fa
package
digitalocean
import
(
"github.com/mitchellh/packer/packer"
"testing"
"github.com/mitchellh/packer/packer"
)
func
TestArtifact_Impl
(
t
*
testing
.
T
)
{
...
...
@@ -13,6 +14,15 @@ func TestArtifact_Impl(t *testing.T) {
}
}
func
TestArtifactId
(
t
*
testing
.
T
)
{
a
:=
&
Artifact
{
"packer-foobar"
,
42
,
"San Francisco"
,
nil
}
expected
:=
"42"
if
a
.
Id
()
!=
expected
{
t
.
Fatalf
(
"artifact ID should match: %v"
,
expected
)
}
}
func
TestArtifactString
(
t
*
testing
.
T
)
{
a
:=
&
Artifact
{
"packer-foobar"
,
42
,
"San Francisco"
,
nil
}
expected
:=
"A snapshot was created: 'packer-foobar' in region 'San Francisco'"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment