You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/cluster-compare-manual-match.adoc
+17-7Lines changed: 17 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,15 @@
7
7
[id="cluster-compare-manual-match_{context}"]
8
8
= Configuring manual matching between CRs and templates
9
9
10
-
For scenarios where the `cluster-compare` plugin's default matching does not work as expected, you can manually match a custom resource (CR) to a template.
10
+
In some cases, the `cluster-compare` plugin's default matching might not work as expected. You can manually define how a custom resource (CR) maps to a template by using a user configuration file.
11
11
12
-
For example, if there is more than one CR in the cluster with the same `apiversion`, `kind`, `name`, and `namespace` fields, the plugin's default matching compares the CR that features the least differences. To control what CR the plugin chooses, you can create a user configuration YAML file with the manual matching configuration, then pass this configuration file to the `cluster-compare` command.
12
+
By default, the plugin maps a CR to a template based on the `apiversion`, `kind`, `name`, and `namespace` fields. However, multiple templates might match a single CR. For example, this can occur in the following scenarios:
13
+
14
+
* Multiple templates exist with the same `apiversion`, `kind`, `name`, and `namespace` fields.
15
+
16
+
* Templates match any CR with a specific `apiversion` and `kind`, regardless of its `namespace` or `name`.
17
+
18
+
When a CR matches multiple templates, the plugin uses a tie-breaking mechanism that selects the template with the fewest differences. To explicitly control which template the plugin chooses, you can create a user configuration YAML file that defines manual matching rules. You can pass this configuration file to the `cluster-compare` command to enforce the required template selection.
13
19
14
20
.Procedure
15
21
@@ -18,12 +24,16 @@ For example, if there is more than one CR in the cluster with the same `apiversi
<1> Specifies the CR and template pair to match. The CR specification uses the following format: `<apiversion>.<kind>.<namespace>.<name>`. For cluster scoped CRs that do not have a namespace, use the format `<apiversion>.<kind>.<name>`.
33
+
<1> The `correlationSettings` section contains the manual correlation settings.
34
+
<2> The `manualCorrelation` section specifies that manual correlation is enabled.
35
+
<3> The `correlationPairs` section lists the CR and template pairs to manually match.
36
+
<4> Specifies the CR and template pair to match. The CR specification uses the following format: `<apiversion>_<kind>_<namespace>_<name>`. For cluster-scoped CRs that do not have a namespace, use the following format: `<apiversion>_<kind>_<name>`. The path to the template must be relative to the `metadata.yaml` file.
27
37
28
38
. Reference the user configuration file in a `cluster-compare` command by running the following command:
0 commit comments