MortalHappiness commented on code in PR #976:
URL: https://github.com/apache/submarine/pull/976#discussion_r921182913


##########
submarine-cloud-v3/artifacts/submarine-database.yaml:
##########
@@ -20,6 +20,10 @@ apiVersion: v1
 kind: PersistentVolumeClaim
 metadata:
   name: submarine-database-pvc
+  labels:
+    app.kubernetes.io/name: submarine-database
+    app.kubernetes.io/version: "0.8.0-SNAPSHOT"
+    app.kubernetes.io/component: database
 spec:

Review Comment:
   I think we can write the version information in golang file instead of yaml 
file. For example, for this PersistentVolumeClaim, see the golang function 
below. We can set `pvc.Labels` before we create the resource. This version 
information can be written as golang constant.
   
   
https://github.com/apache/submarine/blob/e7ed4a5b182a7cc3cad32f406a8327e6c788d966/submarine-cloud-v3/controllers/submarine_database.go#L35-L46
   
   For your reference:
   + https://pkg.go.dev/k8s.io/api/core/v1#PersistentVolumeClaim
   + https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#ObjectMeta



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to