Merge pull request #140 from caesar0301/master
Resolve cpp keyword conflict
This commit is contained in:
@@ -102,9 +102,9 @@ void kubeconfig_property_free(kubeconfig_property_t * property)
|
|||||||
free(property->cluster);
|
free(property->cluster);
|
||||||
property->cluster = NULL;
|
property->cluster = NULL;
|
||||||
}
|
}
|
||||||
if (property->namespace) {
|
if (property->_namespace) {
|
||||||
free(property->namespace);
|
free(property->_namespace);
|
||||||
property->namespace = NULL;
|
property->_namespace = NULL;
|
||||||
}
|
}
|
||||||
if (property->user) {
|
if (property->user) {
|
||||||
free(property->user);
|
free(property->user);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ extern "C" {
|
|||||||
union {
|
union {
|
||||||
struct { /* context */
|
struct { /* context */
|
||||||
char *cluster;
|
char *cluster;
|
||||||
char *namespace;
|
char *_namespace;
|
||||||
char *user;
|
char *user;
|
||||||
};
|
};
|
||||||
struct { /* cluster */
|
struct { /* cluster */
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ static int parse_kubeconfig_yaml_property_mapping(kubeconfig_property_t * proper
|
|||||||
if (0 == strcmp(key->data.scalar.value, KEY_CLUSTER)) {
|
if (0 == strcmp(key->data.scalar.value, KEY_CLUSTER)) {
|
||||||
property->cluster = strdup(value->data.scalar.value);
|
property->cluster = strdup(value->data.scalar.value);
|
||||||
} else if (0 == strcmp(key->data.scalar.value, KEY_NAMESPACE)) {
|
} else if (0 == strcmp(key->data.scalar.value, KEY_NAMESPACE)) {
|
||||||
property->namespace = strdup(value->data.scalar.value);
|
property->_namespace = strdup(value->data.scalar.value);
|
||||||
} else if (0 == strcmp(key->data.scalar.value, KEY_USER)) {
|
} else if (0 == strcmp(key->data.scalar.value, KEY_USER)) {
|
||||||
property->user = strdup(value->data.scalar.value);
|
property->user = strdup(value->data.scalar.value);
|
||||||
}
|
}
|
||||||
@@ -802,8 +802,8 @@ static int append_key_map_to_mapping_node(yaml_document_t * output_document, int
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Add 'namespace': '' */
|
/* Add 'namespace': '' */
|
||||||
if (property->namespace) {
|
if (property->_namespace) {
|
||||||
if (-1 == append_key_stringvalue_to_mapping_node(output_document, map, KEY_NAMESPACE, property->namespace)) {
|
if (-1 == append_key_stringvalue_to_mapping_node(output_document, map, KEY_NAMESPACE, property->_namespace)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user