Skip to content

Commit 67f80c4

Browse files
[Backport 7.7] Attempting to apply a license file to a snapshot… (#4645)
Fixes #4611 Co-authored-by: Stuart Cam <stuart.cam@elastic.co>
1 parent 1e38842 commit 67f80c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/Tests.Core/ManagedElasticsearch/Clusters/XPackCluster.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ public XPackClusterConfiguration() : this(ClusterFeatures.SSL | ClusterFeatures.
1818

1919
public XPackClusterConfiguration(ClusterFeatures features) : base(ClusterFeatures.XPack | features, 1, ElasticsearchPlugin.IngestAttachment)
2020
{
21+
var isSnapshot = !string.IsNullOrEmpty(Version.PreRelease) && Version.PreRelease.ToLower().Contains("snapshot");
2122
// Get license file path from environment variable
2223
var licenseFilePath = Environment.GetEnvironmentVariable("ES_LICENSE_FILE");
23-
if (!string.IsNullOrEmpty(licenseFilePath) && File.Exists(licenseFilePath))
24+
if (!isSnapshot && !string.IsNullOrEmpty(licenseFilePath) && File.Exists(licenseFilePath))
2425
{
2526
var licenseContents = File.ReadAllText(licenseFilePath);
2627
XPackLicenseJson = licenseContents;

0 commit comments

Comments
 (0)