Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Add --timeout flag to fluxctl #2056

Merged
merged 3 commits into from
Aug 20, 2019
Merged

Conversation

suvl
Copy link
Contributor

@suvl suvl commented May 16, 2019

In our cluster, there's a few operations that almost always take more than 60 seconds. sync is the most sensitive for us, as we use it from tools like Jenkins and Azure DevOps to assert that our changes were applied to the cluster.

The hard-coded timeout prevented us from having a nice deterministic pipeline, so we need to change it: we added the --timeout <int> argument and it'll also be looking to the FLUX_TIMEOUT env variable.

.gitignore Outdated Show resolved Hide resolved
cmd/fluxctl/root_cmd.go Outdated Show resolved Hide resolved
@squaremo
Copy link
Member

This is a nice idea 👍

Is there an advantage to having the timeout in fluxctl, rather than using e.g., timeout 2m fluxctl sync?

I can think of one: it'll be available in environments which don't have GNU coreutils, e.g., Windows -- and since you mentioned Azure, perhaps that's an important advantage for you :-)

@suvl
Copy link
Contributor Author

suvl commented May 16, 2019

@squaremo well, doin' it with timeout is a quite nice idea, but since the timeout is currently hard-coded, and as you said it can be advantageous in some cases, I still would like to see a setting/env var on this.

@hiddeco
Copy link
Member

hiddeco commented May 16, 2019

This PR will probably solve #1857.

Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

Given the issue I mentioned I think this is a good change and will even solve some edge case scenarios people are having issues with at the moment.

Please take a look at my comments (all about code style and not so much about the contents of the PR itself).

@suvl
Copy link
Contributor Author

suvl commented May 17, 2019

@hiddeco I've accepted all proposed changes.

@squaremo
Copy link
Member

This PR will probably solve #1857.

That would be nice, but I don't think it will happen this time -- this PR changes how long fluxctl will keep polling for a job to complete, but the job timeout internal to fluxd remains the same.

@squaremo
Copy link
Member

I still would like to see a setting/env var on this.

Fair enough -- no objection here.

@hiddeco
Copy link
Member

hiddeco commented May 20, 2019

That would be nice, but I don't think it will happen this time -- this PR changes how long fluxctl will keep polling for a job to complete, but the job timeout internal to fluxd remains the same.

Ah, you are right 😞


@suvl looking good, tests are failing due to the introduced timeout var not being set in TestReleaseCommand_CLIConversion. You can run the tests on your own machine by running make test (to confirm you fixed the issue), in addition, can you smash your commits together once this has been fixed?

@hiddeco hiddeco added this to the v1.13.0 milestone May 22, 2019
@2opremio
Copy link
Contributor

@suvl are you planning to continue working on this? If that's the case, please revise on master since we have recently moved to go modules, which is causing a conflict

@suvl
Copy link
Contributor Author

suvl commented Jun 4, 2019

@2opremio yeah sorry I was away for a time, but yeah planning on fixing the tests and now on fixing the merge from master.

@squaremo
Copy link
Member

squaremo commented Jun 11, 2019

fixing the merge from master.

Please rebase on master rather than merging. Usually there will be no conflicts. If you need a hand though, let us know.

EDIT: After re-reading the thread, I think that's what you meant. As you were :-)

@squaremo squaremo modified the milestones: v1.13.0, 1.13.1, 1.14.0 Jun 13, 2019
@suvl suvl changed the title Add timeout setting [WIP] Add timeout setting Jun 18, 2019
@hiddeco hiddeco force-pushed the feature-timeout branch 2 times, most recently from 1d18f96 to 18768fc Compare July 11, 2019 16:20
@hiddeco hiddeco changed the title [WIP] Add timeout setting Add --timeout flag to fluxctl Jul 11, 2019
@hiddeco
Copy link
Member

hiddeco commented Aug 15, 2019

Can't review this myself again as I have touched the code, @stefanprodan / @squaremo PTAL.

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

@stefanprodan stefanprodan merged commit 9a0977c into fluxcd:master Aug 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants