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

Change Variable with forward slash #104

Open
4 tasks
codehepta opened this issue Sep 27, 2022 · 0 comments
Open
4 tasks

Change Variable with forward slash #104

codehepta opened this issue Sep 27, 2022 · 0 comments

Comments

@codehepta
Copy link

codehepta commented Sep 27, 2022

Are you reporting a bug or a feature request ?

  • [] Bug
  • [*] Feature request

Description

I am using Patch YAML and with Slick Syntax. My Patch content is :
= /spec/template/metadata/labels/app.kubernetes.io/version => "v2022.ZZ"
The Problem here is my yaml is something like :

...
metadata:
      labels:
        app.kubernetes.io/name: something
        app.kubernetes.io/instance: something
        app.kubernetes.io/component: backend
        environment: production
        app: appname
        app.kubernetes.io/version: "v2022.XX"
...

I tried two slashes and doesnt work. Is there a way to use / in variable or it is a feature request?

Here is my pipeline output
Starting: Patch files deployment.yaml

Task : Patch YAML Files
Description : Patch YAML files using JSON patch syntax
Version : 4.0.1007
Author : Geek Learning
Help : More Information (Version 4.0.1007)

##[warning]Invalid patch at index 0
= /spec/template/metadata/labels/app.kubernetes.io/version => "v2022.ZZ"
OPERATION_PATH_UNRESOLVABLE
Cannot perform the operation at a path that does not exist
name: OPERATION_PATH_UNRESOLVABLE

Expected behavior

Describe the expected behavior

Reproduction

Insert reproduction steps here

MANDATORY FOR BUGS: Insert debug trace. If you don't provide it it makes it hard to understand what you are facing. 
To get a meaningful Trace don't forget to set System.Debug variable to true when queuing.

In order to allow us to quickly reproduce you issue please include a link to a reproduction repository

System information

VSTS or TFS:

  • VSTS
  • [ *] TFS

Agent:

  • [ *] Hosted
  • Custom

OS:

  • [ *] Windows
  • Mac
  • Linux

I tried my patch with https://json-schema-validator.herokuapp.com/jsonpatch.jsp and according to Json Pointer i changed my content as :
= /spec/template/metadata/labels/app.kubernetes.io1version => "v2022.ZZ"
this patch is working in test but not working in AzureDevops
here is the output:
= /spec/template/metadata/labels/app.kubernetes.io
1version => "something"
OPERATION_PATH_UNRESOLVABLE
Cannot perform the operation at a path that does not exist
name: OPERATION_PATH_UNRESOLVABLE
index: 0
operation: {
"op": "replace",
"path": "/spec/template/metadata/labels/app.kubernetes.io~1version",
"value": "something"
}

json-patch/json-patch-tests#42

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

1 participant