Skip to content

Commit

Permalink
Fixed fmt issues. check_format.shj now shows diff of fmt errors.
Browse files Browse the repository at this point in the history
Signed-off-by: Houston Putman <hputman1@bloomberg.net>
  • Loading branch information
HoustonPutman committed May 3, 2019
1 parent 5a25d41 commit 2c7f01d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/zk/generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ func makeZkPodSpec(z *v1beta1.ZookeeperCluster, volumes []v1.Volume) v1.PodSpec
Containers: []v1.Container{zkContainer},
Affinity: z.Spec.Pod.Affinity,
Volumes: volumes,
TerminationGracePeriodSeconds: &z.Spec.Pod.TerminationGracePeriodSeconds,
}
if reflect.DeepEqual(v1.PodSecurityContext{}, z.Spec.Pod.SecurityContext) {
podSpec.SecurityContext = z.Spec.Pod.SecurityContext
}
podSpec.NodeSelector = z.Spec.Pod.NodeSelector
podSpec.Tolerations = z.Spec.Pod.Tolerations
podSpec.TerminationGracePeriodSeconds = &z.Spec.Pod.TerminationGracePeriodSeconds

return podSpec
}
Expand Down
7 changes: 6 additions & 1 deletion scripts/check_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ invalidFiles=$(gofmt -l $goFiles)

if [ "$invalidFiles" ]; then
echo -e "These files did not pass the 'go fmt' check, please run 'go fmt' on them:"
echo -e $invalidFiles
for file in $invalidFiles
do
echo ""
gofmt -d $file
done

exit 1
fi

0 comments on commit 2c7f01d

Please sign in to comment.