Skip to content

Commit

Permalink
pkg/asset/installconfig: Add OPENSHIFT_INSTALL_AWS_USER_TAGS
Browse files Browse the repository at this point in the history
With a JSON string containing the intended values.

This is probably not how we're going to expose this long-term, so I'm
not documenting the enviroment variable yet.  But I want this so we
can get back to tagging expirationData in CI, without waiting for
asset state <-> disk (de)serialization.
  • Loading branch information
wking committed Sep 28, 2018
1 parent 149ac98 commit adf12e9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/asset/installconfig/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net/url"
"os"
"sort"
"strings"

Expand Down Expand Up @@ -162,6 +163,12 @@ func (a *Platform) awsPlatform() (*asset.State, error) {
}
platform.Region = string(region.Contents[0].Data)

if value, ok := os.LookupEnv("OPENSHIFT_INSTALL_AWS_USER_TAGS"); ok {
if err := json.Unmarshal([]byte(value), &platform.UserTags); err != nil {
return nil, fmt.Errorf("OPENSHIFT_INSTALL_AWS_USER_TAGS contains invalid JSON: %s (%v)", value, err)
}
}

data, err := json.Marshal(platform)
if err != nil {
return nil, err
Expand Down

0 comments on commit adf12e9

Please sign in to comment.