-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement migrations based on the metadata version instead of just unmarshalling and re-marshalling the config.
- Loading branch information
Showing
6 changed files
with
135 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package upgrade | ||
|
||
import "github.com/LINBIT/linstor-gateway/pkg/reactor" | ||
|
||
// removeID unsets the ID field of the promoter config. | ||
// Starting with drbd-reactor v1.2.0, configs no longer require an ID. It | ||
// prints a deprecation warning when it is used, so remove the field. | ||
func removeID(cfg *reactor.PromoterConfig) error { | ||
cfg.ID = "" | ||
return nil | ||
} | ||
|
||
func firstResourceId(cfg *reactor.PromoterConfig) string { | ||
for k := range cfg.Resources { | ||
return k | ||
} | ||
return "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters