Skip to content

Commit

Permalink
rename and reword
Browse files Browse the repository at this point in the history
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
  • Loading branch information
Wwwsylvia committed Jul 25, 2023
1 parent 7264aba commit 3285991
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions registry/remote/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -1281,14 +1281,14 @@ func (s *manifestStore) push(ctx context.Context, expected ocispec.Descriptor, c
if resp.StatusCode != http.StatusCreated {
return errutil.ParseErrorResponse(resp)
}
s.checkReferrersSupport(resp)
s.checkOCISubjectHeader(resp)
return verifyContentDigest(resp, expected.Digest)
}

// checkReferrersSupport checks the "OCI-Subject" header in the response and
// checkOCISubjectHeader checks the "OCI-Subject" header in the response and
// sets referrers capability accordingly.
// Reference: https://github.com/opencontainers/distribution-spec/blob/v1.1.0-rc3/spec.md#pushing-manifests-with-subject
func (s *manifestStore) checkReferrersSupport(resp *http.Response) {
func (s *manifestStore) checkOCISubjectHeader(resp *http.Response) {
// Referrers capability is not set to false when the subject header is not
// present, as the server may still conform to an older version of the spec
if subjectHeader := resp.Header.Get(headerOCISubject); subjectHeader != "" {
Expand Down Expand Up @@ -1326,8 +1326,8 @@ func (s *manifestStore) pushWithIndexing(ctx context.Context, expected ocispec.D
}
}

// indexReferrersForPush indexes referrers for an artifact manifest or
// an image manifest or an image index with a subject field on manifest push.
// indexReferrersForPush indexes referrers for manifests with a subject field
// on manifest push.
//
// References:
// - https://github.com/opencontainers/distribution-spec/blob/v1.1.0-rc3/spec.md#pushing-manifests-with-subject
Expand Down

0 comments on commit 3285991

Please sign in to comment.