Switch to black box testing of KustTarget and Resource

This commit is contained in:
Jeffrey Regan
2019-02-11 15:23:26 -08:00
parent 74d3e92b55
commit 48717f3f30
24 changed files with 136 additions and 67 deletions

View File

@@ -16,6 +16,11 @@ limitations under the License.
package types
import (
"strconv"
"strings"
)
// GenArgs contains both generator args and options
type GenArgs struct {
args *GeneratorArgs
@@ -30,6 +35,18 @@ func NewGenArgs(args *GeneratorArgs, opts *GeneratorOptions) *GenArgs {
}
}
func (g *GenArgs) String() string {
if g == nil {
return "{nilGenArgs}"
}
return "{" +
strings.Join([]string{
"nsfx:" + strconv.FormatBool(g.NeedsHashSuffix()),
"beh:" + g.Behavior().String()},
",") +
"}"
}
// NeedHashSuffix returns true if the hash suffix is needed.
// It is needed when the two conditions are both met
// 1) GenArgs is not nil