Merge pull request #8172 from neumayer/definedtags

Support defined tags for oci builder
pull/8177/head
Megan Marsh 7 years ago committed by GitHub
commit dfaded3f80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save