Skip to content

Commit

Permalink
Merge pull request #2703 from yue9944882/bump-example-18
Browse files Browse the repository at this point in the history
Update example for release-{16,17,18}
  • Loading branch information
k8s-ci-robot committed Jun 16, 2023
2 parents 74f95bc + 754daa0 commit 9a6cb84
Show file tree
Hide file tree
Showing 114 changed files with 47 additions and 47 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,12 @@ jobs:
mvn clean install \
-q \
-Dmaven.test.skip=true
- name: Version 13
- name: Examples
run: |
cd examples/examples-release-13
mvn clean install
- name: Version 14
run: |
cd examples/examples-release-14
mvn clean install
- name: Version 15
run: |
cd examples/examples-release-15
mvn clean install
for d in $(find examples* -maxdepth 1 -type d)
do
mvn clean install -Dmaven.test.skip=true
done
codegen:
runs-on: ubuntu-latest
services:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<relativePath>..</relativePath>
</parent>

<artifactId>client-java-examples-release-13</artifactId>
<name>client-java-examples-release-13</name>
<artifactId>client-java-examples-release-16</artifactId>
<name>client-java-examples-release-16</name>

<dependencies>
<dependency>
Expand All @@ -30,27 +30,27 @@
<dependency>
<groupId>io.kubernetes</groupId>
<artifactId>client-java-api</artifactId>
<version>13.0.1</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.kubernetes</groupId>
<artifactId>client-java</artifactId>
<version>13.0.1</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.kubernetes</groupId>
<artifactId>client-java-extended</artifactId>
<version>13.0.1</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.kubernetes</groupId>
<artifactId>client-java-spring-integration</artifactId>
<version>13.0.1</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>io.kubernetes</groupId>
<artifactId>client-java-proto</artifactId>
<version>13.0.1</version>
<version>16.0.0</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void onDelete(V1Node node, boolean deletedFinalStateUnknown) {
V1ObjectMeta metadata = new V1ObjectMeta();
metadata.setName("noxu");
nodeToCreate.setMetadata(metadata);
V1Node createdNode = coreV1Api.createNode(nodeToCreate, null, null, null);
V1Node createdNode = coreV1Api.createNode(nodeToCreate, null, null, null, null);
Thread.sleep(3000);

Lister<V1Node> nodeLister = new Lister<V1Node>(nodeInformer.getIndexer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static void main(String[] args) throws IOException {
.deserialize(jsonDeploymentStr, V1Deployment.class);

// create a deployment
V1Deployment deploy1 = api.createNamespacedDeployment("default", body, null, null, null);
V1Deployment deploy1 = api.createNamespacedDeployment("default", body, null, null, null, null);
System.out.println("original deployment" + deploy1);

// json-patch a deployment
Expand All @@ -75,6 +75,7 @@ public static void main(String[] args) throws IOException {
null,
null, // field-manager is optional
null,
null,
null),
V1Patch.PATCH_FORMAT_JSON_PATCH,
api.getApiClient());
Expand All @@ -93,6 +94,7 @@ public static void main(String[] args) throws IOException {
null,
null, // field-manager is optional
null,
null,
null),
V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH,
api.getApiClient());
Expand All @@ -112,6 +114,7 @@ public static void main(String[] args) throws IOException {
null,
null,
"example-field-manager", // field-manager is required for server-side apply
null,
true,
null),
V1Patch.PATCH_FORMAT_APPLY_YAML,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ public static void main(String[] args) throws IOException, ApiException, ClassNo
// Deployment and StatefulSet is defined in apps/v1, so you should use AppsV1Api instead of
// CoreV1API
CoreV1Api api = new CoreV1Api();
V1Service createResult = api.createNamespacedService("default", yamlSvc, null, null, null);
V1Service createResult = api.createNamespacedService("default", yamlSvc, null, null, null, null);

System.out.println(createResult);

V1Status deleteResult =
V1Service deleteResult =
api.deleteNamespacedService(
yamlSvc.getMetadata().getName(),
"default",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<relativePath>..</relativePath>
</parent>

<artifactId>client-java-examples-release-14</artifactId>
<name>client-java-examples-release-14</name>
<artifactId>client-java-examples-release-17</artifactId>
<name>client-java-examples-release-17</name>

<dependencies>
<dependency>
Expand All @@ -30,27 +30,27 @@
<dependency>
<groupId>io.kubernetes</groupId>
<artifactId>client-java-api</artifactId>
<version>14.0.0</version>
<version>17.0.0</version>
</dependency>
<dependency>
<groupId>io.kubernetes</groupId>
<artifactId>client-java</artifactId>
<version>14.0.0</version>
<version>17.0.0</version>
</dependency>
<dependency>
<groupId>io.kubernetes</groupId>
<artifactId>client-java-extended</artifactId>
<version>14.0.0</version>
<version>17.0.0</version>
</dependency>
<dependency>
<groupId>io.kubernetes</groupId>
<artifactId>client-java-spring-integration</artifactId>
<version>14.0.0</version>
<version>17.0.0</version>
</dependency>
<dependency>
<groupId>io.kubernetes</groupId>
<artifactId>client-java-proto</artifactId>
<version>14.0.0</version>
<version>17.0.0</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public static void scaleDeployment(String deploymentName, int numberOfReplicas)
V1DeploymentSpec newSpec = deploy.getSpec().replicas(numberOfReplicas);
V1Deployment newDeploy = deploy.spec(newSpec);
appsV1Api.replaceNamespacedDeployment(
deploymentName, DEFAULT_NAME_SPACE, newDeploy, null, null, null);
deploymentName, DEFAULT_NAME_SPACE, newDeploy, null, null, null, null);
} catch (ApiException ex) {
LOGGER.warn("Scale the pod failed for Deployment:" + deploymentName, ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static void main(String[] args) throws IOException, ApiException {
.endSpec()
.build();

api.createNamespacedPod("default", pod, null, null, null);
api.createNamespacedPod("default", pod, null, null, null, null);

V1Pod pod2 =
new V1Pod()
Expand All @@ -63,7 +63,7 @@ public static void main(String[] args) throws IOException, ApiException {
new V1PodSpec()
.containers(Arrays.asList(new V1Container().name("www").image("nginx"))));

api.createNamespacedPod("default", pod2, null, null, null);
api.createNamespacedPod("default", pod2, null, null, null, null);

V1PodList list =
api.listNamespacedPod(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void onDelete(V1Node node, boolean deletedFinalStateUnknown) {
V1ObjectMeta metadata = new V1ObjectMeta();
metadata.setName("noxu");
nodeToCreate.setMetadata(metadata);
V1Node createdNode = coreV1Api.createNode(nodeToCreate, null, null, null);
V1Node createdNode = coreV1Api.createNode(nodeToCreate, null, null, null, null);
Thread.sleep(3000);

Lister<V1Node> nodeLister = new Lister<V1Node>(nodeInformer.getIndexer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static void main(String[] args) throws IOException {
.deserialize(jsonDeploymentStr, V1Deployment.class);

// create a deployment
V1Deployment deploy1 = api.createNamespacedDeployment("default", body, null, null, null);
V1Deployment deploy1 = api.createNamespacedDeployment("default", body, null, null, null, null);
System.out.println("original deployment" + deploy1);

// json-patch a deployment
Expand All @@ -73,6 +73,7 @@ public static void main(String[] args) throws IOException {
new V1Patch(jsonPatchStr),
null,
null,
null,
null, // field-manager is optional
null,
null),
Expand All @@ -91,6 +92,7 @@ public static void main(String[] args) throws IOException {
new V1Patch(strategicMergePatchStr),
null,
null,
null,
null, // field-manager is optional
null,
null),
Expand All @@ -112,8 +114,9 @@ public static void main(String[] args) throws IOException {
null,
null,
"example-field-manager", // field-manager is required for server-side apply
null,
true,
null),
null),
V1Patch.PATCH_FORMAT_APPLY_YAML,
api.getApiClient());
System.out.println("application/apply-patch+yaml deployment" + deploy4);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ public static void main(String[] args) throws IOException, ApiException, ClassNo
// Deployment and StatefulSet is defined in apps/v1, so you should use AppsV1Api instead of
// CoreV1API
CoreV1Api api = new CoreV1Api();
V1Service createResult = api.createNamespacedService("default", yamlSvc, null, null, null);
V1Service createResult = api.createNamespacedService("default", yamlSvc, null, null, null, null);

System.out.println(createResult);

V1Status deleteResult =
V1Service deleteResult =
api.deleteNamespacedService(
yamlSvc.getMetadata().getName(),
"default",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<relativePath>..</relativePath>
</parent>

<artifactId>client-java-examples-release-15</artifactId>
<name>client-java-examples-release-15</name>
<artifactId>client-java-examples-release-18</artifactId>
<name>client-java-examples-release-18</name>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public static void scaleDeployment(String deploymentName, int numberOfReplicas)
V1DeploymentSpec newSpec = deploy.getSpec().replicas(numberOfReplicas);
V1Deployment newDeploy = deploy.spec(newSpec);
appsV1Api.replaceNamespacedDeployment(
deploymentName, DEFAULT_NAME_SPACE, newDeploy, null, null, null);
deploymentName, DEFAULT_NAME_SPACE, newDeploy, null, null, null, null);
} catch (ApiException ex) {
LOGGER.warn("Scale the pod failed for Deployment:" + deploymentName, ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static void main(String[] args) throws IOException, ApiException {
.endSpec()
.build();

api.createNamespacedPod("default", pod, null, null, null);
api.createNamespacedPod("default", pod, null, null, null, null);

V1Pod pod2 =
new V1Pod()
Expand All @@ -63,7 +63,7 @@ public static void main(String[] args) throws IOException, ApiException {
new V1PodSpec()
.containers(Arrays.asList(new V1Container().name("www").image("nginx"))));

api.createNamespacedPod("default", pod2, null, null, null);
api.createNamespacedPod("default", pod2, null, null, null, null);

V1PodList list =
api.listNamespacedPod(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static void main(String[] args) throws IOException, ApiException {
api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null, null);
// A request that should return 404
try {
V1Pod pod = api.readNamespacedPod("foo", "bar", null, null, null);
V1Pod pod = api.readNamespacedPod("foo", "bar", null);
} catch (ApiException ex) {
if (ex.getCode() != 404) {
throw ex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void exactUrlOnly() throws IOException, ApiException {
.withBody(client.getJSON().serialize(ns1))));

CoreV1Api api = new CoreV1Api();
V1Namespace ns2 = api.readNamespace("name", null, null, null);
V1Namespace ns2 = api.readNamespace("name", null);
assertEquals(ns1, ns2);
}
}
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<name>client-java-examples-parent</name>

<modules>
<module>examples-release-13</module>
<module>examples-release-14</module>
<module>examples-release-15</module>
<module>examples-release-16</module>
<module>examples-release-17</module>
<module>examples-release-18</module>
</modules>

<build>
Expand Down

0 comments on commit 9a6cb84

Please sign in to comment.