@@ -65,7 +65,6 @@ func newClusterScalingIntegration(depl *Deployment) *clusterScalingIntegration {
65
65
66
66
// SendUpdateToCluster records the given spec to be sended to the cluster.
67
67
func (ci * clusterScalingIntegration ) SendUpdateToCluster (spec api.DeploymentSpec ) {
68
- ci .log .Debug ().Msg ("SendUpdateToCluster called" )
69
68
ci .pendingUpdate .mutex .Lock ()
70
69
defer ci .pendingUpdate .mutex .Unlock ()
71
70
ci .pendingUpdate .spec = & spec
@@ -76,7 +75,6 @@ func (ci *clusterScalingIntegration) ListenForClusterEvents(stopCh <-chan struct
76
75
start := time .Now ()
77
76
goodInspections := 0
78
77
for {
79
- ci .log .Debug ().Msg ("inspection loop for cluster int." )
80
78
delay := time .Second * 2
81
79
82
80
// Is deployment in running state
@@ -99,8 +97,6 @@ func (ci *clusterScalingIntegration) ListenForClusterEvents(stopCh <-chan struct
99
97
goodInspections ++
100
98
}
101
99
}
102
- } else {
103
- ci .log .Debug ().Msg ("cluster Phase not Running" )
104
100
}
105
101
106
102
select {
@@ -116,7 +112,6 @@ func (ci *clusterScalingIntegration) ListenForClusterEvents(stopCh <-chan struct
116
112
// Perform a single inspection of the cluster
117
113
func (ci * clusterScalingIntegration ) inspectCluster (ctx context.Context , expectSuccess bool ) error {
118
114
log := ci .log
119
- log .Debug ().Msg ("inspect cluster for scaling integration" )
120
115
c , err := ci .depl .clientCache .GetDatabase (ctx )
121
116
if err != nil {
122
117
return maskAny (err )
@@ -129,7 +124,6 @@ func (ci *clusterScalingIntegration) inspectCluster(ctx context.Context, expectS
129
124
return maskAny (err )
130
125
}
131
126
if req .Coordinators == nil && req .DBServers == nil {
132
- log .Debug ().Msg ("Nothing to check" )
133
127
// Nothing to check
134
128
return nil
135
129
}
@@ -147,14 +141,11 @@ func (ci *clusterScalingIntegration) inspectCluster(ctx context.Context, expectS
147
141
dbserversChanged = true
148
142
}
149
143
if ! coordinatorsChanged && ! dbserversChanged {
150
- // if there is nothing to change, check if we naver have asked the cluster before
144
+ // if there is nothing to change, check if we never have asked the cluster before
151
145
// if so, fill in the values for the first time.
152
146
// This happens, when the operator is redeployed and there has not been any
153
147
// update events yet.
154
148
if desired .Coordinators == nil || desired .DBServers == nil {
155
- //ci.lastNumberOfServers.mutex.Lock()
156
- //defer ci.lastNumberOfServers.mutex.Unlock()
157
- ci .log .Debug ().Msg ("Some of desired is nil" )
158
149
if req .Coordinators != nil {
159
150
ci .lastNumberOfServers .NumberOfServers .Coordinators = req .Coordinators
160
151
}
@@ -163,15 +154,13 @@ func (ci *clusterScalingIntegration) inspectCluster(ctx context.Context, expectS
163
154
}
164
155
}
165
156
166
- ci .log .Debug ().Msg ("Nothing has changed" )
167
157
// Nothing has changed
168
158
return nil
169
159
}
170
160
// Let's update the spec
171
161
apiObject := ci .depl .apiObject
172
162
current , err := ci .depl .deps .DatabaseCRCli .DatabaseV1alpha ().ArangoDeployments (apiObject .Namespace ).Get (apiObject .Name , metav1.GetOptions {})
173
163
if err != nil {
174
- log .Debug ().Err (err ).Msg ("Failed to get current deployment" )
175
164
return maskAny (err )
176
165
}
177
166
newSpec := current .Spec .DeepCopy ()
@@ -188,7 +177,6 @@ func (ci *clusterScalingIntegration) inspectCluster(ctx context.Context, expectS
188
177
// Restore original spec in cluster
189
178
ci .SendUpdateToCluster (current .Spec )
190
179
} else {
191
- log .Debug ().Msg ("UpdatedCRSpec via agency" )
192
180
if err := ci .depl .updateCRSpec (* newSpec ); err != nil {
193
181
log .Warn ().Err (err ).Msg ("Failed to update current deployment" )
194
182
return maskAny (err )
@@ -200,14 +188,12 @@ func (ci *clusterScalingIntegration) inspectCluster(ctx context.Context, expectS
200
188
// updateClusterServerCount updates the intended number of servers of the cluster.
201
189
// Returns true when it is safe to ask the cluster for updates.
202
190
func (ci * clusterScalingIntegration ) updateClusterServerCount (ctx context.Context , expectSuccess bool ) (bool , error ) {
203
- ci .log .Debug ().Msg ("updateClusterServerCount" )
204
191
// Any update needed?
205
192
ci .pendingUpdate .mutex .Lock ()
206
193
spec := ci .pendingUpdate .spec
207
194
ci .pendingUpdate .mutex .Unlock ()
208
195
if spec == nil {
209
196
// Nothing pending
210
- ci .log .Debug ().Msg ("Nothing pending" )
211
197
return true , nil
212
198
}
213
199
@@ -225,15 +211,12 @@ func (ci *clusterScalingIntegration) updateClusterServerCount(ctx context.Contex
225
211
226
212
// This is to prevent unneseccary updates that may override some values written by the WebUI (in the case of a update loop)
227
213
if coordinatorCount != lastNumberOfServers .GetCoordinators () || dbserverCount != lastNumberOfServers .GetDBServers () {
228
- ci .log .Debug ().Msg ("Set number of servers now" )
229
214
if err := arangod .SetNumberOfServers (ctx , c .Connection (), coordinatorCount , dbserverCount ); err != nil {
230
215
if expectSuccess {
231
216
log .Debug ().Err (err ).Msg ("Failed to set number of servers" )
232
217
}
233
218
return false , maskAny (err )
234
219
}
235
- } else {
236
- ci .log .Debug ().Msg ("Nothing has changed" )
237
220
}
238
221
239
222
// Success, now update internal state
0 commit comments