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 2022/07/14 13:54:55 UTC

[GitHub] [submarine] MortalHappiness commented on a diff in pull request #976: SUBMARINE-1290. Add k8s labels to k8s resources in submarine-cloud-v3

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: commits-unsubscribe@submarine.apache.org

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