Skip to content

Symlink internal dir in e2e #871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 21, 2018
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
12 changes: 5 additions & 7 deletions internal/util/projutil/project_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,21 @@ import (
"path/filepath"
"strings"

"github.com/operator-framework/operator-sdk/pkg/scaffold"
"github.com/operator-framework/operator-sdk/pkg/scaffold/ansible"
"github.com/operator-framework/operator-sdk/pkg/scaffold/helm"

log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

const (
SrcDir = "src"
mainFile = "./cmd/manager/main.go"
buildDockerfile = "./build/Dockerfile"
)

const (
GopathEnv = "GOPATH"
SrcDir = "src"
)

var mainFile = filepath.Join(scaffold.ManagerDir, scaffold.CmdFile)

// OperatorType - the type of operator
type OperatorType = string

Expand All @@ -57,7 +55,7 @@ const (
func MustInProjectRoot() {
// if the current directory has the "./build/dockerfile" file, then it is safe to say
// we are at the project root.
_, err := os.Stat(buildDockerfile)
_, err := os.Stat(filepath.Join(scaffold.BuildDir, scaffold.DockerfileFile))
if err != nil {
if os.IsNotExist(err) {
log.Fatal("must run command in project root dir: project structure requires ./build/Dockerfile")
Expand Down
9 changes: 6 additions & 3 deletions test/e2e/memcached_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,12 @@ func TestMemcached(t *testing.T) {
}
// link local sdk to vendor if not in travis
if repo == "" {
os.RemoveAll("vendor/github.com/operator-framework/operator-sdk/pkg")
os.Symlink(filepath.Join(gopath, "src/github.com/operator-framework/operator-sdk/pkg"),
"vendor/github.com/operator-framework/operator-sdk/pkg")
for _, dir := range []string{"pkg", "internal"} {
repoDir := filepath.Join("github.com/operator-framework/operator-sdk", dir)
vendorDir := filepath.Join("vendor", repoDir)
os.RemoveAll(vendorDir)
os.Symlink(filepath.Join(gopath, projutil.SrcDir, repoDir), vendorDir)
}
}

file, err := yamlutil.GenerateCombinedGlobalManifest()
Expand Down