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

Pod attach #325

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Pod attach #325

wants to merge 5 commits into from

Conversation

jkobejs
Copy link
Contributor

@jkobejs jkobejs commented Mar 4, 2022

  • currently, it depends on sttp that I built locally, the release will probably be ready in a few days
  • web sockets doesn't work through our teleport
  • exec cannot execute commands like "ls -all", API expects multiple command parameters command=ls&command=-all but generated code accepts only one command
 {
          "description": "Command is the remote command to execute. argv array. Not executed within a shell.",
          "in": "query",
          "name": "command",
          "type": "string",
          "uniqueItems": true
        }
  • attach and execute contain post and get methods with "x-kubernetes-action": "connect" other actions like port forward, service proxy contain even more, how should we filter or group them?

@jkobejs jkobejs requested a review from vigoo March 4, 2022 12:23
import zio.stream.UStream

case class AttachedProcessState(
stdin: Option[Queue[Chunk[Byte]]],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be nicer (at least more symmetric :) if this is a sink?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it looks better :)

new String(Base64.getEncoder.encode(arr))
}
.mapError(toK8sError)
stdin <- ZIO.effect(customParameters.get("stdin").exists(_.toBoolean)).mapError(toK8sError)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not check the schema, just some thoughts:

  • If all the connect operations have stdin, stdout and stderr then these could be fix built-in parameters, like for example the delete parameters and the watch filters.
  • If it is not available for all, is the AttachedProcessState a good result type for those operations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. They don't, port forward only has a list of ports, and there are port, service and pod proxy endpoints that have action connect, they have just path as option
  2. No, it only makes sense for attach and exec

@vigoo
Copy link
Collaborator

vigoo commented Mar 4, 2022

looks very good, added two questions

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 this pull request may close these issues.

2 participants