@@ -23,7 +23,7 @@ const (
23
23
consoleNamespace = "openshift-web-console"
24
24
consoleRBACTemplateName = "web-console-server-rbac"
25
25
consoleAPIServerTemplateName = "openshift-web-console"
26
- consoleAssetConfigFile = "install/origin-web-console/console-config.yaml"
26
+ consoleConfigFile = "install/origin-web-console/console-config.yaml"
27
27
)
28
28
29
29
// InstallWebConsole installs the web console server into the openshift-web-console namespace and waits for it to become ready
@@ -46,40 +46,59 @@ func (h *Helper) InstallWebConsole(f *clientcmd.Factory, imageFormat string, ser
46
46
return errors .NewError ("cannot instantiate template service broker permissions" ).WithCause (err )
47
47
}
48
48
49
- // read in the asset config YAML file like the installer
50
- assetConfigYaml , err := bootstrap .Asset (consoleAssetConfigFile )
49
+ // read in the config YAML file like the installer
50
+ consoleConfigYaml , err := bootstrap .Asset (consoleConfigFile )
51
51
if err != nil {
52
- return errors .NewError ("cannot read web console asset config file" ).WithCause (err )
52
+ return errors .NewError ("cannot read web console config file" ).WithCause (err )
53
53
}
54
54
55
55
// prase the YAML to edit
56
- var assetConfig map [string ]interface {}
57
- if err := yaml .Unmarshal (assetConfigYaml , & assetConfig ); err != nil {
58
- return errors .NewError ("cannot parse web console asset config as YAML" ).WithCause (err )
56
+ var consoleConfig map [string ]interface {}
57
+ if err := yaml .Unmarshal (consoleConfigYaml , & consoleConfig ); err != nil {
58
+ return errors .NewError ("cannot parse web console config as YAML" ).WithCause (err )
59
59
}
60
60
61
- // update asset config values
62
- assetConfig ["publicURL" ] = publicURL
63
- assetConfig ["masterPublicURL" ] = masterURL
61
+ // update config values
62
+ clusterInfo , ok := consoleConfig ["clusterInfo" ].(map [interface {}]interface {})
63
+ if ! ok {
64
+ return errors .NewError ("cannot read clusterInfo in web console config" )
65
+ }
66
+
67
+ clusterInfo ["consolePublicURL" ] = publicURL
68
+ clusterInfo ["masterPublicURL" ] = masterURL
69
+ if len (loggingURL ) > 0 {
70
+ clusterInfo ["loggingPublicURL" ] = loggingURL
71
+ }
72
+ if len (metricsURL ) > 0 {
73
+ clusterInfo ["metricsPublicURL" ] = metricsURL
74
+ }
75
+
76
+ // START deprecated properties
77
+ // These properties have been renamed and will be removed from cluster up
78
+ // in a future pull. Keep both the old and new properties for now so that
79
+ // the cluster up is not broken while the origin-web-console image is updated.
80
+ consoleConfig ["publicURL" ] = publicURL
81
+ consoleConfig ["masterPublicURL" ] = masterURL
64
82
if len (loggingURL ) > 0 {
65
- assetConfig ["loggingPublicURL" ] = loggingURL
83
+ consoleConfig ["loggingPublicURL" ] = loggingURL
66
84
}
67
85
if len (metricsURL ) > 0 {
68
- assetConfig ["metricsPublicURL" ] = metricsURL
86
+ consoleConfig ["metricsPublicURL" ] = metricsURL
69
87
}
88
+ // END deprecated properties
70
89
71
90
// serialize it back out as a string to use as a template parameter
72
- updatedAssetConfig , err := yaml .Marshal (assetConfig )
91
+ updatedConfig , err := yaml .Marshal (consoleConfig )
73
92
if err != nil {
74
- return errors .NewError ("cannot serialize web console asset config" ).WithCause (err )
93
+ return errors .NewError ("cannot serialize web console config" ).WithCause (err )
75
94
}
76
95
77
96
imageTemplate := variable .NewDefaultImageTemplate ()
78
97
imageTemplate .Format = imageFormat
79
98
imageTemplate .Latest = false
80
99
81
100
params := map [string ]string {
82
- "API_SERVER_CONFIG" : string (updatedAssetConfig ),
101
+ "API_SERVER_CONFIG" : string (updatedConfig ),
83
102
"IMAGE" : imageTemplate .ExpandOrDie ("web-console" ),
84
103
"LOGLEVEL" : fmt .Sprint (serverLogLevel ),
85
104
"NAMESPACE" : consoleNamespace ,
0 commit comments