Skip to content
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

Certificate Objects result in an 'update' when no changes were made #131

Closed
deirdre-anderson opened this issue Mar 12, 2020 · 0 comments · Fixed by #132
Closed

Certificate Objects result in an 'update' when no changes were made #131

deirdre-anderson opened this issue Mar 12, 2020 · 0 comments · Fixed by #132

Comments

@deirdre-anderson
Copy link
Member

If you configure a Certificate entity in Kong with a cert and key. A 'deck dump' and a subsequent 'deck sync' will result in the message that an update was made despite no changes being made between the dump and sync.

Reproduce :

  1. Configure a 'Certificate Object' cert and key in Kong (EE in this scnario)
  2. 'deck dump -o debug.yaml' --headers 'kong-admin-token:'
  3. 'deck sync -s debug.yaml' --headers 'kong-admin-token:'
  4. The output of the sync/diff is the below - when in fact no changes where made between the 'dump' and subsequent 'sync':
    updating certificate b734b681-359a-4242-bd0b-febe6f2464f0 {
    ...
    Summary:
    Created: 0
    Updated: 1
    Deleted: 0
@deirdre-anderson deirdre-anderson changed the title Certificate Objects always result in an 'update' when no changes were made Certificate Objects result in an 'update' when no changes were made Mar 12, 2020
hbagdi added a commit that referenced this issue Mar 14, 2020
Kong returns back an empty JSON array instead of a `null` when the
SNI array is empty:

```
{
    "data": [
        {
            "cert": "-truncated-",
            "created_at": 1584219121,
            "id": "3e83146b-7139-4306-aa0c-f95ba3a9e315",
            "key": "-truncated-",
            "snis": [],
            "tags": null
        }
    ],
    "next": null
}
```

Kong deviates from it's regular behavior of returning a `null`.
This causes decK to detect a diff an existing and desired certificate
because the two certificates have different empty SNIs, one has an empty
array ([]*string{}) while the other is `nil`.

This commit populates a nil SNIs field with an empty array.

This bug only shows up when there are no SNIs associates with a
certificate in Kong.

Fix #131
hbagdi added a commit that referenced this issue Mar 14, 2020
Kong returns back an empty JSON array instead of a `null` when the
SNI array is empty:

```
{
    "data": [
        {
            "cert": "-truncated-",
            "created_at": 1584219121,
            "id": "3e83146b-7139-4306-aa0c-f95ba3a9e315",
            "key": "-truncated-",
            "snis": [],
            "tags": null
        }
    ],
    "next": null
}
```

Kong deviates from it's regular behavior of returning a `null`.
This causes decK to detect a diff an existing and desired certificate
because the two certificates have different empty SNIs, one has an empty
array ([]*string{}) while the other is `nil`.

This commit populates a nil SNIs field with an empty array.

This bug only shows up when there are no SNIs associates with a
certificate in Kong.

Fix #131
hbagdi added a commit that referenced this issue Mar 14, 2020
Kong returns back an empty JSON array instead of a `null` when the
SNI array is empty:

```
{
    "data": [
        {
            "cert": "-truncated-",
            "created_at": 1584219121,
            "id": "3e83146b-7139-4306-aa0c-f95ba3a9e315",
            "key": "-truncated-",
            "snis": [],
            "tags": null
        }
    ],
    "next": null
}
```

Kong deviates from it's regular behavior of returning a `null`.
This causes decK to detect a diff an existing and desired certificate
because the two certificates have different empty SNIs, one has an empty
array ([]*string{}) while the other is `nil`.

This commit populates a nil SNIs field with an empty array.

This bug only shows up when there are no SNIs associates with a
certificate in Kong.

Fix #131
From #132
rainest pushed a commit that referenced this issue Apr 21, 2021
Kong returns back an empty JSON array instead of a `null` when the
SNI array is empty:

```
{
    "data": [
        {
            "cert": "-truncated-",
            "created_at": 1584219121,
            "id": "3e83146b-7139-4306-aa0c-f95ba3a9e315",
            "key": "-truncated-",
            "snis": [],
            "tags": null
        }
    ],
    "next": null
}
```

Kong deviates from it's regular behavior of returning a `null`.
This causes decK to detect a diff an existing and desired certificate
because the two certificates have different empty SNIs, one has an empty
array ([]*string{}) while the other is `nil`.

This commit populates a nil SNIs field with an empty array.

This bug only shows up when there are no SNIs associates with a
certificate in Kong.

Fix #131
From #132
AntoineJac pushed a commit that referenced this issue Jan 23, 2024
Kong returns back an empty JSON array instead of a `null` when the
SNI array is empty:

```
{
    "data": [
        {
            "cert": "-truncated-",
            "created_at": 1584219121,
            "id": "3e83146b-7139-4306-aa0c-f95ba3a9e315",
            "key": "-truncated-",
            "snis": [],
            "tags": null
        }
    ],
    "next": null
}
```

Kong deviates from it's regular behavior of returning a `null`.
This causes decK to detect a diff an existing and desired certificate
because the two certificates have different empty SNIs, one has an empty
array ([]*string{}) while the other is `nil`.

This commit populates a nil SNIs field with an empty array.

This bug only shows up when there are no SNIs associates with a
certificate in Kong.

Fix #131
From #132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant