Skip to content

Commit

Permalink
Adding optionals, changing pod to podpolicy
Browse files Browse the repository at this point in the history
Signed-off-by: Zane Williamson <zanew@zillow.com>
  • Loading branch information
sepulworld committed Oct 31, 2019
1 parent b7a7308 commit 29a9ae4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/crds/solr_v1beta1_solrprometheusexporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/solr/v1beta1/solrcloud_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ type ZookeeperSpec struct {
PersistentVolumeClaimSpec *corev1.PersistentVolumeClaimSpec `json:"persistentVolumeClaimSpec,omitempty"`

// Pod resources for zookeeper pod
// +optional
ZookeeperPod ZookeeperPodPolicy `json:"zookeeperPodPolicy,omitempty"`
}

Expand Down Expand Up @@ -400,6 +401,7 @@ type EtcdSpec struct {
PersistentVolumeClaimSpec *corev1.PersistentVolumeClaimSpec `json:"persistentVolumeClaimSpec,omitempty"`

// Pod resources for etcd pods
// +optional
EtcdPod EtcdPodPolicy `json:"etcdPodPolicy,omitempty"`
}

Expand Down Expand Up @@ -440,6 +442,7 @@ type ZetcdSpec struct {
Image *ContainerImage `json:"image,omitempty"`

// Pod resources for zetcd pods
// +optional
ZetcdPod ZetcdPodPolicy `json:"zetcdPodPolicy,omitempty"`
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/solr/v1beta1/solrprometheusexporter_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/solr/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/controller/util/prometheus_exporter_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 29a9ae4

Please sign in to comment.