slog.Warn(fmt.Sprintf("warning: skipping globals because destination %s is not a table.",GlobalKey))
log.Warn(fmt.Sprintf("skipping globals because destination %s is not a table.",GlobalKey),slog.String("key",GlobalKey),slog.String("error","not a table"))
// It's not clear if this condition can actually ever trigger.
// It's not clear if this condition can actually ever trigger.
slog.Warn(fmt.Sprintf("key %s is table. Skipping",key))
log.Warn(fmt.Sprintf("key %s is table. Skipping",key),slog.String("key",key),slog.String("error","cannot merge as key is a table"))
}else{
}else{
// TODO: Do we need to do any additional checking on the value?
// TODO: Do we need to do any additional checking on the value?
dg[key]=val
dg[key]=val
@ -205,8 +205,8 @@ func coalesceValues(c *chart.Chart, v map[string]interface{}, prefix string, mer
// If there is an error something is wrong with copying c.Values it
// If there is an error something is wrong with copying c.Values it
// means there is a problem in the deep copying package or something
// means there is a problem in the deep copying package or something
// wrong with c.Values. In this case we will use c.Values and report
// wrong with c.Values. In this case we will use c.Values and report
// an error.
// a warning.
slog.Warn(fmt.Sprintf("warning: unable to copy values, err: %s",err))
slog.Warn("unable to copy values",slog.String("chart",c.Name()),slog.String("error",err.Error()))
vc=c.Values
vc=c.Values
}else{
}else{
vc,ok=valuesCopy.(map[string]interface{})
vc,ok=valuesCopy.(map[string]interface{})
@ -214,7 +214,7 @@ func coalesceValues(c *chart.Chart, v map[string]interface{}, prefix string, mer
// c.Values has a map[string]interface{} structure. If the copy of
// c.Values has a map[string]interface{} structure. If the copy of
// it cannot be treated as map[string]interface{} there is something
// it cannot be treated as map[string]interface{} there is something
// strangely wrong. Log it and use c.Values
// strangely wrong. Log it and use c.Values
slog.Warn("warning: unable to convert values copy to values type")
slog.Warn("unable to convert values copy to values type",slog.String("chart",c.Name()))
vc=c.Values
vc=c.Values
}
}
}
}
@ -234,7 +234,7 @@ func coalesceValues(c *chart.Chart, v map[string]interface{}, prefix string, mer
// If the original value is nil, there is nothing to coalesce, so we don't print
// If the original value is nil, there is nothing to coalesce, so we don't print
// the warning
// the warning
ifval!=nil{
ifval!=nil{
slog.Warn(fmt.Sprintf("warning: skipped value for %s.%s: Not a table.",subPrefix,key))
slog.Warn(fmt.Sprintf("skipped value for %s.%s",subPrefix,key),slog.String("chart",c.Name()),slog.String("key",fmt.Sprintf("%s.%s",subPrefix,key)),slog.String("error","not a table"))
}
}
}else{
}else{
// If the key is a child chart, coalesce tables with Merge set to true
// If the key is a child chart, coalesce tables with Merge set to true
@ -242,7 +242,7 @@ func coalesceValues(c *chart.Chart, v map[string]interface{}, prefix string, mer
// Because v has higher precedence than nv, dest values override src
// Because v has higher precedence than nv, dest values override src
slog.Warn(fmt.Sprintf("cannot overwrite table with non table for %s (%v)",fullkey,val))
log.Warn(fmt.Sprintf("cannot overwrite table with non table for %s (%v)",fullkey,val),slog.String("key",fullkey),slog.String("error","cannot overwrite table with non-table"))
}
}
}elseifistable(dv)&&val!=nil{
}elseifistable(dv)&&val!=nil{
slog.Warn(fmt.Sprintf("destination for %s is a table. Ignoring non-table value (%v)",fullkey,val))
log.Warn(fmt.Sprintf("destination for %s is a table. Ignoring non-table value (%v)",fullkey,val),slog.String("key",fullkey),slog.String("error","destination is a table"))
assert.Fail(b.t,"expecting records to match level but there were no records to match")
}
for_,record:=rangeb.l.records{
assert.True(b.t,record.record.Level==level,"record '%s' does not match the expected level. Was %d expected %d",record.record.Message,record.record.Level,level)
assert.Fail(b.t,"expecting records to test for attributes but there were no records to match")
}
for_,record:=rangeb.l.records{
hasAttr:=false
for_,attr:=rangerecord.attrs{
ifattr.Key==key{
hasAttr=true
assert.True(b.t,attr.Value.String()==value,"record '%s', attribute '%s' expected value '%s' but got '%s'",record.record.Message,key,value,attr.Value.String())
}
}
assert.True(b.t,hasAttr,"record '%s' does not contain the attribute key '%s'",record.record.Message,key)