Skip to content

Commit df43dd9

Browse files
authored
Merge pull request #90796 from rohennes/OCPBUGS-53243
OCPBUGS-53243: Fixing incorrect delimiters. Clarifying syntax.
2 parents a2d0b60 + 29073ff commit df43dd9

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

modules/cluster-compare-manual-match.adoc

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@
77
[id="cluster-compare-manual-match_{context}"]
88
= Configuring manual matching between CRs and templates
99

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.
1111

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.
1319

1420
.Procedure
1521

@@ -18,12 +24,16 @@ For example, if there is more than one CR in the cluster with the same `apiversi
1824
.Example `user-config.yaml` file
1925
[source,yaml]
2026
----
21-
correlationSettings:
22-
manualCorrelation:
23-
correlationPairs:
24-
apps.v1.DaemonSet.kube-system.kindnet.yaml: "template_example.yaml" <1>
27+
correlationSettings: <1>
28+
manualCorrelation: <2>
29+
correlationPairs: <3>
30+
ptp.openshift.io/v1_PtpConfig_openshift-ptp_grandmaster: optional/ptp-config/PtpOperatorConfig.yaml <4>
31+
ptp.openshift.io/v1_PtpOperatorConfig_openshift-ptp_default: optional/ptp-config/PtpOperatorConfig.yaml
2532
----
26-
<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.
2737

2838
. Reference the user configuration file in a `cluster-compare` command by running the following command:
2939
+

modules/installing-cluster-compare.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Install the `cluster-compare` plugin to compare a reference configuration with a
2323
+
2424
[source,terminal]
2525
----
26-
$ podman login registry.access.redhat.com
26+
$ podman login registry.redhat.io
2727
----
2828

2929
. Create a container for the `cluster-compare` image by running the following command:

0 commit comments

Comments
 (0)