Skip to content

Commit

Permalink
chore: add pod annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Rory-Z committed Aug 17, 2023
1 parent 0946838 commit dd3c7ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions controllers/apps/v2beta1/add_emqx_core.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func generateStatefulSet(instance *appsv2beta1.EMQX) *appsv1.StatefulSet {
ObjectMeta: metav1.ObjectMeta{
Namespace: instance.Namespace,
Name: instance.CoreNamespacedName().Name,
Annotations: instance.Spec.CoreTemplate.Annotations,
Annotations: instance.Spec.CoreTemplate.DeepCopy().Annotations,
Labels: labels,
},
Spec: appsv1.StatefulSetSpec{
Expand All @@ -176,7 +176,8 @@ func generateStatefulSet(instance *appsv2beta1.EMQX) *appsv1.StatefulSet {
PodManagementPolicy: appsv1.ParallelPodManagement,
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: labels,
Annotations: instance.Spec.CoreTemplate.DeepCopy().Annotations,
Labels: labels,
},
Spec: corev1.PodSpec{
ReadinessGates: []corev1.PodReadinessGate{
Expand Down
5 changes: 3 additions & 2 deletions controllers/apps/v2beta1/add_emqx_repl.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func generateReplicaSet(instance *appsv2beta1.EMQX) *appsv1.ReplicaSet {
ObjectMeta: metav1.ObjectMeta{
Namespace: instance.Namespace,
Name: instance.ReplicantNamespacedName().Name,
Annotations: instance.Spec.ReplicantTemplate.Annotations,
Annotations: instance.Spec.ReplicantTemplate.DeepCopy().Annotations,
Labels: labels,
},
Spec: appsv1.ReplicaSetSpec{
Expand All @@ -180,7 +180,8 @@ func generateReplicaSet(instance *appsv2beta1.EMQX) *appsv1.ReplicaSet {
},
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: labels,
Annotations: instance.Spec.ReplicantTemplate.DeepCopy().Annotations,
Labels: labels,
},
Spec: corev1.PodSpec{
ReadinessGates: []corev1.PodReadinessGate{
Expand Down

0 comments on commit dd3c7ec

Please sign in to comment.