Project

General

Profile

Bug #12355

Tags in directives are ignored in POST API

Added by Dmitry Svyatogorov 8 months ago. Updated 3 months ago.

Status:
Released
Priority:
N/A
Category:
API
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
User visibility:
Operational - other Techniques | Technique editor | Rudder settings
Effort required:
Very Small
Priority:
76

Description

Though "tags" array is present in the POST query for directive, e.g.

"tags": [{"ubuntu": "etc"}]

they are silently ignored. Problem presents till current Rudder 4.1.10.

Sample json containing tags (preformatted):

{
    "policyMode": "default",
    "displayName": "/etc/init.d/atop",
    "parameters": {
        "section": {
            "sections": [
                {
                    "section": {
                        "sections": [
                            {
                                "section": {
                                    "sections": [
                                        {
                                            "section": {
                                                "name": "Exclusion/Inclusion",
                                                "vars": [
                                                    {
                                                        "var": {
                                                            "name": "COPYFILE_EXCLUDE_INCLUDE",
                                                            "value": "" 
                                                        }
                                                    },
                                                    {
                                                        "var": {
                                                            "name": "COPYFILE_EXCLUDE_INCLUDE_OPTION",
                                                            "value": "none" 
                                                        }
                                                    }
                                                ]
                                            }
                                        }
                                    ],
                                    "name": "Copy file",
                                    "vars": [
                                        {
                                            "var": {
                                                "name": "COPYFILE_COMPARE_METHOD",
                                                "value": "digest" 
                                            }
                                        },
                                        {
                                            "var": {
                                                "name": "COPYFILE_DESTINATION",
                                                "value": "/etc/init.d/atop" 
                                            }
                                        },
                                        {
                                            "var": {
                                                "name": "COPYFILE_GROUP",
                                                "value": "root" 
                                            }
                                        },
                                        {
                                            "var": {
                                                "name": "COPYFILE_NAME",
                                                "value": "atop/etc/init.d/atop" 
                                            }
                                        },
                                        {
                                            "var": {
                                                "name": "COPYFILE_OWNER",
                                                "value": "root" 
                                            }
                                        },
                                        {
                                            "var": {
                                                "name": "COPYFILE_PERM",
                                                "value": "755" 
                                            }
                                        },
                                        {
                                            "var": {
                                                "name": "COPYFILE_PURGE",
                                                "value": "false" 
                                            }
                                        },
                                        {
                                            "var": {
                                                "name": "COPYFILE_RECURSION",
                                                "value": "0" 
                                            }
                                        },
                                        {
                                            "var": {
                                                "name": "COPYFILE_SGID",
                                                "value": "false" 
                                            }
                                        },
                                        {
                                            "var": {
                                                "name": "COPYFILE_STICKY_FOLDER",
                                                "value": "false" 
                                            }
                                        },
                                        {
                                            "var": {
                                                "name": "COPYFILE_SUID",
                                                "value": "false" 
                                            }
                                        }
                                    ]
                                }
                            },
                            {
                                "section": {
                                    "name": "Post-modification hook",
                                    "vars": [
                                        {
                                            "var": {
                                                "name": "COPYFILE_POST_HOOK_COMMAND",
                                                "value": "" 
                                            }
                                        },
                                        {
                                            "var": {
                                                "name": "COPYFILE_POST_HOOK_RUN",
                                                "value": "false" 
                                            }
                                        }
                                    ]
                                }
                            }
                        ],
                        "name": "Copy file and PostHook" 
                    }
                }
            ],
            "name": "sections" 
        }
    },
    "tags": [
        {
            "ubuntu": "etc" 
        }
    ],
    "enabled": true,
    "system": false,
    "techniqueVersion": "2.1",
    "longDescription": "",
    "priority": 5,
    "techniqueName": "copyGitFile",
    "shortDescription": "atop fixed init script" 
}


Subtasks

Bug #12796: Compilation is broken with #12355 upmergeReleasedVincent MEMBRÉ

Related issues

Related to Rudder - Bug #13374: Tags in rules are ignored in POST APIReleased

Associated revisions

Revision 95cca05c (diff)
Added by Pierre Hay 6 months ago

Fixes #12355: Tags in directives are ignored in POST API

History

#1 Updated by François ARMAND 8 months ago

  • Severity set to Major - prevents use of part of Rudder | no simple workaround
  • User visibility set to Operational - other Techniques | Technique editor | Rudder settings
  • Effort required set to Very Small
  • Priority changed from 0 to 80

Thanks for reporting !

#2 Updated by Vincent MEMBRÉ 8 months ago

  • Target version changed from 4.1.11 to 4.1.12

#3 Updated by Benoît PECCATTE 8 months ago

  • Assignee set to Vincent MEMBRÉ

#4 Updated by Vincent MEMBRÉ 7 months ago

  • Target version changed from 4.1.12 to 4.1.13

#5 Updated by Benoît PECCATTE 7 months ago

  • Target version changed from 4.1.13 to 411

#6 Updated by Benoît PECCATTE 7 months ago

  • Target version changed from 411 to 4.1.13

#7 Updated by Benoît PECCATTE 7 months ago

  • Priority changed from 80 to 79

#8 Updated by François ARMAND 6 months ago

  • Assignee changed from Vincent MEMBRÉ to Pierre HAY

#9 Updated by Pierre HAY 6 months ago

  • Status changed from New to In progress

#11 Updated by Pierre HAY 6 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Pierre HAY to Vincent MEMBRÉ
  • Pull Request set to https://github.com/Normation/rudder/pull/1970

#12 Updated by Anonymous 6 months ago

  • Status changed from Pending technical review to Pending release

#13 Updated by Vincent MEMBRÉ 5 months ago

  • Status changed from Pending release to Released
  • Priority changed from 79 to 77

This bug has been fixed in Rudder 4.1.13, 4.2.7 and 4.3.3 which were released today.

#14 Updated by Dmitry Svyatogorov 3 months ago

  • Priority changed from 77 to 76

Please fix the same problem with rules, still exists in current Rudder 4.1.14.
Example json:

{"displayName": "#old test rule", "tags": [{"actual": "0"}], "enabled": true, "system": false, "id": "e848b263-2afb-403f-9c68-9e645caba5c9", "directives": [], "longDescription": "", "shortDescription": "", "targets": [{"exclude": {"or": []}, "include": {"or": []}}]}

Request is ok (I've tested it with POST), but nothing happens with tags in directive.

answer body is:
{"action":"updateRule","id":"e848b263-2afb-403f-9c68-9e645caba5c9","result":"success","data":{"rules":[{"id":"e848b263-2afb-403f-9c68-9e645caba5c9","displayName":"#old test rule","shortDescription":"","longDescription":"","directives":[],"targets":[{"include":{"or":[]},"exclude":{"or":[]}}],"enabled":true,"system":false,"tags":[{"actual":"1"}]}]}}

…and tags in web-interface remains in the same state.

#15 Updated by Benoît PECCATTE 3 months ago

  • Related to Bug #13374: Tags in rules are ignored in POST API added

#16 Updated by Benoît PECCATTE 3 months ago

Dimitry: I created #13374 to follow the fixup of this case

Also available in: Atom PDF