Skip to content

Commit

Permalink
Fixing format and manifests.
Browse files Browse the repository at this point in the history
Signed-off-by: Houston Putman <[email protected]>
  • Loading branch information
HoustonPutman committed Feb 14, 2020
1 parent 636e672 commit a1c14b1
Show file tree
Hide file tree
Showing 6 changed files with 4,587 additions and 20 deletions.
3 changes: 1 addition & 2 deletions api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ type AdditionalVolume struct {
DefaultContainerMount corev1.VolumeMount `json:"defaultContainerMount"`
}


// ContainerImage defines the fields needed for a Docker repository image. The
// format here matches the predominant format used in Helm charts.
type ContainerImage struct {
Expand Down Expand Up @@ -135,4 +134,4 @@ func ImageVersion(image string) (version string) {
} else {
return split[1]
}
}
}
2,288 changes: 2,286 additions & 2 deletions config/crd/bases/solr.bloomberg.com_solrclouds.yaml

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions controllers/solrcloud_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,27 +126,27 @@ func TestCloudReconcileWithIngress(t *testing.T) {
UseEtcdCRD(false)
UseZkCRD(true)
g := gomega.NewGomegaWithT(t)
testPodAnnotations := map[string]string {
testPodAnnotations := map[string]string{
"test1": "value1",
"test2": "value2",
}
testPodLabels := map[string]string {
testPodLabels := map[string]string{
"test3": "value3",
"test4": "value4",
}
testSSAnnotations := map[string]string {
testSSAnnotations := map[string]string{
"test5": "value5",
"test6": "value6",
}
testSSLabels := map[string]string {
testSSLabels := map[string]string{
"test7": "value7",
"test8": "value8",
}
instance := &solr.SolrCloud{
ObjectMeta: metav1.ObjectMeta{
Name: expectedCloudRequest.Name,
Name: expectedCloudRequest.Name,
Namespace: expectedCloudRequest.Namespace,
Labels: map[string]string{"base": "here"},
Labels: map[string]string{"base": "here"},
},
Spec: solr.SolrCloudSpec{
ZookeeperRef: &solr.ZookeeperRef{
Expand All @@ -156,7 +156,7 @@ func TestCloudReconcileWithIngress(t *testing.T) {
},
SolrGCTune: "gc Options",
CustomSolrKubeOptions: solr.CustomSolrKubeOptions{
PodOptions: &solr.PodOptions{
PodOptions: &solr.PodOptions{
Annotations: testPodAnnotations,
Labels: testPodLabels,
},
Expand Down Expand Up @@ -215,8 +215,8 @@ func TestCloudReconcileWithIngress(t *testing.T) {
"SOLR_PORT": "8983",
"GC_TUNE": "gc Options",
}
expectedStatefulSetLabels := util.MergeLabelsOrAnnotations(instance.SharedLabelsWith(instance.Labels), map[string]string {"technology": "solr-cloud"})
expectedStatefulSetAnnotations := map[string]string {util.SolrZKConnectionStringAnnotation: "host:7271/"}
expectedStatefulSetLabels := util.MergeLabelsOrAnnotations(instance.SharedLabelsWith(instance.Labels), map[string]string{"technology": "solr-cloud"})
expectedStatefulSetAnnotations := map[string]string{util.SolrZKConnectionStringAnnotation: "host:7271/"}
testPodEnvVariables(t, expectedEnvVars, statefulSet.Spec.Template.Spec.Containers[0].Env)
testMapsEqual(t, "statefulSet labels", util.MergeLabelsOrAnnotations(expectedStatefulSetLabels, testSSLabels), statefulSet.Labels)
testMapsEqual(t, "statefulSet annotations", util.MergeLabelsOrAnnotations(expectedStatefulSetAnnotations, testSSAnnotations), statefulSet.Annotations)
Expand Down Expand Up @@ -446,4 +446,4 @@ func TestDefaults(t *testing.T) {
assert.NotNil(t, instance.Spec.ZookeeperRef.ProvidedZookeeper.Zookeeper.Persistence.PersistentVolumeClaimSpec, "Bad Default - instance.Spec.ZookeeperRef.ProvidedZookeeper.Zookeeper.Persistence.PersistentVolumeClaimSpec")
assert.Equal(t, 1, len(instance.Spec.ZookeeperRef.ProvidedZookeeper.Zookeeper.Persistence.PersistentVolumeClaimSpec.Resources.Requests), "Bad Default - Spec.ZookeeperRef.ProvidedZookeeper.Zookeeper.Persistence.PersistentVolumeClaimSpec.Resources length")
assert.Equal(t, 1, len(instance.Spec.ZookeeperRef.ProvidedZookeeper.Zookeeper.Persistence.PersistentVolumeClaimSpec.AccessModes), "Bad Default - Spec.ZookeeperRef.ProvidedZookeeper.Zookeeper.Persistence.PersistentVolumeClaimSpec.AccesModes length")
}
}
6 changes: 3 additions & 3 deletions controllers/util/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func DuplicateLabelsOrAnnotations(from map[string]string) map[string]string {
for k, v := range from {
to[k] = v
}
return to;
return to
}

func MergeLabelsOrAnnotations(base, additional map[string]string) map[string]string {
Expand All @@ -64,5 +64,5 @@ func MergeLabelsOrAnnotations(base, additional map[string]string) map[string]str
merged[k] = v
}
}
return merged;
}
return merged
}
2 changes: 1 addition & 1 deletion controllers/util/solr_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func GenerateStatefulSet(solrCloud *solr.SolrCloud, solrCloudStatus *solr.SolrCl
},
},
VolumeMounts: volumeMounts,
Env: envVars,
Env: envVars,
LivenessProbe: &corev1.Probe{
InitialDelaySeconds: 20,
TimeoutSeconds: 1,
Expand Down
Loading

0 comments on commit a1c14b1

Please sign in to comment.