You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/07/29 04:18:26 UTC

[GitHub] [skywalking-swck] lujiajing1126 commented on a diff in pull request #70: [Feature] Add BanyanDB CRD & Controllers

lujiajing1126 commented on code in PR #70:
URL: https://github.com/apache/skywalking-swck/pull/70#discussion_r932853017


##########
operator/apis/operator/v1alpha1/banyandb_types.go:
##########
@@ -0,0 +1,66 @@
+package v1alpha1
+
+import (
+	appsv1 "k8s.io/api/apps/v1"
+	corev1 "k8s.io/api/core/v1"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+type BanyanDBSpec struct {
+
+	// Version of BanyanDB.
+	// +kubebuilder:validation:Required
+	Version string `json:"version"`
+
+	// Image is the BanyanDB Docker image to deploy.
+	// +kubebuilder:validation:Required
+	Image string `json:"image,omitempty"`
+
+	// BanyanDB startup parameters
+	// +kubebuilder:validation:Optional
+	Config map[string]string `json:"config"`
+
+	// BanyanDB Service
+	// +kubebuilder:validation:Optional
+	Service Service `json:"service,omitempty"`
+
+	// BanyanDB Storage
+	// +kubebuilder:validation:Optional
+	Storage corev1.PersistentVolumeClaim `json:"storage,omitempty"`
+}
+
+type BanyanDBState int8
+
+const (
+	Ready BanyanDBState = iota
+	Reconciling
+	Fail
+)
+
+type BanyanDBStatus struct {
+	// BanyanDB current state
+	State BanyanDBState `json:"state,omitempty"`
+	// Represents the latest available observations of the underlying statefulset's current state.
+	// +kubebuilder:validation:Optional
+	Conditions []appsv1.StatefulSetCondition `json:"conditions,omitempty"`
+}
+
+// +kubebuilder:object:root=true
+
+// BanyanDB is the Schema for the BanyanDB API
+type BanyanDB struct {
+	metav1.TypeMeta   `json:",inline"`
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+
+	Spec   BanyanDBSpec   `json:"spec,omitempty"`

Review Comment:
   Spec and Status should not be `omitempty` as I understand



##########
operator/apis/operator/v1alpha1/banyandb_types.go:
##########
@@ -0,0 +1,66 @@
+package v1alpha1
+
+import (
+	appsv1 "k8s.io/api/apps/v1"
+	corev1 "k8s.io/api/core/v1"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+type BanyanDBSpec struct {
+
+	// Version of BanyanDB.
+	// +kubebuilder:validation:Required
+	Version string `json:"version"`
+
+	// Image is the BanyanDB Docker image to deploy.
+	// +kubebuilder:validation:Required

Review Comment:
   The marker here is in conflict with the `omitempty` option below. 



-- 
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: notifications-unsubscribe@skywalking.apache.org

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