Merge pull request #8172 from neumayer/definedtags

Support defined tags for oci builder
This commit is contained in:
Megan Marsh 2019-10-01 12:26:16 -07:00 committed by GitHub
commit dfaded3f80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 1 deletions

View file

@ -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
}

View file

@ -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"},
},
}
}

View file

@ -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 {

View file

@ -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