From 2282901a455e46ad5a71f1b4c3b3d2df8f982a46 Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Thu, 21 Nov 2024 16:09:41 +0100 Subject: [PATCH 1/3] Move `host_inject.rb` and preserve history --- lib-injection/{host_inject.rb => host_inject_main.rb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib-injection/{host_inject.rb => host_inject_main.rb} (100%) diff --git a/lib-injection/host_inject.rb b/lib-injection/host_inject_main.rb similarity index 100% rename from lib-injection/host_inject.rb rename to lib-injection/host_inject_main.rb From 5591d97f9c24023456439ef8e537eed56ac0abbd Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Thu, 21 Nov 2024 16:14:24 +0100 Subject: [PATCH 2/3] Add frontend `host_inject.rb`, guarding against older versions These versions may be unable to execute - or even parse - the main host injection script. --- .gitlab/prepare-oci-package.sh | 1 + lib-injection/host_inject.rb | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 lib-injection/host_inject.rb diff --git a/.gitlab/prepare-oci-package.sh b/.gitlab/prepare-oci-package.sh index d051f359c15..2c2e65f3322 100755 --- a/.gitlab/prepare-oci-package.sh +++ b/.gitlab/prepare-oci-package.sh @@ -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 diff --git a/lib-injection/host_inject.rb b/lib-injection/host_inject.rb new file mode 100644 index 00000000000..eaca133a905 --- /dev/null +++ b/lib-injection/host_inject.rb @@ -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 From f9aec1a9725b24981fa9fab494eab8b1d4171b78 Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Wed, 27 Nov 2024 13:48:37 +0100 Subject: [PATCH 3/3] Lower to ruby 2.3 --- lib-injection/host_inject.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib-injection/host_inject.rb b/lib-injection/host_inject.rb index eaca133a905..1dbf4d683d8 100644 --- a/lib-injection/host_inject.rb +++ b/lib-injection/host_inject.rb @@ -2,6 +2,6 @@ # 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.' +if RUBY_VERSION >= '2.3.' require File.expand_path(File.join(File.dirname(__FILE__), 'host_inject_main.rb')) end