@@ -112,7 +112,7 @@ are locked by the caller, hence why the functions themselves do not set the lock
112112*/
113113
114114// 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.
116116func (d * Deployment ) GetFile (name , hash string ) []byte {
117117 for _ , file := range d .files {
118118 if name == file .Meta .GetName () && hash == file .Meta .GetHash () {
@@ -124,7 +124,7 @@ func (d *Deployment) GetFile(name, hash string) []byte {
124124}
125125
126126// 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.
128128func (d * Deployment ) SetFiles (files []File ) broadcast.NginxAgentMessage {
129129 d .files = files
130130
@@ -158,32 +158,32 @@ func (d *Deployment) SetFiles(files []File) broadcast.NginxAgentMessage {
158158
159159// SetNGINXPlusActions updates the deployment's latest NGINX Plus Actions to perform if using NGINX Plus.
160160// 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.
162162func (d * Deployment ) SetNGINXPlusActions (actions []* pb.NGINXPlusAction ) {
163163 d .nginxPlusActions = actions
164164}
165165
166166// 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.
168168func (d * Deployment ) SetPodErrorStatus (pod string , err error ) {
169169 d .podStatuses [pod ] = err
170170}
171171
172172// 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.
174174func (d * Deployment ) SetLatestConfigError (err error ) {
175175 d .latestConfigError = err
176176}
177177
178178// 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.
180180func (d * Deployment ) SetLatestUpstreamError (err error ) {
181181 d .latestUpstreamError = err
182182}
183183
184184// GetConfigurationStatus returns the current config status for this Deployment. It combines
185185// 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.
187187func (d * Deployment ) GetConfigurationStatus () error {
188188 errs := make ([]error , 0 , len (d .podStatuses ))
189189 for _ , err := range d .podStatuses {
0 commit comments