Skip to content

Commit

Permalink
pkg/asset/installconfig: Add _CI_ONLY_STAY_AWAY_OPENSHIFT_INSTALL_AWS…
Browse files Browse the repository at this point in the history
…_USER_TAGS

With a JSON string containing the intended values.

This is not how we're going to expose this long-term, so I'm using an
embarrassing name and not documenting the enviroment variable.  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 6e8e960 commit 98a3531
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("_CI_ONLY_STAY_AWAY_OPENSHIFT_INSTALL_AWS_USER_TAGS"); ok {
if err := json.Unmarshal([]byte(value), &platform.UserTags); err != nil {
return nil, fmt.Errorf("_CI_ONLY_STAY_AWAY_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 98a3531

Please sign in to comment.