-
Notifications
You must be signed in to change notification settings - Fork 26
Conversation
Codecov Report
@@ Coverage Diff @@
## master #74 +/- ##
=======================================
Coverage 67.17% 67.17%
=======================================
Files 6 6
Lines 591 591
=======================================
Hits 397 397
Misses 168 168
Partials 26 26 Continue to review full report at Codecov.
|
@amisevsk @sleshchenko Why volume |
@AndrienkoAleksandr The main reason why it's persisted - because of fact that Plugin Broker as a separate Pod downloads plugins binaries and they should be delivered to Workspace Pod. I guess there are ways to avoid necessity of using different pods, but it's another store. |
Is it ready to review? Could you please link it with the related PRs, like plugin registry(I guess model description should be updated) and Che Server. |
Yes, it is. |
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.
LGTM 👍
I've left just one comment but it's more for discussing than for requiring changes.
model/model.go
Outdated
func (v *Volume) UnmarshalYAML(unmarshal func(interface{}) error) error { | ||
type volume Volume | ||
// Volume is persisted by default | ||
raw := volume{PersistVolume: true} |
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.
It's not a real recommendation but just a statement...
Common practice - false
is a default value.
Like from Java Boolean.parse(String)
The {@code boolean}
* returned represents the value {@code true} if the string argument
* is not {@code null} and is equal, ignoring case, to the string
* {@code "true"}. <p>
or when you run mvn clean install
tests are run by default, and if you want to skip them you should specify like -Dmaven.skip.tests
or -DskipTests
arguments...
It makes me think maybe it makes sense to rename persistVolume
to ephemeralVolume
or ephemeral
(maybe without volume word since it's a property of volume) with default value - false.
At the same time, on Che Server side we already have persistVolumes wsConfig attribute with default value true.
Let me clarify that I'm not against the current approach but just shared my thoughts.
Let's wait others thoughts before changing it. @amisevsk WDYT?
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.
I'm a big +1 for keeping our terms in line with the k8s API spec. I would suggest we use emptyDir
here, to more closely signify to a user that this results in the volume being an emptyDir volume. persistVolume
is a Che-specific concept, so while it makes sense to Che devs it doesn't make sense to users without documentation.
Also +1 on having false be a default, in which case the default initialization in go can be used here.
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.
With regards to persistVolume
in Che and something else here, I think the difference isn't a huge issue; calling the property emptyDir
here makes sense since we're describing a Kubernetes volume. On the Che side, persistVolumes
describes a Che-specific setting. Maybe a better name for the Che server property would be something like useEmptyDirVolumes
, but that's a different discussion.
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.
Ephemeral - it's something general. In theory, we can imagine that we will move to another implementation like CSI ephemeral volumes
for some cases.
emptyDir is like one of k8s implementation, but it's just an assumption maybe it would be more straight forward to go with emptyDir since in K8s docs emptyDir is not directly described as ephemeral.
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.
+1 for ephemeral
and having false
as the default.
I think we should:
- Be as much general as possible in the definition of the components of a cloud workspace,
- Choose default values to enable as small yaml definitions as possible and as simple implementations as possible: in Go APIs,
false
would be the default for a boolean value that is omitted in Json or Yaml afaik.
Signed-off-by: Oleksandr Andriienko <[email protected]>
…eral. Signed-off-by: Oleksandr Andriienko <[email protected]>
Signed-off-by: Oleksandr Andriienko <[email protected]>
Signed-off-by: Oleksandr Andriienko <[email protected]>
Taking a look in a moment; to add to the question of why |
59c0ead
to
d805fb2
Compare
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.
As suggested by @sleshchenko I'd prefer using the ephemeral
field name in the model, with false
as the default value.
…that. Signed-off-by: Oleksandr Andriienko <[email protected]>
As suggested by @sleshchenko I'd prefer using the ephemeral field name in the model, with false as > the default value. Done |
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.
LGTM
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.
still LGTM
What does this PR do?
Add ability mark volumes in the CheContainers like persisted or ephemeral. Set up volume like persisted by default(If user in the yaml doesn't applied persistVolume value)
What issues does this PR fix or reference?
eclipse-che/che#13387
Needed for eclipse-che/che#14539