You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2020/11/15 19:10:16 UTC

[GitHub] [rocketmq-operator] AdheipSingh commented on a change in pull request #61: [ISSUEE 60] Add features to the broker and nameserver

AdheipSingh commented on a change in pull request #61:
URL: https://github.com/apache/rocketmq-operator/pull/61#discussion_r523799429



##########
File path: pkg/controller/broker/broker_controller.go
##########
@@ -401,8 +401,15 @@ func (r *ReconcileBroker) getBrokerStatefulSet(broker *rocketmqv1alpha1.Broker,
 			Template: corev1.PodTemplateSpec{
 				ObjectMeta: metav1.ObjectMeta{
 					Labels: ls,
+					Annotations: broker.Spec.PodAnnotations,
 				},
 				Spec: corev1.PodSpec{
+					Affinity: broker.Spec.Affinity,
+					SecurityContext: broker.Spec.SecurityContext,
+					ImagePullSecrets: broker.Spec.ImagePullSecrets,
+					Tolerations: broker.Spec.Tolerations,
+					NodeSelector: broker.Spec.NodeSelector,
+					PriorityClassName: broker.Spec.PriorityClassName,

Review comment:
       You need to write functions for each of them and handle nil value scenarios, by directly adding this you are forcing the user at all times to specify these values, the operator will crash if you don't pass in tolerations.

##########
File path: pkg/controller/nameservice/nameservice_controller.go
##########
@@ -316,10 +316,17 @@ func (r *ReconcileNameService) statefulSetForNameService(nameService *rocketmqv1
 			Template: corev1.PodTemplateSpec{
 				ObjectMeta: metav1.ObjectMeta{
 					Labels: ls,
+					Annotations: nameService.Spec.PodAnnotations,
 				},
 				Spec: corev1.PodSpec{
 					HostNetwork: nameService.Spec.HostNetwork,
 					DNSPolicy: nameService.Spec.DNSPolicy,
+					Affinity: nameService.Spec.Affinity,
+					SecurityContext: nameService.Spec.SecurityContext,
+					ImagePullSecrets: nameService.Spec.ImagePullSecrets,
+					Tolerations: nameService.Spec.Tolerations,
+					NodeSelector: nameService.Spec.NodeSelector,
+					PriorityClassName: nameService.Spec.PriorityClassName,

Review comment:
       same here, we need to write functions to get values to handle nil/empty scenarios




----------------------------------------------------------------
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.

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