New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON decoders should be case sensitive #64612

Closed
nikhita opened this Issue Jun 1, 2018 · 27 comments

Comments

Projects
None yet
8 participants
@nikhita
Member

nikhita commented Jun 1, 2018

Our current json decoders are case-insensitive. Creating a deployment with a field spec.replicAs: 3 will fail kubectl validation with:

error: error validating "deployment.yaml": error validating data: ValidationError(Deployment.spec): unknown field "replicAs" in io.k8s.api.apps.v1.DeploymentSpec; if you choose to ignore these errors, turn validation off with --validate=false

If we use --validate=false, the deployment configuration is accepted and the json decoder unmarshals it as spec.replicas: 3.

IMO we should not allow wrongly named fields even if they differ only in case sensitivity. Also, custom resources validation differs from native resources validation here because the CRD validation specs are case sensitive.

I checked for the current master, 1.10, 1.9 and 1.8. This issue persists for all of them. We started using json-iter instead of ugorji in 1.9 (#48287) so it doesn't look related to that.

Go's json.Unmarshal, by default, is case insensitive. From https://golang.org/pkg/encoding/json/#Unmarshal,

To unmarshal JSON into a struct, Unmarshal matches incoming object keys to the keys used by Marshal (either the struct field name or its tag), preferring an exact match but also accepting a case-insensitive match.

I suspect this is the underlying mechanism used in our json decoders which causes it to be case-insensitive.

Wanted to make sure there is consensus in decoders being case sensitive before attempting a fix.

/cc @liggitt @thockin @sttts
/sig api-machinery
/kind bug

@liggitt

This comment has been minimized.

Member

liggitt commented Jun 2, 2018

I checked for the current master, 1.10, 1.9 and 1.8. This issue persists for all of them. We started using json-iter instead of ugorji in 1.9 (#48287) so it doesn't look related to that.

Actually, we switched to json-iter in 1.8:

$ git log v1.8.0 --format=oneline | grep json-iter
6a845c67f097cd76f9d90ab3c9c5b5603c70afe4 Merge pull request #48287 from thockin/json-iterator
86ef9d00f831bff4012878818db6f198e0e15dcf Add json-iterator dep, remove ugorji dep
5728b1970a2bed2207a2c63c1cfee86e52437d25 Use json-iterator for JSON, kill off codecgen

$ git tag --contains 6a845c67f097cd76f9d90ab3c9c5b5603c70afe4 | grep -v - | grep \\.0
v1.10.0
v1.8.0
v1.9.0

checking against 1.7, ugorji was case-sensitive:

$ curl http://localhost:8080/version
{
  "major": "1",
  "minor": "7+",
  "gitVersion": "v1.7.17-beta.0.1+347f652944cc23",
  "gitCommit": "347f652944cc2348d59b1c815007e21e062fe597",
  "gitTreeState": "clean",
  "buildDate": "2018-06-02T02:19:27Z",
  "goVersion": "go1.8.7",
  "compiler": "gc",
  "platform": "darwin/amd64"
}

$ curl -X POST http://localhost:8080/api/v1/namespaces -H "Content-Type: application/json" \
  --data '{"KIND":"Namespace","APIVERSION":"v1","METADATA":{"NAME":"foo"}}'
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "Namespace \"\" is invalid: metadata.name: Required value: name or generateName is required",
  "reason": "Invalid",
  "details": {
    "kind": "Namespace",
    "causes": [
      {
        "reason": "FieldValueRequired",
        "message": "Required value: name or generateName is required",
        "field": "metadata.name"
      }
    ]
  },
  "code": 422
}

and json-iter in 1.8 is not:

$ curl http://localhost:8080/version
{
  "major": "1",
  "minor": "8+",
  "gitVersion": "v1.8.14-beta.0.8+bbe9159a96c1c6",
  "gitCommit": "bbe9159a96c1c631b3b81562b758eb63b61b8b58",
  "gitTreeState": "clean",
  "buildDate": "2018-06-02T02:27:20Z",
  "goVersion": "go1.8.7",
  "compiler": "gc",
  "platform": "darwin/amd64"
}

$ curl -X POST http://localhost:8080/api/v1/namespaces -H "Content-Type: application/json" \
  --data '{"KIND":"Namespace","APIVERSION":"v1","METADATA":{"NAME":"foo"}}'
{
  "kind": "Namespace",
  "apiVersion": "v1",
  "metadata": {
    "name": "foo",
    "selfLink": "/api/v1/namespaces/foo",
    "uid": "f45db532-660c-11e8-8235-acbc32c1ca87",
    "resourceVersion": "228",
    "creationTimestamp": "2018-06-02T02:30:46Z"
  },
  "spec": {
    "finalizers": [
      "kubernetes"
    ]
  },
  "status": {
    "phase": "Active"
  }
}
@liggitt

This comment has been minimized.

Member

liggitt commented Jun 2, 2018

/priority important-soon

@liggitt

This comment has been minimized.

Member

liggitt commented Jun 2, 2018

@nikhita

This comment has been minimized.

Member

nikhita commented Jun 7, 2018

To clarify: we'll need to fix this on our side, right? Asking the upstream maintainer to support case-sensitivity when Go's Unmarshal doesn't - seems too much to ask. :)

@sttts

This comment has been minimized.

Contributor

sttts commented Jun 7, 2018

/cc @thockin

@lavalamp

This comment has been minimized.

Member

lavalamp commented Jun 7, 2018

Just saw this for the first time. We have to fix this ASAP, otherwise people will depend on in and we'll never be able to fix it.

@lavalamp

This comment has been minimized.

Member

lavalamp commented Jun 7, 2018

It may already be too late if this has been in two releases.

@sttts

This comment has been minimized.

Contributor

sttts commented Jun 7, 2018

We found this some days ago because the client-side OpenAPI validation rejected the manifest, but the server accepted it. So at least for the kubectl based use-cases we should be fine.

@lavalamp

This comment has been minimized.

Member

lavalamp commented Jun 7, 2018

/assign @caesarxuchao

Let's fix this ASAP.

Let's double check that we re-emitted all json before storage so we won't have a problem with unparseable stored data. Was this used for CRs?

@nikhita

This comment has been minimized.

Member

nikhita commented Jun 7, 2018

Was this used for CRs?

CRs are Unstructured so they will accept the json data. For validation against the schema, it is case-sensitive. However, if a field with wrong case sensitivity is provided, it will store it because we don't prune right now.

Example:

This is my CRD.

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: crontabs.stable.example.com
spec:
  group: stable.example.com
  version: v1
  scope: Namespaced
  names:
    plural: crontabs
    singular: crontab
    kind: CronTab
    shortNames:
    - ct
  validation:
    openAPIV3Schema:
      properties:
        spec:
          # cronSpec is required
          required:
          - cronSpec
          properties:
            cronSpec:
              type: string
              pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$'

This is my CR.

apiVersion: "stable.example.com/v1"
kind: CronTab
metadata:
  name: my-new-cron-object
spec:
  # bad case!
  CRONSpec: "* * * *"
  image: my-awesome-cron-image
  • If I don't mark cronSpec as required in the schema, the CR is created without any errors and persists the bad case field.
  • If I mark cronSpec as required in the schema, the CR will not be created because cronSpec is not present in the CR (even though CRONSpec is).
@nikhita

This comment has been minimized.

Member

nikhita commented Jun 7, 2018

Was this used for CRs?

Short answer: no :)

@caesarxuchao

This comment has been minimized.

Member

caesarxuchao commented Jun 7, 2018

It seems not too difficult to make jsoniter support both case-sensitive and case-insensitive: json-iterator/go@e5a1e70

I'll send a patch to the upstream and let's see.

@liggitt

This comment has been minimized.

Member

liggitt commented Jun 8, 2018

We have to fix this ASAP, otherwise people will depend on in and we'll never be able to fix it.

I strongly agree. Case-insensitivity is extremely problematic for API data. We were case-sensitive from 1.1-1.7, and should restore that

Let's double check that we re-emitted all json before storage so we won't have a problem with unparseable stored data.

All native (non-CR) types marshal from go structs to storage, so all persisted etcd data was coerced to the struct tags (for those rare installations still persisting to etcd in json and not protobuf)

As @nikhita described, any CRD that specified a validation schema was validated in a case-sensitive manner

@taowen

This comment has been minimized.

taowen commented Jun 10, 2018

the pull request has been merged. I will be out of office for 2 weeks. @thockin I have added you to the project.

@caesarxuchao

This comment has been minimized.

Member

caesarxuchao commented Jun 11, 2018

I must have missed some code paths, the case sensitivity works fine for first level fields, but not for the nested fields. i.e., it works on "sPec", but doesn't work on "spec.repLicas".

@liggitt

This comment has been minimized.

Member

liggitt commented Jun 11, 2018

@nikhita

This comment has been minimized.

Member

nikhita commented Jun 11, 2018

Opened json-iterator/go#285 upstream. After this fix is incorporated to k/k (see the last two commits in https://github.com/nikhita/kubernetes/commits/json-iter-01),

creating a deployment with sPEC fails:

The Deployment "nginx-deployment" is invalid: 
* spec.selector: Required value
* spec.template.metadata.labels: Invalid value: map[string]string(nil): `selector` does not match template `labels`
* spec.template.spec.containers: Required value

creating a deployment with spec.SeLECTOR also fails:

The Deployment "nginx-deployment" is invalid: 
* spec.selector: Required value
* spec.template.metadata.labels: Invalid value: map[string]string{"app":"nginx"}: `selector` does not match template `labels`
@thockin

This comment has been minimized.

Member

thockin commented Jun 12, 2018

Sorry, just catching up.

Go's JSON is case-insensitive.

I don't know what ugorji did, but Jordan asserts it was case sensitive.

json-iterator is EXPLICITLY compatible with Go's implementation (I even wrote a test for case insensitivity).

Let me go read the PRs - the truth is that I know precious little about the internals of json-iterator.

@caesarxuchao

This comment has been minimized.

Member

caesarxuchao commented Jun 12, 2018

@nikhita do you want me to import the latest json-iterator and add k8s test cases, or do you already have some code locally?

@nikhita

This comment has been minimized.

Member

nikhita commented Jun 21, 2018

cherry-pick for 1.9: #65298

@caesarxuchao

This comment has been minimized.

Member

caesarxuchao commented Jun 22, 2018

I'll try to make the 1.8 cherrypick over the weekend. @nikhita let me know if you already started.

@nikhita

This comment has been minimized.

Member

nikhita commented Jun 24, 2018

@nikhita let me know if you already started.

Sorry, I saw this now - was already on my weekend by then. I had the changes locally, but was waiting on the cherry-pick decision.

Created #65410 👍

k8s-merge-robot added a commit that referenced this issue Jun 27, 2018

Merge pull request #65298 from nikhita/cherrypick-jsoniter-bump-1.9
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.9: make json serializer case sensitive

fixes partially #64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

k8s-publishing-bot added a commit to kubernetes/apimachinery that referenced this issue Jun 27, 2018

Merge pull request #65298 from nikhita/cherrypick-jsoniter-bump-1.9
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.9: make json serializer case sensitive

fixes partially kubernetes/kubernetes#64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

Kubernetes-commit: f4cf484c2cb6056e28fb9759a3c913be3eed990a

k8s-publishing-bot added a commit to kubernetes/client-go that referenced this issue Jun 27, 2018

Merge pull request #65298 from nikhita/cherrypick-jsoniter-bump-1.9
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.9: make json serializer case sensitive

fixes partially kubernetes/kubernetes#64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

Kubernetes-commit: f4cf484c2cb6056e28fb9759a3c913be3eed990a

k8s-publishing-bot added a commit to kubernetes/apiserver that referenced this issue Jun 27, 2018

Merge pull request #65298 from nikhita/cherrypick-jsoniter-bump-1.9
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.9: make json serializer case sensitive

fixes partially kubernetes/kubernetes#64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

Kubernetes-commit: f4cf484c2cb6056e28fb9759a3c913be3eed990a

k8s-publishing-bot added a commit to kubernetes/kube-aggregator that referenced this issue Jun 27, 2018

Merge pull request #65298 from nikhita/cherrypick-jsoniter-bump-1.9
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.9: make json serializer case sensitive

fixes partially kubernetes/kubernetes#64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

Kubernetes-commit: f4cf484c2cb6056e28fb9759a3c913be3eed990a

k8s-publishing-bot added a commit to kubernetes/sample-apiserver that referenced this issue Jun 27, 2018

Merge pull request #65298 from nikhita/cherrypick-jsoniter-bump-1.9
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.9: make json serializer case sensitive

fixes partially kubernetes/kubernetes#64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

Kubernetes-commit: f4cf484c2cb6056e28fb9759a3c913be3eed990a

k8s-publishing-bot added a commit to kubernetes/sample-controller that referenced this issue Jun 27, 2018

Merge pull request #65298 from nikhita/cherrypick-jsoniter-bump-1.9
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.9: make json serializer case sensitive

fixes partially kubernetes/kubernetes#64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

Kubernetes-commit: f4cf484c2cb6056e28fb9759a3c913be3eed990a

k8s-publishing-bot added a commit to kubernetes/apiextensions-apiserver that referenced this issue Jun 27, 2018

Merge pull request #65298 from nikhita/cherrypick-jsoniter-bump-1.9
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.9: make json serializer case sensitive

fixes partially kubernetes/kubernetes#64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

Kubernetes-commit: f4cf484c2cb6056e28fb9759a3c913be3eed990a

k8s-publishing-bot added a commit to kubernetes/metrics that referenced this issue Jun 27, 2018

Merge pull request #65298 from nikhita/cherrypick-jsoniter-bump-1.9
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.9: make json serializer case sensitive

fixes partially kubernetes/kubernetes#64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

Kubernetes-commit: f4cf484c2cb6056e28fb9759a3c913be3eed990a

k8s-merge-robot added a commit that referenced this issue Jun 28, 2018

Merge pull request #65410 from nikhita/cherrypick-jsoniter-bump-1.8
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.8: make json serializer case sensitive

fixes partially #64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool
@nikhita

This comment has been minimized.

Member

nikhita commented Jun 28, 2018

All cherry-picks have been merged. 🎉

Closing.
/close

k8s-publishing-bot added a commit to kubernetes/apimachinery that referenced this issue Jun 28, 2018

Merge pull request #65410 from nikhita/cherrypick-jsoniter-bump-1.8
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.8: make json serializer case sensitive

fixes partially kubernetes/kubernetes#64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

Kubernetes-commit: 14f8f040a211ecce6f848d1eb73be9c6f759bb93

k8s-publishing-bot added a commit to kubernetes/client-go that referenced this issue Jun 28, 2018

Merge pull request #65410 from nikhita/cherrypick-jsoniter-bump-1.8
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.8: make json serializer case sensitive

fixes partially kubernetes/kubernetes#64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

Kubernetes-commit: 14f8f040a211ecce6f848d1eb73be9c6f759bb93

k8s-publishing-bot added a commit to kubernetes/apiserver that referenced this issue Jun 28, 2018

Merge pull request #65410 from nikhita/cherrypick-jsoniter-bump-1.8
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.8: make json serializer case sensitive

fixes partially kubernetes/kubernetes#64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

Kubernetes-commit: 14f8f040a211ecce6f848d1eb73be9c6f759bb93

k8s-publishing-bot added a commit to kubernetes/kube-aggregator that referenced this issue Jun 28, 2018

Merge pull request #65410 from nikhita/cherrypick-jsoniter-bump-1.8
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.8: make json serializer case sensitive

fixes partially kubernetes/kubernetes#64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

Kubernetes-commit: 14f8f040a211ecce6f848d1eb73be9c6f759bb93

k8s-publishing-bot added a commit to kubernetes/sample-apiserver that referenced this issue Jun 28, 2018

Merge pull request #65410 from nikhita/cherrypick-jsoniter-bump-1.8
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.8: make json serializer case sensitive

fixes partially kubernetes/kubernetes#64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

Kubernetes-commit: 14f8f040a211ecce6f848d1eb73be9c6f759bb93

k8s-publishing-bot added a commit to kubernetes/apiextensions-apiserver that referenced this issue Jun 28, 2018

Merge pull request #65410 from nikhita/cherrypick-jsoniter-bump-1.8
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.8: make json serializer case sensitive

fixes partially kubernetes/kubernetes#64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

Kubernetes-commit: 14f8f040a211ecce6f848d1eb73be9c6f759bb93

k8s-publishing-bot added a commit to kubernetes/metrics that referenced this issue Jun 28, 2018

Merge pull request #65410 from nikhita/cherrypick-jsoniter-bump-1.8
Automatic merge from submit-queue.

Manual cherrypick of #65034 to 1.8: make json serializer case sensitive

fixes partially kubernetes/kubernetes#64612

This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive.

**Release note**:

```release-note
ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid.
```

/sig api-machinery
/kind bug
/assign caesarxuchao liggitt thockin sttts mbohlool

Kubernetes-commit: 14f8f040a211ecce6f848d1eb73be9c6f759bb93

satyamz added a commit to satyamz/scope that referenced this issue Aug 24, 2018

Upgrade client-go version to 8.0.0
This will
Add:
	- golang.org/x/time
upgrade:
        - k8s.io/client-go v8.0.0
	- k8s.io/api version to kubernetes-1.11.0
	- k8s.io/apimachinery version to kubernetes-1.11.0
	- github.com/json-iterator/go version to latest because `kubernetes/kubernetes#64612
delete:
	- vendor/github.com/juju/ratelimit because k8s-client-go is shifted to golang.org/x/time
	  Please refer: kubernetes/client-go@acc5249

```
gvt delete k8s.io/client-go
gvt delete k8s.io/api
gvt delete k8s.io/apimachinery
gvt delete github.com/json-iterator/go
gvt delete github.com/juju/ratelimit

gvt fetch --no-recurse -tag v8.0.0 k8s.io/client-go
gvt fetch --no-recurse -tag kubernetes-1.11.0 k8s.io/api
gvt fetch --no-recurse -tag kubernetes-1.11.0 k8s.io/apimachinery
gvt fetch github.com/json-iterator/go
gvt fetch golang.org/x/time
```

fixes: weaveworks#3284

Signed-off-by: Satyam Zode <satyamzode@gmail.com>

justinsb added a commit to justinsb/kops that referenced this issue Sep 23, 2018

Field names are case-sensitive again
There was a regression in apimachinery which meant that kubernetes
tolerated field names with incorrect case.  Upstream bug is
kubernetes/kubernetes#64612

Syncing up with latest kubernetes will mean we get the same breaking
change as kubernetes has/had.  It should only affect people that are
manually building YAML / JSON.

Added as a significant item to release notes.

justinsb added a commit to justinsb/kops that referenced this issue Sep 23, 2018

Field names are case-sensitive again
There was a regression in apimachinery which meant that kubernetes
tolerated field names with incorrect case.  Upstream bug is
kubernetes/kubernetes#64612

Syncing up with latest kubernetes will mean we get the same breaking
change as kubernetes has/had.  It should only affect people that are
manually building YAML / JSON.

Added as a significant item to release notes.

justinsb added a commit to justinsb/kops that referenced this issue Sep 23, 2018

Field names are case-sensitive again
There was a regression in apimachinery which meant that kubernetes
tolerated field names with incorrect case.  Upstream bug is
kubernetes/kubernetes#64612

Syncing up with latest kubernetes will mean we get the same breaking
change as kubernetes has/had.  It should only affect people that are
manually building YAML / JSON.

Added as a significant item to release notes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment