Skip to content
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

Delete KVM entry does not delete entry #61

Closed
deboraelkin2 opened this issue Aug 19, 2022 · 1 comment
Closed

Delete KVM entry does not delete entry #61

deboraelkin2 opened this issue Aug 19, 2022 · 1 comment

Comments

@deboraelkin2
Copy link

The command to delete a KVM entry seems to execute successfully. For instance

$ apigeecli -t $TOKEN -o $PROJECT -e $APIGEE_ENV kvms entries delete --map CDSConfig --key HOK_mtlsHostname 
WARNING: 2022/08/19 12:00:17 clifile.go:234: stat /Users/xxxxx/.apigeecli/config.json: not a directory
WARNING: 2022/08/19 12:00:17 clifile.go:234: stat /Users/xxxxx/.apigeecli/config.json: not a directory
{
	"name": "HOK_mtlsHostname",
	"value": "mtls-eval-group.xxxxx.nip.io"
}

However, if I then get the KVM entry, it is still there:

$ apigeecli -t $TOKEN -o $PROJECT -e $APIGEE_ENV kvms entries get --map CDSConfig --key HOK_mtlsHostname 
WARNING: 2022/08/19 12:02:57 clifile.go:234: stat /Users/xxxxx/.apigeecli/config.json: not a directory
WARNING: 2022/08/19 12:02:57 clifile.go:234: stat /Users/xxxxx/.apigeecli/config.json: not a directory
{
	"name": "HOK_mtlsHostname",
	"value": "mtls-eval-group.xxxxx.nip.io"
}


If, on the other hand, I issue the Apigee API call to delete that entry, it works:

$ curl --request DELETE https://apigee.googleapis.com/v1/organizations/$PROJECT/environments/$APIGEE_ENV/keyvaluemaps/CDSConfig/entries/HOK_mtlsHostname \
> --header "Authorization: Bearer $TOKEN"
{
  "name": "HOK_mtlsHostname",
  "value": "mtls-eval-group.35-227-222-116.nip.io"
}
$ apigeecli -t $TOKEN -o $PROJECT -e $APIGEE_ENV kvms entries get --map CDSConfig --key HOK_mtlsHostname 
WARNING: 2022/08/19 12:06:11 clifile.go:234: stat /Users/xxxx/.apigeecli/config.json: not a directory
WARNING: 2022/08/19 12:06:11 clifile.go:234: stat /Users/xxxx/.apigeecli/config.json: not a directory
ERROR: 2022/08/19 12:06:13 httpclient.go:369: status code 404, error in response: {
  "error": {
    "code": 404,
    "message": "KeyValueMap(Scope=KeyValueMapScope {ScopeType ='ENVIRONMENTS', Organization = 'xxxxx', Environment = 'eval'},Map=CDSConfig) Entry=HOK_mtlsHostname does not exist",
    "status": "NOT_FOUND",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.PreconditionFailure",
        "violations": [
          {
            "type": "keyvaluemap.service.keyvaluemap_entry_doesnt_exist",
            "subject": "[2002:a17:90b:46c1::]:4217:sabx12:9863:356973:110923981",
            "description": "KeyValueMap(Scope=KeyValueMapScope {ScopeType ='ENVIRONMENTS', Organization = 'xxxxx', Environment = 'eval'},Map=CDSConfig) Entry=HOK_mtlsHostname does not exist"
          }
        ]
      },
      {
        "@type": "type.googleapis.com/google.rpc.RequestInfo",
        "requestId": "2445294064319891746"
      }
    ]
  }
}
@srinandan
Copy link
Collaborator

Yep! This is a bug. The wrong method is called

_, err = kvm.GetEntry(proxyName, mapName, keyName)

I will fix it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants