5
5
"crypto/x509"
6
6
"fmt"
7
7
"net/url"
8
+ "runtime"
8
9
"time"
9
10
10
11
"github.com/blang/semver"
@@ -30,6 +31,7 @@ func (optr *Operator) syncAvailableUpdates(config *configv1.ClusterVersion) erro
30
31
usedDefaultUpstream = true
31
32
upstream = optr .defaultUpstreamServer
32
33
}
34
+ arch := runtime .GOARCH
33
35
channel := config .Spec .Channel
34
36
35
37
// updates are only checked at most once per minimumUpdateCheckInterval or if the generation changes
@@ -50,7 +52,7 @@ func (optr *Operator) syncAvailableUpdates(config *configv1.ClusterVersion) erro
50
52
}
51
53
}
52
54
53
- updates , condition := calculateAvailableUpdatesStatus (string (config .Spec .ClusterID ), proxyURL , tlsConfig , upstream , channel , optr .releaseVersion )
55
+ updates , condition := calculateAvailableUpdatesStatus (string (config .Spec .ClusterID ), proxyURL , tlsConfig , upstream , arch , channel , optr .releaseVersion )
54
56
55
57
if usedDefaultUpstream {
56
58
upstream = ""
@@ -117,14 +119,21 @@ func (optr *Operator) getAvailableUpdates() *availableUpdates {
117
119
return optr .availableUpdates
118
120
}
119
121
120
- func calculateAvailableUpdatesStatus (clusterID string , proxyURL * url.URL , tlsConfig * tls.Config , upstream , channel , version string ) ([]configv1.Update , configv1.ClusterOperatorStatusCondition ) {
122
+ func calculateAvailableUpdatesStatus (clusterID string , proxyURL * url.URL , tlsConfig * tls.Config , upstream , arch , channel , version string ) ([]configv1.Update , configv1.ClusterOperatorStatusCondition ) {
121
123
if len (upstream ) == 0 {
122
124
return nil , configv1.ClusterOperatorStatusCondition {
123
125
Type : configv1 .RetrievedUpdates , Status : configv1 .ConditionFalse , Reason : "NoUpstream" ,
124
126
Message : "No upstream server has been set to retrieve updates." ,
125
127
}
126
128
}
127
129
130
+ if len (arch ) == 0 {
131
+ return nil , configv1.ClusterOperatorStatusCondition {
132
+ Type : configv1 .RetrievedUpdates , Status : configv1 .ConditionFalse , Reason : "NoArchitecture" ,
133
+ Message : "The set of architectures has not been configured." ,
134
+ }
135
+ }
136
+
128
137
if len (version ) == 0 {
129
138
return nil , configv1.ClusterOperatorStatusCondition {
130
139
Type : configv1 .RetrievedUpdates , Status : configv1 .ConditionFalse , Reason : "NoCurrentVersion" ,
@@ -148,7 +157,7 @@ func calculateAvailableUpdatesStatus(clusterID string, proxyURL *url.URL, tlsCon
148
157
}
149
158
}
150
159
151
- updates , err := checkForUpdate (clusterID , proxyURL , tlsConfig , upstream , channel , currentVersion )
160
+ updates , err := checkForUpdate (clusterID , proxyURL , tlsConfig , upstream , arch , channel , currentVersion )
152
161
if err != nil {
153
162
klog .V (2 ).Infof ("Upstream server %s could not return available updates: %v" , upstream , err )
154
163
return nil , configv1.ClusterOperatorStatusCondition {
@@ -173,7 +182,7 @@ func calculateAvailableUpdatesStatus(clusterID string, proxyURL *url.URL, tlsCon
173
182
}
174
183
}
175
184
176
- func checkForUpdate (clusterID string , proxyURL * url.URL , tlsConfig * tls.Config , upstream , channel string , currentVersion semver.Version ) ([]cincinnati.Update , error ) {
185
+ func checkForUpdate (clusterID string , proxyURL * url.URL , tlsConfig * tls.Config , upstream , arch , channel string , currentVersion semver.Version ) ([]cincinnati.Update , error ) {
177
186
uuid , err := uuid .Parse (string (clusterID ))
178
187
if err != nil {
179
188
return nil , err
@@ -182,7 +191,7 @@ func checkForUpdate(clusterID string, proxyURL *url.URL, tlsConfig *tls.Config,
182
191
if len (upstream ) == 0 {
183
192
return nil , fmt .Errorf ("no upstream URL set for cluster version" )
184
193
}
185
- return cincinnati .NewClient (uuid , proxyURL , tlsConfig ).GetUpdates (upstream , channel , currentVersion )
194
+ return cincinnati .NewClient (uuid , proxyURL , tlsConfig ).GetUpdates (upstream , arch , channel , currentVersion )
186
195
}
187
196
188
197
// getHTTPSProxyURL returns a url.URL object for the configured
0 commit comments