Project

General

Profile

Actions

Bug #12355

closed

Tags in directives are ignored in POST API

Added by Dmitry Svyatogorov over 6 years ago. Updated over 6 years ago.

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

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 1 (0 open1 closed)

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

Related issues 1 (0 open1 closed)

Related to Rudder - Bug #13374: Tags in rules are ignored in POST APIReleasedVincent MEMBRÉActions
Actions #1

Updated by François ARMAND over 6 years 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 !

Actions #2

Updated by Vincent MEMBRÉ over 6 years ago

  • Target version changed from 4.1.11 to 4.1.12
Actions #3

Updated by Benoît PECCATTE over 6 years ago

  • Assignee set to Vincent MEMBRÉ
Actions #4

Updated by Vincent MEMBRÉ over 6 years ago

  • Target version changed from 4.1.12 to 4.1.13
Actions #5

Updated by Benoît PECCATTE over 6 years ago

  • Target version changed from 4.1.13 to 411
Actions #6

Updated by Benoît PECCATTE over 6 years ago

  • Target version changed from 411 to 4.1.13
Actions #7

Updated by Benoît PECCATTE over 6 years ago

  • Priority changed from 80 to 79
Actions #8

Updated by François ARMAND over 6 years ago

  • Assignee changed from Vincent MEMBRÉ to Pierre HAY
Actions #9

Updated by Pierre HAY over 6 years ago

  • Status changed from New to In progress
Actions #11

Updated by Pierre HAY over 6 years 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
Actions #12

Updated by Anonymous over 6 years ago

  • Status changed from Pending technical review to Pending release
Actions #13

Updated by Vincent MEMBRÉ over 6 years 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.

Actions #14

Updated by Dmitry Svyatogorov over 6 years 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.

Actions #15

Updated by Benoît PECCATTE over 6 years ago

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

Updated by Benoît PECCATTE over 6 years ago

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

Actions

Also available in: Atom PDF