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

CFE-4442: Clarified need for namespace to be specified when defining a custom policy update bundle (3.21) #2951

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions MPF.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,16 @@ Override this bundle by setting `def.mpf_update_policy_bundle` via augments:

```json
{
"vars": {
"mpf_update_policy_bundle": "MyCustomPolicyUpdateBundle"
"variables": {
"default:def.mpf_update_policy_bundle": {
"value": "default:MyCustomPolicyUpdateBundle"
}
}
}
```

**NOTE:** Be sure to specify the namespace the bundle is in, for example, `default`.

**History:**

* Introduced in 3.12.0
Expand Down
14 changes: 6 additions & 8 deletions cfe_internal/update/update_policy.cf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bundle agent cfe_internal_update_policy

# Look for a bundle that matches what the user wants
"found_matching_user_specified_bundle"
slist => bundlesmatching( "$(def.mpf_update_policy_bundle)" );
slist => bundlesmatching( "^$(def.mpf_update_policy_bundle)$" );

methods:

Expand Down Expand Up @@ -71,18 +71,16 @@ bundle agent cfe_internal_update_policy
inform_mode|verbose_mode|DEBUG|DEBUG_cfe_internal_update_policy::
# Report a human readable way to understand the policy behavior

"Found user specified update bundle."
if => "have_user_specified_update_bundle";

"User specified update bundle: $(def.mpf_update_policy_bundle)"
if => "have_user_specified_update_bundle";

"User specified update bundle MISSING! Falling back to $(default_policy_update_bundle)."
if => and( "have_user_specified_update_bundle",
"missing_user_specified_update_bundle"
);


"missing_user_specified_update_bundle" );
any::
"WARNING User specified update bundle '$(def.mpf_update_policy_bundle)' does not specify a namespace. Please specify a namespace, e.g. 'default:$(def.mpf_update_policy_bundle)'."
if => and( not(regcmp( ".*:.*", $(def.mpf_update_policy_bundle) ) ),
"have_user_specified_update_bundle" );
}

bundle agent cfe_internal_setup_python_symlink(symlink_path)
Expand Down
Loading