You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/01/10 08:27:35 UTC

[GitHub] [nifi-minifi-cpp] lordgamez commented on a change in pull request #1234: MINIFICPP-1699 Add kubernetes-client/c library dependency

lordgamez commented on a change in pull request #1234:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1234#discussion_r780966874



##########
File path: cmake/BundledLibreSSL.cmake
##########
@@ -60,6 +60,7 @@ function(use_libre_ssl SOURCE_DIR BINARY_DIR)
     # Set variables
     set(OPENSSL_FOUND "YES" CACHE STRING "" FORCE)
     set(OPENSSL_INCLUDE_DIR "${LIBRESSL_BIN_DIR}/include" CACHE STRING "" FORCE)
+    set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}" CACHE STRING "" FORCE)  # workaround for libwebsockets

Review comment:
       If some thirdparties require this maybe OPENSSL_INCLUDE_DIRS should be added to FindOpenSSL.cmake as well.

##########
File path: extensions/kubernetes/KubernetesClientPOC.cpp
##########
@@ -0,0 +1,123 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <errno.h>
+#include <malloc.h>
+#include <stdio.h>
+#include <string>
+
+extern "C" {
+#include "config/incluster_config.h"
+#include "config/kube_config.h"
+#include "include/apiClient.h"
+#include "api/CoreV1API.h"
+}
+
+void list_pod(apiClient_t * apiClient) {
+    v1_pod_list_t *pod_list = NULL;
+    std::string name_space = "default";
+    std::string field_selector = "spec.nodeName=kind-control-plane";
+    pod_list = CoreV1API_listNamespacedPod(apiClient,
+                                           name_space.data(),
+                                           NULL,    /* pretty */
+                                           0,   /* allowWatchBookmarks */
+                                           NULL,    /* continue */
+                                           field_selector.data(),
+                                           NULL,    /* labelSelector */
+                                           0,   /* limit */
+                                           NULL,    /* resourceVersion */
+                                           NULL,    /* resourceVersionMatch */
+                                           0,   /* timeoutSeconds */
+                                           0    /* watch */);
+    printf("The return code of HTTP request=%ld\n", apiClient->response_code);
+    if (pod_list) {
+        printf("Get pod list:\n");
+        listEntry_t *listEntry = NULL;
+        v1_pod_t *pod = NULL;
+        list_ForEach(listEntry, pod_list->items) {
+            pod = static_cast<v1_pod_t *>(listEntry->data);
+            printf("\tThe pod name: %s\n", pod->metadata->name);
+            v1_container_t *container = NULL;
+        listEntry_t *containerEntry = NULL;
+        list_ForEach(containerEntry, pod->spec->containers) {
+        container = static_cast<v1_container_t *>(containerEntry->data);
+        printf("\tThe container name: %s\n", container->name);
+            }
+    }

Review comment:
       The indentation is a bit off in these lines. I also think that we should change the indentation of the file from 4 to 2 spaces to be aligned with our style guide.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org