-
Notifications
You must be signed in to change notification settings - Fork 1
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 Forgejo backup #310
base: master
Are you sure you want to change the base?
Add Forgejo backup #310
Conversation
3de6648
to
cae72c4
Compare
This reverts commit bb0c4f1.
3fa8c6c
to
7ff5285
Compare
5e7ed2a
to
9ce7aed
Compare
02384c9
to
00b8967
Compare
00b8967
to
7de9b6c
Compare
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.
Some small changes
@@ -52,6 +52,9 @@ func AddK8upBackup(ctx context.Context, svc *runtime.ServiceRuntime, comp common | |||
} | |||
|
|||
func createObjectBucket(ctx context.Context, comp common.InfoGetter, svc *runtime.ServiceRuntime) error { | |||
if comp.GetName() == "" { |
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.
this should not be possible. The comp
argument is the composite itself which cannot exist without a name.
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.
This actually did return an empty string on a few occasions.
With an empty string, it creates a bucket with a bad policy -bucket
which minio complains about and then the whole pipeline gets stuck until that bucket is deleted.
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.
Then we have a deeper problem somewhere in the code.
@@ -52,6 +52,9 @@ func AddK8upBackup(ctx context.Context, svc *runtime.ServiceRuntime, comp common | |||
} | |||
|
|||
func createObjectBucket(ctx context.Context, comp common.InfoGetter, svc *runtime.ServiceRuntime) error { | |||
if comp.GetName() == "" { | |||
return fmt.Errorf("could not get composition name") |
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.
It's composite and not composition.
@@ -80,7 +80,7 @@ func NewRelease(ctx context.Context, svc *runtime.ServiceRuntime, comp InfoGette | |||
|
|||
release := &xhelmv1.Release{ | |||
ObjectMeta: metav1.ObjectMeta{ | |||
Name: comp.GetName(), | |||
Name: resName, |
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.
why this has to change? This is in common package and will disrupt existing releases from other services, we have to be very carefully here.
return nil | ||
} | ||
|
||
func updateRelease(svc *runtime.ServiceRuntime, comp *vshnv1.VSHNForgejo) error { |
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.
This method looks fine but I notice we copy paste it already 3 or 4 times. Would be nice if we could move it to common package.
@@ -0,0 +1,3 @@ | |||
#!/bin/bash | |||
|
|||
forgejo dump --type tar -t /tmp/backup -V -f - |
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.
Add a new line here.
Summary
VSHNForgejo
Checklist
bug
,enhancement
,documentation
,change
,breaking
,dependency
as they show up in the changelog