Skip to content

Commit 617769d

Browse files
author
anton.voskresensky
committed
fix checks config
1 parent 6dc4fd2 commit 617769d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pkg/config/osctlindicesconfig.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,17 @@ func LoadOsctlIndicesConfig(path string) (*OsctlIndicesConfig, error) {
5959

6060
hasIndicesOrUnknown := len(config.Indices) > 0 || config.Unknown.DaysCount > 0
6161
if hasIndicesOrUnknown {
62-
if config.S3Snapshots.UnitCount.All < 1 {
62+
hasSnapshotEnabled := config.Unknown.Snapshot
63+
if !hasSnapshotEnabled {
64+
for _, idx := range config.Indices {
65+
if idx.Snapshot {
66+
hasSnapshotEnabled = true
67+
break
68+
}
69+
}
70+
}
71+
72+
if hasSnapshotEnabled && config.S3Snapshots.UnitCount.All < 1 {
6373
return nil, fmt.Errorf("s3_snapshots.unit_count.all must be >= 1 when indices or unknown config is present")
6474
}
6575

0 commit comments

Comments
 (0)