Skip to content

Commit

Permalink
Merge pull request #10 from dalton-hill-0/renaming-resource-key
Browse files Browse the repository at this point in the history
Renaming Field for Consistency
  • Loading branch information
dalton-hill-0 authored Aug 20, 2024
2 parents e27c258 + 1c3f0ad commit 922052d
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 57 deletions.
2 changes: 1 addition & 1 deletion fn.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func matchResources(ctx context.Context, mc v1beta1.Matcher, observedMap map[str

rs := map[string]*fnv1beta1.Resource{}
for i, r := range mc.Resources {
re, err := regexp.Compile(r.Key)
re, err := regexp.Compile(r.Name)
if err != nil {
log.Info("cannot compile resource key regex", "resourcesIndex", i, "error", err)
return false, nil, errors.Wrapf(err, "cannot compile resource key regex, resourcesIndex: %d", i)
Expand Down
102 changes: 51 additions & 51 deletions fn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -160,7 +160,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -189,7 +189,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -218,7 +218,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -247,7 +247,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -357,7 +357,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand All @@ -371,7 +371,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -400,7 +400,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand All @@ -414,7 +414,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -509,7 +509,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -563,7 +563,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -680,7 +680,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -831,7 +831,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "resource-key-a"
"name": "resource-key-a"
}
],
"conditions": [
Expand Down Expand Up @@ -915,7 +915,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "resource-key-a"
"name": "resource-key-a"
}
],
"conditions": [
Expand Down Expand Up @@ -944,7 +944,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "resource-key-does-not-match"
"name": "resource-key-does-not-match"
}
],
"conditions": [
Expand Down Expand Up @@ -1035,7 +1035,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -1121,7 +1121,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-(?!)"
"name": "example-(?!)"
}
],
"conditions": [
Expand Down Expand Up @@ -1206,7 +1206,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -1292,7 +1292,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -1322,7 +1322,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -1463,7 +1463,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -1548,7 +1548,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -1638,7 +1638,7 @@ func TestRunFunction(t *testing.T) {
{
"resources": [
{
"key": "example-mr"
"name": "example-mr"
}
],
"conditions": [
Expand Down Expand Up @@ -1745,10 +1745,10 @@ func TestRunFunction(t *testing.T) {
"type": "AnyResourceMatchesAnyCondition",
"resources": [
{
"key": "resource-a"
"name": "resource-a"
},
{
"key": "resource-b"
"name": "resource-b"
}
],
"conditions": [
Expand Down Expand Up @@ -1782,10 +1782,10 @@ func TestRunFunction(t *testing.T) {
"type": "AnyResourceMatchesAnyCondition",
"resources": [
{
"key": "resource-a"
"name": "resource-a"
},
{
"key": "resource-b"
"name": "resource-b"
}
],
"conditions": [
Expand Down Expand Up @@ -1843,10 +1843,10 @@ func TestRunFunction(t *testing.T) {
"type": "AnyResourceMatchesAnyCondition",
"resources": [
{
"key": "resource-a"
"name": "resource-a"
},
{
"key": "resource-b"
"name": "resource-b"
}
],
"conditions": []
Expand Down Expand Up @@ -1944,10 +1944,10 @@ func TestRunFunction(t *testing.T) {
"type": "AnyResourceMatchesAllConditions",
"resources": [
{
"key": "resource-a"
"name": "resource-a"
},
{
"key": "resource-b"
"name": "resource-b"
}
],
"conditions": [
Expand Down Expand Up @@ -1979,10 +1979,10 @@ func TestRunFunction(t *testing.T) {
"type": "AnyResourceMatchesAllConditions",
"resources": [
{
"key": "resource-a"
"name": "resource-a"
},
{
"key": "resource-b"
"name": "resource-b"
}
],
"conditions": [
Expand Down Expand Up @@ -2039,10 +2039,10 @@ func TestRunFunction(t *testing.T) {
"type": "AnyResourceMatchesAllConditions",
"resources": [
{
"key": "resource-a"
"name": "resource-a"
},
{
"key": "resource-b"
"name": "resource-b"
}
],
"conditions": []
Expand Down Expand Up @@ -2151,10 +2151,10 @@ func TestRunFunction(t *testing.T) {
"type": "AllResourcesMatchAnyCondition",
"resources": [
{
"key": "resource-a"
"name": "resource-a"
},
{
"key": "resource-b"
"name": "resource-b"
}
],
"conditions": [
Expand Down Expand Up @@ -2186,13 +2186,13 @@ func TestRunFunction(t *testing.T) {
"type": "AllResourcesMatchAnyCondition",
"resources": [
{
"key": "resource-a"
"name": "resource-a"
},
{
"key": "resource-b"
"name": "resource-b"
},
{
"key": "resource-c"
"name": "resource-c"
}
],
"conditions": [
Expand Down Expand Up @@ -2248,10 +2248,10 @@ func TestRunFunction(t *testing.T) {
"type": "AllResourcesMatchAnyCondition",
"resources": [
{
"key": "resource-a"
"name": "resource-a"
},
{
"key": "resource-b"
"name": "resource-b"
}
],
"conditions": []
Expand Down Expand Up @@ -2390,10 +2390,10 @@ func TestRunFunction(t *testing.T) {
"type": "AllResourcesMatchAllConditions",
"resources": [
{
"key": "resource-a"
"name": "resource-a"
},
{
"key": "resource-b"
"name": "resource-b"
}
],
"conditions": [
Expand Down Expand Up @@ -2425,10 +2425,10 @@ func TestRunFunction(t *testing.T) {
"type": "AllResourcesMatchAllConditions",
"resources": [
{
"key": "resource-a"
"name": "resource-a"
},
{
"key": "resource-b"
"name": "resource-b"
}
],
"conditions": [
Expand Down Expand Up @@ -2460,13 +2460,13 @@ func TestRunFunction(t *testing.T) {
"type": "AllResourcesMatchAllConditions",
"resources": [
{
"key": "resource-a"
"name": "resource-a"
},
{
"key": "resource-b"
"name": "resource-b"
},
{
"key": "resource-c"
"name": "resource-c"
}
],
"conditions": [
Expand Down Expand Up @@ -2522,10 +2522,10 @@ func TestRunFunction(t *testing.T) {
"type": "AllResourcesMatchAllConditions",
"resources": [
{
"key": "resource-a"
"name": "resource-a"
},
{
"key": "resource-b"
"name": "resource-b"
}
],
"conditions": []
Expand Down
Loading

0 comments on commit 922052d

Please sign in to comment.