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

feat: print the port chosen by kernel if port is unspecified #720

Closed
wants to merge 1 commit into from

Conversation

thesayyn
Copy link

What type of PR is this?

feature

Which issue does this PR fix:

#717

What does this PR do / Why do we need it:

If an issue # is not available please add repro steps and logs showing the issue:

Testing done on this change:

{"level":"info","params":{"distSpecVersion":"1.0.1-dev","GoVersion":"","Commit":"","BinaryType":"","AccessControl":null,"Storage":{"Dedupe":true,"GC":true,"Commit":false,"GCDelay":3600000000000,"GCInterval":0,"RootDirectory":"/tmp/zot","StorageDriver":null,"SubPaths":null},"HTTP":{"Address":"127.0.0.1","Port":"0","AllowOrigin":"","TLS":null,"Auth":{"FailDelay":0,"HTPasswd":{"Path":""},"LDAP":null,"Bearer":null},"RawAccessControl":null,"Realm":"","Ratelimit":null},"Log":{"Level":"debug","Output":"","Audit":""},"Extensions":null},"goroutine":1,"caller":"/Users/thesayyn/Documents/zot/pkg/api/controller.go:107","time":"2022-08-11T18:06:37.75729+03:00","message":"configuration settings"}
{"level":"info","cpus":8,"max. open files":10240,"goroutine":1,"caller":"/Users/thesayyn/Documents/zot/pkg/api/controller.go:102","time":"2022-08-11T18:06:37.757374+03:00","message":"runtime params"}
{"level":"warn","goroutine":1,"caller":"/Users/thesayyn/Documents/zot/pkg/extensions/extensions_lint_disabled.go:13","time":"2022-08-11T18:06:37.757525+03:00","message":"lint extension is disabled because given zot binary doesn'tinclude this feature please build a binary that does so"}
{"level":"info","port":64680,"address":"127.0.0.1","goroutine":1,"caller":"/Users/thesayyn/Documents/zot/pkg/api/controller.go:175","time":"2022-08-11T18:06:37.80581+03:00","message":"Port is unspecified. zot will listen on an available port chosen by the kernel."}

Automation added to e2e:

Will this break upgrades or downgrades?
No

Does this PR introduce any user-facing change?:

Print the port chosen by the kernel when port is unspecified

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@@ -170,6 +170,11 @@ func (c *Controller) Run(reloadCtx context.Context) error {
return err
}

if c.Config.HTTP.Port == "0" || c.Config.HTTP.Port == "" {
Copy link
Author

Choose a reason for hiding this comment

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

right side of the condition is never true because zot will have the port 8080 as default

@rchincha
Copy link
Contributor

Thanks for the PR.

Just FYI, we require our commits to be git Signed-off-by and gpg signed.

@thesayyn
Copy link
Author

Thanks for the PR.

Just FYI, we require our commits to be git Signed-off-by and gpg signed.

Thanks for the heads-up. I'll fix that.

@shimish2
Copy link
Collaborator

Hi @thesayyn

Do you plan to update the PR to fix the failures or shall we takeover your PR ?

@thesayyn
Copy link
Author

Feel free to take over. Due to #724, I am stuck on using zot.

@thesayyn
Copy link
Author

@rchincha @shimish2 this should be ready.

rchincha added a commit to rchincha/zot that referenced this pull request Sep 6, 2022
Based off of the PR by @thesayyn
project-zot#720

Signed-off-by: Ramkumar Chinchani <[email protected]>
@rchincha
Copy link
Contributor

rchincha commented Sep 6, 2022

Pls see #770

rchincha added a commit to rchincha/zot that referenced this pull request Sep 6, 2022
Based off of the PR by @thesayyn
project-zot#720

Signed-off-by: Ramkumar Chinchani <[email protected]>
rchincha added a commit to rchincha/zot that referenced this pull request Sep 7, 2022
Based off of the PR by @thesayyn
project-zot#720

Signed-off-by: Ramkumar Chinchani <[email protected]>
rchincha added a commit to rchincha/zot that referenced this pull request Sep 8, 2022
Based off of the PR by @thesayyn
project-zot#720

Signed-off-by: Ramkumar Chinchani <[email protected]>
andaaron pushed a commit that referenced this pull request Sep 9, 2022
Based off of the PR by @thesayyn
#720

Signed-off-by: Ramkumar Chinchani <[email protected]>
@thesayyn
Copy link
Author

closing in favor of #770

@thesayyn thesayyn closed this Sep 16, 2022
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.

3 participants