-
Notifications
You must be signed in to change notification settings - Fork 126
Feat: pipelinerun reconciliation #1972
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 |
|---|---|---|
|
|
@@ -150,6 +150,9 @@ jobs: | |
| export IMAGE_PROCESSING_CONTAINER_IMAGE="$(KO_DOCKER_REPO=kind.local ko publish ./cmd/image-processing)" | ||
|
|
||
| make test-integration | ||
| - name: Test-PipelineRun | ||
| run: | | ||
| BUILDRUN_EXECUTOR=PipelineRun ginkgo --focus-file="buildruns_to_pipelineruns_test.go" -v test/integration/... | ||
|
|
||
| e2e: | ||
| strategy: | ||
|
|
@@ -240,6 +243,33 @@ jobs: | |
| export TEST_E2E_FLAGS="-r --procs 8 --randomize-all --timeout=1h --trace --vv" | ||
| export TEST_E2E_TIMEOUT_MULTIPLIER=2 | ||
| make test-e2e | ||
| - name: Test-PipelineRun | ||
| run: | | ||
| export TEST_NAMESPACE=shp-e2e | ||
| export TEST_IMAGE_REPO=registry.registry.svc.cluster.local:32222/shipwright-io/build-e2e | ||
| export TEST_IMAGE_REPO_INSECURE=true | ||
| export TEST_E2E_TIMEOUT_MULTIPLIER=1 | ||
| kubectl patch deployment shipwright-build-controller -n shipwright-build --type='json' -p='[ | ||
| { | ||
| "op": "add", | ||
| "path": "/spec/template/spec/containers/0/env/-", | ||
| "value": { | ||
| "name": "BUILDRUN_EXECUTOR", | ||
| "value": "PipelineRun" | ||
| } | ||
| } | ||
| ]' | ||
| # Wait for the rollout to complete | ||
| kubectl rollout restart deployment shipwright-build-controller -n shipwright-build | ||
| kubectl rollout status deployment shipwright-build-controller -n shipwright-build | ||
|
|
||
| # Run PipelineRun tests | ||
| TEST_CONTROLLER_NAMESPACE=${TEST_NAMESPACE} \ | ||
| TEST_WATCH_NAMESPACE=${TEST_NAMESPACE} \ | ||
| TEST_E2E_SERVICEACCOUNT_NAME=pipeline \ | ||
| TEST_E2E_TIMEOUT_MULTIPLIER=${TEST_E2E_TIMEOUT_MULTIPLIER} \ | ||
| TEST_E2E_VERIFY_TEKTONOBJECTS=true \ | ||
| ginkgo --focus="PipelineRun E2E Tests" --procs 8 --timeout=1h --vv test/e2e/v1beta1/ | ||
|
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. nit (not blocking): ditto on incorporating this into the make target. |
||
| - name: Build controller logs | ||
| if: ${{ failure() }} | ||
| run: | | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -213,6 +213,7 @@ test-integration: install-apis ginkgo | |
| --randomize-all \ | ||
| --randomize-suites \ | ||
| --fail-on-pending \ | ||
| --skip-file=buildruns_to_pipelineruns_test.go \ | ||
|
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. nit (not blocking): we should use labels or other Ginkgo-native mechanisms for skipping these tests in the default integration and e2e test suites. |
||
| -trace \ | ||
| test/integration/... | ||
|
|
||
|
|
@@ -226,7 +227,7 @@ test-e2e-plain: ginkgo | |
| TEST_E2E_SERVICEACCOUNT_NAME=${TEST_E2E_SERVICEACCOUNT_NAME} \ | ||
| TEST_E2E_TIMEOUT_MULTIPLIER=${TEST_E2E_TIMEOUT_MULTIPLIER} \ | ||
| TEST_E2E_VERIFY_TEKTONOBJECTS=${TEST_E2E_VERIFY_TEKTONOBJECTS} \ | ||
| $(GINKGO) ${TEST_E2E_FLAGS} test/e2e/ | ||
| $(GINKGO) --skip-file=e2e_pipelinerun_test.go ${TEST_E2E_FLAGS} test/e2e/ | ||
|
|
||
| .PHONY: test-e2e-kind-with-prereq-install | ||
| test-e2e-kind-with-prereq-install: ginkgo install-controller-kind install-strategies test-e2e-plain | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,6 +66,7 @@ const ( | |
| controllerBuildRunMaxConcurrentReconciles = "BUILDRUN_MAX_CONCURRENT_RECONCILES" | ||
| controllerBuildStrategyMaxConcurrentReconciles = "BUILDSTRATEGY_MAX_CONCURRENT_RECONCILES" | ||
| controllerClusterBuildStrategyMaxConcurrentReconciles = "CLUSTERBUILDSTRATEGY_MAX_CONCURRENT_RECONCILES" | ||
| controllerBuildrunExecutorEnvVar = "BUILDRUN_EXECUTOR" | ||
|
|
||
| // environment variables for the kube API | ||
| kubeAPIBurst = "KUBE_API_BURST" | ||
|
|
@@ -107,6 +108,7 @@ type Config struct { | |
| KubeAPIOptions KubeAPIOptions | ||
| GitRewriteRule bool | ||
| VulnerabilityCountLimit int | ||
| BuildrunExecutor string | ||
| } | ||
|
|
||
| // PrometheusConfig contains the specific configuration for the | ||
|
|
@@ -163,6 +165,7 @@ func NewDefaultConfig() *Config { | |
| TerminationLogPath: terminationLogPathDefault, | ||
| GitRewriteRule: false, | ||
| VulnerabilityCountLimit: 50, | ||
| BuildrunExecutor: "TaskRun", | ||
|
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. 👍 on default value. |
||
|
|
||
| GitContainerTemplate: Step{ | ||
| Image: gitDefaultImage, | ||
|
|
@@ -361,6 +364,11 @@ func (c *Config) SetConfigFromEnv() error { | |
| c.VulnerabilityCountLimit = vc | ||
| } | ||
|
|
||
| // set environment variable for executor type | ||
| if executor := os.Getenv(controllerBuildrunExecutorEnvVar); executor != "" { | ||
| c.BuildrunExecutor = executor | ||
| } | ||
|
Comment on lines
+367
to
+370
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. nit (not blocking): ideally we should have some validation on this env var value and not accept it at face value. |
||
|
|
||
| // Mark that the Git wrapper is suppose to use Git rewrite rule | ||
| if useGitRewriteRule := os.Getenv(useGitRewriteRule); useGitRewriteRule != "" { | ||
| c.GitRewriteRule = strings.ToLower(useGitRewriteRule) == "true" | ||
|
|
||
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.
nit (not blocking): ideally would like to have these be arguments to the make target, but I can live with this for now.