1. 08 Dec, 2016 1 commit
    • juanvallejo's avatar
      fix duplicate validation/field/errors · a7286e8a
      juanvallejo authored
      Related PR: https://github.com/kubernetes/kubernetes/pull/30313
      
      PR #30313 fixed duplicate errors for invalid aggregate errors in
      https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/util/helpers.go
      
      However, duplicate aggregate errors that went through
      https://github.com/kubernetes/kubernetes/blob/master/pkg/util/validation/field/errors.go
      were not affected by that patch.
      
      This patch adds duplicate aggregate error checking to
      `pkg/util/validation/field/errors.go`
      
      \##### Before
      `$ kubectl set env rc/idling-echo-1 test-abc=1234`
      ```
      error: ReplicationController "idling-echo-1" is invalid:
      [spec.template.spec.containers[0].env[0].name: Invalid value:
      "test-abc": must be a C identifier (matching regex
      [A-Za-z_][A-Za-z0-9_]*): e.g. "my_name" or "MyName",
      spec.template.spec.containers[1].env[0].name: Invalid value: "test-abc":
      must be a C identifier (matching regex [A-Za-z_][A-Za-z0-9_]*): e.g.
      "my_name" or "MyName", spec.template.spec.containers[0].env[0].name:
      Invalid value: "test-abc": must be a C identifier (matching regex
      [A-Za-z_][A-Za-z0-9_]*): e.g. "my_name" or "MyName",
      spec.template.spec.containers[1].env[0].name: Invalid value: "test-abc":
      must be a C identifier (matching regex [A-Za-z_][A-Za-z0-9_]*): e.g.
      "my_name" or "MyName"]
      ```
      
      `$ kubectl set env rc/node-1 test-abc=1234`
      ```
      error: ReplicationController "idling-echo-1" is invalid:
      [spec.template.spec.containers[0].env[0].name: Invalid value:
      "test-abc": must be a C identifier (matching regex
      [A-Za-z_][A-Za-z0-9_]*): e.g. "my_name" or "MyName",
      spec.template.spec.containers[1].env[0].name: Invalid value: "test-abc":
      must be a C identifier (matching regex [A-Za-z_][A-Za-z0-9_]*): e.g.
      "my_name" or "MyName"]
      ```
      
      \##### After
      `$ kubectl set env rc/idling-echo-1 test-abc=1234`
      ```
      error: ReplicationController "idling-echo-1" is invalid:
      [spec.template.spec.containers[0].env[0].name: Invalid value:
      "test-abc": must be a C identifier (matching regex
      [A-Za-z_][A-Za-z0-9_]*): e.g. "my_name" or "MyName",
      spec.template.spec.containers[1].env[0].name: Invalid value: "test-abc":
      must be a C identifier (matching regex [A-Za-z_][A-Za-z0-9_]*): e.g.
      "my_name" or "MyName"]
      ```
      
      `$ kubectl set env rc/node-1 test-abc=1234`
      ```
      error: ReplicationController "node-1" is invalid:
      spec.template.spec.containers[0].env[0].name: Invalid value: "test-abc":
      must be a C identifier (matching regex [A-Za-z_][A-Za-z0-9_]*): e.g.
      "my_name" or "MyName"
      ```
      a7286e8a
  2. 05 Dec, 2016 37 commits
  3. 04 Dec, 2016 2 commits