From 4937008ae07e5b6ae360246b5e572c5834783ce3 Mon Sep 17 00:00:00 2001 From: Zach Loafman Date: Mon, 2 Mar 2015 11:14:27 -0800 Subject: [PATCH] Revert "TCPSocket could not be used as it was not checked in validation" --- pkg/api/validation/validation.go | 8 ----- pkg/api/validation/validation_test.go | 48 --------------------------- 2 files changed, 56 deletions(-) diff --git a/pkg/api/validation/validation.go b/pkg/api/validation/validation.go index 1d3d9923021ca..04aabc7c8142f 100644 --- a/pkg/api/validation/validation.go +++ b/pkg/api/validation/validation.go @@ -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{} diff --git a/pkg/api/validation/validation_test.go b/pkg/api/validation/validation_test.go index fdda8adb9c752..2635f7c63f75b 100644 --- a/pkg/api/validation/validation_test.go +++ b/pkg/api/validation/validation_test.go @@ -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", @@ -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}, },