Adds suspend and resume all cmd

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
pull/1358/head
Somtochi Onyekwere 4 years ago
parent 68074d3543
commit 12a2100fcf

@ -23,6 +23,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/fluxcd/flux2/internal/utils" "github.com/fluxcd/flux2/internal/utils"
) )
@ -33,7 +34,15 @@ var resumeCmd = &cobra.Command{
Long: "The resume sub-commands resume a suspended resource.", Long: "The resume sub-commands resume a suspended resource.",
} }
type ResumeFlags struct {
all bool
}
var resumeArgs ResumeFlags
func init() { func init() {
resumeCmd.PersistentFlags().BoolVarP(&resumeArgs.all, "all", "", false,
"suspend all resources in that namespace")
rootCmd.AddCommand(resumeCmd) rootCmd.AddCommand(resumeCmd)
} }
@ -47,13 +56,18 @@ type resumable interface {
type resumeCommand struct { type resumeCommand struct {
apiType apiType
object resumable object resumable
list listResumable
}
type listResumable interface {
listAdapter
resumeItem(i int) resumable
} }
func (resume resumeCommand) run(cmd *cobra.Command, args []string) error { func (resume resumeCommand) run(cmd *cobra.Command, args []string) error {
if len(args) < 1 { if len(args) < 1 && !resumeArgs.all {
return fmt.Errorf("%s name is required", resume.humanKind) return fmt.Errorf("%s name is required", resume.humanKind)
} }
name := args[0]
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout) ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel() defer cancel()
@ -63,29 +77,46 @@ func (resume resumeCommand) run(cmd *cobra.Command, args []string) error {
return err return err
} }
namespacedName := types.NamespacedName{ var listOpts []client.ListOption
Namespace: rootArgs.namespace, listOpts = append(listOpts, client.InNamespace(rootArgs.namespace))
Name: name, if len(args) > 0 {
listOpts = append(listOpts, client.MatchingFields{
"metadata.name": args[0],
})
} }
err = kubeClient.Get(ctx, namespacedName, resume.object.asClientObject()) err = kubeClient.List(ctx, resume.list.asClientList(), listOpts...)
if err != nil { if err != nil {
return err return err
} }
logger.Actionf("resuming %s %s in %s namespace", resume.humanKind, name, rootArgs.namespace) if resume.list.len() == 0 {
resume.object.setUnsuspended() logger.Failuref("no %s objects found in %s namespace", resume.kind, rootArgs.namespace)
if err := kubeClient.Update(ctx, resume.object.asClientObject()); err != nil { return nil
return err
} }
logger.Successf("%s resumed", resume.humanKind)
logger.Waitingf("waiting for %s reconciliation", resume.kind) for i := 0; i < resume.list.len(); i++ {
if err := wait.PollImmediate(rootArgs.pollInterval, rootArgs.timeout, logger.Actionf("resuming %s %s in %s namespace", resume.humanKind, resume.list.resumeItem(i).asClientObject().GetName(), rootArgs.namespace)
isReady(ctx, kubeClient, namespacedName, resume.object)); err != nil { resume.list.resumeItem(i).setUnsuspended()
return err if err := kubeClient.Update(ctx, resume.list.resumeItem(i).asClientObject()); err != nil {
return err
}
logger.Successf("%s resumed", resume.humanKind)
namespacedName := types.NamespacedName{
Name: resume.list.resumeItem(i).asClientObject().GetName(),
Namespace: rootArgs.namespace,
}
logger.Waitingf("waiting for %s reconciliation", resume.kind)
if err := wait.PollImmediate(rootArgs.pollInterval, rootArgs.timeout,
isReady(ctx, kubeClient, namespacedName, resume.list.resumeItem(i))); err != nil {
logger.Failuref(err.Error())
continue
}
logger.Successf("%s reconciliation completed", resume.kind)
logger.Successf(resume.list.resumeItem(i).successMessage())
} }
logger.Successf("%s reconciliation completed", resume.kind)
logger.Successf(resume.object.successMessage())
return nil return nil
} }

@ -32,6 +32,7 @@ finish the apply.`,
RunE: resumeCommand{ RunE: resumeCommand{
apiType: alertType, apiType: alertType,
object: alertAdapter{&notificationv1.Alert{}}, object: alertAdapter{&notificationv1.Alert{}},
list: &alertListAdapter{&notificationv1.AlertList{}},
}.run, }.run,
} }
@ -50,3 +51,7 @@ func (obj alertAdapter) setUnsuspended() {
func (obj alertAdapter) successMessage() string { func (obj alertAdapter) successMessage() string {
return "Alert reconciliation completed" return "Alert reconciliation completed"
} }
func (a alertListAdapter) resumeItem(i int) resumable {
return &alertAdapter{&a.AlertList.Items[i]}
}

@ -35,6 +35,7 @@ finish the apply.`,
RunE: resumeCommand{ RunE: resumeCommand{
apiType: helmReleaseType, apiType: helmReleaseType,
object: helmReleaseAdapter{&helmv2.HelmRelease{}}, object: helmReleaseAdapter{&helmv2.HelmRelease{}},
list: helmReleaseListAdapter{&helmv2.HelmReleaseList{}},
}.run, }.run,
} }
@ -53,3 +54,7 @@ func (obj helmReleaseAdapter) setUnsuspended() {
func (obj helmReleaseAdapter) successMessage() string { func (obj helmReleaseAdapter) successMessage() string {
return fmt.Sprintf("applied revision %s", obj.Status.LastAppliedRevision) return fmt.Sprintf("applied revision %s", obj.Status.LastAppliedRevision)
} }
func (a helmReleaseListAdapter) resumeItem(i int) resumable {
return &helmReleaseAdapter{&a.HelmReleaseList.Items[i]}
}

@ -31,6 +31,7 @@ var resumeImageRepositoryCmd = &cobra.Command{
RunE: resumeCommand{ RunE: resumeCommand{
apiType: imageRepositoryType, apiType: imageRepositoryType,
object: imageRepositoryAdapter{&imagev1.ImageRepository{}}, object: imageRepositoryAdapter{&imagev1.ImageRepository{}},
list: imageRepositoryListAdapter{&imagev1.ImageRepositoryList{}},
}.run, }.run,
} }
@ -45,3 +46,7 @@ func (obj imageRepositoryAdapter) getObservedGeneration() int64 {
func (obj imageRepositoryAdapter) setUnsuspended() { func (obj imageRepositoryAdapter) setUnsuspended() {
obj.ImageRepository.Spec.Suspend = false obj.ImageRepository.Spec.Suspend = false
} }
func (a imageRepositoryListAdapter) resumeItem(i int) resumable {
return &imageRepositoryAdapter{&a.ImageRepositoryList.Items[i]}
}

@ -31,6 +31,7 @@ var resumeImageUpdateCmd = &cobra.Command{
RunE: resumeCommand{ RunE: resumeCommand{
apiType: imageUpdateAutomationType, apiType: imageUpdateAutomationType,
object: imageUpdateAutomationAdapter{&autov1.ImageUpdateAutomation{}}, object: imageUpdateAutomationAdapter{&autov1.ImageUpdateAutomation{}},
list: imageUpdateAutomationListAdapter{&autov1.ImageUpdateAutomationList{}},
}.run, }.run,
} }
@ -45,3 +46,7 @@ func (obj imageUpdateAutomationAdapter) setUnsuspended() {
func (obj imageUpdateAutomationAdapter) getObservedGeneration() int64 { func (obj imageUpdateAutomationAdapter) getObservedGeneration() int64 {
return obj.ImageUpdateAutomation.Status.ObservedGeneration return obj.ImageUpdateAutomation.Status.ObservedGeneration
} }
func (a imageUpdateAutomationListAdapter) resumeItem(i int) resumable {
return &imageUpdateAutomationAdapter{&a.ImageUpdateAutomationList.Items[i]}
}

@ -35,6 +35,7 @@ finish the apply.`,
RunE: resumeCommand{ RunE: resumeCommand{
apiType: kustomizationType, apiType: kustomizationType,
object: kustomizationAdapter{&kustomizev1.Kustomization{}}, object: kustomizationAdapter{&kustomizev1.Kustomization{}},
list: kustomizationListAdapter{&kustomizev1.KustomizationList{}},
}.run, }.run,
} }
@ -53,3 +54,7 @@ func (obj kustomizationAdapter) setUnsuspended() {
func (obj kustomizationAdapter) successMessage() string { func (obj kustomizationAdapter) successMessage() string {
return fmt.Sprintf("applied revision %s", obj.Status.LastAppliedRevision) return fmt.Sprintf("applied revision %s", obj.Status.LastAppliedRevision)
} }
func (a kustomizationListAdapter) resumeItem(i int) resumable {
return &kustomizationAdapter{&a.KustomizationList.Items[i]}
}

@ -32,6 +32,7 @@ finish the apply.`,
RunE: resumeCommand{ RunE: resumeCommand{
apiType: receiverType, apiType: receiverType,
object: receiverAdapter{&notificationv1.Receiver{}}, object: receiverAdapter{&notificationv1.Receiver{}},
list: receiverListAdapter{&notificationv1.ReceiverList{}},
}.run, }.run,
} }
@ -50,3 +51,7 @@ func (obj receiverAdapter) setUnsuspended() {
func (obj receiverAdapter) successMessage() string { func (obj receiverAdapter) successMessage() string {
return "Receiver reconciliation completed" return "Receiver reconciliation completed"
} }
func (a receiverListAdapter) resumeItem(i int) resumable {
return &receiverAdapter{&a.ReceiverList.Items[i]}
}

@ -45,3 +45,7 @@ func (obj bucketAdapter) getObservedGeneration() int64 {
func (obj bucketAdapter) setUnsuspended() { func (obj bucketAdapter) setUnsuspended() {
obj.Bucket.Spec.Suspend = false obj.Bucket.Spec.Suspend = false
} }
func (a bucketListAdapter) resumeItem(i int) resumable {
return &bucketAdapter{&a.BucketList.Items[i]}
}

@ -33,6 +33,7 @@ var resumeSourceHelmChartCmd = &cobra.Command{
RunE: resumeCommand{ RunE: resumeCommand{
apiType: helmChartType, apiType: helmChartType,
object: &helmChartAdapter{&sourcev1.HelmChart{}}, object: &helmChartAdapter{&sourcev1.HelmChart{}},
list: &helmChartListAdapter{&sourcev1.HelmChartList{}},
}.run, }.run,
} }
@ -51,3 +52,7 @@ func (obj helmChartAdapter) setUnsuspended() {
func (obj helmChartAdapter) successMessage() string { func (obj helmChartAdapter) successMessage() string {
return fmt.Sprintf("fetched revision %s", obj.Status.Artifact.Revision) return fmt.Sprintf("fetched revision %s", obj.Status.Artifact.Revision)
} }
func (a helmChartListAdapter) resumeItem(i int) resumable {
return &helmChartAdapter{&a.HelmChartList.Items[i]}
}

@ -31,6 +31,7 @@ var resumeSourceGitCmd = &cobra.Command{
RunE: resumeCommand{ RunE: resumeCommand{
apiType: gitRepositoryType, apiType: gitRepositoryType,
object: gitRepositoryAdapter{&sourcev1.GitRepository{}}, object: gitRepositoryAdapter{&sourcev1.GitRepository{}},
list: gitRepositoryListAdapter{&sourcev1.GitRepositoryList{}},
}.run, }.run,
} }
@ -45,3 +46,7 @@ func (obj gitRepositoryAdapter) getObservedGeneration() int64 {
func (obj gitRepositoryAdapter) setUnsuspended() { func (obj gitRepositoryAdapter) setUnsuspended() {
obj.GitRepository.Spec.Suspend = false obj.GitRepository.Spec.Suspend = false
} }
func (a gitRepositoryListAdapter) resumeItem(i int) resumable {
return &gitRepositoryAdapter{&a.GitRepositoryList.Items[i]}
}

@ -31,6 +31,7 @@ var resumeSourceHelmCmd = &cobra.Command{
RunE: resumeCommand{ RunE: resumeCommand{
apiType: helmRepositoryType, apiType: helmRepositoryType,
object: helmRepositoryAdapter{&sourcev1.HelmRepository{}}, object: helmRepositoryAdapter{&sourcev1.HelmRepository{}},
list: helmRepositoryListAdapter{&sourcev1.HelmRepositoryList{}},
}.run, }.run,
} }
@ -45,3 +46,7 @@ func (obj helmRepositoryAdapter) getObservedGeneration() int64 {
func (obj helmRepositoryAdapter) setUnsuspended() { func (obj helmRepositoryAdapter) setUnsuspended() {
obj.HelmRepository.Spec.Suspend = false obj.HelmRepository.Spec.Suspend = false
} }
func (a helmRepositoryListAdapter) resumeItem(i int) resumable {
return &helmRepositoryAdapter{&a.HelmRepositoryList.Items[i]}
}

@ -21,7 +21,7 @@ import (
"fmt" "fmt"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client"
"github.com/fluxcd/flux2/internal/utils" "github.com/fluxcd/flux2/internal/utils"
) )
@ -32,7 +32,15 @@ var suspendCmd = &cobra.Command{
Long: "The suspend sub-commands suspend the reconciliation of a resource.", Long: "The suspend sub-commands suspend the reconciliation of a resource.",
} }
type SuspendFlags struct {
all bool
}
var suspendArgs SuspendFlags
func init() { func init() {
suspendCmd.PersistentFlags().BoolVarP(&suspendArgs.all, "all", "", false,
"suspend all resources in that namespace")
rootCmd.AddCommand(suspendCmd) rootCmd.AddCommand(suspendCmd)
} }
@ -44,14 +52,19 @@ type suspendable interface {
type suspendCommand struct { type suspendCommand struct {
apiType apiType
list listSuspendable
object suspendable object suspendable
} }
type listSuspendable interface {
listAdapter
item(i int) suspendable
}
func (suspend suspendCommand) run(cmd *cobra.Command, args []string) error { func (suspend suspendCommand) run(cmd *cobra.Command, args []string) error {
if len(args) < 1 { if len(args) < 1 && !suspendArgs.all {
return fmt.Errorf("%s name is required", suspend.humanKind) return fmt.Errorf("%s name is required", suspend.humanKind)
} }
name := args[0]
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout) ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel() defer cancel()
@ -61,21 +74,33 @@ func (suspend suspendCommand) run(cmd *cobra.Command, args []string) error {
return err return err
} }
namespacedName := types.NamespacedName{ var listOpts []client.ListOption
Namespace: rootArgs.namespace, listOpts = append(listOpts, client.InNamespace(rootArgs.namespace))
Name: name, if len(args) > 0 {
listOpts = append(listOpts, client.MatchingFields{
"metadata.name": args[0],
})
} }
err = kubeClient.Get(ctx, namespacedName, suspend.object.asClientObject())
err = kubeClient.List(ctx, suspend.list.asClientList(), listOpts...)
if err != nil { if err != nil {
return err return err
} }
logger.Actionf("suspending %s %s in %s namespace", suspend.humanKind, name, rootArgs.namespace) if suspend.list.len() == 0 {
suspend.object.setSuspended() logger.Failuref("no %s objects found in %s namespace", suspend.kind, rootArgs.namespace)
if err := kubeClient.Update(ctx, suspend.object.asClientObject()); err != nil { return nil
return err }
for i := 0; i < suspend.list.len(); i++ {
logger.Actionf("suspending %s %s in %s namespace", suspend.humanKind, suspend.list.item(i).asClientObject().GetName(), rootArgs.namespace)
suspend.list.item(i).setSuspended()
if err := kubeClient.Update(ctx, suspend.list.item(i).asClientObject()); err != nil {
return err
}
logger.Successf("%s suspended", suspend.humanKind)
} }
logger.Successf("%s suspended", suspend.humanKind)
return nil return nil
} }

@ -31,6 +31,7 @@ var suspendAlertCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: alertType, apiType: alertType,
object: &alertAdapter{&notificationv1.Alert{}}, object: &alertAdapter{&notificationv1.Alert{}},
list: &alertListAdapter{&notificationv1.AlertList{}},
}.run, }.run,
} }
@ -45,3 +46,7 @@ func (obj alertAdapter) isSuspended() bool {
func (obj alertAdapter) setSuspended() { func (obj alertAdapter) setSuspended() {
obj.Alert.Spec.Suspend = true obj.Alert.Spec.Suspend = true
} }
func (a alertListAdapter) item(i int) suspendable {
return &alertAdapter{&a.AlertList.Items[i]}
}

@ -32,6 +32,7 @@ var suspendHrCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: helmReleaseType, apiType: helmReleaseType,
object: &helmReleaseAdapter{&helmv2.HelmRelease{}}, object: &helmReleaseAdapter{&helmv2.HelmRelease{}},
list: &helmReleaseListAdapter{&helmv2.HelmReleaseList{}},
}.run, }.run,
} }
@ -46,3 +47,7 @@ func (obj helmReleaseAdapter) isSuspended() bool {
func (obj helmReleaseAdapter) setSuspended() { func (obj helmReleaseAdapter) setSuspended() {
obj.HelmRelease.Spec.Suspend = true obj.HelmRelease.Spec.Suspend = true
} }
func (a helmReleaseListAdapter) item(i int) suspendable {
return &helmReleaseAdapter{&a.HelmReleaseList.Items[i]}
}

@ -31,6 +31,7 @@ var suspendImageRepositoryCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: imageRepositoryType, apiType: imageRepositoryType,
object: imageRepositoryAdapter{&imagev1.ImageRepository{}}, object: imageRepositoryAdapter{&imagev1.ImageRepository{}},
list: &imageRepositoryListAdapter{&imagev1.ImageRepositoryList{}},
}.run, }.run,
} }
@ -45,3 +46,7 @@ func (obj imageRepositoryAdapter) isSuspended() bool {
func (obj imageRepositoryAdapter) setSuspended() { func (obj imageRepositoryAdapter) setSuspended() {
obj.ImageRepository.Spec.Suspend = true obj.ImageRepository.Spec.Suspend = true
} }
func (a imageRepositoryListAdapter) item(i int) suspendable {
return &imageRepositoryAdapter{&a.ImageRepositoryList.Items[i]}
}

@ -31,6 +31,7 @@ var suspendImageUpdateCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: imageUpdateAutomationType, apiType: imageUpdateAutomationType,
object: imageUpdateAutomationAdapter{&autov1.ImageUpdateAutomation{}}, object: imageUpdateAutomationAdapter{&autov1.ImageUpdateAutomation{}},
list: &imageUpdateAutomationListAdapter{&autov1.ImageUpdateAutomationList{}},
}.run, }.run,
} }
@ -45,3 +46,7 @@ func (update imageUpdateAutomationAdapter) isSuspended() bool {
func (update imageUpdateAutomationAdapter) setSuspended() { func (update imageUpdateAutomationAdapter) setSuspended() {
update.ImageUpdateAutomation.Spec.Suspend = true update.ImageUpdateAutomation.Spec.Suspend = true
} }
func (a imageUpdateAutomationListAdapter) item(i int) suspendable {
return &imageUpdateAutomationAdapter{&a.ImageUpdateAutomationList.Items[i]}
}

@ -32,6 +32,7 @@ var suspendKsCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: kustomizationType, apiType: kustomizationType,
object: kustomizationAdapter{&kustomizev1.Kustomization{}}, object: kustomizationAdapter{&kustomizev1.Kustomization{}},
list: &kustomizationListAdapter{&kustomizev1.KustomizationList{}},
}.run, }.run,
} }
@ -46,3 +47,7 @@ func (obj kustomizationAdapter) isSuspended() bool {
func (obj kustomizationAdapter) setSuspended() { func (obj kustomizationAdapter) setSuspended() {
obj.Kustomization.Spec.Suspend = true obj.Kustomization.Spec.Suspend = true
} }
func (a kustomizationListAdapter) item(i int) suspendable {
return &kustomizationAdapter{&a.KustomizationList.Items[i]}
}

@ -31,6 +31,7 @@ var suspendReceiverCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: receiverType, apiType: receiverType,
object: &receiverAdapter{&notificationv1.Receiver{}}, object: &receiverAdapter{&notificationv1.Receiver{}},
list: &receiverListAdapter{&notificationv1.ReceiverList{}},
}.run, }.run,
} }
@ -45,3 +46,7 @@ func (obj receiverAdapter) isSuspended() bool {
func (obj receiverAdapter) setSuspended() { func (obj receiverAdapter) setSuspended() {
obj.Receiver.Spec.Suspend = true obj.Receiver.Spec.Suspend = true
} }
func (a receiverListAdapter) item(i int) suspendable {
return &receiverAdapter{&a.ReceiverList.Items[i]}
}

@ -31,6 +31,7 @@ var suspendSourceBucketCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: bucketType, apiType: bucketType,
object: bucketAdapter{&sourcev1.Bucket{}}, object: bucketAdapter{&sourcev1.Bucket{}},
list: bucketListAdapter{&sourcev1.BucketList{}},
}.run, }.run,
} }
@ -45,3 +46,7 @@ func (obj bucketAdapter) isSuspended() bool {
func (obj bucketAdapter) setSuspended() { func (obj bucketAdapter) setSuspended() {
obj.Bucket.Spec.Suspend = true obj.Bucket.Spec.Suspend = true
} }
func (a bucketListAdapter) item(i int) suspendable {
return &bucketAdapter{&a.BucketList.Items[i]}
}

@ -31,6 +31,7 @@ var suspendSourceHelmChartCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: helmChartType, apiType: helmChartType,
object: helmChartAdapter{&sourcev1.HelmChart{}}, object: helmChartAdapter{&sourcev1.HelmChart{}},
list: helmChartListAdapter{&sourcev1.HelmChartList{}},
}.run, }.run,
} }
@ -45,3 +46,7 @@ func (obj helmChartAdapter) isSuspended() bool {
func (obj helmChartAdapter) setSuspended() { func (obj helmChartAdapter) setSuspended() {
obj.HelmChart.Spec.Suspend = true obj.HelmChart.Spec.Suspend = true
} }
func (a helmChartListAdapter) item(i int) suspendable {
return &helmChartAdapter{&a.HelmChartList.Items[i]}
}

@ -31,6 +31,7 @@ var suspendSourceGitCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: gitRepositoryType, apiType: gitRepositoryType,
object: gitRepositoryAdapter{&sourcev1.GitRepository{}}, object: gitRepositoryAdapter{&sourcev1.GitRepository{}},
list: gitRepositoryListAdapter{&sourcev1.GitRepositoryList{}},
}.run, }.run,
} }
@ -45,3 +46,7 @@ func (obj gitRepositoryAdapter) isSuspended() bool {
func (obj gitRepositoryAdapter) setSuspended() { func (obj gitRepositoryAdapter) setSuspended() {
obj.GitRepository.Spec.Suspend = true obj.GitRepository.Spec.Suspend = true
} }
func (a gitRepositoryListAdapter) item(i int) suspendable {
return &gitRepositoryAdapter{&a.GitRepositoryList.Items[i]}
}

@ -31,6 +31,7 @@ var suspendSourceHelmCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: helmRepositoryType, apiType: helmRepositoryType,
object: helmRepositoryAdapter{&sourcev1.HelmRepository{}}, object: helmRepositoryAdapter{&sourcev1.HelmRepository{}},
list: helmRepositoryListAdapter{&sourcev1.HelmRepositoryList{}},
}.run, }.run,
} }
@ -45,3 +46,7 @@ func (obj helmRepositoryAdapter) isSuspended() bool {
func (obj helmRepositoryAdapter) setSuspended() { func (obj helmRepositoryAdapter) setSuspended() {
obj.HelmRepository.Spec.Suspend = true obj.HelmRepository.Spec.Suspend = true
} }
func (a helmRepositoryListAdapter) item(i int) suspendable {
return &helmRepositoryAdapter{&a.HelmRepositoryList.Items[i]}
}

@ -12,6 +12,7 @@ The resume sub-commands resume a suspended resource.
### Options ### Options
``` ```
--all suspend all resources in that namespace
-h, --help help for resume -h, --help help for resume
``` ```

@ -30,6 +30,7 @@ flux resume alert [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -30,6 +30,7 @@ flux resume helmrelease [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -18,6 +18,7 @@ The resume image sub-commands resume suspended image automation objects.
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -29,6 +29,7 @@ flux resume image repository [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -29,6 +29,7 @@ flux resume image update [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -30,6 +30,7 @@ flux resume kustomization [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -30,6 +30,7 @@ flux resume receiver [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -18,6 +18,7 @@ The resume sub-commands resume a suspended source.
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -29,6 +29,7 @@ flux resume source bucket [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -29,6 +29,7 @@ flux resume source chart [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -29,6 +29,7 @@ flux resume source git [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -29,6 +29,7 @@ flux resume source helm [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -12,6 +12,7 @@ The suspend sub-commands suspend the reconciliation of a resource.
### Options ### Options
``` ```
--all suspend all resources in that namespace
-h, --help help for suspend -h, --help help for suspend
``` ```

@ -29,6 +29,7 @@ flux suspend alert [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -29,6 +29,7 @@ flux suspend helmrelease [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -18,6 +18,7 @@ The suspend image sub-commands suspend the reconciliation of an image automation
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -29,6 +29,7 @@ flux suspend image repository [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -29,6 +29,7 @@ flux suspend image update [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -29,6 +29,7 @@ flux suspend kustomization [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -29,6 +29,7 @@ flux suspend receiver [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -18,6 +18,7 @@ The suspend sub-commands suspend the reconciliation of a source.
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -29,6 +29,7 @@ flux suspend source bucket [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -29,6 +29,7 @@ flux suspend source chart [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -29,6 +29,7 @@ flux suspend source git [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

@ -29,6 +29,7 @@ flux suspend source helm [name] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--all suspend all resources in that namespace
--context string kubernetes context to use --context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file --kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system") -n, --namespace string the namespace scope for this operation (default "flux-system")

Loading…
Cancel
Save