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

Log docker server info #548

Merged
merged 5 commits into from Oct 6, 2022
Merged

Conversation

gauravgahlot
Copy link
Contributor

@gauravgahlot gauravgahlot commented Oct 5, 2022

Closes #546

github.com/testcontainers/testcontainers-go - Connected to docker: 
  Server Version: 20.10.17
  API Version: 1.41
  Operating System: Docker Desktop
  Total Memory: 7859 MB

@gauravgahlot gauravgahlot requested a review from a team as a code owner October 5, 2022 04:35
docker.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 5, 2022

Codecov Report

Merging #548 (254f6b1) into main (4c79569) will decrease coverage by 0.11%.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##             main     #548      +/-   ##
==========================================
- Coverage   68.84%   68.73%   -0.12%     
==========================================
  Files          22       22              
  Lines        2154     2172      +18     
==========================================
+ Hits         1483     1493      +10     
- Misses        533      539       +6     
- Partials      138      140       +2     
Impacted Files Coverage Δ
docker.go 71.06% <83.33%> (-0.30%) ⬇️

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

@mdelapenya mdelapenya added the feature New functionality or new behaviors on the existing one label Oct 5, 2022
@mdelapenya mdelapenya self-assigned this Oct 5, 2022
Copy link
Member

@kiview kiview left a comment

Choose a reason for hiding this comment

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

Can we add a test?

docker.go Outdated Show resolved Hide resolved
docker.go Outdated Show resolved Hide resolved
@mdelapenya
Copy link
Collaborator

mdelapenya commented Oct 5, 2022

@gauravgahlot I agree with @kiview: this code will print the information but for the current host, and it could be the case that Docker is connected to a remote daemon.

I'd go with the Docker client libraries, i.e. when we retrieve the Docker provider:

	type empty struct{}
	infoMessage := `%v - Connected to docker: 
  Server Version: %v
  API Version: %v
  Operating System: %v
  Total Memory: %v MB
`
	info, err := p.client.Info(context.Background())
	if err != nil {
		return nil, err
	}

	o.Logger.Printf(infoMessage, reflect.TypeOf(empty{}).PkgPath(),
		info.ServerVersion, c.ClientVersion(), info.OperatingSystem, info.MemTotal/1024/1024)

@gauravgahlot
Copy link
Contributor Author

Thank you @kiview @mdelapenya. I almost forgot we can use a remote host, maybe coz we didn't. 😄
I have updated the log message in description as per the new code.

@gauravgahlot
Copy link
Contributor Author

@mdelapenya Could you add me to the assignees please?

docker.go Outdated Show resolved Hide resolved
@mdelapenya
Copy link
Collaborator

@mdelapenya Could you add me to the assignees please?

Hi @gauravgahlot I'd like to understand the reasons to be in the assignees section. I'm used to using it to define who in the project team is actively working on the issue, not only reviewing but driving the conversation with the original author. That's why I'd like to know your personal preference

@gauravgahlot
Copy link
Contributor Author

@mdelapenya Could you add me to the assignees please?

Hi @gauravgahlot I'd like to understand the reasons to be in the assignees section. I'm used to using it to define who in the project team is actively working on the issue, not only reviewing but driving the conversation with the original author. That's why I'd like to know your personal preference

Oh, okay. I like to maintain a list of contributions that I did over the year and use "assigned" as a filter. That's the only reason. There are other ways to get my contribution list. So, no worries.

@gauravgahlot gauravgahlot requested review from mdelapenya and removed request for kiview October 5, 2022 11:56
Copy link
Collaborator

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM thanks for your help!!!

docker.go Outdated Show resolved Hide resolved
@mdelapenya mdelapenya merged commit 38fbdc6 into testcontainers:main Oct 6, 2022
mdelapenya added a commit to prskr/testcontainers-go that referenced this pull request Oct 6, 2022
* main:
  Log docker server info (testcontainers#548)
  docs: add docs regarding Colima usage (testcontainers#547)
@gauravgahlot gauravgahlot deleted the server-info branch October 6, 2022 11:46
mdelapenya referenced this pull request in mdelapenya/testcontainers-go Dec 21, 2022
* main:
  Add system requirements parent docs page for podman and colima (#562)
  Support for cap-add/cap-drop (#555)
  fix container NetworkMode usage (#560)
  chore: use hashed versions of test-summary action (#556)
  chore: use container.State() function in tests (#543)
  Log docker server info (#548)
  docs: add docs regarding Colima usage (#547)
  chore: add emoji to breaking changes in release drafter (#542)
  chore: add CONTRIBUTING file (#539)
  issue #537 Rename the wait/multi.go file to wait/all.go (#541)
  docs: add a basic layout for wait strategies in docs (#536)
  docs: improve consistency and fix typos (#534)
  chore: do not skip test (#528)
  chore: include test flakiness in the release drafter (#535)
  chore: retire old versions of Go (#530)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality or new behaviors on the existing one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: Log docker server info
3 participants