Skip to content

Commit

Permalink
Add frontend host_inject.rb, guarding against older versions
Browse files Browse the repository at this point in the history
These versions may be unable to execute - or even parse - the main host
injection script.
  • Loading branch information
lloeki committed Nov 22, 2024
1 parent 165d035 commit afe6b26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitlab/prepare-oci-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -e
mkdir sources

cp ../lib-injection/host_inject.rb sources
cp ../lib-injection/host_inject_main.rb sources
cp ../lib-injection/requirements.json sources/requirements.json
# Kubernetes injection expects a different path
ln -rs sources/host_inject.rb sources/auto_inject.rb
Expand Down
7 changes: 7 additions & 0 deletions lib-injection/host_inject.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file's intent is to be parseable and executable by all ruby versions
# to call into the main one only for versions for which it is known-compatible
# with at the language level.

if RUBY_VERSION >= '2.5.'
require File.expand_path(File.join(File.dirname(__FILE__), 'host_inject_main.rb'))
end

0 comments on commit afe6b26

Please sign in to comment.