mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
Merge pull request #8172 from neumayer/definedtags
Support defined tags for oci builder
This commit is contained in:
commit
dfaded3f80
4 changed files with 19 additions and 1 deletions
|
|
@ -63,7 +63,8 @@ type Config struct {
|
|||
SubnetID string `mapstructure:"subnet_ocid"`
|
||||
|
||||
// Tagging
|
||||
Tags map[string]string `mapstructure:"tags"`
|
||||
Tags map[string]string `mapstructure:"tags"`
|
||||
DefinedTags map[string]map[string]interface{} `mapstructure:"defined_tags"`
|
||||
|
||||
ctx interpolate.Context
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ func testConfig(accessConfFile *os.File) map[string]interface{} {
|
|||
"metadata": map[string]string{
|
||||
"key": "value",
|
||||
},
|
||||
"defined_tags": map[string]map[string]interface{}{
|
||||
"namespace": {"key": "value"},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ func (d *driverOCI) CreateImage(ctx context.Context, id string) (core.Image, err
|
|||
InstanceId: &id,
|
||||
DisplayName: &d.cfg.ImageName,
|
||||
FreeformTags: d.cfg.Tags,
|
||||
DefinedTags: d.cfg.DefinedTags,
|
||||
}})
|
||||
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -161,6 +161,19 @@ builder.
|
|||
"tag2": "value2"
|
||||
```
|
||||
|
||||
- `defined_tags` (map of map of strings) - Add one or more defined tags for a given namespace to the resulting
|
||||
custom image. See [the Oracle
|
||||
docs](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/taggingoverview.htm)
|
||||
for more details. Example:
|
||||
|
||||
``` {.yaml}
|
||||
"tags":
|
||||
"namespace": {
|
||||
"tag1": "value1",
|
||||
"tag2": "value2"
|
||||
}
|
||||
```
|
||||
|
||||
## Basic Example
|
||||
|
||||
Here is a basic example. Note that account specific configuration has been
|
||||
|
|
|
|||
Loading…
Reference in a new issue