Skip to content

Commit

Permalink
Merge pull request #3656 from justinsb/avoid_spurious_mirroring
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue.

Avoid spurious mirror tasks in plan
  • Loading branch information
Kubernetes Submit Queue committed Oct 17, 2017
2 parents 41074c4 + 552d045 commit 4282d1d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions upup/pkg/fi/fitasks/mirrorkeystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ func (e *MirrorKeystore) GetDependencies(tasks map[string]fi.Task) []fi.Task {

// Find implements fi.Task::Find
func (e *MirrorKeystore) Find(c *fi.Context) (*MirrorKeystore, error) {
if vfsKeystore, ok := c.Keystore.(*fi.VFSCAStore); ok {
if vfsKeystore.VFSPath().Path() == e.MirrorPath.Path() {
return e, nil
}
}

// TODO: implement Find so that we aren't always mirroring
glog.V(2).Infof("MirrorKeystore::Find not implemented; always copying (inefficient)")
return nil, nil
Expand Down
7 changes: 7 additions & 0 deletions upup/pkg/fi/fitasks/mirrorsecrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package fitasks
import (
"github.com/golang/glog"
"k8s.io/kops/upup/pkg/fi"
"k8s.io/kops/upup/pkg/fi/secrets"
"k8s.io/kops/util/pkg/vfs"
)

Expand All @@ -45,6 +46,12 @@ func (e *MirrorSecrets) GetDependencies(tasks map[string]fi.Task) []fi.Task {

// Find implements fi.Task::Find
func (e *MirrorSecrets) Find(c *fi.Context) (*MirrorSecrets, error) {
if vfsSecretStore, ok := c.SecretStore.(*secrets.VFSSecretStore); ok {
if vfsSecretStore.VFSPath().Path() == e.MirrorPath.Path() {
return e, nil
}
}

// TODO: implement Find so that we aren't always mirroring
glog.V(2).Infof("MirrorSecrets::Find not implemented; always copying (inefficient)")
return nil, nil
Expand Down

0 comments on commit 4282d1d

Please sign in to comment.