Skip to content

Commit 31fbb3a

Browse files
authored
Merge pull request #1079 from yue9944882/validate-source-license
Switching formatter to spotless and applies license header
2 parents 256a0e5 + d1b0ba9 commit 31fbb3a

File tree

1,026 files changed

+580371
-356700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,026 files changed

+580371
-356700
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ jobs:
2323
uses: actions/setup-java@v1
2424
with:
2525
java-version: ${{ matrix.java }}
26+
- name: Verify Format and License
27+
run: mvn spotless:check
2628
- name: Build with Maven
2729
run: mvn -q test -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn

examples/pom.xml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,6 @@
9494
</execution>
9595
</executions>
9696
</plugin>
97-
<plugin>
98-
<groupId>com.coveo</groupId>
99-
<artifactId>fmt-maven-plugin</artifactId>
100-
<version>2.2.0</version>
101-
<executions>
102-
<execution>
103-
<phase>test</phase>
104-
<goals>
105-
<goal>check</goal>
106-
</goals>
107-
</execution>
108-
</executions>
109-
</plugin>
11097
</plugins>
11198
</build>
11299

examples/src/main/java/io/kubernetes/client/examples/AttachExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
Copyright 2017 The Kubernetes Authors.
2+
Copyright 2020 The Kubernetes Authors.
33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
55
You may obtain a copy of the License at
6-
http://www.apache.org/licenses/LICENSE-2.0
6+
http://www.apache.org/licenses/LICENSE-2.0
77
Unless required by applicable law or agreed to in writing, software
88
distributed under the License is distributed on an "AS IS" BASIS,
99
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

examples/src/main/java/io/kubernetes/client/examples/ControllerExample.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
/*
2+
Copyright 2020 The Kubernetes Authors.
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
113
package io.kubernetes.client.examples;
214

315
import io.kubernetes.client.extended.controller.Controller;
@@ -37,7 +49,8 @@ public static void main(String[] args) throws IOException {
3749
apiClient.getHttpClient().newBuilder().readTimeout(0, TimeUnit.SECONDS).build();
3850
apiClient.setHttpClient(httpClient);
3951

40-
// instantiating an informer-factory, and there should be only one informer-factory globally.
52+
// instantiating an informer-factory, and there should be only one informer-factory
53+
// globally.
4154
SharedInformerFactory informerFactory = new SharedInformerFactory();
4255
// registering node-informer into the informer-factory.
4356
SharedIndexInformer<V1Node> nodeInformer =
@@ -99,9 +112,8 @@ public static void main(String[] args) throws IOException {
99112
.withReconciler(nodeReconciler) // required, set the actual reconciler
100113
.withName("node-printing-controller") // optional, set name for controller
101114
.withWorkerCount(4) // optional, set worker thread count
102-
.withReadyFunc(
103-
nodeInformer
104-
::hasSynced) // optional, only starts controller when the cache has synced up
115+
.withReadyFunc(nodeInformer::hasSynced) // optional, only starts controller when the
116+
// cache has synced up
105117
.build();
106118

107119
// Use builder library to manage one or multiple controllers.

examples/src/main/java/io/kubernetes/client/examples/CopyExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
Copyright 2017, 2018 The Kubernetes Authors.
2+
Copyright 2020 The Kubernetes Authors.
33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
55
You may obtain a copy of the License at
6-
http://www.apache.org/licenses/LICENSE-2.0
6+
http://www.apache.org/licenses/LICENSE-2.0
77
Unless required by applicable law or agreed to in writing, software
88
distributed under the License is distributed on an "AS IS" BASIS,
99
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

examples/src/main/java/io/kubernetes/client/examples/Example.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
Copyright 2017 The Kubernetes Authors.
2+
Copyright 2020 The Kubernetes Authors.
33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
55
You may obtain a copy of the License at
6-
http://www.apache.org/licenses/LICENSE-2.0
6+
http://www.apache.org/licenses/LICENSE-2.0
77
Unless required by applicable law or agreed to in writing, software
88
distributed under the License is distributed on an "AS IS" BASIS,
99
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

examples/src/main/java/io/kubernetes/client/examples/ExecExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
Copyright 2017, 2018 The Kubernetes Authors.
2+
Copyright 2020 The Kubernetes Authors.
33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
55
You may obtain a copy of the License at
6-
http://www.apache.org/licenses/LICENSE-2.0
6+
http://www.apache.org/licenses/LICENSE-2.0
77
Unless required by applicable law or agreed to in writing, software
88
distributed under the License is distributed on an "AS IS" BASIS,
99
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

examples/src/main/java/io/kubernetes/client/examples/ExpandedExample.java

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
Copyright 2018 The Kubernetes Authors.
2+
Copyright 2020 The Kubernetes Authors.
33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
55
You may obtain a copy of the License at
6-
http://www.apache.org/licenses/LICENSE-2.0
6+
http://www.apache.org/licenses/LICENSE-2.0
77
Unless required by applicable law or agreed to in writing, software
88
distributed under the License is distributed on an "AS IS" BASIS,
99
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -66,8 +66,7 @@ public static void main(String[] args) {
6666

6767
// List all of the namaspaces and pods
6868
List<String> nameSpaces = getAllNameSpaces();
69-
nameSpaces
70-
.stream()
69+
nameSpaces.stream()
7170
.forEach(
7271
namespace -> {
7372
try {
@@ -105,9 +104,7 @@ public static List<String> getAllNameSpaces() throws ApiException {
105104
COREV1_API.listNamespace(
106105
"true", null, null, null, null, 0, null, Integer.MAX_VALUE, Boolean.FALSE);
107106
List<String> list =
108-
listNamespace
109-
.getItems()
110-
.stream()
107+
listNamespace.getItems().stream()
111108
.map(v1Namespace -> v1Namespace.getMetadata().getName())
112109
.collect(Collectors.toList());
113110
return list;
@@ -123,9 +120,7 @@ public static List<String> getPods() throws ApiException {
123120
V1PodList v1podList =
124121
COREV1_API.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null);
125122
List<String> podList =
126-
v1podList
127-
.getItems()
128-
.stream()
123+
v1podList.getItems().stream()
129124
.map(v1Pod -> v1Pod.getMetadata().getName())
130125
.collect(Collectors.toList());
131126
return podList;
@@ -174,9 +169,7 @@ public static List<String> getNamespacedPod(String namespace, String label) thro
174169
TIME_OUT_VALUE,
175170
Boolean.FALSE);
176171
List<String> listPods =
177-
listNamespacedPod
178-
.getItems()
179-
.stream()
172+
listNamespacedPod.getItems().stream()
180173
.map(v1pod -> v1pod.getMetadata().getName())
181174
.collect(Collectors.toList());
182175
return listPods;
@@ -201,9 +194,7 @@ public static List<String> getServices() throws ApiException {
201194
null,
202195
TIME_OUT_VALUE,
203196
Boolean.FALSE);
204-
return listNamespacedService
205-
.getItems()
206-
.stream()
197+
return listNamespacedService.getItems().stream()
207198
.map(v1service -> v1service.getMetadata().getName())
208199
.collect(Collectors.toList());
209200
}
@@ -226,8 +217,7 @@ public static void scaleDeployment(String deploymentName, int numberOfReplicas)
226217
List<ExtensionsV1beta1Deployment> extensionsV1beta1DeploymentItems =
227218
listNamespacedDeployment.getItems();
228219
Optional<ExtensionsV1beta1Deployment> findedDeployment =
229-
extensionsV1beta1DeploymentItems
230-
.stream()
220+
extensionsV1beta1DeploymentItems.stream()
231221
.filter(
232222
(ExtensionsV1beta1Deployment deployment) ->
233223
deployment.getMetadata().getName().equals(deploymentName))

examples/src/main/java/io/kubernetes/client/examples/FluentExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
Copyright 2018 The Kubernetes Authors.
2+
Copyright 2020 The Kubernetes Authors.
33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
55
You may obtain a copy of the License at
6-
http://www.apache.org/licenses/LICENSE-2.0
6+
http://www.apache.org/licenses/LICENSE-2.0
77
Unless required by applicable law or agreed to in writing, software
88
distributed under the License is distributed on an "AS IS" BASIS,
99
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

examples/src/main/java/io/kubernetes/client/examples/GenericClientExample.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
/*
2+
Copyright 2020 The Kubernetes Authors.
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
113
package io.kubernetes.client.examples;
214

315
import com.google.common.annotations.Beta;

0 commit comments

Comments
 (0)