Skip to content
Draft
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
2 changes: 1 addition & 1 deletion cmd/ci-operator/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ func TestBuildPartialGraph(t *testing.T) {
loggingclient.New(fakectrlruntimeclient.NewClientBuilder().WithRuntimeObjects(&imagev1.ImageStreamTag{ObjectMeta: metav1.ObjectMeta{Name: ":"}}).Build(), nil),
nil,
),
steps.SourceStep(api.SourceStepConfiguration{From: api.PipelineImageStreamTagReferenceRoot, To: api.PipelineImageStreamTagReferenceSource}, api.ResourceConfiguration{}, nil, nil, &api.JobSpec{}, nil, nil, nil),
steps.SourceStep(api.SourceStepConfiguration{From: api.PipelineImageStreamTagReferenceRoot, To: api.PipelineImageStreamTagReferenceSource}, api.ResourceConfiguration{}, nil, nil, &api.JobSpec{}, nil, nil, nil, "openshift"),
steps.ProjectDirectoryImageBuildStep(
api.ProjectDirectoryImageBuildStepConfiguration{
From: api.PipelineImageStreamTagReferenceSource,
Expand Down
12 changes: 7 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,16 @@ require (
cloud.google.com/go/resourcemanager v1.10.3
cloud.google.com/go/secretmanager v1.14.5
github.com/GoogleCloudPlatform/secrets-store-csi-driver-provider-gcp v1.7.0
github.com/aws/aws-sdk-go-v2 v1.36.3
github.com/aws/aws-sdk-go-v2 v1.41.5
github.com/aws/aws-sdk-go-v2/config v1.29.14
github.com/aws/aws-sdk-go-v2/credentials v1.17.67
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.0
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.68.0
github.com/aws/aws-sdk-go-v2/service/codebuild v1.68.13
github.com/aws/aws-sdk-go-v2/service/ec2 v1.194.0
github.com/aws/aws-sdk-go-v2/service/s3 v1.69.0
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19
github.com/aws/smithy-go v1.22.2
github.com/aws/smithy-go v1.24.2
github.com/coreos/stream-metadata-go v0.1.8
github.com/estesp/manifest-tool/v2 v2.1.8
github.com/felixge/httpsnoop v1.0.4
Expand Down Expand Up @@ -232,11 +234,11 @@ require (
github.com/andygrunwald/go-gerrit v0.0.0-20230211083816-04e01d7217b2 // indirect
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/apache/arrow/go/v15 v15.0.2 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.10 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.24 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3 // indirect
Expand Down
24 changes: 14 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:l
github.com/aws/aws-sdk-go v1.42.23/go.mod h1:gyRszuZ/icHmHAVE4gc/r+cfCmhA1AD+vqfWbgI+eHs=
github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU=
github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/aws/aws-sdk-go-v2 v1.36.3 h1:mJoei2CxPutQVxaATCzDUjcZEjVRdpsiiXi2o38yqWM=
github.com/aws/aws-sdk-go-v2 v1.36.3/go.mod h1:LLXuLpgzEbD766Z5ECcRmi8AzSwfZItDtmABVkRLGzg=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 h1:lL7IfaFzngfx0ZwUGOZdsFFnQ5uLvR0hWqqhyE7Q9M8=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7/go.mod h1:QraP0UcVlQJsmHfioCrveWOC1nbiWUl3ej08h4mXWoc=
github.com/aws/aws-sdk-go-v2 v1.41.5 h1:dj5kopbwUsVUVFgO4Fi5BIT3t4WyqIDjGKCangnV/yY=
github.com/aws/aws-sdk-go-v2 v1.41.5/go.mod h1:mwsPRE8ceUUpiTgF7QmQIJ7lgsKUPQOUl3o72QBrE1o=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8 h1:eBMB84YGghSocM7PsjmmPffTa+1FBUeNvGvFou6V/4o=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8/go.mod h1:lyw7GFp3qENLh7kwzf7iMzAxDn+NzjXEAGjKS2UOKqI=
github.com/aws/aws-sdk-go-v2/config v1.29.14 h1:f+eEi/2cKCg9pqKBoAIwRGzVb70MRKqWX4dg1BDcSJM=
github.com/aws/aws-sdk-go-v2/config v1.29.14/go.mod h1:wVPHWcIFv3WO89w0rE10gzf17ZYy+UVS1Geq8Iei34g=
github.com/aws/aws-sdk-go-v2/credentials v1.17.67 h1:9KxtdcIA/5xPNQyZRgUSpYOE6j9Bc4+D7nZua0KGYOM=
Expand All @@ -186,16 +186,20 @@ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 h1:x793wxmUWVDhshP8WW2mln
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30/go.mod h1:Jpne2tDnYiFascUEs2AWHJL9Yp7A5ZVy3TNyxaAjD6M=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.10 h1:zeN9UtUlA6FTx0vFSayxSX32HDw73Yb6Hh2izDSFxXY=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.10/go.mod h1:3HKuexPDcwLWPaqpW2UR/9n8N/u/3CKcGAzSs8p8u8g=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 h1:ZK5jHhnrioRkUNOc+hOgQKlUL5JeC3S6JgLxtQ+Rm0Q=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34/go.mod h1:p4VfIceZokChbA9FzMbRGz5OV+lekcVtHlPKEO0gSZY=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 h1:SZwFm17ZUNNg5Np0ioo/gq8Mn6u9w19Mri8DnJ15Jf0=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34/go.mod h1:dFZsC0BLo346mvKQLWmoJxT+Sjp+qcVR1tRVHQGOH9Q=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 h1:Rgg6wvjjtX8bNHcvi9OnXWwcE0a2vGpbwmtICOsvcf4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21/go.mod h1:A/kJFst/nm//cyqonihbdpQZwiUhhzpqTsdbhDdRF9c=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 h1:PEgGVtPoB6NTpPrBgqSE5hE/o47Ij9qk/SEZFbUOe9A=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21/go.mod h1:p+hz+PRAYlY3zcpJhPwXlLC4C+kqn70WIHwnzAfs6ps=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d2KyU5X/BZxjOkRo=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.24 h1:JX70yGKLj25+lMC5Yyh8wBtvB01GDilyRuJvXJ4piD0=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.24/go.mod h1:+Ln60j9SUTD0LEwnhEB0Xhg61DHqplBrbZpLgyjoEHg=
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.0 h1:zmXJiEm/fQYtFDLIUsZrcPIjTrL3R/noFICGlYBj3Ww=
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.0/go.mod h1:9nOjXCDKE+QMK4JaCrLl36PU+VEfJmI7WVehYmojO8s=
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.68.0 h1:+/lmB/+i2oqkzbmlQxsW0kr/+wmJgmyiEF9VDJicX34=
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.68.0/go.mod h1:PobeppEnIjw4pcgjFryNDZCTH7AiqZw0yb5r98Gvf9c=
github.com/aws/aws-sdk-go-v2/service/codebuild v1.68.13 h1:EEdmtkVROLA9VniV5STKv/EfEgV+n9NFBpOYU1jN9As=
github.com/aws/aws-sdk-go-v2/service/codebuild v1.68.13/go.mod h1:+pwMMAvpmRuI7oHsTT2F5Lrp4ZQV2RF7b6tiaBj3Ugk=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.194.0 h1:56YXcRmryw9wiTrvdVeJEUwBCoN/+o33R52PA7CCi08=
github.com/aws/aws-sdk-go-v2/service/ec2 v1.194.0/go.mod h1:mzj8EEjIHSN2oZRXiw1Dd+uB4HZTl7hC8nBzX9IZMWw=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3 h1:eAh2A4b5IzM/lum78bZ590jy36+d/aFLgKF/4Vd1xPE=
Expand All @@ -214,8 +218,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.1 h1:hXmVKytPfTy5axZ+fYbR5d0c
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.1/go.mod h1:MlYRNmYu/fGPoxBQVvBYr9nyr948aY/WLUvwBMBJubs=
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19 h1:1XuUZ8mYJw9B6lzAkXhqHlJd/XvaX32evhproijJEZY=
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19/go.mod h1:cQnB8CUnxbMU82JvlqjKR2HBOm3fe9pWorWBza6MBJ4=
github.com/aws/smithy-go v1.22.2 h1:6D9hW43xKFrRx/tXXfAlIZc4JI+yQe6snnWcQyxSyLQ=
github.com/aws/smithy-go v1.22.2/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng=
github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
github.com/bazelbuild/buildtools v0.0.0-20200922170545-10384511ce98 h1:OhVnC5zU5QHQ+DUSmgOTPqPnJnrlFmrh2S0HKeHmpbw=
github.com/bazelbuild/buildtools v0.0.0-20200922170545-10384511ce98/go.mod h1:5JP0TXzWDHXv8qvxRC4InIazwdyDseBDbzESUMKk1yU=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
Expand Down
4 changes: 4 additions & 0 deletions pkg/api/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ func (config *ReleaseBuildConfiguration) Default() {
for i := range config.Tests {
defTest(&config.Tests[i])
}

if config.BuildType == "" {
config.BuildType = "openshift"
}
}

// ImageStreamFor guesses at the ImageStream that will hold a tag.
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ type ReleaseBuildConfiguration struct {

InputConfiguration `json:",inline"`

BuildType string `json:"build_type,omitempty"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since this is a top level configuration, and we have only one new way of using the build which is the aws builds. Perhaps it would be just better to have a boolean here like use_aws_builds or something like that.


// BinaryBuildCommands will create a "bin" image based on "src" that
// contains the output of this command. This allows reuse of binary artifacts
// across other steps. If empty, no "bin" image will be created.
Expand Down
12 changes: 6 additions & 6 deletions pkg/defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ func fromConfig(ctx context.Context, cfg *Config) ([]api.Step, []api.Step, error
inputImages[conf.InputImage] = struct{}{}
} else if rawStep.PipelineImageCacheStepConfiguration != nil {
skippedBinaries := filterRequiredBinariesFromSkipped(cfg.CIConfig.Images.Items, cfg.SkippedImages)
step = steps.PipelineImageCacheStep(*rawStep.PipelineImageCacheStepConfiguration, cfg.CIConfig.Resources, cfg.buildClient, cfg.podClient, cfg.JobSpec, cfg.PullSecret, cfg.MetricsAgent, skippedBinaries)
step = steps.PipelineImageCacheStep(*rawStep.PipelineImageCacheStepConfiguration, cfg.CIConfig.Resources, cfg.buildClient, cfg.podClient, cfg.JobSpec, cfg.PullSecret, cfg.MetricsAgent, skippedBinaries, cfg.CIConfig.BuildType)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You will avoid all of those changes if you encapsulate the build method inside the buildClient. Since all builds will use the same build type.

} else if rawStep.SourceStepConfiguration != nil {
step = steps.SourceStep(*rawStep.SourceStepConfiguration, cfg.CIConfig.Resources, cfg.buildClient, cfg.podClient, cfg.JobSpec, cfg.CloneAuthConfig, cfg.PullSecret, cfg.MetricsAgent)
step = steps.SourceStep(*rawStep.SourceStepConfiguration, cfg.CIConfig.Resources, cfg.buildClient, cfg.podClient, cfg.JobSpec, cfg.CloneAuthConfig, cfg.PullSecret, cfg.MetricsAgent, cfg.CIConfig.BuildType)
} else if rawStep.BundleSourceStepConfiguration != nil {
step = steps.BundleSourceStep(*rawStep.BundleSourceStepConfiguration, cfg.CIConfig, cfg.CIConfig.Resources, cfg.buildClient, cfg.podClient, cfg.JobSpec, cfg.PullSecret)
step = steps.BundleSourceStep(*rawStep.BundleSourceStepConfiguration, cfg.CIConfig, cfg.CIConfig.Resources, cfg.buildClient, cfg.podClient, cfg.JobSpec, cfg.PullSecret, cfg.CIConfig.BuildType)
} else if rawStep.IndexGeneratorStepConfiguration != nil {
step = steps.IndexGeneratorStep(*rawStep.IndexGeneratorStepConfiguration, cfg.CIConfig, cfg.CIConfig.Resources, cfg.buildClient, cfg.podClient, cfg.JobSpec, cfg.PullSecret, cfg.MetricsAgent)
step = steps.IndexGeneratorStep(*rawStep.IndexGeneratorStepConfiguration, cfg.CIConfig, cfg.CIConfig.Resources, cfg.buildClient, cfg.podClient, cfg.JobSpec, cfg.PullSecret, cfg.MetricsAgent, cfg.CIConfig.BuildType)
} else if rawStep.ProjectDirectoryImageBuildStepConfiguration != nil {
imgConfig := rawStep.ProjectDirectoryImageBuildStepConfiguration
if cfg.SkippedImages.Has(string(imgConfig.To)) {
Expand All @@ -216,9 +216,9 @@ func fromConfig(ctx context.Context, cfg *Config) ([]api.Step, []api.Step, error
}
step = steps.ProjectDirectoryImageBuildStep(*imgConfig, cfg.CIConfig, cfg.CIConfig.Resources, cfg.buildClient, cfg.podClient, cfg.JobSpec, cfg.PullSecret, cfg.MetricsAgent)
} else if rawStep.ProjectDirectoryImageBuildInputs != nil {
step = steps.GitSourceStep(*rawStep.ProjectDirectoryImageBuildInputs, cfg.CIConfig.Resources, cfg.buildClient, cfg.podClient, cfg.JobSpec, cfg.CloneAuthConfig, cfg.PullSecret, cfg.MetricsAgent)
step = steps.GitSourceStep(*rawStep.ProjectDirectoryImageBuildInputs, cfg.CIConfig.Resources, cfg.buildClient, cfg.podClient, cfg.JobSpec, cfg.CloneAuthConfig, cfg.PullSecret, cfg.MetricsAgent, cfg.CIConfig.BuildType)
} else if rawStep.RPMImageInjectionStepConfiguration != nil {
step = steps.RPMImageInjectionStep(*rawStep.RPMImageInjectionStepConfiguration, cfg.CIConfig.Resources, cfg.buildClient, cfg.podClient, cfg.JobSpec, cfg.PullSecret, cfg.MetricsAgent)
step = steps.RPMImageInjectionStep(*rawStep.RPMImageInjectionStepConfiguration, cfg.CIConfig.Resources, cfg.buildClient, cfg.podClient, cfg.JobSpec, cfg.PullSecret, cfg.MetricsAgent, cfg.CIConfig.BuildType)
} else if rawStep.RPMServeStepConfiguration != nil {
step = steps.RPMServerStep(*rawStep.RPMServeStepConfiguration, cfg.kubeClient, cfg.JobSpec)
} else if rawStep.OutputImageTagStepConfiguration != nil {
Expand Down
5 changes: 4 additions & 1 deletion pkg/steps/bundle_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type bundleSourceStep struct {
podClient kubernetes.PodClient
jobSpec *api.JobSpec
pullSecret *coreapi.Secret
buildType string
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

func (s *bundleSourceStep) Inputs() (api.InputDefinition, error) {
Expand Down Expand Up @@ -82,7 +83,7 @@ func (s *bundleSourceStep) run(ctx context.Context) error {
// Bundle images are not multi-arch by design. Here we build it without creating a manifest-listed image.
// Note that we are not configuring a node selector here, so the build will be scheduled on any available
// node no matter the architecture.
return handleBuild(ctx, s.client, s.podClient, *build)
return handleBuild(ctx, s.client, s.podClient, *build, s.buildType)
}

func replaceCommand(pullSpec, with string) string {
Expand Down Expand Up @@ -144,6 +145,7 @@ func BundleSourceStep(
podClient kubernetes.PodClient,
jobSpec *api.JobSpec,
pullSecret *coreapi.Secret,
buildType string,
) api.Step {
return &bundleSourceStep{
config: config,
Expand All @@ -153,5 +155,6 @@ func BundleSourceStep(
podClient: podClient,
jobSpec: jobSpec,
pullSecret: pullSecret,
buildType: buildType,
}
}
5 changes: 4 additions & 1 deletion pkg/steps/git_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type gitSourceStep struct {
pullSecret *coreapi.Secret
architectures sets.Set[string]
metricsAgent *metrics.MetricsAgent
buildType string
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

func (s *gitSourceStep) Inputs() (api.InputDefinition, error) {
Expand All @@ -52,7 +53,7 @@ func (s *gitSourceStep) run(ctx context.Context) error {
if s.config.Ref != "" {
root = fmt.Sprintf("%s-%s", root, s.config.Ref)
}
return handleBuilds(ctx, s.buildClient, s.podClient, *buildFromSource(s.jobSpec, "", api.PipelineImageStreamTagReference(root), buildapi.BuildSource{
return handleBuilds(ctx, s.buildClient, s.podClient, s.buildType, *buildFromSource(s.jobSpec, "", api.PipelineImageStreamTagReference(root), buildapi.BuildSource{
Type: buildapi.BuildSourceGit,
Dockerfile: s.config.DockerfileLiteral,
ContextDir: s.config.ContextDir,
Expand Down Expand Up @@ -142,6 +143,7 @@ func GitSourceStep(
cloneAuthConfig *CloneAuthConfig,
pullSecret *coreapi.Secret,
metricsAgent *metrics.MetricsAgent,
buildType string,
) api.Step {
return &gitSourceStep{
config: config,
Expand All @@ -153,5 +155,6 @@ func GitSourceStep(
pullSecret: pullSecret,
architectures: sets.New[string](),
metricsAgent: metricsAgent,
buildType: buildType,
}
}
5 changes: 4 additions & 1 deletion pkg/steps/index_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type indexGeneratorStep struct {
pullSecret *coreapi.Secret
architectures sets.Set[string]
metricsAgent *metrics.MetricsAgent
buildType string
}
Comment thread
hector-vido marked this conversation as resolved.

const IndexDataDirectory = "/index-data"
Expand Down Expand Up @@ -126,7 +127,7 @@ func (s *indexGeneratorStep) run(ctx context.Context) error {
nil,
"",
)
err = handleBuilds(ctx, s.client, s.podClient, *build, s.metricsAgent, newImageBuildOptions(s.architectures.UnsortedList()))
err = handleBuilds(ctx, s.client, s.podClient, s.buildType, *build, s.metricsAgent, newImageBuildOptions(s.architectures.UnsortedList()))
if err != nil && strings.Contains(err.Error(), "error checking provided apis") {
return results.ForReason("generating_index").WithError(err).Errorf("failed to generate operator index due to invalid bundle info: %v", err)
}
Expand Down Expand Up @@ -217,6 +218,7 @@ func IndexGeneratorStep(
jobSpec *api.JobSpec,
pullSecret *coreapi.Secret,
metricsAgent *metrics.MetricsAgent,
buildType string,
) api.Step {
return &indexGeneratorStep{
config: config,
Expand All @@ -228,5 +230,6 @@ func IndexGeneratorStep(
pullSecret: pullSecret,
architectures: sets.New[string](),
metricsAgent: metricsAgent,
buildType: buildType,
}
}
5 changes: 4 additions & 1 deletion pkg/steps/pipeline_image_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type pipelineImageCacheStep struct {
architectures sets.Set[string]
metricsAgent *metrics.MetricsAgent
skippedImages sets.Set[string]
buildType string
}

func (s *pipelineImageCacheStep) Inputs() (api.InputDefinition, error) {
Expand Down Expand Up @@ -75,7 +76,7 @@ func (s *pipelineImageCacheStep) run(ctx context.Context) error {
build.Spec.Strategy.DockerStrategy.Env = append(build.Spec.Strategy.DockerStrategy.Env, coreapi.EnvVar{Name: SkippedImagesEnvVar, Value: strings.Join(sets.List(s.skippedImages), ",")})
}

return handleBuilds(ctx, s.client, s.podClient, *build, s.metricsAgent, newImageBuildOptions(s.architectures.UnsortedList()))
return handleBuilds(ctx, s.client, s.podClient, s.buildType, *build, s.metricsAgent, newImageBuildOptions(s.architectures.UnsortedList()))
}

func (s *pipelineImageCacheStep) Requires() []api.StepLink {
Expand Down Expand Up @@ -122,6 +123,7 @@ func PipelineImageCacheStep(
pullSecret *coreapi.Secret,
metricsAgent *metrics.MetricsAgent,
skippedImages sets.Set[string],
buildType string,
) api.Step {
return &pipelineImageCacheStep{
config: config,
Expand All @@ -133,5 +135,6 @@ func PipelineImageCacheStep(
architectures: sets.New[string](),
metricsAgent: metricsAgent,
skippedImages: skippedImages,
buildType: buildType,
}
}
5 changes: 3 additions & 2 deletions pkg/steps/project_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type projectDirectoryImageBuildStep struct {
multiArch bool
architectures sets.Set[string]
metricsAgent *metrics.MetricsAgent
buildType string
}

func (s *projectDirectoryImageBuildStep) Inputs() (api.InputDefinition, error) {
Expand Down Expand Up @@ -72,10 +73,10 @@ func (s *projectDirectoryImageBuildStep) run(ctx context.Context) error {

// Bundle images are non multi-arch by design. No manifest list is needed. Here we spawn a single build.
if s.config.IsBundleImage() {
return handleBuild(ctx, s.client, s.podClient, *build)
return handleBuild(ctx, s.client, s.podClient, *build, s.buildType)
}

return handleBuilds(ctx, s.client, s.podClient, *build, s.metricsAgent, newImageBuildOptions(s.architectures.UnsortedList()))
return handleBuilds(ctx, s.client, s.podClient, s.buildType, *build, s.metricsAgent, newImageBuildOptions(s.architectures.UnsortedList()))
}

type workingDir func(tag string) (string, error)
Expand Down
5 changes: 4 additions & 1 deletion pkg/steps/rpm_injection.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type rpmImageInjectionStep struct {
pullSecret *coreapi.Secret
architectures sets.Set[string]
metricsAgent *metrics.MetricsAgent
buildType string
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

func (s *rpmImageInjectionStep) Inputs() (api.InputDefinition, error) {
Expand All @@ -54,7 +55,7 @@ func (s *rpmImageInjectionStep) run(ctx context.Context) error {
if err != nil {
return err
}
return handleBuilds(ctx, s.client, s.podClient, *buildFromSource(
return handleBuilds(ctx, s.client, s.podClient, s.buildType, *buildFromSource(
s.jobSpec, s.config.From, s.config.To,
buildapi.BuildSource{
Type: buildapi.BuildSourceDockerfile,
Expand Down Expand Up @@ -107,6 +108,7 @@ func RPMImageInjectionStep(
jobSpec *api.JobSpec,
pullSecret *coreapi.Secret,
metricsAgent *metrics.MetricsAgent,
buildType string,
) api.Step {
return &rpmImageInjectionStep{
config: config,
Expand All @@ -117,5 +119,6 @@ func RPMImageInjectionStep(
pullSecret: pullSecret,
architectures: sets.New[string](),
metricsAgent: metricsAgent,
buildType: buildType,
}
}
Loading