resolve code-sytle-check issues

This commit is contained in:
DanyT
2024-07-05 07:55:42 +03:00
parent 4a19bc2a5f
commit 70f05e512c
3 changed files with 6 additions and 10 deletions

View File

@@ -304,7 +304,7 @@ static int kuberconfig_auth_provider(kubeconfig_property_t * current_user, kubec
return rc;
}
int load_kube_config_common(char **pBasePath, sslConfig_t ** pSslConfig, list_t ** pApiKeys, kubeconfig_t *kubeconfig)
int load_kube_config_common(char **pBasePath, sslConfig_t ** pSslConfig, list_t ** pApiKeys, kubeconfig_t * kubeconfig)
{
static char fname[] = "load_kube_config_common()";
int rc = 0;
@@ -314,7 +314,7 @@ int load_kube_config_common(char **pBasePath, sslConfig_t ** pSslConfig, list_t
rc = kubeyaml_load_kubeconfig(kubeconfig);
if (0 != rc) {
fprintf(stderr, "%s: Cannot load the kubeconfig %s\n", fname, kubeconfig->fileName?kubeconfig->fileName:kubeconfig->buffer);
fprintf(stderr, "%s: Cannot load the kubeconfig %s\n", fname, kubeconfig->fileName ? kubeconfig->fileName : kubeconfig->buffer);
rc = -1;
goto end;
}

View File

@@ -443,11 +443,9 @@ int kubeyaml_load_kubeconfig(kubeconfig_t * kubeconfig)
fprintf(stderr, "%s: Cannot open the file %s.[%s]\n", fname, kubeconfig->fileName, strerror(errno));
return -1;
}
}
else if (kubeconfig->buffer) {
} else if (kubeconfig->buffer) {
// Nothing to do here for now.
}
else {
} else {
fprintf(stderr, "%s: One of the kubeconfig->fileName or kubeconfig->buffer needs to be set.\n", fname);
return -1;
}
@@ -459,9 +457,8 @@ int kubeyaml_load_kubeconfig(kubeconfig_t * kubeconfig)
yaml_parser_initialize(&parser);
if (input) {
yaml_parser_set_input_file(&parser, input);
}
else {
yaml_parser_set_input_string(&parser, (const unsigned char*)kubeconfig->buffer, strlen(kubeconfig->buffer));
} else {
yaml_parser_set_input_string(&parser, (const unsigned char *) kubeconfig->buffer, strlen(kubeconfig->buffer));
}
int done = 0;

View File

@@ -34,7 +34,6 @@ extern "C" {
*/
int kubeyaml_load_kubeconfig(kubeconfig_t * kubeconfig);
/*
* kubeyaml_parse_exec_crendential
*