Skip to content

Commit 1e4732c

Browse files
committed
fix comments bug
1 parent ac03b26 commit 1e4732c

13 files changed

Lines changed: 254 additions & 32 deletions

src/main/java/io/github/kubesys/client/KubernetesClient.java

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public class KubernetesClient {
101101
/**
102102
* 根据配置文件创建Kubernetes客户端
103103
*
104-
* @throws KubernetesConnectionException
104+
* @throws KubernetesConnectionException KubernetesConnectionException
105105
*/
106106
public KubernetesClient() throws KubernetesConnectionException {
107107
this(new File(KubernetesConstants.KUBE_CONFIG));
@@ -111,7 +111,7 @@ public KubernetesClient() throws KubernetesConnectionException {
111111
* 根据配置文件创建Kubernetes客户端
112112
*
113113
* @param file 比如$HOME$/.kube/conf
114-
* @throws KubernetesConnectionException
114+
* @throws KubernetesConnectionException KubernetesConnectionException
115115
*/
116116
public KubernetesClient(File file) throws KubernetesConnectionException {
117117
this(file, new KubernetesAnalyzer());
@@ -123,7 +123,7 @@ public KubernetesClient(File file) throws KubernetesConnectionException {
123123
*
124124
* @param file 比如$HOME$/.kube/conf
125125
* @param analyzer 用于自动分析Kubernetes中所有kind资源,以及该资源对应的Url
126-
* @throws KubernetesConnectionException
126+
* @throws KubernetesConnectionException KubernetesConnectionException
127127
*/
128128
public KubernetesClient(File file, KubernetesAnalyzer analyzer) throws KubernetesConnectionException {
129129
try {
@@ -147,7 +147,7 @@ public KubernetesClient(File file, KubernetesAnalyzer analyzer) throws Kubernete
147147
*
148148
* @param url 如https://IP:6443/
149149
* @param token bearer token, 通过ServiceAccount和ClusterRoleBinding进行创建
150-
* @throws KubernetesConnectionException
150+
* @throws KubernetesConnectionException KubernetesConnectionException
151151
*/
152152
public KubernetesClient(String url, String token) throws KubernetesConnectionException {
153153
this(url, token, new KubernetesAnalyzer());
@@ -160,7 +160,7 @@ public KubernetesClient(String url, String token) throws KubernetesConnectionExc
160160
* @param url 如https://IP:6443/
161161
* @param token bearer token, 通过ServiceAccount和ClusterRoleBinding进行创建
162162
* @param analyzer 用于自动分析Kubernetes中所有kind资源,以及该资源对应的Url
163-
* @throws KubernetesConnectionException
163+
* @throws KubernetesConnectionException KubernetesConnectionException
164164
*/
165165
public KubernetesClient(String url, String token, KubernetesAnalyzer analyzer) throws KubernetesConnectionException {
166166
try {
@@ -189,7 +189,7 @@ public KubernetesClient(String url, String token, KubernetesAnalyzer analyzer) t
189189
* @param url 如https://IP:6443/
190190
* @param username basic authing
191191
* @param password basic authing
192-
* @throws KubernetesConnectionException
192+
* @throws KubernetesConnectionException KubernetesConnectionException
193193
*/
194194
public KubernetesClient(String url, String username, String password) throws KubernetesConnectionException {
195195
this(url, username, password, new KubernetesAnalyzer());
@@ -203,7 +203,7 @@ public KubernetesClient(String url, String username, String password) throws Kub
203203
* @param username basic authing
204204
* @param password basic authing
205205
* @param analyzer 用于自动分析Kubernetes中所有kind资源,以及该资源对应的Url
206-
* @throws KubernetesConnectionException
206+
* @throws KubernetesConnectionException KubernetesConnectionException
207207
*/
208208
public KubernetesClient(String url, String username, String password, KubernetesAnalyzer analyzer) throws KubernetesConnectionException {
209209
try {
@@ -225,6 +225,9 @@ public KubernetesClient(String url, String username, String password, Kubernetes
225225
*
226226
**********************************************************/
227227
// https://www.oreilly.com/library/view/managing-kubernetes/9781492033905/ch04.html
228+
/**
229+
* statusDesc
230+
*/
228231
static Map<Integer, String> statusDesc = new HashMap<>();
229232

230233
static {
@@ -238,9 +241,11 @@ public KubernetesClient(String url, String username, String password, Kubernetes
238241
"Unprocessable entity. The request was parsed correctly but failed some sort of validation.");
239242
}
240243

244+
241245
/**
242-
* @return httpClient
243-
* @throws Exception
246+
* @param kac kac
247+
* @return CloseableHttpClient
248+
* @throws Exception Exception
244249
*/
245250
protected CloseableHttpClient createDefaultHttpClient(KubernetesAdminConfig kac) throws Exception {
246251

@@ -323,8 +328,9 @@ protected synchronized JsonNode parseResponse(CloseableHttpResponse response) {
323328

324329
}
325330

331+
326332
/**
327-
* @param inputStream is
333+
* @param resp response
328334
* @return string
329335
*/
330336
public static String convertToString(CloseableHttpResponse resp) {
@@ -340,9 +346,10 @@ public static String convertToString(CloseableHttpResponse resp) {
340346
return ex.toString();
341347
}
342348
}
349+
343350
/**
344351
* @param req req
345-
* @return json json
352+
* @return json
346353
* @throws Exception exception
347354
*/
348355
@SuppressWarnings("deprecation")
@@ -727,7 +734,6 @@ public JsonNode getResourceByNamespaceAndName(String fullkind, String namespace,
727734
* get a Kubernetes resource using kind, namespace and name
728735
*
729736
* @param fullkind kind
730-
* @param namespace namespace, if this kind unsupports namespace, it is null
731737
* @param name name
732738
* @return json json
733739
* @throws Exception Kubernetes cannot parsing this jsonStr
@@ -818,7 +824,8 @@ public JsonNode listResourcesByNamespace(String fullkind, String namespace) thro
818824
*
819825
* @param fullkind kind
820826
* @param namespace namespace
821-
* @return fields fields
827+
* @param fields fields
828+
* @return json
822829
* @throws Exception Kubernetes cannot parsing this jsonStr
823830
*/
824831
@Api(desc = "根据fullkind、namespace和filed查询所有Kubernetes资源", catches = {})
@@ -832,7 +839,8 @@ public JsonNode listResourcesByNamespaceAndField(String fullkind, String namespa
832839
*
833840
* @param fullkind kind
834841
* @param namespace namespace
835-
* @return labels labels
842+
* @param labels labels
843+
* @return json
836844
* @throws Exception Kubernetes cannot parsing this jsonStr
837845
*/
838846
@Api(desc = "根据fullkind、namespace和label查询所有Kubernetes资源", catches = {})
@@ -925,7 +933,7 @@ public JsonNode updateResourceStatusByJson(String obj) throws Exception {
925933
/**
926934
* update a Kubernetes resource status using JSON
927935
*
928-
* @param obj json
936+
* @param yaml yaml
929937
* @return json json
930938
* @throws Exception Kubernetes cannot parsing this jsonStr
931939
*/
@@ -1131,7 +1139,7 @@ public JsonNode bindingResource(String namespace, String pod, String host) thro
11311139
* @param kind kind
11321140
* @param plural plural
11331141
* @return JSON
1134-
* @throws Exception
1142+
* @throws Exception Exception
11351143
*/
11361144
@Api(desc = "创建和注册CRD资源", catches = {})
11371145
public JsonNode registerResource(String group, String kind, String plural) throws Exception {
@@ -1141,6 +1149,10 @@ public JsonNode registerResource(String group, String kind, String plural) throw
11411149
return createResourceByJson(json);
11421150
}
11431151

1152+
/**
1153+
* @return json
1154+
* @throws Exception Exception
1155+
*/
11441156
@Api(desc = "创建和注册CRD资源", catches = {})
11451157
public JsonNode createWebHook() throws Exception {
11461158
return null;
@@ -1251,7 +1263,7 @@ public JsonNode createWebHook() throws Exception {
12511263
*
12521264
* @param crd 上面就是一个CRD例子
12531265
* @return /apis/doslab.io/v1
1254-
* @throws Exception
1266+
* @throws Exception Exception
12551267
*/
12561268
@Api(desc = "提取CRD信息", catches = {})
12571269
public JsonNode extractResource(JsonNode crd) throws Exception {

0 commit comments

Comments
 (0)