Skip to content

Commit

Permalink
Removes mounts helper
Browse files Browse the repository at this point in the history
  • Loading branch information
mikenomitch committed Oct 24, 2023
1 parent db9f7f8 commit 613f56a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,6 @@
[[- end ]]
[[- end ]]


// Generic mount template
[[ define "mounts" -]]
[[- range $idx, $mount := . ]]
mount {
type = [[ $mount.type | quote ]]
target = [[ $mount.target | quote ]]
source = [[ $mount.source | quote ]]
readonly = [[ $mount.readonly ]]
[[- if gt (len $mount.bind_options) 0 ]]
bind_options {
[[- range $idx, $opt := $mount.bind_options ]]
[[ $opt.name ]] = [[ $opt.value | quote ]]
[[- end ]]
}
[[- end ]]
}
[[- end ]]
[[- end ]]

// Generic resources template
[[ define "resources" -]]
[[- $resources := . ]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,6 @@
[[- end ]]
[[- end ]]


// Generic mount template
[[ define "mounts" -]]
[[- range $idx, $mount := . ]]
mount {
type = [[ $mount.type | quote ]]
target = [[ $mount.target | quote ]]
source = [[ $mount.source | quote ]]
readonly = [[ $mount.readonly ]]
[[- if gt (len $mount.bind_options) 0 ]]
bind_options {
[[- range $idx, $opt := $mount.bind_options ]]
[[ $opt.name ]] = [[ $opt.value | quote ]]
[[- end ]]
}
[[- end ]]
}
[[- end ]]
[[- end ]]

// Generic resources template
[[ define "resources" -]]
[[- $resources := . ]]
Expand Down
41 changes: 0 additions & 41 deletions internal/creator/templates/pack_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -127,47 +127,6 @@ This helper formats maps as key and quoted value pairs.

[[- /*

## `mounts` helper

```
list(
object(
type string, target string, source string,
readonly bool,
bind_options map(string)
)
)
```

This helper is extremely similar to the `services` helper. It uses several
alternative syntax choices and leverages the fact that range provides the
current iteratee as the current template context inside of it's scope.

Additional notes:
"", 0, false, nil, and empty slices all evaluate to false for `if`
"", 0, false, nil, and empty slices all evaluate to empty for `range`

*/ -]]
[[ define "mounts" -]]
[[- range . ]]
mount {
type = [[ quote .type ]]
target = [[ quote .target ]]
source = [[ quote .source ]]
readonly = [[ .readonly ]]
[[- if .bind_options ]]
bind_options {
[[- range .bind_options ]]
[[ .name ]] = [[ quote .value ]]
[[- end ]]
}
[[- end ]]
}
[[- end ]]
[[- end ]]

[[- /*

## `resources` helper

This helper formats values of object(cpu number, memory number) as a `resources`
Expand Down
Binary file added nomad-pack
Binary file not shown.

0 comments on commit 613f56a

Please sign in to comment.