Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update: renamed flag --plain-http to --insecure-registry #674

Merged
merged 9 commits into from May 22, 2023

Conversation

Two-Hearts
Copy link
Contributor

@Two-Hearts Two-Hearts commented May 19, 2023

This PR is based on discussions in issue #623 with following changes:

  1. Renamed flag --plain-http to --insecure-registry for notation sign, verify, list, inspect and login. And added the original flag name --plain-http as an alias of the new name.
  2. Updated the flag's description to use HTTP protocol while connecting to registries. Should be used only for testing. Related specs are updated as well.

Resolves #623.

Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
@codecov-commenter
Copy link

codecov-commenter commented May 19, 2023

Codecov Report

Merging #674 (2b50e15) into main (c55aab0) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #674      +/-   ##
==========================================
- Coverage   61.37%   61.35%   -0.02%     
==========================================
  Files          42       42              
  Lines        2281     2280       -1     
==========================================
- Hits         1400     1399       -1     
  Misses        782      782              
  Partials       99       99              
Impacted Files Coverage Δ
cmd/notation/common.go 100.00% <100.00%> (ø)
cmd/notation/registry.go 67.92% <100.00%> (-0.30%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
@Two-Hearts Two-Hearts changed the title update: renamed --plain-http to --insecure-registry update: added --insecure-registry flag with alias --plain-http May 19, 2023
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yizha1 @Two-Hearts Should we just drop --plain-http in RC versions?

@yizha1
Copy link
Contributor

yizha1 commented May 19, 2023

@yizha1 @Two-Hearts Should we just drop --plain-http in RC versions?

RC-5 is the last RC release. The next is v1 release.

@shizhMSFT
Copy link
Contributor

shizhMSFT commented May 19, 2023

@yizha1 @Two-Hearts Should we just drop --plain-http in RC versions?

RC-5 is the last RC release. The next is v1 release.

Then we should drop the --plain-http flag and it can be added if needed. After 1.0.0, we are not able to remove any non-experimental flag but we are able to add new flags.

cmd/notation/common.go Outdated Show resolved Hide resolved
opts.Username = os.Getenv(defaultUsernameEnv)
opts.Password = os.Getenv(defaultPasswordEnv)
}

func aliasNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend removing aliasing to avoid breaking post RC to GA. Also this should be used only for test either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend removing aliasing to avoid breaking post RC to GA. Also this should be used only for test either way.

Got it. Updated the code to remove aliasing.

specs/commandline/verify.md Outdated Show resolved Hide resolved
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
@Two-Hearts Two-Hearts changed the title update: added --insecure-registry flag with alias --plain-http update: renamed flag --plain-http to --insecure-registry May 22, 2023
@Two-Hearts
Copy link
Contributor Author

@yizha1 @Two-Hearts Should we just drop --plain-http in RC versions?

RC-5 is the last RC release. The next is v1 release.

Then we should drop the --plain-http flag and it can be added if needed. After 1.0.0, we are not able to remove any non-experimental flag but we are able to add new flags.

Thanks @shizhMSFT, good point! I updated the code to reflect it.

@yizha1
Copy link
Contributor

yizha1 commented May 22, 2023

Agree to drop --plain-http flag in upcoming RC release

Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
shizhMSFT

This comment was marked as duplicate.

Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@priteshbandi priteshbandi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@priteshbandi priteshbandi merged commit 13bac0e into notaryproject:main May 22, 2023
4 checks passed
@Two-Hearts Two-Hearts deleted the chore branch May 22, 2023 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flag --plain-http didn't explicitly remind users the insecure connection to registries
7 participants