-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from weaveworks/dev
Reference flux objects in violations events instead of the original resource object
- Loading branch information
Showing
8 changed files
with
122 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
apiVersion: v2 | ||
appVersion: "1.2.0" | ||
appVersion: "1.2.1" | ||
description: A Helm chart for Kubernetes to configure the policy agent | ||
name: policy-agent | ||
version: 1.2.0 | ||
version: 1.2.1 | ||
maintainers: | ||
- name: Weaveworks | ||
email: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
internal/sink/flux-notification/utils.go → internal/utils/utils.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package utils | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestGetFluxObject(t *testing.T) { | ||
fluxObj := GetFluxObject(map[string]string{}) | ||
|
||
if fluxObj != nil { | ||
t.Error("unexpected flux object") | ||
} | ||
|
||
for apiVersion, kind := range fluxControllerKindMap { | ||
fluxObj := GetFluxObject(map[string]string{ | ||
fmt.Sprintf("%s/name", apiVersion): "my-app", | ||
fmt.Sprintf("%s/namespace", apiVersion): "default", | ||
}) | ||
|
||
assert.NotEqual(t, fluxObj, nil) | ||
|
||
assert.Equal(t, fluxObj.GetAPIVersion(), apiVersion) | ||
assert.Equal(t, fluxObj.GetKind(), kind) | ||
assert.Equal(t, fluxObj.GetNamespace(), "default") | ||
assert.Equal(t, fluxObj.GetName(), "my-app") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.2.0 | ||
1.2.1 |