Skip to content

Comments

Add openshift support for c2c#846

Merged
anuruddhal merged 3 commits intoballerina-platform:masterfrom
anuruddhal:master
Sep 3, 2025
Merged

Add openshift support for c2c#846
anuruddhal merged 3 commits intoballerina-platform:masterfrom
anuruddhal:master

Conversation

@anuruddhal
Copy link
Member

@anuruddhal anuruddhal requested a review from Copilot May 14, 2025 04:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@anuruddhal anuruddhal force-pushed the master branch 4 times, most recently from 799bc46 to 9213074 Compare May 14, 2025 09:18
@@ -0,0 +1,23 @@
// Copyright (c) 2020 WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
Copy link
Member

Choose a reason for hiding this comment

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

Shall we put 2025 LLC header?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

@@ -0,0 +1,4 @@
[container.image]
repository= "anuruddhal" # Container repository to host the container
Copy link
Member

Choose a reason for hiding this comment

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

can we use something like ballerina

}
}


Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

@anuruddhal anuruddhal merged commit d0ea811 into ballerina-platform:master Sep 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants