Skip to content

Commit 98a3531

Browse files
committed
pkg/asset/installconfig: Add _CI_ONLY_STAY_AWAY_OPENSHIFT_INSTALL_AWS_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.
1 parent 6e8e960 commit 98a3531

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/asset/installconfig/platform.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/json"
55
"fmt"
66
"net/url"
7+
"os"
78
"sort"
89
"strings"
910

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

166+
if value, ok := os.LookupEnv("_CI_ONLY_STAY_AWAY_OPENSHIFT_INSTALL_AWS_USER_TAGS"); ok {
167+
if err := json.Unmarshal([]byte(value), &platform.UserTags); err != nil {
168+
return nil, fmt.Errorf("_CI_ONLY_STAY_AWAY_OPENSHIFT_INSTALL_AWS_USER_TAGS contains invalid JSON: %s (%v)", value, err)
169+
}
170+
}
171+
165172
data, err := json.Marshal(platform)
166173
if err != nil {
167174
return nil, err

0 commit comments

Comments
 (0)