You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2021/08/26 04:09:40 UTC

[GitHub] [submarine] Kenchu123 commented on a change in pull request #719: SUBMARINE-950. Create state machine for submarine custom resource

Kenchu123 commented on a change in pull request #719:
URL: https://github.com/apache/submarine/pull/719#discussion_r696273895



##########
File path: submarine-cloud-v2/pkg/controller/controller.go
##########
@@ -380,102 +383,129 @@ func (c *Controller) processNextWorkItem() bool {
 // syncHandler compares the actual state with the desired, and attempts to
 // converge the two. It then updates the Status block of the Submarine resource
 // with the current status of the resource.
+// State Machine for Submarine
+//+-----------------------------------------------------------------+
+//|      +---------+         +----------+          +----------+     |
+//|      |         |         |          |          |          |     |
+//|      |   New   +---------> Creating +----------> Running  |     |
+//|      |         |         |          |          |          |     |
+//|      +----+----+         +-----+----+          +-----+----+     |
+//|           |                    |                     |          |
+//|           |                    |                     |          |
+//|           |                    |                     |          |
+//|           |                    |               +-----v----+     |
+//|           |                    |               |          |     |
+//|           +--------------------+--------------->  Failed  |     |
+//|                                                |          |     |
+//|                                                +----------+     |
+//+-----------------------------------------------------------------+
 func (c *Controller) syncHandler(key string) error {
 	// Convert the namespace/name string into a distinct namespace and name
 	namespace, name, err := cache.SplitMetaNamespaceKey(key)
 	if err != nil {
-		utilruntime.HandleError(fmt.Errorf("Invalid resource key: %s", key))
+		utilruntime.HandleError(fmt.Errorf("invalid resource key: %s", key))

Review comment:
       There is a warning: `Error strings should not be capitalized (unless beginning with proper nouns or acronyms) or end with punctuation`.
   
   Ref. https://github.com/golang/go/wiki/CodeReviewComments#error-strings




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@submarine.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org