@@ -61,6 +61,7 @@ func (j *jsonPatchGenerator) Generate(_ context.Context, _ client.Object, req *r
61
61
errs := []error {}
62
62
for i := range req .Items {
63
63
item := & req .Items [i ]
64
+ objectKind := item .Object .Object .GetObjectKind ().GroupVersionKind ().Kind
64
65
65
66
templateVariables := patchvariables .ToMap (item .Variables )
66
67
@@ -81,13 +82,13 @@ func (j *jsonPatchGenerator) Generate(_ context.Context, _ client.Object, req *r
81
82
// Merge template-specific and global variables.
82
83
variables , err := patchvariables .MergeVariableMaps (globalVariables , templateVariables )
83
84
if err != nil {
84
- errs = append (errs , errors .Wrapf (err , "failed to merge global and template-specific variables for item with uid %q" , item . UID ))
85
+ errs = append (errs , errors .Wrapf (err , "failed to merge global and template-specific variables for %q" , objectKind ))
85
86
continue
86
87
}
87
88
88
89
enabled , err := patchIsEnabled (j .patch .EnabledIf , variables )
89
90
if err != nil {
90
- errs = append (errs , errors .Wrapf (err , "failed to calculate if patch %s is enabled for item with uid %q" , j . patch . Name , item . UID ))
91
+ errs = append (errs , errors .Wrapf (err , "failed to calculate if patch is enabled for %q" , objectKind ))
91
92
continue
92
93
}
93
94
if ! enabled {
@@ -100,7 +101,7 @@ func (j *jsonPatchGenerator) Generate(_ context.Context, _ client.Object, req *r
100
101
// Generate JSON patches.
101
102
jsonPatches , err := generateJSONPatches (patch .JSONPatches , variables )
102
103
if err != nil {
103
- errs = append (errs , errors .Wrapf (err , "failed to generate JSON patches for item with uid %q" , item . UID ))
104
+ errs = append (errs , errors .Wrapf (err , "failed to generate JSON patches for %q" , objectKind ))
104
105
continue
105
106
}
106
107
0 commit comments