fix(atc): fixed a crash from credVarsTracker.
@@ -21,7 +21,7 @@ type CredVarsTracker interface {
func NewCredVarsTracker(credVars Variables, on bool) CredVarsTracker {
if on {
- return credVarsTracker{
+ return &credVarsTracker{
credVars: credVars,
interpolatedCreds: map[string]string{},
lock: sync.RWMutex{},
@@ -39,7 +39,7 @@ type credVarsTracker struct {
lock sync.RWMutex
}
-func (t credVarsTracker) Get(varDef VariableDefinition) (interface{}, bool, error) {
+func (t *credVarsTracker) Get(varDef VariableDefinition) (interface{}, bool, error) {
val, found, err := t.credVars.Get(varDef)
if found {
t.lock.Lock()
@@ -50,7 +50,7 @@ func (t credVarsTracker) Get(varDef VariableDefinition) (interface{}, bool, erro
return val, found, err
}
-func (t credVarsTracker) track(name string, val interface{}) {
+func (t *credVarsTracker) track(name string, val interface{}) {
switch v := val.(type) {
case map[interface{}]interface{}:
for kk, vv := range v {
@@ -69,11 +69,11 @@ func (t credVarsTracker) track(name string, val interface{}) {
}
}
-func (t credVarsTracker) List() ([]VariableDefinition, error) {
+func (t *credVarsTracker) List() ([]VariableDefinition, error) {
return t.credVars.List()
}
-func (t credVarsTracker) IterateInterpolatedCreds(iter CredVarsTrackerIterator) {
+func (t *credVarsTracker) IterateInterpolatedCreds(iter CredVarsTrackerIterator) {
t.lock.RLock()
for k, v := range t.interpolatedCreds {
iter.YieldCred(k, v)
@@ -81,7 +81,7 @@ func (t credVarsTracker) IterateInterpolatedCreds(iter CredVarsTrackerIterator)
t.lock.RUnlock()
}
-func (t credVarsTracker) Enabled() bool {
+func (t *credVarsTracker) Enabled() bool {
return true
}
