Skip to content

Commit

Permalink
Move images func to reduce import impact to install pkg
Browse files Browse the repository at this point in the history
Signed-off-by: Tiger Kaovilai <[email protected]>
  • Loading branch information
kaovilai committed Sep 10, 2024
1 parent 55d1b0b commit cb1ea3b
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions pkg/cmd/cli/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

"github.com/vmware-tanzu/velero/internal/velero"
images "github.com/vmware-tanzu/velero/internal/velero/images"
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
"github.com/vmware-tanzu/velero/pkg/client"
"github.com/vmware-tanzu/velero/pkg/cmd"
Expand Down Expand Up @@ -167,7 +167,7 @@ func (o *Options) BindFlags(flags *pflag.FlagSet) {
func NewInstallOptions() *Options {
return &Options{
Namespace: velerov1api.DefaultNamespace,
Image: velero.DefaultVeleroImage(),
Image: images.DefaultVeleroImage(),

Check warning on line 170 in pkg/cmd/cli/install/install.go

View check run for this annotation

Codecov / codecov/patch

pkg/cmd/cli/install/install.go#L170

Added line #L170 was not covered by tests
BackupStorageConfig: flag.NewMap(),
VolumeSnapshotConfig: flag.NewMap(),
PodAnnotations: flag.NewMap(),
Expand Down
4 changes: 2 additions & 2 deletions pkg/install/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/vmware-tanzu/velero/internal/velero"
images "github.com/vmware-tanzu/velero/internal/velero/images"
)

func DaemonSet(namespace string, opts ...podTemplateOption) *appsv1.DaemonSet {
c := &podTemplateConfig{
image: velero.DefaultVeleroImage(),
image: images.DefaultVeleroImage(),
}

for _, opt := range opts {
Expand Down
4 changes: 2 additions & 2 deletions pkg/install/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/vmware-tanzu/velero/internal/velero"
images "github.com/vmware-tanzu/velero/internal/velero/images"
"github.com/vmware-tanzu/velero/pkg/builder"
"github.com/vmware-tanzu/velero/pkg/util/kube"
)
Expand Down Expand Up @@ -195,7 +195,7 @@ func WithKeepLatestMaintenanceJobs(keepLatestMaintenanceJobs int) podTemplateOpt
func Deployment(namespace string, opts ...podTemplateOption) *appsv1.Deployment {
// TODO: Add support for server args
c := &podTemplateConfig{
image: velero.DefaultVeleroImage(),
image: images.DefaultVeleroImage(),
}

for _, opt := range opts {
Expand Down
1 change: 0 additions & 1 deletion pkg/install/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,5 @@ func TestPkgImportNoCloudProvider(t *testing.T) {
}
}
}
// TODO: expected to fail until #8145 rebase
require.Empty(t, cloudProviderDeps)
}
2 changes: 1 addition & 1 deletion pkg/restore/actions/pod_volume_restore_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
corev1client "k8s.io/client-go/kubernetes/typed/core/v1"
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"

veleroimage "github.com/vmware-tanzu/velero/internal/velero"
veleroimage "github.com/vmware-tanzu/velero/internal/velero/images"
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
"github.com/vmware-tanzu/velero/pkg/builder"
"github.com/vmware-tanzu/velero/pkg/label"
Expand Down
2 changes: 1 addition & 1 deletion pkg/restore/actions/pod_volume_restore_action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes/fake"

veleroimage "github.com/vmware-tanzu/velero/internal/velero"
veleroimage "github.com/vmware-tanzu/velero/internal/velero/images"
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
"github.com/vmware-tanzu/velero/pkg/builder"
"github.com/vmware-tanzu/velero/pkg/buildinfo"
Expand Down

0 comments on commit cb1ea3b

Please sign in to comment.