remove unused function

This commit is contained in:
Robert Brennan
2019-12-23 21:16:59 +00:00
parent b0035158d2
commit 7cc0be4188

View File

@@ -12,7 +12,6 @@ import (
"k8s.io/apimachinery/pkg/util/yaml"
"github.com/fairwindsops/polaris/pkg/config"
controller "github.com/fairwindsops/polaris/pkg/validator/controllers"
)
type includeExcludeList struct {
@@ -96,26 +95,6 @@ func parseCheck(rawBytes []byte) (SchemaCheck, error) {
}
}
func (check SchemaCheck) check(controller controller.Interface) (bool, error) {
pod := controller.GetPodSpec()
if check.Target == targetPod {
return check.checkPod(pod)
} else if check.Target == targetContainer {
for _, container := range pod.Containers {
bytes, err := json.Marshal(container)
if err != nil {
return false, err
}
errors, err := check.Schema.ValidateBytes(bytes)
if err != nil || len(errors) > 0 {
return false, err
}
}
// TODO: initcontainers
}
return true, nil
}
func (check SchemaCheck) checkPod(pod *corev1.PodSpec) (bool, error) {
return check.checkObject(pod)
}