Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional Pod Controller Scans #166

Merged
merged 32 commits into from
Jul 31, 2019
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
eb3741c
Additions
Jul 6, 2019
bbec130
Added additionally supported Controllers to test config
Jul 16, 2019
b92d7c7
Added docs pages per request
nickfw Jul 23, 2019
c7702e6
Merge branch 'master' into nh/add-more-controller-support
nickfw Jul 23, 2019
18b9f6d
Copyright rename
nickfw Jul 23, 2019
8d3c08e
Adjusted office hours name
nickfw Jul 23, 2019
824d210
Adjustments
nickfw Jul 23, 2019
355b8da
Adjusted docs movement which apparently affects the dashboard :?
nickfw Jul 23, 2019
2f72309
Added functionality to webhook
nickfw Jul 23, 2019
4dc3b0c
Added testing for getting supported controllers from string
nickfw Jul 23, 2019
f0b7ce9
Adjustments
nickfw Jul 24, 2019
4ac9257
Added RBAC changes
nickfw Jul 24, 2019
6f73ffb
Adjusted version
nickfw Jul 24, 2019
77293c4
Adjusted version in main.go
nickfw Jul 24, 2019
8f7def8
added testing for binary image
nickfw Jul 24, 2019
5204b14
Adjustements getting tag filter back
nickfw Jul 24, 2019
832142c
Adjusted sha
nickfw Jul 24, 2019
c066dea
Merge branch 'master' into nh/add-more-controller-support
Jul 25, 2019
7963b3c
Merge branch 'master' into nh/add-more-controller-support
nickfw Jul 31, 2019
641ed8c
Adjusted naming to match master
nickfw Jul 31, 2019
05ae1e8
matching license naming
nickfw Jul 31, 2019
770017f
adjusted copyright info
nickfw Jul 31, 2019
b815b54
Added new supported type to tests
nickfw Jul 31, 2019
fb8e5ed
Added supported controllers to webhook
nickfw Jul 31, 2019
15b8ef2
Adjusted version in webhook accidentally
nickfw Jul 31, 2019
bbdd924
Added refactor of webhook registration
nickfw Jul 31, 2019
f16bc3d
Adjusted naming of webhooks to conform to DNS-1123
nickfw Jul 31, 2019
59531c8
Adjust method of registration
nickfw Jul 31, 2019
9e398a2
Adjusted webhook and dashboard plus fixed view of new controllers
nickfw Jul 31, 2019
ea06a36
Adjusted request
nickfw Jul 31, 2019
b64c03c
Merge branch 'master' into nh/add-more-controller-support
Jul 31, 2019
c168c01
Added requested change
nickfw Jul 31, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added testing for getting supported controllers from string
  • Loading branch information
nickfw committed Jul 23, 2019
commit 4dc3b0c6356c1972bb8a4edee337907d38d28108
20 changes: 20 additions & 0 deletions pkg/config/supportedcontrollers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"encoding/json"
"fmt"
"testing"

"github.com/stretchr/testify/assert"
)

type checkMarshal struct {
Expand Down Expand Up @@ -103,3 +105,21 @@ func TestCheckIfControllerKindIsConfiguredForValidation(t *testing.T) {
}
}
}

func TestGetSupportedControllerFromString(t *testing.T) {
fixture := map[string]SupportedController{
"": Unsupported,
"asdfasdf": Unsupported,
"\000": Unsupported,
"deployMENTS": Deployments,
"JOB": Jobs,
}

for inputString, expectedType := range fixture {
resolvedType, err := GetSupportedControllerFromString(inputString)
if expectedType == Unsupported && err == nil {
t.Errorf("Expected (%s) to resolve to an unsupported type and throw an error.", inputString)
}
assert.Equal(t, expectedType, resolvedType, fmt.Sprintf("Expected (%s) to return (%s) controller type.", inputString, expectedType))
}
}