@@ -17,7 +17,6 @@ package helm
17
17
import (
18
18
"os"
19
19
"path/filepath"
20
- "strings"
21
20
22
21
log "github.com/sirupsen/logrus"
23
22
@@ -55,12 +54,6 @@ func (mh *MemcachedHelm) Prepare() {
55
54
56
55
// Run runs the steps to generate the sample
57
56
func (mh * MemcachedHelm ) Run () {
58
- current , err := os .Getwd ()
59
- if err != nil {
60
- log .Error (err )
61
- os .Exit (1 )
62
- }
63
-
64
57
// When operator-sdk scaffolds Helm projects, it tries to use the discovery API of a Kubernetes
65
58
// cluster to intelligently build the RBAC rules that the operator will require based on the
66
59
// content of the helm chart.
@@ -73,15 +66,12 @@ func (mh *MemcachedHelm) Run() {
73
66
os .Setenv ("KUBECONFIG" , "broken_so_we_generate_static_default_rules" )
74
67
75
68
log .Infof ("creating the project" )
76
- err = mh .ctx .Init (
69
+ err : = mh .ctx .Init (
77
70
"--plugins" , "helm" ,
78
71
"--domain" , mh .ctx .Domain )
79
72
pkg .CheckError ("creating the project" , err )
80
73
81
- log .Infof ("handling work path to get helm chart mock data" )
82
- projectPath := strings .Split (current , "operator-sdk/" )[0 ]
83
- projectPath = strings .Replace (projectPath , "operator-sdk" , "" , 1 )
84
- helmChartPath := filepath .Join (projectPath , "operator-sdk/hack/generate/samples/internal/helm/testdata/memcached-0.0.1.tgz" )
74
+ helmChartPath := "../../../hack/generate/samples/internal/helm/testdata/memcached-0.0.1.tgz"
85
75
log .Infof ("using the helm chart in: (%v)" , helmChartPath )
86
76
87
77
err = mh .ctx .CreateAPI (
0 commit comments