-
Notifications
You must be signed in to change notification settings - Fork 118
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
add support for openshift build config #305
add support for openshift build config #305
Conversation
Codecov Report
@@ Coverage Diff @@
## master #305 +/- ##
==========================================
- Coverage 24.81% 24.28% -0.54%
==========================================
Files 70 71 +1
Lines 4429 4522 +93
==========================================
- Hits 1099 1098 -1
- Misses 3226 3320 +94
Partials 104 104
Continue to review full report at Codecov.
|
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.
Nice work Hari. Overall it looks great.
Few comments:
Do we have conditions to ensure that if a Openshift cluster (has buildconfig) supports tekton we create only tekton? I did not see any such condition in buildconfig createnewresource.
Also, do should we create buildconfig and imagestream even if the cluster supports only deployment (means somebody has manually disabled deployment config). This is a corner case, we can handle it as part of sensible defaults (we can create a new issue for it).
internal/apiresource/buildconfig.go
Outdated
case strings.Contains(gitRepoURL, "bitbucket"): | ||
return okdbuildv1.BitbucketWebHookBuildTriggerType | ||
default: | ||
log.Warnf("the git repo is not on github, gitlab or bitbucket. Defaulting to generic web hook trigger") |
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.
Do we want this to be a debug message? Since in many cases the we might not have found a git repo url
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.
Do we have conditions to ensure that if a Openshift cluster (has buildconfig) supports tekton we create only tekton? I did not see any such condition in buildconfig createnewresource.
https://github.com/HarikrishnanBalagopal/move2kube/blob/buildconfig/internal/transformer/cicdtransformer.go#L39-L50
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.
Also, do should we create buildconfig and imagestream even if the cluster supports only deployment (means somebody has manually disabled deployment config). This is a corner case, we can handle it as part of sensible defaults (we can create a new issue for it).
To get k8s deployments to use image streams we have to add certain annotations https://developers.redhat.com/blog/2019/09/20/using-red-hat-openshift-image-streams-with-kubernetes-deployments/
annotations:
deployment.kubernetes.io/revision: "2"
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"ubi:8"},"fieldPath":"spec.template.spec.containers[?(@.name==\"myapp\")].image"}]'
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.
Do we want this to be a debug message? Since in many cases the we might not have found a git repo url
If there's no repo should we just avoid creating CICD resources?
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.
We can create it if there is request from customers. For now, create an issue with this link
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.
Do we want this to be a debug message? Since in many cases the we might not have found a git repo url
If there's no repo should we just avoid creating CICD resources?
Let it be there, with placeholder for git repo.
dfa083f
to
4c9606f
Compare
bb60bae
to
a480168
Compare
When targeting Openshift, generate a BuildConfig if Tekton is not available for CI/CD purposes. Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
a480168
to
9a128bb
Compare
When targeting Openshift, generate a BuildConfig if Tekton
is not available for CI/CD purposes.
Signed-off-by: Harikrishnan Balagopal harikrishmenon@gmail.com