-
Notifications
You must be signed in to change notification settings - Fork 38
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
Issue 489: Added support for custom storage option in long term storage #585
Changes from all commits
37776cc
968259a
637518c
8ca7a7a
aa86771
3807f45
437b7fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -456,6 +456,9 @@ type LongTermStorageSpec struct { | |||||
|
||||||
// Hdfs is used to configure an HDFS system as a Tier 2 backend | ||||||
Hdfs *HDFSSpec `json:"hdfs,omitempty"` | ||||||
|
||||||
// Custom Storage as a Tier2 backend | ||||||
Custom *CustomSpec `json:"custom,omitempty"` | ||||||
} | ||||||
|
||||||
// AuthImpemenationSpec helps to inject plugins to contoller pod | ||||||
|
@@ -471,7 +474,7 @@ type AuthHandlerSpec struct { | |||||
} | ||||||
|
||||||
func (s *LongTermStorageSpec) withDefaults() (changed bool) { | ||||||
if s.FileSystem == nil && s.Ecs == nil && s.Hdfs == nil { | ||||||
if s.FileSystem == nil && s.Ecs == nil && s.Hdfs == nil && s.Custom == nil { | ||||||
changed = true | ||||||
fs := &FileSystemSpec{ | ||||||
PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{ | ||||||
|
@@ -511,3 +514,9 @@ type HDFSSpec struct { | |||||
// +optional | ||||||
ReplicationFactor int32 `json:"replicationFactor"` | ||||||
} | ||||||
|
||||||
// CustomSpec contains the options and env variables to be passed to segmentstore | ||||||
type CustomSpec struct { | ||||||
Options map[string]string `json:"options,omitempty"` | ||||||
Env map[string]string `json:"env"` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This spec is actually needed to override the |
||||||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -284,6 +284,12 @@ func MakeSegmentstoreConfigMap(p *api.PravegaCluster) *corev1.ConfigMap { | |
javaOpts = append(javaOpts, fmt.Sprintf("-D%v=%v", name, value)) | ||
} | ||
|
||
if p.Spec.Pravega.LongTermStorage.Custom != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm... There is nothing saying that the storage options cannot be included by the customer into |
||
for name, value := range p.Spec.Pravega.LongTermStorage.Custom.Options { | ||
javaOpts = append(javaOpts, fmt.Sprintf("-D%v=%v", name, value)) | ||
} | ||
} | ||
|
||
sort.Strings(javaOpts) | ||
|
||
authEnabledStr := fmt.Sprint(p.Spec.Authentication.IsEnabled()) | ||
|
@@ -309,7 +315,6 @@ func MakeSegmentstoreConfigMap(p *api.PravegaCluster) *corev1.ConfigMap { | |
for k, v := range getTier2StorageOptions(p.Spec.Pravega) { | ||
configData[k] = v | ||
} | ||
|
||
return &corev1.ConfigMap{ | ||
TypeMeta: metav1.TypeMeta{ | ||
Kind: "ConfigMap", | ||
|
@@ -362,6 +367,12 @@ func getTier2StorageOptions(pravegaSpec *api.PravegaSpec) map[string]string { | |
} | ||
} | ||
|
||
if pravegaSpec.LongTermStorage.Custom != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There seems to be an indentation issue within There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
if pravegaSpec.LongTermStorage.Custom.Env != nil { | ||
return pravegaSpec.LongTermStorage.Custom.Env | ||
} | ||
} | ||
|
||
return make(map[string]string) | ||
} | ||
|
||
|
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.
Could we add the heading of this section to the contents in the beginning of the doc too?
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.
Done