Skip to content

Commit 2840833

Browse files
fix: Ssl missing configratiun crash (#398) (#399)
* SSL configuration fix * Added script for building local tile
1 parent b5e4c0e commit 2840833

File tree

2 files changed

+54
-4
lines changed

2 files changed

+54
-4
lines changed

scripts/local-tile-build.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env bash
2+
3+
cd ..
4+
set -e
5+
echo "Local tile build script"
6+
7+
# Read current version from tile-history.yml
8+
CURRENT_VERSION=$(grep '^version:' tile/tile-history.yml)
9+
10+
if [ -z "$CURRENT_VERSION" ]; then
11+
echo "Could not read version from tile/tile-history.yml"
12+
exit 1
13+
fi
14+
15+
echo "Building version: $CURRENT_VERSION"
16+
17+
echo "Building Go binary..."
18+
env GOOS=linux GOARCH=amd64 go build -o splunk-firehose-nozzle -ldflags "-X main.version=$CURRENT_VERSION" ./main.go
19+
20+
# Make sure binary is executable
21+
chmod +x splunk-firehose-nozzle
22+
23+
# Check if tile command exists
24+
if ! command -v tile &> /dev/null; then
25+
echo "tile command not found. Installing tile-generator..."
26+
pip3 install tile-generator
27+
fi
28+
29+
# Check if bosh command exists (required by tile-generator)
30+
if ! command -v bosh &> /dev/null; then
31+
echo "bosh command not found. Please install bosh-cli:"
32+
echo " brew install cloudfoundry/tap/bosh-cli"
33+
echo " # or download from: https://github.com/cloudfoundry/bosh-cli/releases"
34+
exit 1
35+
fi
36+
37+
# Build the tile
38+
echo "Building tile..."
39+
cd tile
40+
tile build $CURRENT_VERSION
41+
cd ..
42+
43+
echo "Build completed!"
44+
ls -la tile/product/*.pivotal

splunknozzle/nozzle.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ package splunknozzle
33
import (
44
"context"
55
"fmt"
6-
"github.com/cloudfoundry/go-cfclient/v3/resource"
76
"os"
87
"strings"
98
"time"
109

10+
"github.com/cloudfoundry/go-cfclient/v3/resource"
11+
1112
"code.cloudfoundry.org/lager/v3"
1213
"github.com/cloudfoundry-community/splunk-firehose-nozzle/cache"
1314
"github.com/cloudfoundry-community/splunk-firehose-nozzle/eventrouter"
@@ -88,11 +89,16 @@ func (s *SplunkFirehoseNozzle) EventRouter(cache cache.Cache, eventSink eventsin
8889

8990
// CFClient creates a client object which can talk to Cloud Foundry
9091
func (s *SplunkFirehoseNozzle) PCFClient() (*NozzleCfClient, error) {
91-
var skipSSL config.Option
92+
var cfConfig *config.Config
93+
var err error
94+
9295
if s.config.SkipSSLCF {
93-
skipSSL = config.SkipTLSValidation()
96+
cfConfig, err = config.New(s.config.ApiEndpoint, config.ClientCredentials(s.config.ClientID, s.config.ClientSecret), config.SkipTLSValidation(), config.UserAgent(fmt.Sprintf("splunk-firehose-nozzle/%s", s.config.Version)))
97+
} else {
98+
cfConfig, err = config.New(s.config.ApiEndpoint, config.ClientCredentials(s.config.ClientID, s.config.ClientSecret), config.UserAgent(fmt.Sprintf("splunk-firehose-nozzle/%s", s.config.Version)))
9499
}
95-
if cfConfig, err := config.New(s.config.ApiEndpoint, config.ClientCredentials(s.config.ClientID, s.config.ClientSecret), skipSSL, config.UserAgent(fmt.Sprintf("splunk-firehose-nozzle/%s", s.config.Version))); err != nil {
100+
101+
if err != nil {
96102
return nil, err
97103
} else {
98104
if cfClient, err := client.New(cfConfig); err != nil {

0 commit comments

Comments
 (0)