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);
|
||||
property->cluster = NULL;
|
||||
}
|
||||
if (property->namespace) {
|
||||
free(property->namespace);
|
||||
property->namespace = NULL;
|
||||
if (property->_namespace) {
|
||||
free(property->_namespace);
|
||||
property->_namespace = NULL;
|
||||
}
|
||||
if (property->user) {
|
||||
free(property->user);
|
||||
|
||||
@@ -45,7 +45,7 @@ extern "C" {
|
||||
union {
|
||||
struct { /* context */
|
||||
char *cluster;
|
||||
char *namespace;
|
||||
char *_namespace;
|
||||
char *user;
|
||||
};
|
||||
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)) {
|
||||
property->cluster = strdup(value->data.scalar.value);
|
||||
} 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)) {
|
||||
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': '' */
|
||||
if (property->namespace) {
|
||||
if (-1 == append_key_stringvalue_to_mapping_node(output_document, map, KEY_NAMESPACE, property->namespace)) {
|
||||
if (property->_namespace) {
|
||||
if (-1 == append_key_stringvalue_to_mapping_node(output_document, map, KEY_NAMESPACE, property->_namespace)) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user