-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Bump operator-registry dependency #2662
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -42,6 +42,7 @@ https://github.com/openshift/enhancements/blob/master/enhancements/olm/operator- | |||||||||||
|
|
||||||||||||
| type bundleCmd struct { | ||||||||||||
| directory string | ||||||||||||
| outputDir string | ||||||||||||
| packageName string | ||||||||||||
| imageTag string | ||||||||||||
| imageBuilder string | ||||||||||||
|
|
@@ -53,9 +54,17 @@ type bundleCmd struct { | |||||||||||
| // cleanupFuncs returns a set of general funcs to clean up after a bundle | ||||||||||||
| // subcommand. | ||||||||||||
| func (c bundleCmd) cleanupFuncs() (fs []func()) { | ||||||||||||
| metaDir := filepath.Join(c.directory, bundle.MetadataDir) | ||||||||||||
| dockerFile := filepath.Join(c.directory, bundle.DockerFile) | ||||||||||||
| manifestDir := c.outputDir | ||||||||||||
| if manifestDir == "" { | ||||||||||||
| manifestDir = c.directory | ||||||||||||
| } | ||||||||||||
| absManifestDir, _ := filepath.Abs(manifestDir) | ||||||||||||
| manifestParent := filepath.Dir(absManifestDir) | ||||||||||||
| metaDir := filepath.Join(manifestParent, bundle.MetadataDir) | ||||||||||||
| metaExists := isExist(metaDir) | ||||||||||||
|
|
||||||||||||
| workingDir, _ := os.Getwd() | ||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
| dockerFile := filepath.Join(workingDir, bundle.DockerFile) | ||||||||||||
| dockerFileExists := isExist(dockerFile) | ||||||||||||
| fs = append(fs, | ||||||||||||
| func() { | ||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,7 +78,7 @@ $ operator-sdk bundle create \ | |
| if len(args) != 0 { | ||
| return fmt.Errorf("command %s does not accept any arguments", cmd.CommandPath()) | ||
| } | ||
| err := bundle.GenerateFunc(c.directory, c.packageName, channels, | ||
| err := bundle.GenerateFunc(c.directory, c.outputDir, c.packageName, channels, | ||
| c.defaultChannel, true) | ||
| if err != nil { | ||
| log.Fatalf("Error generating bundle image files: %v", err) | ||
|
|
@@ -96,7 +96,7 @@ $ operator-sdk bundle create \ | |
| defer cleanup() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These cleanup funcs assume the generated files are present in func (c bundleCmd) cleanupFuncs() (fs []func()) {
dir := c.outputDir
if dir == "" {
dir = c.directory
}
metaDir := filepath.Join(dir, bundle.MetadataDir)
dockerFile := filepath.Join(dir, bundle.DockerFile)
...
}
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @estroz ah. so, the explicit purpose of --output-dir is to end up with a generated directory as output so that you don't have to keep generating them everytime you build. It seems like IMO though it seems weird to me to generate and throw these files away all the time, given that OLM's packaging format is at some point probably going to want you to drive other stuff in the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also this change renames the |
||
| } | ||
| // Build but never overwrite existing metadata/Dockerfile. | ||
| err := bundle.BuildFunc(c.directory, c.imageTag, c.imageBuilder, | ||
| err := bundle.BuildFunc(c.directory, c.outputDir, c.imageTag, c.imageBuilder, | ||
| c.packageName, channels, c.defaultChannel, false) | ||
| if err != nil { | ||
| log.Fatalf("Error building bundle image: %v", err) | ||
|
|
@@ -115,6 +115,8 @@ $ operator-sdk bundle create \ | |
|
|
||
| cmd.Flags().StringVarP(&c.directory, "directory", "d", defaultDir, | ||
| "The directory where bundle manifests are located") | ||
| cmd.Flags().StringVarP(&c.outputDir, "output-dir", "o", "", | ||
camilamacedo86 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "Optional output directory for operator manifests") | ||
| cmd.Flags().StringVarP(&c.packageName, "package", "p", projectName, | ||
| "The name of the package that bundle image belongs to. Set if package name differs from project name") | ||
| cmd.Flags().StringSliceVarP(&c.channels, "channels", "c", defaultChannels, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be abs? If so import
log "github.com/sirupsen/logrus"above and add: