Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
velero-plugin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
velero-plugin
Commits
ddeb04b7
Commit
ddeb04b7
authored
Dec 26, 2019
by
haoshuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmt checking update
Signed-off-by: haoshuwei <haoshuwei24@gmail.com>
parent
f5ff5ebd
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
12 deletions
+9
-12
velero-plugin-for-alibabacloud/common.go
+2
-2
velero-plugin-for-alibabacloud/main.go
+1
-1
velero-plugin-for-alibabacloud/object_store.go
+0
-0
velero-plugin-for-alibabacloud/restore_item_action.go
+6
-9
No files found.
velero-plugin-for-alibabacloud/common.go
View file @
ddeb04b7
package
main
import
(
"fmt"
"github.com/joho/godotenv"
"os"
"github.com/pkg/errors"
"io/ioutil"
"net/http"
"
fmt
"
"
os
"
)
const
(
...
...
velero-plugin-for-alibabacloud/main.go
View file @
ddeb04b7
...
...
@@ -17,8 +17,8 @@ limitations under the License.
package
main
import
(
veleroplugin
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
"github.com/sirupsen/logrus"
veleroplugin
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
)
func
main
()
{
...
...
velero-plugin-for-alibabacloud/object_store.go
View file @
ddeb04b7
velero-plugin-for-alibabacloud/restore_item_action.go
View file @
ddeb04b7
package
main
import
(
corev1api
"k8s.io/api/core/v1
"
"github.com/pkg/errors
"
"github.com/sirupsen/logrus"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
corev1api
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
)
type
RestoreItemAction
struct
{
...
...
@@ -16,7 +16,7 @@ type RestoreItemAction struct {
}
//
func
newRestoreItemAction
(
logger
logrus
.
FieldLogger
)
*
RestoreItemAction
{
func
newRestoreItemAction
(
logger
logrus
.
FieldLogger
)
*
RestoreItemAction
{
return
&
RestoreItemAction
{
log
:
logger
}
}
...
...
@@ -53,7 +53,6 @@ func (p *RestoreItemAction) Execute(input *velero.RestoreItemActionExecuteInput)
annotations
=
make
(
map
[
string
]
string
)
}
annotations
[
"velero.io/alibabacloud-restore-plugin"
]
=
"1"
metadata
.
SetAnnotations
(
annotations
)
...
...
@@ -69,7 +68,7 @@ func (p *RestoreItemAction) Execute(input *velero.RestoreItemActionExecuteInput)
if
int64
(
volSizeBytes
)
<=
int64
(
minReqVolSizeBytes
)
{
p
.
log
.
Warnf
(
"Alibaba disk volume request at least 20Gi, auto resize persistentVolumeClaim to 20Gi."
)
pvc
.
Spec
.
Resources
=
corev1api
.
ResourceRequirements
{
Requests
:
getResourceList
(
minReqVolSizeString
),
Requests
:
getResourceList
(
minReqVolSizeString
),
}
pvc
.
Status
=
corev1api
.
PersistentVolumeClaimStatus
{}
inputMap
,
err
=
runtime
.
DefaultUnstructuredConverter
.
ToUnstructured
(
&
pvc
)
...
...
@@ -125,5 +124,3 @@ func getResourceList(storage string) corev1api.ResourceList {
}
return
res
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment