Skip to content

Conversation

nb-ohad
Copy link
Contributor

@nb-ohad nb-ohad commented Jun 28, 2020

  • Moved BackingStorePhaseInfo from backingstore_types.go to the reconciler (the struct only serve as an implementation detail and should not be exposed as an API)
  • Refactor out all redundant info from BackingStorePhaseInfo
  • Added severity to BackingStorePhaseInfo, to represent an event severity attached to the mode
  • Renamed BackingStorePhaseInfo to better fit its actual usage.

Fixing BZ 1847815

@nb-ohad nb-ohad requested a review from romayalon June 28, 2020 10:32
@nb-ohad nb-ohad force-pushed the ohad-fix-backingstore-event-types branch from 981aa0c to 0e06bc0 Compare June 28, 2020 10:39
@nb-ohad nb-ohad force-pushed the ohad-fix-backingstore-event-types branch from 0e06bc0 to 1cf6e31 Compare June 28, 2020 11:35
Also removed BackingStorePhaseInfo from backingstore_types.go as it is an interal structure that is not part of the backingstore API and should be treated as such (the struct only serve as an implementation detail)
@nb-ohad nb-ohad force-pushed the ohad-fix-backingstore-event-types branch from 1cf6e31 to a41e1a7 Compare June 28, 2020 11:44
@nb-ohad nb-ohad merged commit 17d9d3e into noobaa:master Jun 28, 2020
"IO_ERRORS": {nbv1.BackingStorePhaseRejected, "BackingStorePhaseRejected", "Backing store mode: IO_ERRORS"},
"STORAGE_NOT_EXIST": {nbv1.BackingStorePhaseRejected, "BackingStorePhaseRejected", "Backing store mode: STORAGE_NOT_EXIST"},
"AUTH_FAILED": {nbv1.BackingStorePhaseRejected, "BackingStorePhaseRejected", "Backing store mode: AUTH_FAILED"},
func modeInfoMap() map[string]ModeInfo {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nb-ohad Why do you use an init() function to call another function just to return a map when you can create the map directly on the global var - am I missing something?

var bsModeInfoMap = map[string]ModeInfo{
	"INITIALIZING":        {nbv1.BackingStorePhaseReady, corev1.EventTypeNormal},
	"DELETING":            {nbv1.BackingStorePhaseReady, corev1.EventTypeNormal},
	"SCALING":             {nbv1.BackingStorePhaseReady, corev1.EventTypeNormal},
	...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guymguym this was in the original code. I didn't change it. But you are perfectly right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants