Skip to content
Closed
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
1 change: 1 addition & 0 deletions pkg/config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func newDefaults(project Project) Config {
ImagesGenerated: ":vhs: Images generated",
},
SyncLabels: []string{"kind/sync-fork-to-upstream"},
SkipImage: false,
DockerfileGen: dockerfilegen.DefaultParams(project.Path),
}
}
1 change: 1 addition & 0 deletions pkg/config/structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type Config struct {
DryRun bool `json:"dryRun"`
GithubWorkflowsRemovalGlob string `json:"githubWorkflowsRemovalGlob" valid:"required"`
SyncLabels []string `json:"syncLabels" valid:"required"`
SkipImage bool `json:"skipImage,omitempty"`
DockerfileGen dockerfilegen.Params `json:"dockerfileGen"`
ResyncReleases `json:"resyncReleases"`
Branches `json:"branches"`
Expand Down
5 changes: 5 additions & 0 deletions pkg/sync/generate_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import (

func (o Operation) generateImages(rel release) step {
return func() error {
// Check if DockerfileGen configuration is provided
if o.Config.SkipImage {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we skip based on the o.Config.DockerfileGen not being configured, instead of introducing this flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I tried this first. But since it is always initialized with the default values, its never empty. If you an easier idea to do this (maybe with pointers or not using default for DockerfileGen), I'm all ears as I don't like this solution much either.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. Thinking...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could create a wrapper struct around dockerfilegen.Params, and add a skip param there. It should still be able to unmarshal, right? Let me check...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about #44 instead?

o.Println("- Skip image generation because skipImage is configured.")
return nil
}
o.Println("- Generating images")
params := o.Config.DockerfileGen
var closer func()
Expand Down