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

Multiple arguments for flux suspend/resume ks #3746

Closed
1 task done
rishinair11 opened this issue Apr 3, 2023 · 2 comments · Fixed by #3755
Closed
1 task done

Multiple arguments for flux suspend/resume ks #3746

rishinair11 opened this issue Apr 3, 2023 · 2 comments · Fixed by #3755
Assignees
Labels
enhancement New feature or request

Comments

@rishinair11
Copy link
Contributor

rishinair11 commented Apr 3, 2023

Describe the bug

What

This is a proposal for an enhancement to run suspend/resume on multiple Kustomizations using

flux suspend ks operator database app

Why

Currently, to run flux suspend/resume ks on multiple Kustomizations, I need to do the following:

flux suspend ks operator && \
flux suspend ks database && \
flux suspend ks app

This will improve the developer workflow and user experience as I have done the above workaround many times to run the above-mentioned operations on Kustomizations frequently.

Steps to reproduce

N/A

Expected behavior

# flux suspend ks operator database app
► resuming kustomization operator in flux-system namespace
✔ kustomization resumed
◎ waiting for Kustomization reconciliation
✔ Kustomization reconciliation completed
✔ applied revision main/<commit-sha>
► resuming kustomization datastores in flux-system namespace
✔ kustomization resumed
◎ waiting for Kustomization reconciliation
✔ Kustomization reconciliation completed
✔ applied revision main/<commit-sha>
► resuming kustomization app in flux-system namespace
✔ kustomization resumed
◎ waiting for Kustomization reconciliation
✔ Kustomization reconciliation completed
✔ applied revision main/<commit-sha>

Screenshots and recordings

No response

OS / Distro

Linux

Flux version

N/A

Flux check

N/A

Git provider

No response

Container Registry provider

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@stefanprodan stefanprodan added enhancement New feature or request area/UX labels Apr 3, 2023
@rishinair11
Copy link
Contributor Author

I can work on this. Can you assign it to me @stefanprodan ?

@rishinair11 rishinair11 changed the title Multiple arguments for flux reconcile/suspend/resume ks Multiple arguments for flux suspend/resume ks Apr 4, 2023
@rishinair11
Copy link
Contributor Author

Changed the title as reconcile should be handled differently from suspend and resume.

rishinair11 added a commit to rishinair11/flux2 that referenced this issue Apr 4, 2023
Closes fluxcd#3746

This commit adds support for running `suspend/resume` on multiple supported resources at the same time.
This improves the user experience by converting
```console
flux suspend ks operator && \
flux suspend ks database && \
flux suspend ks app
```
to
```console
flux suspend ks operator database app
```

This works for all types of resources (Kustomizations, Sources, etc.) since it has been implemented at the `suspend.go` and `resume.go` level.

Local `e2e` test result:

```console
...
...
...
=== RUN   TestKustomizationFromGit
--- PASS: TestKustomizationFromGit (50.05s)
...
...
PASS
coverage: 30.2% of statements
ok      github.com/fluxcd/flux2/cmd/flux        260.698s        coverage: 30.2% of statements
```

Notes:
- `resumeCommand` struct now contains `shouldReconcile`,
  which should be set if reconciliation needed

- Added tests for suspend/reconcile with multiple args

Signed-off-by: Rishikesh <alienware505@gmail.com>
rishinair11 added a commit to rishinair11/flux2 that referenced this issue Apr 4, 2023
Closes fluxcd#3746

This commit adds support for running `suspend/resume` on multiple supported resources at the same time.
This improves the user experience by converting
`flux suspend ks operator && flux suspend ks database && flux suspend ks app`
to
`flux suspend ks operator database app`

This works for all types of resources (Kustomizations, Sources, etc.) since it has been implemented at the `suspend.go` and `resume.go` level.

Notes:
- `resumeCommand` struct now contains `shouldReconcile`,
  which should be set if reconciliation needed

- Added tests for suspend/reconcile with multiple args

Signed-off-by: Rishikesh <alienware505@gmail.com>
rishinair11 added a commit to rishinair11/flux2 that referenced this issue Apr 7, 2023
Closes fluxcd#3746

This commit adds support for running `suspend/resume` on multiple supported resources at the same time.
This improves the user experience by converting
`flux suspend ks operator && flux suspend ks database && flux suspend ks app`
to
`flux suspend ks operator database app`

This works for all types of resources (Kustomizations, Sources, etc.) since it has been implemented at the `suspend.go` and `resume.go` level.

Notes:
- `resumeCommand` struct now contains `shouldReconcile`,
  which should be set if reconciliation needed

- Added tests for suspend/reconcile with multiple args

Signed-off-by: Rishikesh <alienware505@gmail.com>
rishinair11 added a commit to rishinair11/flux2 that referenced this issue Apr 7, 2023
Closes fluxcd#3746

This commit adds support for running `suspend/resume` on multiple supported resources at the same time.
This improves the user experience by converting
`flux suspend ks operator && flux suspend ks database && flux suspend ks app`
to
`flux suspend ks operator database app`

This works for all types of resources (Kustomizations, Sources, etc.) since it has been implemented at the `suspend.go` and `resume.go` level.

Notes:
- `resumeCommand` struct now contains `shouldReconcile`,
  which should be set if reconciliation needed

- Added tests for suspend/reconcile with multiple args

Signed-off-by: Rishikesh <alienware505@gmail.com>
hiddeco pushed a commit to rishinair11/flux2 that referenced this issue May 30, 2023
Closes fluxcd#3746

This commit adds support for running `suspend/resume` on multiple supported resources at the same time.
This improves the user experience by converting
`flux suspend ks operator && flux suspend ks database && flux suspend ks app`
to
`flux suspend ks operator database app`

This works for all types of resources (Kustomizations, Sources, etc.) since it has been implemented at the `suspend.go` and `resume.go` level.

Notes:
- `resumeCommand` struct now contains `shouldReconcile`,
  which should be set if reconciliation needed

- Added tests for suspend/reconcile with multiple args

Signed-off-by: Rishikesh <alienware505@gmail.com>
hiddeco pushed a commit to rishinair11/flux2 that referenced this issue Jun 14, 2023
Closes fluxcd#3746

This commit adds support for running `suspend/resume` on multiple supported resources at the same time.
This improves the user experience by converting
`flux suspend ks operator && flux suspend ks database && flux suspend ks app`
to
`flux suspend ks operator database app`

This works for all types of resources (Kustomizations, Sources, etc.) since it has been implemented at the `suspend.go` and `resume.go` level.

Notes:
- `resumeCommand` struct now contains `shouldReconcile`,
  which should be set if reconciliation needed

- Added tests for suspend/reconcile with multiple args

Signed-off-by: Rishikesh <alienware505@gmail.com>
rishinair11 added a commit to rishinair11/flux2 that referenced this issue Jun 27, 2023
Closes fluxcd#3746

This commit adds support for running `suspend/resume` on multiple supported resources at the same time.
This improves the user experience by converting
`flux suspend ks operator && flux suspend ks database && flux suspend ks app`
to
`flux suspend ks operator database app`

This works for all types of resources (Kustomizations, Sources, etc.) since it has been implemented at the `suspend.go` and `resume.go` level.

Notes:
- `resumeCommand` struct now contains `shouldReconcile`,
  which should be set if reconciliation needed

- Added tests for suspend/reconcile with multiple args

Signed-off-by: Rishikesh <alienware505@gmail.com>
rishinair11 added a commit to rishinair11/flux2 that referenced this issue Jun 27, 2023
Closes fluxcd#3746

This commit adds support for running `suspend/resume` on multiple supported resources at the same time.
This improves the user experience by converting
`flux suspend ks operator && flux suspend ks database && flux suspend ks app`
to
`flux suspend ks operator database app`

This works for all types of resources (Kustomizations, Sources, etc.) since it has been implemented at the `suspend.go` and `resume.go` level.

Notes:
- `resumeCommand` struct now contains `shouldReconcile`,
  which should be set if reconciliation needed

- Added tests for suspend/reconcile with multiple args

Signed-off-by: Rishikesh <alienware505@gmail.com>
Signed-off-by: Rishikesh Nair <alienware505@gmail.com>
makkes pushed a commit to rishinair11/flux2 that referenced this issue Jun 28, 2023
Closes fluxcd#3746

This commit adds support for running `suspend/resume` on multiple supported resources at the same time.
This improves the user experience by converting
`flux suspend ks operator && flux suspend ks database && flux suspend ks app`
to
`flux suspend ks operator database app`

This works for all types of resources (Kustomizations, Sources, etc.) since it has been implemented at the `suspend.go` and `resume.go` level.

Notes:
- `resumeCommand` struct now contains `shouldReconcile`,
  which should be set if reconciliation needed

- Added tests for suspend/reconcile with multiple args

Signed-off-by: Rishikesh <alienware505@gmail.com>
Signed-off-by: Rishikesh Nair <alienware505@gmail.com>
makkes pushed a commit to rishinair11/flux2 that referenced this issue Jun 28, 2023
This change adds support for running `suspend/resume` on multiple
supported resources at the same time. This improves the user
experience by converting

```
flux suspend ks operator && \
flux suspend ks database && \
flux suspend ks app
```

to

```
flux suspend ks operator database app
```

This works for all types of resources (Kustomizations, Sources, etc.)
since it has been implemented at the `suspend.go` and `resume.go`
level.

When the `--wait` flag is passed to the `resume` command, then Flux
will wait for all resources in parallel within a goroutine each.

Each object is only processed once, even if user provided its name
more than once.

If suspension or resuming fails for one object, it is still carried
out for the remaining objects.

As a special case, the old behaviour of `resume` is retained, i.e.
when only one object name is provided, `resume` waits for the object
to become ready even if the `--wait` flag is not provided. In all
other cases the `--wait` flag is always considered.

Co-Authored-By: Max Jonas Werner <mail@makk.es>
Signed-off-by: Rishikesh Nair <alienware505@gmail.com>
Signed-off-by: Max Jonas Werner <mail@makk.es>

closes fluxcd#3746
rishinair11 added a commit to rishinair11/flux2 that referenced this issue Jun 28, 2023
This change adds support for running `suspend/resume` on multiple
supported resources at the same time. This improves the user
experience by converting

```
flux suspend ks operator && \
flux suspend ks database && \
flux suspend ks app
```

to

```
flux suspend ks operator database app
```

This works for all types of resources (Kustomizations, Sources, etc.)
since it has been implemented at the `suspend.go` and `resume.go`
level.

When the `--wait` flag is passed to the `resume` command, then Flux
will wait for all resources in parallel within a goroutine each.

Each object is only processed once, even if user provided its name
more than once.

If suspension or resuming fails for one object, it is still carried
out for the remaining objects.

As a special case, the old behaviour of `resume` is retained, i.e.
when only one object name is provided, `resume` waits for the object
to become ready even if the `--wait` flag is not provided. In all
other cases the `--wait` flag is always considered.

Signed-off-by: Rishikesh Nair <alienware505@gmail.com>
Co-Authored-By: Max Jonas Werner <mail@makk.es>
closes fluxcd#3746
Signed-off-by: Rishikesh Nair <alienware505@gmail.com>
makkes pushed a commit to rishinair11/flux2 that referenced this issue Jun 29, 2023
This change adds support for running `suspend/resume` on multiple
supported resources at the same time. This improves the user
experience by converting

```
flux suspend ks operator && \
flux suspend ks database && \
flux suspend ks app
```

to

```
flux suspend ks operator database app
```

This works for all types of resources (Kustomizations, Sources, etc.)
since it has been implemented at the `suspend.go` and `resume.go`
level.

When the `--wait` flag is passed to the `resume` command, then Flux
will wait for all resources in parallel within a goroutine each.

Each object is only processed once, even if user provided its name
more than once.

If suspension or resuming fails for one object, it is still carried
out for the remaining objects.

As a special case, the old behaviour of `resume` is retained, i.e.
when only one object name is provided, `resume` waits for the object
to become ready even if the `--wait` flag is not provided. In all
other cases the `--wait` flag is always considered.

closes fluxcd#3746
closes fluxcd#3793

Co-Authored-By: Max Jonas Werner <mail@makk.es>
Signed-off-by: Rishikesh Nair <alienware505@gmail.com>
Signed-off-by: Max Jonas Werner <mail@makk.es>
makkes pushed a commit to rishinair11/flux2 that referenced this issue Jun 29, 2023
This change adds support for running `suspend/resume` on multiple
supported resources at the same time. This improves the user
experience by converting

```
flux suspend ks operator && \
flux suspend ks database && \
flux suspend ks app
```

to

```
flux suspend ks operator database app
```

This works for all types of resources (Kustomizations, Sources, etc.)
since it has been implemented at the `suspend.go` and `resume.go`
level.

When the `--wait` flag is passed to the `resume` command, then Flux
will wait for all resources in parallel within a goroutine each.

Each object is only processed once, even if user provided its name
more than once.

If suspension or resuming fails for one object, it is still carried
out for the remaining objects.

As a special case, the old behaviour of `resume` is retained, i.e.
when only one object name is provided, `resume` waits for the object
to become ready even if the `--wait` flag is not provided. In all
other cases the `--wait` flag is always considered.

closes fluxcd#3746
closes fluxcd#3793

Co-Authored-By: Max Jonas Werner <mail@makk.es>
Signed-off-by: Rishikesh Nair <alienware505@gmail.com>
Signed-off-by: Max Jonas Werner <mail@makk.es>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants