Skip to content

Commit

Permalink
Merge pull request #198 from swhoro/fixed
Browse files Browse the repository at this point in the history
add support of reading certificate-authority file
  • Loading branch information
k8s-ci-robot committed Jul 24, 2023
2 parents c223563 + 79ab588 commit 4aa8bb7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kubernetes/config/kube_config_yaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ mapping :: = MAPPING - START(node node) * MAPPING - END
#define KEY_USER_AUTH_PROVIDER_CONFIG_IDP_ISSUE_URL "idp-issuer-url"
#define KEY_USER_AUTH_PROVIDER_CONFIG_REFRESH_TOKEN "refresh-token"
#define KEY_CERTIFICATE_AUTHORITY_DATA "certificate-authority-data"
#define KEY_CERTIFICATE_AUTHORITY "certificate-authority"
#define KEY_INSECURE_SKIP_TLS_VERIFY "insecure-skip-tls-verify"
#define KEY_SERVER "server"
#define KEY_CLIENT_CERTIFICATE "client-certificate"
Expand Down Expand Up @@ -192,7 +193,7 @@ static int parse_kubeconfig_yaml_string_mapping_sequence(keyValuePair_t *** p_st

static int parse_kubeconfig_yaml_property_mapping(kubeconfig_property_t * property, yaml_document_t * document, yaml_node_t * node)
{
static char fname[] = "parse_kubeconfig_yaml_property_info_mapping()";
static char fname[] = "parse_kubeconfig_yaml_property_mapping()";

yaml_node_pair_t *pair = NULL;
yaml_node_t *key = NULL;
Expand All @@ -214,6 +215,8 @@ static int parse_kubeconfig_yaml_property_mapping(kubeconfig_property_t * proper
if (KUBECONFIG_PROPERTY_TYPE_CLUSTER == property->type) {
if (0 == strcmp(key->data.scalar.value, KEY_CERTIFICATE_AUTHORITY_DATA)) {
property->certificate_authority_data = strdup(value->data.scalar.value);
} else if (0 == strcmp(key->data.scalar.value, KEY_CERTIFICATE_AUTHORITY)) {
property->certificate_authority_data = load_file_content(value->data.scalar.value);
} else if (0 == strcmp(key->data.scalar.value, KEY_SERVER)) {
property->server = strdup(value->data.scalar.value);
} else if (0 == strcmp(key->data.scalar.value, KEY_INSECURE_SKIP_TLS_VERIFY)) {
Expand Down

0 comments on commit 4aa8bb7

Please sign in to comment.