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

Decoding error when deleting a service #27

Closed
t089 opened this issue Feb 10, 2023 · 1 comment
Closed

Decoding error when deleting a service #27

t089 opened this issue Feb 10, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@t089
Copy link
Contributor

t089 commented Feb 10, 2023

do {
  try await self.client.services.delete(in: namespace, name: serviceName, options: nil)
  logger.info("Deleted service: \(serviceName)")
} catch {
  logger.error("Failed to delete service \(serviceName): \(error)")
}

Output:

Failed to delete service test: decodingError("Couldn\'t decode response")
    {
      "identity": "client",
      "kind": "remoteSourceControl",
      "location": "https://github.com/swiftkube/client.git",
      "state": {
        "revision": "9b842812c63c9b3ebbb9142b717727f0d0ae2bb9",
        "version": "0.13.0"
      }
    },
    {
      "identity": "model",
      "kind": "remoteSourceControl",
      "location": "https://github.com/swiftkube/model.git",
      "state": {
        "revision": "f3096f4628f2b068d8f936653ebb3cc1004b095d",
        "version": "0.7.2"
      }
    }
clientVersion:
  buildDate: "2022-06-15T14:22:29Z"
  compiler: gc
  gitCommit: f66044f4361b9f1f96f0053dd46cb7dce5e990a8
  gitTreeState: clean
  gitVersion: v1.24.2
  goVersion: go1.18.3
  major: "1"
  minor: "24"
  platform: darwin/amd64
kustomizeVersion: v4.5.4
serverVersion:
  buildDate: "2022-11-29T18:43:31Z"
  compiler: gc
  gitCommit: 96e7d52c98a32f2b296ca7f19dc9346cf79915ba
  gitTreeState: clean
  gitVersion: v1.23.14-eks-ffeb93d
  goVersion: go1.17.13
  major: "1"
  minor: 23+
  platform: linux/amd64
@iabudiab iabudiab added the bug Something isn't working label Feb 10, 2023
@iabudiab
Copy link
Member

iabudiab commented Feb 10, 2023

Hmm, it seems that the API Server returns the deleted Service instead of a meta.v1.Status object. Happens on 1.23 and 1.24 server versions.

I think, I'll have to just ignore any payload that is not a meta.v1.Status for successful DELETE requests. (client-go also does something similar, I guess)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants