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

Support for space in entry name for KVM #214

Closed
Jimbo51000 opened this issue Sep 24, 2024 · 12 comments
Closed

Support for space in entry name for KVM #214

Jimbo51000 opened this issue Sep 24, 2024 · 12 comments

Comments

@Jimbo51000
Copy link

I am getting a http ERROR

"code": 409, "message": "KeyValueMapEntry TestMap__Test PPP already exists in map testsite_kvmap", { "@type": "type.googleapis.com/google.rpc.PreconditionFailure", "violations": [ { "type": "keyvaluemap.service.KeyValueMapEntryAlreadyExists", } ] },
when trying to update the value of this entry in my resources kvm org config folder in kvms.json file. A kvm entry with name "TestMap__Test PPP" already exists in the runtime kvm map. I believe this issue happens because the mvn plugin is making a POST request to create an entry without deleting it first. This would not have happened if the kvm name was in the list of existingKVM entries fetched with RestUtils. Is there an issue in fetching the current runtime KVM entries with your RestUtils that doesn't consider spaces in kvm entry name?
image

@ssvaidyanathan
Copy link
Collaborator

@Jimbo51000 - can you please share the version you are using and the command you are running?

@Jimbo51000
Copy link
Author

i am using 2.8.1 and command is :
mvn -X apigee-config:keyvaluemaps -Pcicd -Dfile=$APIGEE_TARGET_TOKEN -Dorg=$APIGEE_ORG -Dapigee.config.options=update -Dapigee.config.dir=$kvm_path -Dapigee.kvm.override=false

@ssvaidyanathan
Copy link
Collaborator

ssvaidyanathan commented Sep 24, 2024

-Dapigee.kvm.override=false --> why are you passing that. Thats why its skipping

Check the plugin README

-Dapigee.kvm.override=true|false
     is used only when -Dapigee.config.options=update. 
     It overrides the KVM entries even if there are no changes. 
     Default is true. If set to false, it skips the entry update.

@Jimbo51000
Copy link
Author

Jimbo51000 commented Sep 24, 2024

This config works for kvm entry updates where key names do not have space in them. And I believe we had an earlier thread : #207 (comment) for why we needed the override,

@ssvaidyanathan
Copy link
Collaborator

so TestMap__Test PPP is a key and not the map name right?

@Jimbo51000
Copy link
Author

  {
    "name": "TestMap__Test PPP",
    "value": "test3"
  }
  
  This is the entry for the KVM map. And yes, it is a key name not a kvm map name.

@ssvaidyanathan
Copy link
Collaborator

so just to be clear, this entry is not present in the map currently... and you are trying to push this using the "update" option, correct?

@Jimbo51000
Copy link
Author

The entry is currently present in the runtime and went through in the first run of the plugin call. This was because the entry was absent in the runtime and the POST call from mvn created a new entry. The problem here is the mvn plugin is still making that POST call eventhough the entry exists. This should just be an regular update as any and have tried different kvm name characters. Space seems to throw the error.

@ssvaidyanathan
Copy link
Collaborator

Ok - must be a bug in the way how I check the entry:value
will fix and provide an update

@Jimbo51000
Copy link
Author

Thanks. Please keep us posted.

ssvaidyanathan added a commit that referenced this issue Sep 25, 2024
ssvaidyanathan added a commit that referenced this issue Sep 25, 2024
@ssvaidyanathan
Copy link
Collaborator

Just released v2.9.1
Can you test your cases with that and let me know if its working as expected.

@Jimbo51000
Copy link
Author

thanks. works.

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