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

Add client support for Swarm Logs and Swarm Config #589

Merged
merged 14 commits into from
Apr 13, 2023

Conversation

ACoderLife
Copy link
Contributor

This pull request finishes off work started by @The-TT-Hacker here:
#472

It could also close this:
#387

If you are happy with the API being client.Config and not client.Swarm.Config

and also surfaces the service logs.

@dnfadmin
Copy link

dnfadmin commented Sep 19, 2022

CLA assistant check
All CLA requirements met.

@ACoderLife
Copy link
Contributor Author

@galvesribeiro let me know I you need some unit tests against these changes. Thanks.

@galvesribeiro
Copy link
Member

Hello! Thanks for the contribution.

let me know I you need some unit tests against these changes. Thanks.

Can you please add some basic coverage to it?

Thank you!

@dazinator dazinator mentioned this pull request Feb 18, 2023
Copy link
Contributor

@HofmeisterAn HofmeisterAn left a comment

Choose a reason for hiding this comment

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

Thank you for submitting this pull request. I have reviewed the code and overall it looks good. However, as @galvesribeiro mentioned, tests are missing.

src/Docker.DotNet/Endpoints/IConfigsOperations.cs Outdated Show resolved Hide resolved
src/Docker.DotNet/Endpoints/ISwarmOperations.cs Outdated Show resolved Hide resolved
src/Docker.DotNet/Endpoints/ISwarmOperations.cs Outdated Show resolved Hide resolved
using Models;
using System.IO;

internal class SwarmOperations : ISwarmOperations
Copy link
Contributor

@HofmeisterAn HofmeisterAn Feb 18, 2023

Choose a reason for hiding this comment

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

It would be kind if we could remove all the (unnecessary) whitespace changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean lineendings? I'm having trouble with this as it seems to me the repo has a mix of lineendings already? I ran git ls-files --eol and see both CRLF and LF.
My attempts at normalizing have resulted in even more files changed.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have similar issues with this repo all the time. It just makes it super hard to review SwarmOperations and ISwarmOperationsTests. Probably, it is necessary to encode and normalize the files all at once.

ACoderLife and others added 3 commits March 20, 2023 16:08
Co-authored-by: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com>
Co-authored-by: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com>
@ACoderLife ACoderLife force-pushed the master-plus-models-update branch 4 times, most recently from 227bfd5 to 6a30878 Compare March 20, 2023 22:52
add logging test
fix naming convention
src/Docker.DotNet/Endpoints/IConfigsOperations.cs Outdated Show resolved Hide resolved
src/Docker.DotNet/Endpoints/IConfigsOperations.cs Outdated Show resolved Hide resolved
src/Docker.DotNet/Endpoints/ConfigsOperations.cs Outdated Show resolved Hide resolved
using Models;
using System.IO;

internal class SwarmOperations : ISwarmOperations
Copy link
Contributor

Choose a reason for hiding this comment

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

I have similar issues with this repo all the time. It just makes it super hard to review SwarmOperations and ISwarmOperationsTests. Probably, it is necessary to encode and normalize the files all at once.


namespace Docker.DotNet
{
internal class ConfigsOperations : IConfigsOperations
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need tests for this class too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'll add them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added: Create, List, Inspect and Remove tests.

ACoderLife and others added 4 commits March 23, 2023 22:14
Co-authored-by: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com>
Co-authored-by: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com>
Co-authored-by: Andre Hofmeister <9199345+HofmeisterAn@users.noreply.github.com>
Copy link
Contributor

@HofmeisterAn HofmeisterAn left a comment

Choose a reason for hiding this comment

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

Looks good @galvesribeiro WDYT?

@ACoderLife
Copy link
Contributor Author

@galvesribeiro Did you want me to make any other clean up?

@galvesribeiro galvesribeiro self-assigned this Apr 11, 2023
@galvesribeiro
Copy link
Member

Thanks for the PR! I would rename swarm-related objects as suggested and also fix the test. Everything else LGTM.

@ACoderLife
Copy link
Contributor Author

ACoderLife commented Apr 13, 2023

@galvesribeiro renaming based on suggestions should be complete. Fixed test, @HofmeisterAn can you retry the CI build? Cheers.

@galvesribeiro galvesribeiro merged commit 1c3a067 into dotnet:master Apr 13, 2023
@galvesribeiro
Copy link
Member

All good! Thank you @ACoderLife. Will cut a new build soon.

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.

None yet

5 participants