-
Notifications
You must be signed in to change notification settings - Fork 86
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
Implement Pause Restic #315
Conversation
test/e2e/deployment_test.go
Outdated
f.EventualEvent(restic.ObjectMeta).Should(WithTransform(f.CountSuccessfulBackups, BeNumerically(">=", 1))) | ||
|
||
By(`Patching Restic with "paused: true"`) | ||
err = f.PatchRestic(&restic, func(in *api.Restic) *api.Restic { |
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.
assign newly patched restic or, use CreateOrPatch in next patch.
test/e2e/deployment_test.go
Outdated
@@ -28,6 +29,7 @@ var _ = Describe("Deployment", func() { | |||
cred core.Secret | |||
deployment apps.Deployment | |||
recovery api.Recovery | |||
previousBackupCount int64 |
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.
Don't need to define it globally.
pkg/docker/checks.go
Outdated
@@ -1,7 +1,7 @@ | |||
package docker | |||
|
|||
const ( | |||
ACRegistry = "appscode" | |||
ACRegistry = "emruzhossain" |
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.
You can set it here for running e2e tests.
pkg/backup/backup.go
Outdated
@@ -189,6 +189,9 @@ func (c *Controller) setup() (*api.Restic, error) { | |||
} | |||
|
|||
func (c *Controller) runResticBackup(resource *api.Restic) (err error) { | |||
if resource.Spec.Paused == true { | |||
return nil |
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.
log.Infoln("skipped logging since restic is paused.")
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.
added.
pkg/controller/daemonsets.go
Outdated
@@ -59,7 +59,9 @@ func (c *StashController) runDaemonSetInjector(key string) error { | |||
} | |||
|
|||
if newRestic != nil && !util.ResticEqual(oldRestic, newRestic) { | |||
return c.EnsureDaemonSetSidecar(ds, oldRestic, newRestic) | |||
if newRestic.Spec.Paused == false { |
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.
Use !newRestic.Spec.Paused
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.
updated
Fixes #279