Skip to content

Commit

Permalink
address code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
scme0 committed Sep 27, 2024
1 parent 7a6d854 commit 1414e56
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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-<agent-name>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> History = new HashSet<string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.IO;
using Octopus.Diagnostics;
using Octopus.Tentacle.Util;
using Octopus.Tentacle.Variables;

namespace Octopus.Tentacle.Kubernetes
{
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions source/Octopus.Tentacle/Variables/EnvironmentVariables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}

0 comments on commit 1414e56

Please sign in to comment.