Skip to content

Commit acc29f4

Browse files
fix: specify the right path of metadata in bundle.Dockerfile
Signed-off-by: varshaprasad96 <[email protected]>
1 parent e222e98 commit acc29f4

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# entries is a list of entries to include in
2+
# release notes and/or the migration guide
3+
entries:
4+
- description: >
5+
Fixed the `operator-sdk generate bundle` command to specify the right path of bundle
6+
metadata in bundle.Dcokerfile.
7+
8+
# kind is one of:
9+
# - addition
10+
# - change
11+
# - deprecation
12+
# - removal
13+
# - bugfix
14+
kind: bugfix
15+
16+
# Is this a breaking change?
17+
breaking: false

internal/util/bundleutil/bundleutil.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (meta *BundleMetaData) GenerateMetadata() error {
8888
// Create annotation values for both bundle.Dockerfile and annotations.yaml, which should
8989
// hold the same set of values always.
9090
values := annotationsValues{
91-
BundleDir: filepath.Base(meta.BundleDir),
91+
BundleDir: meta.BundleDir,
9292
PackageName: meta.PackageName,
9393
Channels: meta.Channels,
9494
DefaultChannel: meta.DefaultChannel,
@@ -107,11 +107,13 @@ func (meta *BundleMetaData) GenerateMetadata() error {
107107
}
108108

109109
dockerfilePath := defaultBundleDockerfilePath
110-
// If migrating from packagemanifests to bundle, bundle.Docker file is present
111-
// inside bundleDir, else its in the project directory.
110+
// If migrating from packagemanifests to bundle, bundle.Dockerfile is present
111+
// inside bundleDir, else its in the project directory. Hence dockerfile
112+
// should have the path specified with respect to output directory of resulting bundles.
112113
// Remmove this, when pkgman-to-bundle migrate command is removed.
113114
if len(meta.PkgmanifestPath) != 0 {
114115
dockerfilePath = filepath.Join(filepath.Dir(meta.BundleDir), "bundle.Dockerfile")
116+
values.BundleDir = filepath.Base(meta.BundleDir)
115117
}
116118

117119
templateMap := map[string]*template.Template{

0 commit comments

Comments
 (0)