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
dd5de1e3
Commit
dd5de1e3
authored
Dec 08, 2014
by
Armon Dadgar
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1692 from nitrous-io/digitalocean-image-id
Use DigitalOcean image ID for artifact Id()
parents
fdeb2bc8
3d6865fa
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 @
dd5de1e3
...
...
@@ -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 @
dd5de1e3
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