Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ website/resources/
website/node_modules/
website/tech-doc-hugo

# samples bin
# Ensure that will not commit the bin gen in the go sample
testdata/go/memcached-operator/bin/*

# Ignore molecule samples testdata if it be generated in the testdata/ diretory
testdata/ansible/memcached-molecule-operator

# Trash files
*\.DS_Store

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export PATH := $(PWD)/$(BUILD_DIR):$(PWD)/$(TOOLS_DIR):$(PATH)
.PHONY: generate
generate: build # Generate CLI docs and samples
go run ./hack/generate/cli-doc/gen-cli-doc.go
go run ./hack/generate/samples/generate_all.go
go run ./hack/generate/samples/generate_testdata.go
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make more sense be generate_testdata
it also makes more simplicity its goal.


.PHONY: bindata
OLM_VERSION=0.15.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ import (
"github.com/operator-framework/operator-sdk/internal/testutils"
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just moving the vars to the main for not let them global in the pkg.

var (
binaryName string
)

func main() {
// testdata is the path where all samples should be generate
const testdata = "/testdata/"

// binaryName allow inform the binary that should be used.
// By default it is operator-sdk
var binaryName string

flag.StringVar(&binaryName, "bin", testutils.BinaryName, "Binary path that should be used")
flag.Parse()

Expand All @@ -41,7 +44,7 @@ func main() {
os.Exit(1)
}

samplesPath := filepath.Join(currentPath, "testdata")
samplesPath := filepath.Join(currentPath, testdata)
log.Infof("using the path: (%v)", samplesPath)

log.Infof("creating Helm Memcached Sample")
Expand Down
Loading