Skip to content

Commit

Permalink
Merge pull request kubernetes#4948 from GoogleCloudPlatform/revert-48…
Browse files Browse the repository at this point in the history
…83-fix_tcpsocket_validation

Revert "TCPSocket could not be used as it was not checked in validation"
  • Loading branch information
zmerlynn committed Mar 2, 2015
2 parents c7cbc5c + 4937008 commit 148ce12
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 56 deletions.
8 changes: 0 additions & 8 deletions pkg/api/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,14 +469,6 @@ func validateTCPSocketAction(tcp *api.TCPSocketAction) errs.ValidationErrorList
return allErrors
}

func validateTCPSocketAction(tcp *api.TCPSocketAction) errs.ValidationErrorList {
allErrors := errs.ValidationErrorList{}
if len(tcp.Port.StrVal) == 0 && tcp.Port.IntVal == 0 {
allErrors = append(allErrors, errs.NewFieldRequired("port", tcp.Port))
}
return allErrors
}

func validateHandler(handler *api.Handler) errs.ValidationErrorList {
numHandlers := 0
allErrors := errs.ValidationErrorList{}
Expand Down
48 changes: 0 additions & 48 deletions pkg/api/validation/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,32 +496,6 @@ func TestValidateContainers(t *testing.T) {
ImagePullPolicy: "IfNotPresent",
},
},
"invalid lifecycle, no tcp socket port.": {
{
Name: "life-123",
Image: "image",
Lifecycle: &api.Lifecycle{
PreStop: &api.Handler{
TCPSocket: &api.TCPSocketAction{},
},
},
ImagePullPolicy: "IfNotPresent",
},
},
"invalid lifecycle, zero tcp socket port.": {
{
Name: "life-123",
Image: "image",
Lifecycle: &api.Lifecycle{
PreStop: &api.Handler{
TCPSocket: &api.TCPSocketAction{
Port: util.IntOrString{IntVal: 0},
},
},
},
ImagePullPolicy: "IfNotPresent",
},
},
"invalid lifecycle, no action.": {
{
Name: "life-123",
Expand All @@ -532,28 +506,6 @@ func TestValidateContainers(t *testing.T) {
ImagePullPolicy: "IfNotPresent",
},
},
"invalid liveness probe, no tcp socket port.": {
{
Name: "life-123",
Image: "image",
LivenessProbe: &api.Probe{
Handler: api.Handler{
TCPSocket: &api.TCPSocketAction{},
},
},
ImagePullPolicy: "IfNotPresent",
},
},
"invalid liveness probe, no action.": {
{
Name: "life-123",
Image: "image",
LivenessProbe: &api.Probe{
Handler: api.Handler{},
},
ImagePullPolicy: "IfNotPresent",
},
},
"privilege disabled": {
{Name: "abc", Image: "image", Privileged: true},
},
Expand Down

0 comments on commit 148ce12

Please sign in to comment.