Repository: syngit-org/syngit (language: go)

Issue:
[BUG]: `excludedFields` are not recursives
### Describe the bug

Considering this object:
```yaml
kind: MyObject
...
spec:
  field1: "test"
  field2: "test"
...
```

Currently, in the `RemoteSyncer`, this configuration will not exclude anything:
```yaml
apiVersion: syngit.io/v1beta3
kind: RemoteSyncer
...
spec:
  excludedFields:
    - spec
```

While this one will exclude the fields:
```yaml
apiVersion: syngit.io/v1beta3
kind: RemoteSyncer
...
spec:
  excludedFields:
    - spec.field1
    - spec.field2
```

We want the first configuration to exclude the `spec.field1` and `spec.field2` as well.

### To Reproduce

1. Create a Kubernetes resource
2. Try to exclude a "non-final" field of this resource. In other words, a field that contains other fields

### Expected behavior

It should exclude all sub-fields of the "non-final" field.

### System infos

- Syngit version: 0.4.1
- RemoteSyncer `apiVersion`: v1beta3

### How to solve this issue

Change this function:
https://github.com/syngit-org/syngit/blob/8908e43ebd78c6004afafe8699ef8b8f8e5c6272/pkg/utils/parser.go#L35

When taking this path as input: `spec`, it should excluded `spec.field1` AND `spec.field2`.


Discussion / hints:

Fix patch:
diff --git a/pkg/utils/parser.go b/pkg/utils/parser.go
index 0083ce8..91a0b25 100644
--- a/pkg/utils/parser.go
+++ b/pkg/utils/parser.go
@@ -34,9 +34,9 @@ package utils
 //	    test6: value
 func ExcludedFieldsFromJson(data map[string]interface{}, path string) {
 	parts := make([]string, 0)
-
 	var current string
 	inBrackets := false
+
 	for _, char := range path {
 		switch char {
 		case '.':
@@ -67,28 +67,32 @@ func ExcludedFieldsFromJson(data map[string]interface{}, path string) {
 	if current != "" {
 		parts = append(parts, current)
 	}
+
+	if len(parts) == 0 {
+		return
+	}
+
 	last := len(parts) - 1
+	currentMap := data
 
-	// Traverse the map based on the path
 	for i, part := range parts {
 		if i == last {
-			// Last part of the path, delete the field
-			delete(data, part)
+			// Delete the last part from the current map
+			delete(currentMap, part)
 			return
 		}
-		// Move to the next level of the map
-		val, ok := data[part]
+
+		// Traverse deeper
+		val, ok := currentMap[part]
 		if !ok {
 			// Path not found
 			return
 		}
-		// Check if the value is a map
-		next, ok := val.(map[string]interface{})
+		nextMap, ok := val.(map[string]interface{})
 		if !ok {
-			// Not a map, cannot traverse further
+			// Can't descend further, not a map
 			return
 		}
-		// Update data for next iteration
-		data = next
+		currentMap = nextMap
 	}
 }


Test patch: