@@ -293,7 +293,9 @@ func WriteMetadataToFile(metadata *Metadata, path string) error {
293
293
294
294
func getObjectDisksCredentials (ctx context.Context , ch * clickhouse.ClickHouse ) (map [string ]ObjectStorageCredentials , error ) {
295
295
credentials := make (map [string ]ObjectStorageCredentials )
296
- if version , err := ch .GetVersion (ctx ); err != nil {
296
+ var version int
297
+ var err error
298
+ if version , err = ch .GetVersion (ctx ); err != nil {
297
299
return nil , err
298
300
} else if version <= 20006000 {
299
301
return credentials , nil
@@ -320,8 +322,11 @@ func getObjectDisksCredentials(ctx context.Context, ch *clickhouse.ClickHouse) (
320
322
}
321
323
if endPointNode := d .SelectElement ("endpoint" ); endPointNode != nil {
322
324
creds .EndPoint = strings .Trim (endPointNode .InnerText (), "\r \n \t " )
323
- if creds .EndPoint , err = ch .ApplyMacros (ctx , creds .EndPoint ); err != nil {
324
- return nil , fmt .Errorf ("%s -> /%s/storage_configuration/disks/%s apply macros to <endpoint> error: %v" , configFile , root .Data , diskName , err )
325
+ // macros works only after 23.3+ https://github.com/Altinity/clickhouse-backup/issues/750
326
+ if version > 23003000 {
327
+ if creds .EndPoint , err = ch .ApplyMacros (ctx , creds .EndPoint ); err != nil {
328
+ return nil , fmt .Errorf ("%s -> /%s/storage_configuration/disks/%s apply macros to <endpoint> error: %v" , configFile , root .Data , diskName , err )
329
+ }
325
330
}
326
331
} else {
327
332
return nil , fmt .Errorf ("%s -> /%s/storage_configuration/disks/%s doesn't contains <endpoint>" , configFile , root .Data , diskName )
0 commit comments