Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ namespace Calamari.Aws.Kubernetes.Discovery;

public class AwsKubernetesDiscoverer(ILog log) : KubernetesDiscovererBase(log)
{
readonly ILog log = log;

/// <remarks>
/// This type value here must be the same as in Octopus.Server.Orchestration.ServerTasks.Deploy.TargetDiscovery.AwsAuthenticationContext
/// This value is hardcoded because:
Expand Down Expand Up @@ -58,7 +60,7 @@ public override IEnumerable<KubernetesCluster> DiscoverClusters(string contextJs
Log.Verbose(" Role: No IAM Role provided.");
}

if (!authenticationDetails.TryGetCredentials(Log, out var credentials))
if (!authenticationDetails.TryGetCredentials(log, out var credentials))
yield break;

foreach (var region in authenticationDetails.Regions)
Expand Down Expand Up @@ -174,4 +176,4 @@ bool TryGetAwsAuthenticationDetails(

return true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ namespace Calamari.Common.Features.Discovery;

public abstract class KubernetesDiscovererBase(ILog log) : IKubernetesDiscoverer
{
protected readonly ILog Log = log;



protected bool TryGetDiscoveryContext<TAuthenticationDetails>(string json,
[NotNullWhen(returnValue: true)] out TAuthenticationDetails? authenticationDetails,
out string? workerPoolId) where TAuthenticationDetails : class, ITargetDiscoveryAuthenticationDetails
Expand Down Expand Up @@ -63,4 +59,4 @@ void LogDeserialisationError(string? detail = null, Exception? exception = null)

public abstract string Type { get; }
public abstract IEnumerable<KubernetesCluster> DiscoverClusters(string contextJson);
}
}