Skip to content

EndOfStreamException after upgrading from 6.0.4 to 17.0.14 #1714

@vladajankovic

Description

@vladajankovic

Describe the bug
In version 6.0.4 the following code works when resourceVersion is null or has a value:

await _k8SClient.ListNamespacedSecretWithHttpMessagesAsync(
      _namespace,
      labelSelector: labelSelector,
      watch: true,
      resourceVersion: resourceVersion,
      timeoutSeconds: 300,
      cancellationToken: _cancellationTokenSource.Token
)

After updating to 17.0.14 version, the code:

await _k8SClient.CoreV1.ListNamespacedSecretWithHttpMessagesAsync(
      _namespace,
      labelSelector: labelSelector,
      watch: true,
      resourceVersion: resourceVersion,
      timeoutSeconds: 300,
      cancellationToken: _cancellationTokenSource.Token
)

fails when resourceVersion has a value and throws EndOfStreamException.
But when resourceVersion is null, the method returns a valid result.

Starting from version 8.0.4, after moving the method ListNamespacedSecretWithHttpMessagesAsync into CoreV1, the method throws EndOfStreamException if resourceVersion has a value (not null).

Kubernetes C# SDK Client Version
17.0.14

Server Kubernetes Version
1.34.2

Dotnet Runtime Version
net8

To Reproduce
Call method where resourceVersion has a value.

Expected behavior
Not to throw an exception when resourceVersion is not null

Additional context
@ShirmanDenis This exception is the same as for #1675, but the exception is thrown before calling Watch():

using var watcher = (await _k8SClient.CoreV1.ListNamespacedSecretWithHttpMessagesAsync(
    _namespace,
    labelSelector: labelSelector,
    watch: true,
    resourceVersion: resourceVersion,
    timeoutSeconds: 300,
    cancellationToken: _cancellationTokenSource.Token)
).Watch<V1Secret, V1SecretList>(...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions