@@ -112,7 +112,7 @@ are locked by the caller, hence why the functions themselves do not set the lock
112
112
*/
113
113
114
114
// GetFile gets the requested file for the deployment and returns its contents.
115
- // Caller MUST lock the deployment before calling this function.
115
+ // The deployment MUST already be locked before calling this function.
116
116
func (d * Deployment ) GetFile (name , hash string ) []byte {
117
117
for _ , file := range d .files {
118
118
if name == file .Meta .GetName () && hash == file .Meta .GetHash () {
@@ -124,7 +124,7 @@ func (d *Deployment) GetFile(name, hash string) []byte {
124
124
}
125
125
126
126
// SetFiles updates the nginx files and fileOverviews for the deployment and returns the message to send.
127
- // Caller MUST lock the deployment before calling this function.
127
+ // The deployment MUST already be locked before calling this function.
128
128
func (d * Deployment ) SetFiles (files []File ) broadcast.NginxAgentMessage {
129
129
d .files = files
130
130
@@ -158,32 +158,32 @@ func (d *Deployment) SetFiles(files []File) broadcast.NginxAgentMessage {
158
158
159
159
// SetNGINXPlusActions updates the deployment's latest NGINX Plus Actions to perform if using NGINX Plus.
160
160
// Used by a Subscriber when it first connects.
161
- // Caller MUST lock the deployment before calling this function.
161
+ // The deployment MUST already be locked before calling this function.
162
162
func (d * Deployment ) SetNGINXPlusActions (actions []* pb.NGINXPlusAction ) {
163
163
d .nginxPlusActions = actions
164
164
}
165
165
166
166
// SetPodErrorStatus sets the error status of a Pod in this Deployment if applying the config failed.
167
- // Caller MUST lock the deployment before calling this function.
167
+ // The deployment MUST already be locked before calling this function.
168
168
func (d * Deployment ) SetPodErrorStatus (pod string , err error ) {
169
169
d .podStatuses [pod ] = err
170
170
}
171
171
172
172
// SetLatestConfigError sets the latest config apply error for the deployment.
173
- // Caller MUST lock the deployment before calling this function.
173
+ // The deployment MUST already be locked before calling this function.
174
174
func (d * Deployment ) SetLatestConfigError (err error ) {
175
175
d .latestConfigError = err
176
176
}
177
177
178
178
// SetLatestUpstreamError sets the latest upstream update error for the deployment.
179
- // Caller MUST lock the deployment before calling this function.
179
+ // The deployment MUST already be locked before calling this function.
180
180
func (d * Deployment ) SetLatestUpstreamError (err error ) {
181
181
d .latestUpstreamError = err
182
182
}
183
183
184
184
// GetConfigurationStatus returns the current config status for this Deployment. It combines
185
185
// the most recent errors (if they exist) for all Pods in the Deployment into a single error.
186
- // Caller MUST lock the deployment before calling this function.
186
+ // The deployment MUST already be locked before calling this function.
187
187
func (d * Deployment ) GetConfigurationStatus () error {
188
188
errs := make ([]error , 0 , len (d .podStatuses ))
189
189
for _ , err := range d .podStatuses {
0 commit comments