diff --git a/pkg/compare/compare.go b/pkg/compare/compare.go index 55e8a0cf..dbe71d7e 100644 --- a/pkg/compare/compare.go +++ b/pkg/compare/compare.go @@ -8,7 +8,6 @@ import ( "errors" "fmt" "io/fs" - "math" "os" "path/filepath" "slices" @@ -34,21 +33,21 @@ import ( var ( compareLong = templates.LongDesc(` Compare a known valid reference configuration and a set of specific cluster configuration CRs. - - The reference configuration consists of Resource templates. + + The reference configuration consists of Resource templates. Resource Templates are files that contain Resource definitions and with fixed and optional content. Optional content is represented as Go templates. - The compare command will match each Resource in the cluster configuration to a Resource Template in the reference - configuration. Then, the templated Resource will be injected with the cluster Resource parameters. + The compare command will match each Resource in the cluster configuration to a Resource Template in the reference + configuration. Then, the templated Resource will be injected with the cluster Resource parameters. For each cluster Resource, a diff between the Resource and its matching injected template will be presented to the user. - + The input cluster configuration may be provided as an "offline" set of CRs or can be pulled from a live cluster. - + The Reference also includes a mandatory metadata.yaml file where all the Resource templates should be specified. The Resource templates can be divided into components. Each component and Resource template can be set as required, resulting in a report to the user in case one of them is missing. - - Each Resource definition should be in its own template file. + + Each Resource definition should be in its own template file. The input to the Go template is the "input cluster configuration" in order to allow expected user variable content to be synchronized between cluster CR and reference CR prior to the diff. The usage of all Go built-in functions is supported along with the functions in the Sprig library. @@ -56,20 +55,20 @@ var ( Before using functions that can fail for nil values, always check that the value exists. It's possible to pass a user config that contains an option to specify manual matches between cluster resources - and Resource templates. The matches can be added to the config as pairs of - apiVersion_kind_namespace_name: