Enable all linters by default

This removes the directive from .golangci.yml to disable all linters,
and fixes the relevant bugs / issues that are exposed.
This commit is contained in:
Sargun Dhillon
2020-12-03 11:33:06 -08:00
parent d562b71d9a
commit d64d427ec8
8 changed files with 14 additions and 33 deletions

View File

@@ -108,7 +108,7 @@ func populateContainerEnvironment(ctx context.Context, pod *corev1.Pod, containe
// https://github.com/kubernetes/kubernetes/blob/v1.13.1/pkg/kubelet/kubelet_pods.go#L557-L558
container.EnvFrom = []corev1.EnvFromSource{}
res := make([]corev1.EnvVar, 0)
res := make([]corev1.EnvVar, 0, len(tmpEnv))
for key, val := range tmpEnv {
res = append(res, corev1.EnvVar{
@@ -171,7 +171,7 @@ func getServiceEnvVarMap(rm *manager.ResourceManager, ns string, enableServiceLi
// makeEnvironmentMapBasedOnEnvFrom returns a map representing the resolved environment of the specified container after being populated from the entries in the ".envFrom" field.
func makeEnvironmentMapBasedOnEnvFrom(ctx context.Context, pod *corev1.Pod, container *corev1.Container, rm *manager.ResourceManager, recorder record.EventRecorder) (map[string]string, error) {
// Create a map to hold the resulting environment.
res := make(map[string]string, 0)
res := make(map[string]string)
// Iterate over "envFrom" references in order to populate the environment.
loop:
for _, envFrom := range container.EnvFrom {