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

Fix for platfrom detection and refactoring #20

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Conversation

Vasu1105
Copy link
Contributor

@Vasu1105 Vasu1105 commented Feb 27, 2024

Description

This involves code refactoring to follow train plugin standards and few changes made for platform detection.

Note: Platform detection is only currently able to detect linux platform.

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New content (non-breaking change)
  • Breaking change (a content change which would break existing functionality or processes)

Checklist:

  • I have read the CONTRIBUTING document.

Vasu1105 added 3 commits February 21, 2024 19:03
Signed-off-by: Vasu1105 <vjagdle@progress.com>
Signed-off-by: Vasu1105 <vjagdle@progress.com>
Signed-off-by: Vasu1105 <vjagdle@progress.com>
@Vasu1105 Vasu1105 changed the title [Do not merge] [WIP] Fix for platfrom detection and refactoring Fix for platfrom detection and refactoring Feb 28, 2024
Signed-off-by: Sathish Babu <sbabu@progress.com>
…hell

Signed-off-by: Sathish Babu <sbabu@progress.com>
Signed-off-by: Sathish Babu <sbabu@progress.com>
This allows to use only single session

Signed-off-by: Sathish Babu <sbabu@progress.com>
Signed-off-by: Sathish Babu <sbabu@progress.com>
Signed-off-by: Sathish Babu <sbabu@progress.com>
Signed-off-by: Sathish Babu <sbabu@progress.com>
Signed-off-by: Sathish Babu <sbabu@progress.com>
Signed-off-by: Sathish Babu <sbabu@progress.com>
Signed-off-by: Sathish Babu <sbabu@progress.com>
Signed-off-by: Sathish Babu <sbabu@progress.com>
Signed-off-by: Sathish Babu <sbabu@progress.com>
- set reader, writer and PID
- define reconnect logic
- load session at class level

Signed-off-by: Sathish Babu <sbabu@progress.com>
Signed-off-by: Sathish Babu <sbabu@progress.com>
Signed-off-by: Sathish Babu <sbabu@progress.com>
Signed-off-by: Sathish Babu <sbabu@progress.com>
Signed-off-by: Sathish Babu <sbabu@progress.com>
Signed-off-by: Sathish Babu <sbabu@progress.com>
end

def strip_ansi_sequences(text)
text.gsub(/\e\[.*?m/, "").gsub(/\e\]0;.*?\a/, "").gsub(/\e\[A/, "").gsub(/\e\[C/, "").gsub(/\e\[K/, "")

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on a
library input
may run slow on strings starting with 'e]0;' and with many repetitions of 'e]0;'.
end

def strip_ansi_sequences(text)
text.gsub(/\e\[.*?m/, "").gsub(/\e\]0;.*?\a/, "").gsub(/\e\[A/, "").gsub(/\e\[C/, "").gsub(/\e\[K/, "")

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on a
library input
may run slow on strings starting with 'e[' and with many repetitions of 'e['.
end

def connect
@reader, @writer, @pid = PTY.spawn("kubectl exec --stdin --tty #{@pod} -n #{@namespace} -c #{@container_name} -- /bin/bash")

Check warning

Code scanning / CodeQL

Unsafe shell command constructed from library input Medium

This string construction which depends on
library input
is later used in a
shell command
.
This string construction which depends on
library input
is later used in a
shell command
.
This string construction which depends on
library input
is later used in a
shell command
.
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