Skip to content

Commit 430f7af

Browse files
authored
sample generation fixes (#4247)
1 parent e56ad8a commit 430f7af

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

hack/generate/samples/internal/helm/memcached.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ package helm
1717
import (
1818
"os"
1919
"path/filepath"
20-
"strings"
2120

2221
log "github.com/sirupsen/logrus"
2322

@@ -55,12 +54,6 @@ func (mh *MemcachedHelm) Prepare() {
5554

5655
// Run runs the steps to generate the sample
5756
func (mh *MemcachedHelm) Run() {
58-
current, err := os.Getwd()
59-
if err != nil {
60-
log.Error(err)
61-
os.Exit(1)
62-
}
63-
6457
// When operator-sdk scaffolds Helm projects, it tries to use the discovery API of a Kubernetes
6558
// cluster to intelligently build the RBAC rules that the operator will require based on the
6659
// content of the helm chart.
@@ -73,15 +66,12 @@ func (mh *MemcachedHelm) Run() {
7366
os.Setenv("KUBECONFIG", "broken_so_we_generate_static_default_rules")
7467

7568
log.Infof("creating the project")
76-
err = mh.ctx.Init(
69+
err := mh.ctx.Init(
7770
"--plugins", "helm",
7871
"--domain", mh.ctx.Domain)
7972
pkg.CheckError("creating the project", err)
8073

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"
8575
log.Infof("using the helm chart in: (%v)", helmChartPath)
8676

8777
err = mh.ctx.CreateAPI(

hack/generate/samples/internal/pkg/utils.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ func (ctx *SampleContext) CreateBundle() {
4646

4747
err = ctx.StripBundleAnnotations()
4848
CheckError("stripping bundle annotations", err)
49-
50-
err = ctx.Make("bundle-build", "BUNDLE_IMG="+ctx.BundleImageName)
51-
CheckError("running make bundle-build", err)
5249
}
5350

5451
// StripBundleAnnotations removes all annotations applied to bundle manifests and metadata

0 commit comments

Comments
 (0)