Skip to content

Commit

Permalink
added Mutex to data field of Meta
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Porres Molina committed Dec 19, 2017
1 parent c595467 commit eb58c27
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion helm/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"crypto/x509"
"fmt"
"log"
"sync"
"time"

"github.com/hashicorp/terraform/helper/pathorcontents"
Expand Down Expand Up @@ -182,8 +183,10 @@ type Meta struct {
Tunnel *kube.Tunnel
DefaultNamespace string

data *schema.ResourceData
helmClient helm.Interface

mutex sync.Mutex
data *schema.ResourceData
}

func NewMeta(d *schema.ResourceData) (*Meta, error) {
Expand Down Expand Up @@ -311,6 +314,8 @@ func getK8sConfig(d *schema.ResourceData) (clientcmd.ClientConfig, error) {

func (m *Meta) installTillerIfNeeded(d *schema.ResourceData) error {
o := &installer.Options{}
m.mutex.Lock()
defer m.mutex.Unlock()
o.Namespace = d.Get("namespace").(string)
o.ImageSpec = d.Get("tiller_image").(string)

Expand Down

0 comments on commit eb58c27

Please sign in to comment.