Skip to content

Commit

Permalink
updated per code review
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
  • Loading branch information
Two-Hearts committed Apr 8, 2024
1 parent d75bbf0 commit 1e3fd9f
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cmd/notation/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Example - Inspect signatures on an OCI artifact identified by a digest and outpu
return fmt.Errorf("max-signatures value %d must be a positive number", opts.maxSignatures)
}
if cmd.Flags().Changed("allow-referrers-api") {
fmt.Fprintln(os.Stderr, "Warning: flag '--allow-referrers-api' is deprecated and ignored.")
fmt.Fprintln(os.Stderr, "Warning: flag '--allow-referrers-api' is deprecated and will be removed in a future version.")
}
return runInspect(cmd, opts)
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/notation/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Example - [Experimental] List signatures of an OCI artifact identified by a tag
return fmt.Errorf("max-signatures value %d must be a positive number", opts.maxSignatures)
}
if cmd.Flags().Changed("allow-referrers-api") {
fmt.Fprintln(os.Stderr, "Warning: flag '--allow-referrers-api' is deprecated and ignored.")
fmt.Fprintln(os.Stderr, "Warning: flag '--allow-referrers-api' is deprecated and will be removed in a future version.")
}
return runList(cmd.Context(), opts)
},
Expand Down
4 changes: 2 additions & 2 deletions cmd/notation/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ Example - [Experimental] Sign an OCI artifact identified by a tag and referenced
// allow-referrers-api flag is set
if cmd.Flags().Changed("allow-referrers-api") {
if opts.allowReferrersAPI {
fmt.Fprintln(os.Stderr, "Warning: flag '--allow-referrers-api' is deprecated, use '--force-referrers-tag=false' instead.")
fmt.Fprintln(os.Stderr, "Warning: flag '--allow-referrers-api' is deprecated and will be removed in a future version, use '--force-referrers-tag=false' instead.")
opts.forceReferrersTag = false
} else {
fmt.Fprintln(os.Stderr, "Warning: flag '--allow-referrers-api' is deprecated, use '--force-referrers-tag' instead.")
fmt.Fprintln(os.Stderr, "Warning: flag '--allow-referrers-api' is deprecated and will be removed in a future version.")
}
}
return runSign(cmd, opts)
Expand Down
2 changes: 1 addition & 1 deletion cmd/notation/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Example - [Experimental] Verify a signature on an OCI artifact identified by a t
return fmt.Errorf("max-signatures value %d must be a positive number", opts.maxSignatureAttempts)
}
if cmd.Flags().Changed("allow-referrers-api") {
fmt.Fprintln(os.Stderr, "Warning: flag '--allow-referrers-api' is deprecated and ignored.")
fmt.Fprintln(os.Stderr, "Warning: flag '--allow-referrers-api' is deprecated and will be removed in a future version.")
}
return runVerify(cmd, opts)
},
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/suite/command/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ var _ = Describe("notation inspect", func() {
notation.Exec("inspect", artifact.ReferenceWithDigest(), "--allow-referrers-api", "-v").
MatchErrKeyWords(
"Warning: This feature is experimental and may not be fully tested or completed and may be deprecated.",
"Warning: flag '--allow-referrers-api' is deprecated and ignored.",
"Warning: flag '--allow-referrers-api' is deprecated and will be removed in a future version.",
).
MatchKeyWords(inspectSuccessfully...)
})
Expand All @@ -126,7 +126,7 @@ var _ = Describe("notation inspect", func() {
notation.Exec("inspect", artifact.ReferenceWithDigest(), "--allow-referrers-api", "-v").
MatchErrKeyWords(
"Warning: This feature is experimental and may not be fully tested or completed and may be deprecated.",
"Warning: flag '--allow-referrers-api' is deprecated and ignored.",
"Warning: flag '--allow-referrers-api' is deprecated and will be removed in a future version.",
).
MatchKeyWords(inspectSuccessfully...)
})
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/suite/command/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ var _ = Describe("notation list", func() {
notation.Exec("list", artifact.ReferenceWithDigest(), "--allow-referrers-api", "-v").
MatchErrKeyWords(
"Warning: This feature is experimental and may not be fully tested or completed and may be deprecated.",
"Warning: flag '--allow-referrers-api' is deprecated and ignored.",
"Warning: flag '--allow-referrers-api' is deprecated and will be removed in a future version.",
).
MatchKeyWords(
"└── application/vnd.cncf.notary.signature",
Expand All @@ -149,7 +149,7 @@ var _ = Describe("notation list", func() {
notation.Exec("list", artifact.ReferenceWithDigest(), "--allow-referrers-api", "-v").
MatchErrKeyWords(
"Warning: This feature is experimental and may not be fully tested or completed and may be deprecated.",
"Warning: flag '--allow-referrers-api' is deprecated and ignored.",
"Warning: flag '--allow-referrers-api' is deprecated and will be removed in a future version.",
).
MatchKeyWords(
"└── application/vnd.cncf.notary.signature",
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/suite/command/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ var _ = Describe("notation sign", func() {
Exec("sign", artifact.ReferenceWithDigest(), "--allow-referrers-api").
MatchErrKeyWords(
"Warning: This feature is experimental and may not be fully tested or completed and may be deprecated.",
"Warning: flag '--allow-referrers-api' is deprecated, use '--force-referrers-tag=false' instead.",
"Warning: flag '--allow-referrers-api' is deprecated and will be removed in a future version, use '--force-referrers-tag=false' instead.",
).
MatchKeyWords(SignSuccessfully)

Expand All @@ -124,7 +124,7 @@ var _ = Describe("notation sign", func() {
Exec("sign", artifact.ReferenceWithDigest(), "--allow-referrers-api=false").
MatchErrKeyWords(
"Warning: This feature is experimental and may not be fully tested or completed and may be deprecated.",
"Warning: flag '--allow-referrers-api' is deprecated, use '--force-referrers-tag' instead.",
"Warning: flag '--allow-referrers-api' is deprecated and will be removed in a future version.",
).
MatchKeyWords(SignSuccessfully)

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/suite/command/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ var _ = Describe("notation verify", func() {
notation.Exec("verify", artifact.ReferenceWithDigest(), "--allow-referrers-api", "-v").
MatchErrKeyWords(
"Warning: This feature is experimental and may not be fully tested or completed and may be deprecated.",
"Warning: flag '--allow-referrers-api' is deprecated and ignored.",
"Warning: flag '--allow-referrers-api' is deprecated and will be removed in a future version.",
).
MatchKeyWords(VerifySuccessfully)
})
Expand All @@ -111,7 +111,7 @@ var _ = Describe("notation verify", func() {
notation.Exec("verify", artifact.ReferenceWithDigest(), "--allow-referrers-api", "-v").
MatchErrKeyWords(
"Warning: This feature is experimental and may not be fully tested or completed and may be deprecated.",
"Warning: flag '--allow-referrers-api' is deprecated and ignored.",
"Warning: flag '--allow-referrers-api' is deprecated and will be removed in a future version.",
).
MatchKeyWords(VerifySuccessfully)
})
Expand Down

0 comments on commit 1e3fd9f

Please sign in to comment.