Add openshift support for c2c#846
Merged
anuruddhal merged 3 commits intoballerina-platform:masterfrom Sep 3, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds OpenShift support for the c2c module by extending the existing Kubernetes and Docker artifact generation logic. Key changes include:
- Bumping version numbers and updating build options to target OpenShift.
- Enhancing multiple compiler-plugin modules (utils, tasks, handlers) to generate OpenShift artifacts.
- Adding an OpenShift sample with corresponding documentation and integration tests.
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| gradle.properties | Bumps the Ballerina language version. |
| examples/openshift-yaml-with-ballerina-project/hello_api.bal | Introduces a sample Ballerina service for OpenShift. |
| examples/openshift-yaml-with-ballerina-project/README.md | Updates documentation with instructions for deploying OpenShift artifacts. |
| examples/openshift-yaml-with-ballerina-project/Cloud.toml | Adds container image configuration for OpenShift deployment. |
| examples/openshift-yaml-with-ballerina-project/Ballerina.toml | Sets the build option to “openshift.” |
| .gitignore | Contains duplicate ignore entries that can be consolidated. |
| compiler-plugin/src/main/java/io/ballerina/c2c/utils/KubernetesUtils.java | Updates file I/O methods to use Files.writeString. |
| compiler-plugin/src/main/java/io/ballerina/c2c/tasks/* | Refactors and extends build option checks and artifact generation for OpenShift. |
| compiler-plugin/src/main/java/io/ballerina/c2c/models/KubernetesDataHolder.java | Adds a field for OpenShift artifact output path. |
| compiler-plugin/src/main/java/io/ballerina/c2c/handlers/BuildConfigHandler.java | Implements a new handler for generating OpenShift BuildConfig artifacts. |
| compiler-plugin/src/main/java/io/ballerina/c2c/KubernetesConstants.java | Adds constants for OpenShift and build config file postfix. |
| compiler-plugin/src/main/java/io/ballerina/c2c/ArtifactManager.java | Integrates OpenShift artifact generation and instructions into the artifact manager. |
| compiler-plugin/build.gradle | Adds the Fabric8 OpenShift client dependency. |
| compiler-plugin-tests/src/test/java/io/ballerina/c2c/test/samples/OpenshiftSampleTest.java | Introduces integration tests for the OpenShift sample. |
| ballerina/* | Bumps version numbers and updates dependency paths for the OpenShift-enabled release. |
compiler-plugin/src/main/java/io/ballerina/c2c/tasks/CloudTomlAnalysisTask.java
Outdated
Show resolved
Hide resolved
compiler-plugin/src/main/java/io/ballerina/c2c/tasks/C2CCodeGeneratedTask.java
Outdated
Show resolved
Hide resolved
compiler-plugin/src/main/java/io/ballerina/c2c/tasks/C2CAnalysisTask.java
Outdated
Show resolved
Hide resolved
799bc46 to
9213074
Compare
keizer619
reviewed
May 14, 2025
| @@ -0,0 +1,23 @@ | |||
| // Copyright (c) 2020 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. | |||
Member
There was a problem hiding this comment.
Shall we put 2025 LLC header?
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for the OpenShift cloud option for c2c, extending the current Kubernetes and Docker support. Key changes include:
- Updates to build option validation and artifact generation utilities to accommodate an "openshift" value.
- Enhancements to the ArtifactManager and related handler classes to generate OpenShift-specific artifacts.
- Addition of new test cases and sample project files for OpenShift support.
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| examples/openshift-yaml-with-ballerina-project/hello_api.bal | New Ballerina service example for OpenShift deployment |
| examples/openshift-yaml-with-ballerina-project/README.md | Updated instructions and commands for OpenShift deployment |
| examples/openshift-yaml-with-ballerina-project/Cloud.toml | Added OpenShift container image configuration |
| examples/openshift-yaml-with-ballerina-project/Ballerina.toml | Updated build options to use OpenShift |
| compiler-plugin/src/main/java/io/ballerina/c2c/utils/KubernetesUtils.java | Refactored file-writing functions to use Files.writeString |
| compiler-plugin/src/main/java/io/ballerina/c2c/tasks/* | Updated build option checks to support "openshift" |
| compiler-plugin/src/main/java/io/ballerina/c2c/handlers/BuildConfigHandler.java | Created BuildConfig for OpenShift artifacts |
| compiler-plugin/src/main/java/io/ballerina/c2c/models/KubernetesDataHolder.java | Added field for OpenShift artifact output path |
| compiler-plugin/src/main/java/io/ballerina/c2c/ArtifactManager.java | Added logic to generate OpenShift artifacts and instructions |
| compiler-plugin/build.gradle | Added dependency on openshift-client from Fabric8 |
| compiler-plugin-tests/* | Added unit tests for validating OpenShift artifact generation and deployment |
keizer619
reviewed
Jun 4, 2025
| @@ -0,0 +1,4 @@ | |||
| [container.image] | |||
| repository= "anuruddhal" # Container repository to host the container | |||
Member
There was a problem hiding this comment.
can we use something like ballerina
keizer619
reviewed
Jun 4, 2025
| } | ||
| } | ||
|
|
||
|
|
NipunaMadhushan
approved these changes
Sep 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose