Skip to content

Commit

Permalink
ignore .git dir when formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Tiger Kaovilai <[email protected]>
  • Loading branch information
kaovilai committed May 6, 2024
1 parent e1bef5b commit c304594
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hack/update-1fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if ! command -v goimports > /dev/null; then
exit 1
fi

files="$(find . -type f -name '*.go' -not -path './.go/*' -not -path './vendor/*' -not -path './site/*' -not -path '*/generated/*' -not -name 'zz_generated*' -not -path '*/mocks/*')"
files="$(find . -type f -name '*.go' -not -path './.go/*' -not -path './vendor/*' -not -path './site/*' -not -path './.git/*' -not -path '*/generated/*' -not -name 'zz_generated*' -not -path '*/mocks/*')"
echo "${ACTION} gofmt"
output=$(gofmt "${MODE}" -s ${files})
if [[ -n "${output}" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/restore_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ import (
"github.com/vmware-tanzu/velero/pkg/plugin/clientmgmt"
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
pkgrestore "github.com/vmware-tanzu/velero/pkg/restore"
"github.com/vmware-tanzu/velero/pkg/restore/util"
"github.com/vmware-tanzu/velero/pkg/util/collections"
kubeutil "github.com/vmware-tanzu/velero/pkg/util/kube"
"github.com/vmware-tanzu/velero/pkg/util/logging"
"github.com/vmware-tanzu/velero/pkg/util/results"
pkgrestoreUtil "github.com/vmware-tanzu/velero/pkg/util/velero/restore"
)

// nonRestorableResources is an exclusion list for the restoration process. Any resources
Expand Down Expand Up @@ -348,7 +348,7 @@ func (r *restoreReconciler) validateAndComplete(restore *api.Restore) (backupInf
}

// validate ExistingResourcePolicy
if restore.Spec.ExistingResourcePolicy != "" && !util.IsResourcePolicyValid(string(restore.Spec.ExistingResourcePolicy)) {
if restore.Spec.ExistingResourcePolicy != "" && !pkgrestoreUtil.IsResourcePolicyValid(string(restore.Spec.ExistingResourcePolicy)) {
restore.Status.ValidationErrors = append(restore.Status.ValidationErrors, fmt.Sprintf("Invalid ExistingResourcePolicy: %s", restore.Spec.ExistingResourcePolicy))
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util
package restore

import (
api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package util
package restore

import (
"testing"
Expand Down

0 comments on commit c304594

Please sign in to comment.