diff --git a/k8s-agent-debug-cluster-config/launchSettings.template.json b/k8s-agent-debug-cluster-config/launchSettings.template.json index a16f3339c..45b765225 100644 --- a/k8s-agent-debug-cluster-config/launchSettings.template.json +++ b/k8s-agent-debug-cluster-config/launchSettings.template.json @@ -3,7 +3,6 @@ "Octopus Kubernetes Agent": { "commandName": "Project", "commandLineArgs": "agent --instance Tentacle --noninteractive", - "framework": "net8.0", "environmentVariables": { "ACCEPT_EULA": "Y", "OCTOPUS__K8STENTACLE__NAMESPACE": "octopus-agent-", diff --git a/source/Octopus.Tentacle/Diagnostics/OctopusLogsDirectoryRenderer.cs b/source/Octopus.Tentacle/Diagnostics/OctopusLogsDirectoryRenderer.cs index 9a0ef81ec..57cd33b71 100644 --- a/source/Octopus.Tentacle/Diagnostics/OctopusLogsDirectoryRenderer.cs +++ b/source/Octopus.Tentacle/Diagnostics/OctopusLogsDirectoryRenderer.cs @@ -5,13 +5,14 @@ using System.Text; using NLog; using NLog.LayoutRenderers; +using Octopus.Tentacle.Variables; namespace Octopus.Tentacle.Diagnostics { [LayoutRenderer("octopusLogsDirectory")] public class OctopusLogsDirectoryRenderer : LayoutRenderer { - public static readonly string DefaultLogsDirectory = Environment.GetEnvironmentVariable("DefaultLogDirectory") ?? + public static readonly string DefaultLogsDirectory = Environment.GetEnvironmentVariable(EnvironmentVariables.DefaultLogDirectory) ?? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), Path.Combine("Octopus", "Logs")); public static readonly HashSet History = new HashSet(); diff --git a/source/Octopus.Tentacle/Kubernetes/KubernetesPhysicalFileSystem.cs b/source/Octopus.Tentacle/Kubernetes/KubernetesPhysicalFileSystem.cs index ed800d8af..1ab8ad4d8 100644 --- a/source/Octopus.Tentacle/Kubernetes/KubernetesPhysicalFileSystem.cs +++ b/source/Octopus.Tentacle/Kubernetes/KubernetesPhysicalFileSystem.cs @@ -2,6 +2,7 @@ using System.IO; using Octopus.Diagnostics; using Octopus.Tentacle.Util; +using Octopus.Tentacle.Variables; namespace Octopus.Tentacle.Kubernetes { @@ -13,7 +14,7 @@ public class KubernetesPhysicalFileSystem : OctopusPhysicalFileSystem // Set like this for now because we don't have a way to get the home directory from the provider without requiring ourselves // DI can be painful when circular dependencies happen with constructed classes :sad-panda: // When we can get an Injectable KubernetesConfiguration, we can remove this, alternatively, we can pull apart the configuration stores into different implementations - readonly string HomeDir = Environment.GetEnvironmentVariable("TentacleHome") ?? "/octopus"; + readonly string HomeDir = Environment.GetEnvironmentVariable(EnvironmentVariables.TentacleHome) ?? "/octopus"; public KubernetesPhysicalFileSystem(IKubernetesDirectoryInformationProvider directoryInformationProvider, ISystemLog log) : base(log) diff --git a/source/Octopus.Tentacle/Variables/EnvironmentVariables.cs b/source/Octopus.Tentacle/Variables/EnvironmentVariables.cs index cbf32ad89..5f29bb928 100644 --- a/source/Octopus.Tentacle/Variables/EnvironmentVariables.cs +++ b/source/Octopus.Tentacle/Variables/EnvironmentVariables.cs @@ -27,5 +27,6 @@ public static class EnvironmentVariables public const string NfsWatchdogDirectory = "watchdog_directory"; public static string TentacleUseTcpNoDelay = "TentacleUseTcpNoDelay"; public static string TentacleUseAsyncListener = "TentacleUseAsyncListener"; + public static string DefaultLogDirectory = "DefaultLogDirectory"; } } \ No newline at end of file