mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-11-08 04:18:06 +00:00
Expose resourcemodifiers package to pkg for plugin reuse (#10759)
Move the resourcemodifiers package from internal/ to pkg/ so that external plugins, such as Restore Item Action (RIA) plugins, can import and reuse Velero's built-in resource modifier implementation. Due to Go's internal package visibility restrictions, external plugins cannot import packages located under internal/. Relocating resourcemodifiers to pkg/ allows plugins to evaluate and apply resource modifier rules to in-memory resource objects prior to validation or restore execution, ensuring consistent behavior with the Velero server without duplicate code. Update all internal import paths and add an unreleased changelog entry. Fixes #10668 Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
This commit is contained in:
1 parent
65d40341b0
commit
ce474d01e8
15 files changed
+6
-5
No files matched your search
@@ -0,0 +1 @@
|
||||
Move internal/resourcemodifiers to pkg/resourcemodifiers for plugin reuse
|
||||
@@ -31,7 +31,6 @@ import (
|
||||
"k8s.io/client-go/tools/cache"
|
||||
kbclient "sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
"github.com/velero-io/velero/internal/resourcemodifiers"
|
||||
"github.com/velero-io/velero/internal/resourcepolicies"
|
||||
api "github.com/velero-io/velero/pkg/apis/velero/v1"
|
||||
"github.com/velero-io/velero/pkg/client"
|
||||
@@ -39,6 +38,7 @@ import (
|
||||
"github.com/velero-io/velero/pkg/cmd/cli"
|
||||
"github.com/velero-io/velero/pkg/cmd/util/flag"
|
||||
"github.com/velero-io/velero/pkg/cmd/util/output"
|
||||
"github.com/velero-io/velero/pkg/resourcemodifiers"
|
||||
"github.com/velero-io/velero/pkg/util/boolptr"
|
||||
"github.com/velero-io/velero/pkg/util/kube"
|
||||
"github.com/velero-io/velero/pkg/util/velero/restore"
|
||||
|
||||
@@ -43,7 +43,6 @@ import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
|
||||
|
||||
"github.com/velero-io/velero/internal/hook"
|
||||
"github.com/velero-io/velero/internal/resourcemodifiers"
|
||||
"github.com/velero-io/velero/internal/resourcepolicies"
|
||||
"github.com/velero-io/velero/internal/volume"
|
||||
api "github.com/velero-io/velero/pkg/apis/velero/v1"
|
||||
@@ -54,6 +53,7 @@ import (
|
||||
"github.com/velero-io/velero/pkg/persistence"
|
||||
"github.com/velero-io/velero/pkg/plugin/clientmgmt"
|
||||
"github.com/velero-io/velero/pkg/plugin/framework"
|
||||
"github.com/velero-io/velero/pkg/resourcemodifiers"
|
||||
pkgrestore "github.com/velero-io/velero/pkg/restore"
|
||||
"github.com/velero-io/velero/pkg/util/boolptr"
|
||||
"github.com/velero-io/velero/pkg/util/collections"
|
||||
|
||||
@@ -35,7 +35,6 @@ import (
|
||||
ctrl "sigs.k8s.io/controller-runtime"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
|
||||
"github.com/velero-io/velero/internal/resourcemodifiers"
|
||||
"github.com/velero-io/velero/internal/volume"
|
||||
velerov1api "github.com/velero-io/velero/pkg/apis/velero/v1"
|
||||
"github.com/velero-io/velero/pkg/builder"
|
||||
@@ -45,6 +44,7 @@ import (
|
||||
"github.com/velero-io/velero/pkg/plugin/framework"
|
||||
pluginmocks "github.com/velero-io/velero/pkg/plugin/mocks"
|
||||
riav2 "github.com/velero-io/velero/pkg/plugin/velero/restoreitemaction/v2"
|
||||
"github.com/velero-io/velero/pkg/resourcemodifiers"
|
||||
pkgrestore "github.com/velero-io/velero/pkg/restore"
|
||||
velerotest "github.com/velero-io/velero/pkg/test"
|
||||
"github.com/velero-io/velero/pkg/util/logging"
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -25,11 +25,11 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
"github.com/velero-io/velero/internal/resourcemodifiers"
|
||||
"github.com/velero-io/velero/internal/resourcepolicies"
|
||||
"github.com/velero-io/velero/internal/volume"
|
||||
velerov1api "github.com/velero-io/velero/pkg/apis/velero/v1"
|
||||
"github.com/velero-io/velero/pkg/itemoperation"
|
||||
"github.com/velero-io/velero/pkg/resourcemodifiers"
|
||||
"github.com/velero-io/velero/pkg/util/kube"
|
||||
)
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ import (
|
||||
|
||||
"github.com/velero-io/velero/internal/credentials"
|
||||
"github.com/velero-io/velero/internal/hook"
|
||||
"github.com/velero-io/velero/internal/resourcemodifiers"
|
||||
"github.com/velero-io/velero/internal/resourcepolicies"
|
||||
"github.com/velero-io/velero/internal/volume"
|
||||
velerov1api "github.com/velero-io/velero/pkg/apis/velero/v1"
|
||||
@@ -74,6 +73,7 @@ import (
|
||||
"github.com/velero-io/velero/pkg/podexec"
|
||||
"github.com/velero-io/velero/pkg/podvolume"
|
||||
"github.com/velero-io/velero/pkg/podvolume/configs"
|
||||
"github.com/velero-io/velero/pkg/resourcemodifiers"
|
||||
"github.com/velero-io/velero/pkg/types"
|
||||
"github.com/velero-io/velero/pkg/util/boolptr"
|
||||
"github.com/velero-io/velero/pkg/util/collections"
|
||||
|
||||
Reference in new issue
Block a user