Commit ddeb04b7 by haoshuwei

fmt checking update

Signed-off-by: haoshuwei <haoshuwei24@gmail.com>
parent f5ff5ebd
package main package main
import ( import (
"fmt"
"github.com/joho/godotenv" "github.com/joho/godotenv"
"os"
"github.com/pkg/errors" "github.com/pkg/errors"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"fmt" "os"
) )
const ( const (
......
...@@ -17,8 +17,8 @@ limitations under the License. ...@@ -17,8 +17,8 @@ limitations under the License.
package main package main
import ( import (
veleroplugin "github.com/vmware-tanzu/velero/pkg/plugin/framework"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
veleroplugin "github.com/vmware-tanzu/velero/pkg/plugin/framework"
) )
func main() { func main() {
......
package main package main
import ( import (
corev1api "k8s.io/api/core/v1" "github.com/pkg/errors"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/vmware-tanzu/velero/pkg/plugin/velero" "github.com/vmware-tanzu/velero/pkg/plugin/velero"
corev1api "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta" "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/api/resource"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
) )
type RestoreItemAction struct { type RestoreItemAction struct {
...@@ -16,7 +16,7 @@ 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} return &RestoreItemAction{log: logger}
} }
...@@ -53,7 +53,6 @@ func (p *RestoreItemAction) Execute(input *velero.RestoreItemActionExecuteInput) ...@@ -53,7 +53,6 @@ func (p *RestoreItemAction) Execute(input *velero.RestoreItemActionExecuteInput)
annotations = make(map[string]string) annotations = make(map[string]string)
} }
annotations["velero.io/alibabacloud-restore-plugin"] = "1" annotations["velero.io/alibabacloud-restore-plugin"] = "1"
metadata.SetAnnotations(annotations) metadata.SetAnnotations(annotations)
...@@ -69,7 +68,7 @@ func (p *RestoreItemAction) Execute(input *velero.RestoreItemActionExecuteInput) ...@@ -69,7 +68,7 @@ func (p *RestoreItemAction) Execute(input *velero.RestoreItemActionExecuteInput)
if int64(volSizeBytes) <= int64(minReqVolSizeBytes) { if int64(volSizeBytes) <= int64(minReqVolSizeBytes) {
p.log.Warnf("Alibaba disk volume request at least 20Gi, auto resize persistentVolumeClaim to 20Gi.") p.log.Warnf("Alibaba disk volume request at least 20Gi, auto resize persistentVolumeClaim to 20Gi.")
pvc.Spec.Resources = corev1api.ResourceRequirements{ pvc.Spec.Resources = corev1api.ResourceRequirements{
Requests : getResourceList(minReqVolSizeString), Requests: getResourceList(minReqVolSizeString),
} }
pvc.Status = corev1api.PersistentVolumeClaimStatus{} pvc.Status = corev1api.PersistentVolumeClaimStatus{}
inputMap, err = runtime.DefaultUnstructuredConverter.ToUnstructured(&pvc) inputMap, err = runtime.DefaultUnstructuredConverter.ToUnstructured(&pvc)
...@@ -125,5 +124,3 @@ func getResourceList(storage string) corev1api.ResourceList { ...@@ -125,5 +124,3 @@ func getResourceList(storage string) corev1api.ResourceList {
} }
return res return res
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment