Make test buildable both using a Makefile and CMake
Fix conditional commands
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
cmake_minimum_required (VERSION 2.6...3.10.2)
|
||||
project(examples)
|
||||
|
||||
set(pkgName "kubernetes")
|
||||
|
||||
add_subdirectory(list_pod)
|
||||
@@ -1,5 +1,5 @@
|
||||
INCLUDE:=-I../../kubernetes/include -I../../kubernetes/model -I../../kubernetes/api -I../../kubernetes/config
|
||||
LIBS:=-L../../kubernetes/build -lkubernetes -lyaml -lwebsockets -L/usr/local/lib
|
||||
INCLUDE:=-I../../kubernetes/
|
||||
LIBS:=-L../../kubernetes/build -lyaml -lwebsockets -lkubernetes -L/usr/local/lib
|
||||
CFLAGS:=-g
|
||||
BIN:=list_pod_bin
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <kube_config.h>
|
||||
#include <apiClient.h>
|
||||
#include <CoreV1API.h>
|
||||
#include <config/kube_config.h>
|
||||
#include <api/CoreV1API.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void list_pod(apiClient_t * apiClient)
|
||||
|
||||
@@ -64,8 +64,14 @@ char *kubeconfig_mk_cert_key_tempfile(const char *data)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
int rc = write(fd, cert_key_data, cert_key_data_bytes);
|
||||
close(fd);
|
||||
#else
|
||||
int rc = _write(fd, cert_key_data, cert_key_data_bytes);
|
||||
_close(fd);
|
||||
#endif
|
||||
|
||||
if (true == is_data_base64_encoded && cert_key_data) {
|
||||
free((char *) cert_key_data); // cast "const char *" to "char *"
|
||||
cert_key_data = NULL;
|
||||
|
||||
Reference in New Issue
Block a user