Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch namespaces at time of sync #6135

Merged
merged 2 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/skaffold/sync/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewSyncProvider(config Config, cli *kubectl.CLI) Provider {
kubernetesSyncer: func(podSelector *kubernetes.ImageList) Syncer {
return &podSyncer{
kubectl: cli,
namespaces: config.GetNamespaces(),
config: config,
}
},
noopSyncer: func() Syncer {
Expand Down
4 changes: 2 additions & 2 deletions pkg/skaffold/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,15 @@ func (s *podSyncer) Sync(ctx context.Context, item *Item) error {
if len(item.Copy) > 0 {
logrus.Infoln("Copying files:", item.Copy, "to", item.Image)

if err := Perform(ctx, item.Image, item.Copy, s.copyFileFn, s.namespaces); err != nil {
if err := Perform(ctx, item.Image, item.Copy, s.copyFileFn, s.config.GetNamespaces()); err != nil {
return fmt.Errorf("copying files: %w", err)
}
}

if len(item.Delete) > 0 {
logrus.Infoln("Deleting files:", item.Delete, "from", item.Image)

if err := Perform(ctx, item.Image, item.Delete, s.deleteFileFn, s.namespaces); err != nil {
if err := Perform(ctx, item.Image, item.Delete, s.deleteFileFn, s.config.GetNamespaces()); err != nil {
return fmt.Errorf("deleting files: %w", err)
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/skaffold/sync/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ type Syncer interface {
}

type podSyncer struct {
kubectl *pkgkubectl.CLI
namespaces []string
kubectl *pkgkubectl.CLI
config Config
}

type Config interface {
Expand Down