Skip to content
Merged
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
3 changes: 3 additions & 0 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ type ProwgenOverrides struct {
// Expose declares that jobs should not be hidden from view in deck if they
// are private. This field has no effect if private is not set.
Expose bool `json:"expose,omitempty"`
// DisableSparseCheckout disables the sparse checkout optimization for the
// repository clone done by Prow's clonerefs.
DisableSparseCheckout bool `json:"disable_sparse_checkout,omitempty"`
}

// ReleaseBuildConfiguration describes how release
Expand Down
5 changes: 4 additions & 1 deletion pkg/prowgen/jobbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ func NewProwJobBaseBuilder(configSpec *cioperatorapi.ReleaseBuildConfiguration,
if shouldSkipCloning {
b.base.UtilityConfig.DecorationConfig.SkipCloning = ptr.To(true)
} else {
b.base.UtilityConfig.DecorationConfig.SparseCheckoutFiles = sparseFiles
disableSparseCheckout := configSpec.Prowgen != nil && configSpec.Prowgen.DisableSparseCheckout
if !disableSparseCheckout {
b.base.UtilityConfig.DecorationConfig.SparseCheckoutFiles = sparseFiles
}
if private {
b.base.UtilityConfig.DecorationConfig.OauthTokenSecret = &prowv1.OauthTokenSecret{Key: cioperatorapi.OauthTokenSecretKey, Name: cioperatorapi.OauthTokenSecretName}
}
Expand Down
16 changes: 16 additions & 0 deletions pkg/prowgen/jobbase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,22 @@ func TestProwJobBaseBuilder(t *testing.T) {
prefix: "default",
podSpecBuilder: newFakePodSpecBuilder(),
},
{
name: "job with images and sparse checkout disabled",
info: defaultInfo,
images: ciop.ImageConfiguration{Items: []ciop.ProjectDirectoryImageBuildStepConfiguration{{From: "base", To: "image"}}},
prowgenOverrides: &ciop.ProwgenOverrides{DisableSparseCheckout: true},
prefix: "default",
podSpecBuilder: newFakePodSpecBuilder(),
},
{
name: "private job with images and sparse checkout disabled",
info: &ciop.Metadata{Org: "vorg", Repo: "vrepo", Branch: "vbranch"},
images: ciop.ImageConfiguration{Items: []ciop.ProjectDirectoryImageBuildStepConfiguration{{From: "base", To: "image"}}},
prowgenOverrides: &ciop.ProwgenOverrides{Private: true, DisableSparseCheckout: true},
prefix: "default",
podSpecBuilder: NewCiOperatorPodSpecGenerator(),
},
{
name: "default job without further configuration, including podspec",
info: defaultInfo,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
agent: kubernetes
decorate: true
decoration_config: {}
name: default-ci-org-repo-branch-
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
agent: kubernetes
decorate: true
decoration_config:
oauth_token_secret:
key: oauth
name: github-credentials-openshift-ci-robot-private-git-cloner
hidden: true
name: default-ci-vorg-vrepo-vbranch-
spec:
containers:
- args:
- --gcs-upload-secret=/secrets/gcs/service-account.json
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
- --oauth-token-path=/usr/local/github-credentials/oauth
- --report-credentials-file=/etc/report/credentials
command:
- ci-operator
image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest
imagePullPolicy: Always
name: ""
resources:
requests:
cpu: 10m
volumeMounts:
- mountPath: /secrets/gcs
name: gcs-credentials
readOnly: true
- mountPath: /usr/local/github-credentials
name: github-credentials-openshift-ci-robot-private-git-cloner
readOnly: true
- mountPath: /secrets/manifest-tool
name: manifest-tool-local-pusher
readOnly: true
- mountPath: /etc/pull-secret
name: pull-secret
readOnly: true
- mountPath: /etc/report
name: result-aggregator
readOnly: true
serviceAccountName: ci-operator
volumes:
- name: manifest-tool-local-pusher
secret:
secretName: manifest-tool-local-pusher
- name: pull-secret
secret:
secretName: registry-pull-credentials
- name: result-aggregator
secret:
secretName: result-aggregator
3 changes: 3 additions & 0 deletions pkg/webreg/zz_generated.ci_operator_reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ const ciOperatorReferenceYaml = "# The list of base images describe\n" +
" tag_by_commit: true\n" +
"prowgen:\n" +
" disable_rehearsals: true\n" +
" # DisableSparseCheckout disables the sparse checkout optimization for the\n" +
" # repository clone done by Prow's clonerefs.\n" +
" disable_sparse_checkout: true\n" +
" enable_secrets_store_csi_driver: true\n" +
" # Expose declares that jobs should not be hidden from view in deck if they\n" +
" # are private. This field has no effect if private is not set.\n" +
Expand Down