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
2056fda4
Commit
2056fda4
authored
Jun 10, 2015
by
Clint Shryock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/amazon: Allow spaces in AMI names
parent
9da9ce60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
builder/amazon/common/template_funcs.go
builder/amazon/common/template_funcs.go
+1
-1
builder/amazon/common/template_funcs_test.go
builder/amazon/common/template_funcs_test.go
+2
-2
No files found.
builder/amazon/common/template_funcs.go
View file @
2056fda4
...
@@ -20,7 +20,7 @@ func isalphanumeric(b byte) bool {
...
@@ -20,7 +20,7 @@ func isalphanumeric(b byte) bool {
// Clean up AMI name by replacing invalid characters with "-"
// Clean up AMI name by replacing invalid characters with "-"
func
templateCleanAMIName
(
s
string
)
string
{
func
templateCleanAMIName
(
s
string
)
string
{
allowed
:=
[]
byte
{
'('
,
')'
,
','
,
'/'
,
'-'
,
'_'
}
allowed
:=
[]
byte
{
'('
,
')'
,
','
,
'/'
,
'-'
,
'_'
,
' '
}
b
:=
[]
byte
(
s
)
b
:=
[]
byte
(
s
)
newb
:=
make
([]
byte
,
len
(
b
))
newb
:=
make
([]
byte
,
len
(
b
))
for
i
,
c
:=
range
b
{
for
i
,
c
:=
range
b
{
...
...
builder/amazon/common/template_funcs_test.go
View file @
2056fda4
...
@@ -5,8 +5,8 @@ import (
...
@@ -5,8 +5,8 @@ import (
)
)
func
TestAMITemplatePrepare_clean
(
t
*
testing
.
T
)
{
func
TestAMITemplatePrepare_clean
(
t
*
testing
.
T
)
{
origName
:=
"AMZamz09(),/-_:&^$%"
origName
:=
"AMZamz09(),/-_:&^
$%"
expected
:=
"AMZamz09(),/-_-----"
expected
:=
"AMZamz09(),/-_---
--"
name
:=
templateCleanAMIName
(
origName
)
name
:=
templateCleanAMIName
(
origName
)
...
...
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