mirror of
https://github.com/FairwindsOps/polaris.git
synced 2026-05-20 16:14:32 +00:00
remove unused function
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user