diff --git a/config/crds/solr_v1beta1_solrprometheusexporter.yaml b/config/crds/solr_v1beta1_solrprometheusexporter.yaml index cd832b90..d84b64dc 100644 --- a/config/crds/solr_v1beta1_solrprometheusexporter.yaml +++ b/config/crds/solr_v1beta1_solrprometheusexporter.yaml @@ -68,7 +68,7 @@ spec: to 1 format: int32 type: integer - pod: + podPolicy: description: Pod defines the policy to create pod for the SolrCloud. Updating the Pod does not take effect on any existing pods. properties: diff --git a/pkg/apis/solr/v1beta1/solrcloud_types.go b/pkg/apis/solr/v1beta1/solrcloud_types.go index ee4610c8..fd266d8d 100644 --- a/pkg/apis/solr/v1beta1/solrcloud_types.go +++ b/pkg/apis/solr/v1beta1/solrcloud_types.go @@ -320,6 +320,7 @@ type ZookeeperSpec struct { PersistentVolumeClaimSpec *corev1.PersistentVolumeClaimSpec `json:"persistentVolumeClaimSpec,omitempty"` // Pod resources for zookeeper pod + // +optional ZookeeperPod ZookeeperPodPolicy `json:"zookeeperPodPolicy,omitempty"` } @@ -400,6 +401,7 @@ type EtcdSpec struct { PersistentVolumeClaimSpec *corev1.PersistentVolumeClaimSpec `json:"persistentVolumeClaimSpec,omitempty"` // Pod resources for etcd pods + // +optional EtcdPod EtcdPodPolicy `json:"etcdPodPolicy,omitempty"` } @@ -440,6 +442,7 @@ type ZetcdSpec struct { Image *ContainerImage `json:"image,omitempty"` // Pod resources for zetcd pods + // +optional ZetcdPod ZetcdPodPolicy `json:"zetcdPodPolicy,omitempty"` } diff --git a/pkg/apis/solr/v1beta1/solrprometheusexporter_types.go b/pkg/apis/solr/v1beta1/solrprometheusexporter_types.go index 73f596e0..d1104b4d 100644 --- a/pkg/apis/solr/v1beta1/solrprometheusexporter_types.go +++ b/pkg/apis/solr/v1beta1/solrprometheusexporter_types.go @@ -38,7 +38,7 @@ type SolrPrometheusExporterSpec struct { // Pod defines the policy to create pod for the SolrCloud. // Updating the Pod does not take effect on any existing pods. // +optional - Pod SolrPodPolicy `json:"pod,omitempty"` + PodPolicy SolrPodPolicy `json:"podPolicy,omitempty"` // The entrypoint into the exporter. Defaults to the official docker-solr location. // +optional diff --git a/pkg/apis/solr/v1beta1/zz_generated.deepcopy.go b/pkg/apis/solr/v1beta1/zz_generated.deepcopy.go index 6e45e0ac..8536e5c4 100644 --- a/pkg/apis/solr/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/solr/v1beta1/zz_generated.deepcopy.go @@ -746,7 +746,7 @@ func (in *SolrPrometheusExporterSpec) DeepCopyInto(out *SolrPrometheusExporterSp *out = new(ContainerImage) **out = **in } - in.Pod.DeepCopyInto(&out.Pod) + in.PodPolicy.DeepCopyInto(&out.PodPolicy) return } diff --git a/pkg/controller/util/prometheus_exporter_util.go b/pkg/controller/util/prometheus_exporter_util.go index ae0357a7..af2b477f 100644 --- a/pkg/controller/util/prometheus_exporter_util.go +++ b/pkg/controller/util/prometheus_exporter_util.go @@ -158,8 +158,8 @@ func GenerateSolrPrometheusExporterDeployment(solrPrometheusExporter *solr.SolrP } } - if solrPrometheusExporter.Spec.Pod.Resources.Limits != nil || solrPrometheusExporter.Spec.Pod.Resources.Requests != nil { - deployment.Spec.Template.Spec.Containers[0].Resources = solrPrometheusExporter.Spec.Pod.Resources + if solrPrometheusExporter.Spec.PodPolicy.Resources.Limits != nil || solrPrometheusExporter.Spec.PodPolicy.Resources.Requests != nil { + deployment.Spec.Template.Spec.Containers[0].Resources = solrPrometheusExporter.Spec.PodPolicy.Resources } return deployment