Skip to content

Commit 40d2a61

Browse files
committed
review fixes
1 parent 85b5b00 commit 40d2a61

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/cmd/admin/image/verify-signature.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (o *VerifyImageSignatureOptions) Complete(f *clientcmd.Factory, cmd *cobra.
7979
// .gnupg/pubring.gpg will be ignored.
8080
if len(o.PublicKeyFilename) > 0 {
8181
if o.Remove {
82-
return kcmdutil.UsageError(cmd, "cannot use public key when removing verifications status")
82+
return kcmdutil.UsageError(cmd, "cannot use public key when removing verification status")
8383
}
8484
if o.PublicKey, err = ioutil.ReadFile(o.PublicKeyFilename); err != nil {
8585
return err
@@ -174,10 +174,10 @@ func (o *VerifyImageSignatureOptions) verifyImageIdentity(reference, digest stri
174174
return nil
175175
}
176176

177-
// removeImageSignature removes the current image signature from the Image object by
177+
// clearSignatureVerificationStatus removes the current image signature from the Image object by
178178
// erasing all signature fields that were previously set (when image signature was
179179
// previously verified).
180-
func (o *VerifyImageSignatureOptions) removeImageSignature(s *imageapi.ImageSignature) {
180+
func (o *VerifyImageSignatureOptions) clearSignatureVerificationStatus(s *imageapi.ImageSignature) {
181181
s.Conditions = []imageapi.SignatureCondition{}
182182
s.IssuedBy = nil
183183
}
@@ -196,7 +196,7 @@ func (o *VerifyImageSignatureOptions) Run() error {
196196
// signatures.
197197
// TODO: This should probably need to handle removal of a single signature.
198198
if o.Remove {
199-
o.removeImageSignature(&img.Signatures[i])
199+
o.clearSignatureVerificationStatus(&img.Signatures[i])
200200
continue
201201
}
202202

@@ -220,7 +220,7 @@ func (o *VerifyImageSignatureOptions) Run() error {
220220
// If we have error and --confirm then remove the signature from the image which
221221
// changes the image to "unverified" state.
222222
if signatureErr != nil || signatureContentErr != nil || identityError != nil {
223-
o.removeImageSignature(&img.Signatures[i])
223+
o.clearSignatureVerificationStatus(&img.Signatures[i])
224224
continue
225225
}
226226

0 commit comments

Comments
 (0)