constants.go 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. /*
  15. Copyright 2016 The Kubernetes Authors.
  16. Licensed under the Apache License, Version 2.0 (the "License");
  17. you may not use this file except in compliance with the License.
  18. You may obtain a copy of the License at
  19. http://www.apache.org/licenses/LICENSE-2.0
  20. Unless required by applicable law or agreed to in writing, software
  21. distributed under the License is distributed on an "AS IS" BASIS,
  22. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. See the License for the specific language governing permissions and
  24. limitations under the License.
  25. */
  26. package remotecommand
  27. import (
  28. "time"
  29. metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
  30. )
  31. const (
  32. DefaultStreamCreationTimeout = 30 * time.Second
  33. // The SPDY subprotocol "channel.k8s.io" is used for remote command
  34. // attachment/execution. This represents the initial unversioned subprotocol,
  35. // which has the known bugs http://issues.k8s.io/13394 and
  36. // http://issues.k8s.io/13395.
  37. StreamProtocolV1Name = "channel.k8s.io"
  38. // The SPDY subprotocol "v2.channel.k8s.io" is used for remote command
  39. // attachment/execution. It is the second version of the subprotocol and
  40. // resolves the issues present in the first version.
  41. StreamProtocolV2Name = "v2.channel.k8s.io"
  42. // The SPDY subprotocol "v3.channel.k8s.io" is used for remote command
  43. // attachment/execution. It is the third version of the subprotocol and
  44. // adds support for resizing container terminals.
  45. StreamProtocolV3Name = "v3.channel.k8s.io"
  46. // The SPDY subprotocol "v4.channel.k8s.io" is used for remote command
  47. // attachment/execution. It is the 4th version of the subprotocol and
  48. // adds support for exit codes.
  49. StreamProtocolV4Name = "v4.channel.k8s.io"
  50. NonZeroExitCodeReason = metav1.StatusReason("NonZeroExitCode")
  51. ExitCodeCauseType = metav1.CauseType("ExitCode")
  52. )
  53. var SupportedStreamingProtocols = []string{StreamProtocolV4Name, StreamProtocolV3Name, StreamProtocolV2Name, StreamProtocolV1Name}