-
Notifications
You must be signed in to change notification settings - Fork 347
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 command 'k0s ctr [command] [flags] [args]' #924
Conversation
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
If you want to verify if it works, execute the commands below to see that subcommands, flags and arguments work properly.
|
Can you please run |
Go build / Smoke test for BYO CRI feature failed but it seems that it is not related to my change. Could you retry this stage? |
I'm trying to pass this
where as ctr is accepting -a --address flag
|
I'm sorry. I know what is the problem. |
One more thing Does this make sense? |
Ok, thanks for the feedback. I will fix it soon. |
@jewertow also it would be good to have some sort of integration tests for such scenarios which would allow us to check if the tool has been included entirely. |
@jasmingacic does it make sense to set default namespace to
Maybe it would be better to not set namespace and relay on default behaviour of the |
The ctr in this case will be used only for k0s purposes so defaulting to namespace k8s.io where all containers reside makes sense. So we should default to |
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
52b32d0
to
b1d5420
Compare
@jasmingacic I significantly simplified the implementation. Now it fully relies on the original implementation. |
After changing implementation entirely, do you still see the need to add integration tests? |
I don't see anything worth unit testing in it now, there's hardly any "units" to test. LGTM. A pretty simple "smoke test" case would be to just add some |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will add a test soon. |
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
47b8ea6
to
995b2f0
Compare
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
@jasmingacic this failed CI plan looks like random failure, because it's not related to my changes and the test I added works fine. Could you trigger failed tests or run CI plan once again? |
@jewertow The CI issue is due to some changes can you sync your fork with the upstream. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jewertow this is looking good.
@k0sproject/k0s-core can someone else take a look too especially to the GH action changes.
inttest/ctr/singlenode_test.go
Outdated
_, err = ssh.ExecWithOutput("k0s install controller --enable-worker") | ||
s.Require().NoError(err) | ||
|
||
_, err = ssh.ExecWithOutput("rc-service k0scontroller start") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change this to k0s start
we can test the #896 at the same time :)
_, err = ssh.ExecWithOutput("rc-service k0scontroller start") | |
_, err = ssh.ExecWithOutput("k0s start") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. You're right, but the command re-service k0scontroller start/stop
is also used in other tests, so we could change all of them to k0s start/stop
in another pull request, because it's not related to the issue. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather that we don't touch other tests. Let's scope this PR to ctr only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, done
Signed-off-by: Jacek Ewertowski <jacek.ewertowski1@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @jewertow thank you
Issue
Fixes #856
What this PR Includes
This PR adds command
ctr
, which is containerd CLI.