-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Added feast Go operator db stores support #4771
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Daniele Martinoli <[email protected]>
…use it in deploy flow Signed-off-by: Daniele Martinoli <[email protected]>
Signed-off-by: Theodor Mihalache <[email protected]>
|
||
if services.OfflineStore.Persistence != nil && | ||
services.OfflineStore.Persistence.FilePersistence != nil && | ||
len(services.OfflineStore.Persistence.FilePersistence.Type) > 0 { | ||
persistenceType = services.OfflineStore.Persistence.FilePersistence.Type | ||
} else if services.OfflineStore.Persistence != nil && | ||
services.OfflineStore.Persistence.DBPersistence != nil { | ||
if len(services.OfflineStore.Persistence.DBPersistence.Type) > 0 { | ||
var err error | ||
persistenceType = services.OfflineStore.Persistence.DBPersistence.Type | ||
secretKeyName := services.OfflineStore.Persistence.DBPersistence.SecretKeyName | ||
if len(secretKeyName) == 0 { | ||
secretKeyName = persistenceType | ||
} | ||
parametersMap, err = secretExtractionFunc(services.OfflineStore.Persistence.DBPersistence.SecretRef.Name, secretKeyName) | ||
if err != nil { | ||
return err | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for these setRepoConfig functions, maybe we can clean it up a bit by consolidating?
if services.OfflineStore.Persistence != nil && | |
services.OfflineStore.Persistence.FilePersistence != nil && | |
len(services.OfflineStore.Persistence.FilePersistence.Type) > 0 { | |
persistenceType = services.OfflineStore.Persistence.FilePersistence.Type | |
} else if services.OfflineStore.Persistence != nil && | |
services.OfflineStore.Persistence.DBPersistence != nil { | |
if len(services.OfflineStore.Persistence.DBPersistence.Type) > 0 { | |
var err error | |
persistenceType = services.OfflineStore.Persistence.DBPersistence.Type | |
secretKeyName := services.OfflineStore.Persistence.DBPersistence.SecretKeyName | |
if len(secretKeyName) == 0 { | |
secretKeyName = persistenceType | |
} | |
parametersMap, err = secretExtractionFunc(services.OfflineStore.Persistence.DBPersistence.SecretRef.Name, secretKeyName) | |
if err != nil { | |
return err | |
} | |
} | |
} | |
offlinePersistence := services.OfflineStore.Persistence | |
if offlinePersistence != nil && | |
offlinePersistence.FilePersistence != nil && | |
len(offlinePersistence.FilePersistence.Type) > 0 { | |
persistenceType = offlinePersistence.FilePersistence.Type | |
} else if offlinePersistence != nil && | |
offlinePersistence.DBPersistence != nil { | |
if len(offlinePersistence.DBPersistence.Type) > 0 { | |
var err error | |
persistenceType = offlinePersistence.DBPersistence.Type | |
secretKeyName := offlinePersistence.DBPersistence.SecretKeyName | |
if len(secretKeyName) == 0 { | |
secretKeyName = persistenceType | |
} | |
parametersMap, err = secretExtractionFunc(offlinePersistence.DBPersistence.SecretRef.Name, secretKeyName) | |
if err != nil { | |
return err | |
} | |
} | |
} |
var err error | ||
filePath = "" | ||
persistenceType = services.Registry.Local.Persistence.DBPersistence.Type | ||
secretKeyName := services.Registry.Local.Persistence.DBPersistence.SecretKeyName | ||
if len(secretKeyName) == 0 { | ||
secretKeyName = persistenceType | ||
} | ||
parametersMap, err = secretExtractionFunc(services.Registry.Local.Persistence.DBPersistence.SecretRef.Name, secretKeyName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to declare an error var... instead use a short assignment statement as we do elsewhere in the code.
var err error | |
filePath = "" | |
persistenceType = services.Registry.Local.Persistence.DBPersistence.Type | |
secretKeyName := services.Registry.Local.Persistence.DBPersistence.SecretKeyName | |
if len(secretKeyName) == 0 { | |
secretKeyName = persistenceType | |
} | |
parametersMap, err = secretExtractionFunc(services.Registry.Local.Persistence.DBPersistence.SecretRef.Name, secretKeyName) | |
filePath = "" | |
persistenceType = services.Registry.Local.Persistence.DBPersistence.Type | |
secretKeyName := services.Registry.Local.Persistence.DBPersistence.SecretKeyName | |
if len(secretKeyName) == 0 { | |
secretKeyName = persistenceType | |
} | |
parametersMap, err := secretExtractionFunc(services.Registry.Local.Persistence.DBPersistence.SecretRef.Name, secretKeyName) |
} else if services.OnlineStore.Persistence != nil && | ||
services.OnlineStore.Persistence.DBPersistence != nil { | ||
if len(services.OnlineStore.Persistence.DBPersistence.Type) > 0 { | ||
var err error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
} else if services.OfflineStore.Persistence != nil && | ||
services.OfflineStore.Persistence.DBPersistence != nil { | ||
if len(services.OfflineStore.Persistence.DBPersistence.Type) > 0 { | ||
var err error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
objectKey := client.ObjectKeyFromObject(secret) | ||
if err := feast.Client.Get(feast.Context, objectKey, secret); err != nil { | ||
if apierrors.IsNotFound(err) || err != nil { | ||
return nil, fmt.Errorf("invalid secret %s for offline store", secretRef) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe just return the error here but log an Error prior to the return
return nil, fmt.Errorf("invalid secret %s for offline store", secretRef) | |
logger := log.FromContext(feast.Context) | |
logger.Error("invalid secret %s for offline store", secretRef) | |
return nil, err |
What this PR does / why we need it:
This PR adds db stores persistence configuration options to the FeatureStore CRD.
DB store para
Which issue(s) this PR fixes:
Relates to #4561