-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: adds support for kvm entries upsert #488 #489
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating a KVM with upserts for plain entries that exist works, however, the output from the command shows 2 sets of values, apparently the values after deleting the "basepath" that has changed.
$ gorun kvms entries import --org=apigeex-mint-kurt --env=dev --map=issue488 --file=./testing-issue-488/issue488-update.json
{
"name": "key1",
"value": "value1"
}
{
"name": "pathsuffix",
"value": "/is/great"
}
{
"name": "pathsuffix",
"value": "/is/great"
}
{
"name": "basepath",
"value": "/christopher/duncan"
}
{
"name": "key1",
"value": "value1"
}
$ apigeeclix kvms entries list --org=apigeex-mint-kurt --env=dev --map=issue488
{
"keyValueEntries": [
{
"name": "basepath",
"value": "/christopher/duncan"
},
{
"name": "key1",
"value": "value1"
},
{
"name": "pathsuffix",
"value": "/is/great"
}
],
"nextPageToken": ""
}
Import of KVM entries with JSON values fails on the entry with JSON value.
This works if I use import on the KVM, but not on entries
$ gorun kvms entries import --org=$ORG --env=dev --map=issue488-json --file=./testing-issue-488/issue488-json.json
{
"error": {
"code": 404,
"message": "KeyValueMap(Scope=KeyValueMapScope {ScopeType ='ENVIRONMENTS', Organization = 'apigeex-mint-kurt', Environment = 'dev'},Map=issue488-json) Entry=json1 does not exist",
"status": "NOT_FOUND",
"details": [
{
"@type": "type.googleapis.com/google.rpc.PreconditionFailure",
"violations": [
{
"type": "keyvaluemap.service.keyvaluemap_entry_doesnt_exist",
"subject": "[2002:add:ddd7:0:b0:3de:d529:9714]:4004:blcbt2-20020a0566939d8200b00078702e4343:9801:504140:53193567",
"description": "KeyValueMap(Scope=KeyValueMapScope {ScopeType ='ENVIRONMENTS', Organization = 'apigeex-mint-kurt', Environment = 'dev'},Map=issue488-json) Entry=json1 does not exist"
}
]
},
{
"@type": "type.googleapis.com/google.rpc.RequestInfo",
"requestId": "7183663024520603695"
}
]
}
}
{
"error": {
"code": 404,
"message": "KeyValueMap(Scope=KeyValueMapScope {ScopeType ='ENVIRONMENTS', Organization = 'apigeex-mint-kurt', Environment = 'dev'},Map=issue488-json) Entry=pathsuffix does not exist",
"status": "NOT_FOUND",
"details": [
{
"@type": "type.googleapis.com/google.rpc.PreconditionFailure",
"violations": [
{
"type": "keyvaluemap.service.keyvaluemap_entry_doesnt_exist",
"subject": "[2002:ab0:ea91:0:b0:3db:18c2:1e66]:4001:bibik8-20020a056f19258800b003abbdcabb26:9801:967918:81993994",
"description": "KeyValueMap(Scope=KeyValueMapScope {ScopeType ='ENVIRONMENTS', Organization = 'apigeex-mint-kurt', Environment = 'dev'},Map=issue488-json) Entry=pathsuffix does not exist"
}
]
},
{
"@type": "type.googleapis.com/google.rpc.RequestInfo",
"requestId": "2143025881040377933"
}
]
}
}
{
"error": {
"code": 404,
"message": "KeyValueMap(Scope=KeyValueMapScope {ScopeType ='ENVIRONMENTS', Organization = 'apigeex-mint-kurt', Environment = 'dev'},Map=issue488-json) Entry=basepath does not exist",
"status": "NOT_FOUND",
"details": [
{
"@type": "type.googleapis.com/google.rpc.PreconditionFailure",
"violations": [
{
"type": "keyvaluemap.service.keyvaluemap_entry_doesnt_exist",
"subject": "[2002:ab0:f19a:0:b0:3de:d902:c746]:4004:bibmk11-20020a056f19390b00b00395eb164452:9801:659791:18930648",
"description": "KeyValueMap(Scope=KeyValueMapScope {ScopeType ='ENVIRONMENTS', Organization = 'apigeex-mint-kurt', Environment = 'dev'},Map=issue488-json) Entry=basepath does not exist"
}
]
},
{
"@type": "type.googleapis.com/google.rpc.RequestInfo",
"requestId": "5345608810271077102"
}
]
}
}
{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Expected , or } after key:value pair.\n:\"json1\",\"value\":\"{\"message\":\"hello\"}\"}\n ^",
"status": "INVALID_ARGUMENT"
}
}
{
"name": "pathsuffix",
"value": "/is/great"
}
{
"name": "basepath",
"value": "/christopher/duncan"
}
$ gorun kvms entries list --org=$ORG --env=dev --map=issue488-json
{
"keyValueEntries": [
{
"name": "basepath",
"value": "/christopher/duncan"
},
{
"name": "pathsuffix",
"value": "/is/great"
}
],
"nextPageToken": ""
}
Removing an entry from the entries does not remove it, but I think that's as expected. |
Test for non-json entries
test issue488.json file
Test issue488-update.json file
|
Test for issue4880json
test issue488-json.json file
test issue488-json-update.json file
|
Everything works, but wondering about outputs: Import with changed entries I don't see anything, so I don't really know if anything happened. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.