Skip to content

Commit 57e1f68

Browse files
authored
Merge pull request #1236 from spaceuptech/v0.19.1
v0.19.1
2 parents 2d1e94f + 3b08cd3 commit 57e1f68

36 files changed

+322
-202
lines changed

gateway/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM golang:1.13.5-alpine3.10
22
WORKDIR /build
33

44
# Take the current space cloud version as a argument
5-
ARG SC_VERSION=0.19.0
5+
ARG SC_VERSION=0.19.1
66

77
# Copy all the source files
88
COPY . .
@@ -16,7 +16,7 @@ RUN GOOS=linux CGO_ENABLED=0 go build -a -ldflags '-s -w -extldflags "-static"'
1616
RUN echo $SC_VERSION && wget https://storage.googleapis.com/space-cloud/mission-control/mission-control-v$SC_VERSION.zip && unzip mission-control-v$SC_VERSION.zip
1717

1818
FROM alpine:3.10
19-
ARG SC_VERSION=0.19.0
19+
ARG SC_VERSION=0.19.1
2020

2121
RUN apk --no-cache add ca-certificates
2222

gateway/config/config.go

+24-20
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,15 @@ func (headers Headers) UpdateHeader(reqHeaders http.Header) {
233233

234234
// FileStore holds the config for the file store module
235235
type FileStore struct {
236-
Enabled bool `json:"enabled" yaml:"enabled"`
237-
StoreType string `json:"storeType" yaml:"storeType"`
238-
Conn string `json:"conn" yaml:"conn"`
239-
Endpoint string `json:"endpoint" yaml:"endpoint"`
240-
Bucket string `json:"bucket" yaml:"bucket"`
241-
Secret string `json:"secret" yaml:"secret"`
242-
Rules []*FileRule `json:"rules,omitempty" yaml:"rules"`
236+
Enabled bool `json:"enabled" yaml:"enabled"`
237+
StoreType string `json:"storeType" yaml:"storeType"`
238+
Conn string `json:"conn" yaml:"conn"`
239+
Endpoint string `json:"endpoint" yaml:"endpoint"`
240+
Bucket string `json:"bucket" yaml:"bucket"`
241+
Secret string `json:"secret" yaml:"secret"`
242+
Rules []*FileRule `json:"rules,omitempty" yaml:"rules"`
243+
DisableSSL *bool `json:"disableSSL,omitempty" yaml:"disableSSL,omitempty"`
244+
ForcePathStyle *bool `json:"forcePathStyle,omitempty" yaml:"forcePathStyle,omitempty"`
243245
}
244246

245247
// FileRule is the authorization object at the file rule level
@@ -267,23 +269,25 @@ type StaticRoute struct {
267269

268270
// Eventing holds the config for the eventing module (task queue)
269271
type Eventing struct {
270-
Enabled bool `json:"enabled" yaml:"enabled"`
271-
DBAlias string `json:"dbAlias" yaml:"dbAlias"`
272-
Rules map[string]EventingRule `json:"triggers,omitempty" yaml:"triggers"`
273-
InternalRules map[string]EventingRule `json:"internalTriggers,omitempty" yaml:"internalTriggers,omitempty"`
274-
SecurityRules map[string]*Rule `json:"securityRules,omitempty" yaml:"securityRules,omitempty"`
275-
Schemas map[string]SchemaObject `json:"schemas,omitempty" yaml:"schemas,omitempty"`
272+
Enabled bool `json:"enabled" yaml:"enabled"`
273+
DBAlias string `json:"dbAlias" yaml:"dbAlias"`
274+
Rules map[string]*EventingRule `json:"triggers,omitempty" yaml:"triggers"`
275+
InternalRules map[string]*EventingRule `json:"internalTriggers,omitempty" yaml:"internalTriggers,omitempty"`
276+
SecurityRules map[string]*Rule `json:"securityRules,omitempty" yaml:"securityRules,omitempty"`
277+
Schemas map[string]SchemaObject `json:"schemas,omitempty" yaml:"schemas,omitempty"`
276278
}
277279

278280
// EventingRule holds an eventing rule
279281
type EventingRule struct {
280-
Type string `json:"type" yaml:"type"`
281-
Retries int `json:"retries" yaml:"retries"`
282-
// Timeout is in milliseconds
283-
Timeout int `json:"timeout" yaml:"timeout"`
284-
ID string `json:"id" yaml:"id"`
285-
URL string `json:"url" yaml:"url"`
286-
Options map[string]string `json:"options" yaml:"options"`
282+
Type string `json:"type" yaml:"type"`
283+
Retries int `json:"retries" yaml:"retries"`
284+
Timeout int `json:"timeout" yaml:"timeout"` // Timeout is in milliseconds
285+
ID string `json:"id" yaml:"id"`
286+
URL string `json:"url" yaml:"url"`
287+
Options map[string]string `json:"options" yaml:"options"`
288+
Tmpl EndpointTemplatingEngine `json:"template,omitempty" yaml:"template,omitempty"`
289+
RequestTemplate string `json:"requestTemplate,omitempty" yaml:"requestTemplate,omitempty"`
290+
OpFormat string `json:"outputFormat,omitempty" yaml:"outputFormat,omitempty"`
287291
}
288292

289293
// SchemaObject is the body of the request for adding schema

gateway/go.mod

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ module github.com/spaceuptech/space-cloud/gateway
22

33
require (
44
cloud.google.com/go/storage v1.6.0
5+
github.com/Masterminds/goutils v1.1.0 // indirect
6+
github.com/Masterminds/semver v1.5.0 // indirect
7+
github.com/Masterminds/sprig v2.22.0+incompatible
58
github.com/armon/go-metrics v0.3.3 // indirect
69
github.com/aws/aws-sdk-go v1.33.14
710
github.com/coreos/bbolt v1.3.3 // indirect
@@ -31,13 +34,15 @@ require (
3134
github.com/hashicorp/go-msgpack v0.5.5 // indirect
3235
github.com/hashicorp/golang-lru v0.5.4 // indirect
3336
github.com/hashicorp/memberlist v0.1.5 // indirect
37+
github.com/huandu/xstrings v1.3.2 // indirect
3438
github.com/jmoiron/sqlx v1.2.0
3539
github.com/jonboulle/clockwork v0.1.0 // indirect
3640
github.com/kr/pty v1.1.4 // indirect
3741
github.com/lib/pq v1.2.0
3842
github.com/mattn/go-colorable v0.1.2 // indirect
3943
github.com/mattn/go-sqlite3 v1.11.0 // indirect
4044
github.com/mholt/certmagic v0.9.1
45+
github.com/mitchellh/copystructure v1.0.0 // indirect
4146
github.com/mitchellh/mapstructure v1.1.2
4247
github.com/rs/cors v1.7.0
4348
github.com/satori/go.uuid v1.2.0

gateway/go.sum

+13
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym
5555
github.com/DATA-DOG/go-sqlmock v1.3.3 h1:CWUqKXe0s8A2z6qCgkP4Kru7wC11YoAnoupUKFDnH08=
5656
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
5757
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
58+
github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg=
59+
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
60+
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
61+
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
62+
github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60=
63+
github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
5864
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
5965
github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8 h1:xzYJEypr/85nBpB11F9br+3HUrpgb+fcm5iADzXXYEw=
6066
github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc=
@@ -303,8 +309,11 @@ github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174 h1:WlZsjVhE8Af9IcZDG
303309
github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A=
304310
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
305311
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
312+
github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw=
313+
github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
306314
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
307315
github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df/go.mod h1:QMZY7/J/KSQEhKWFeDesPjMj+wCHReeknARU3wqlyN4=
316+
github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q=
308317
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
309318
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
310319
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
@@ -383,6 +392,8 @@ github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3N
383392
github.com/miekg/dns v1.1.15 h1:CSSIDtllwGLMoA6zjdKnaE6Tx6eVUxQ29LUgGetiDCI=
384393
github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
385394
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
395+
github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ=
396+
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
386397
github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0=
387398
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
388399
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
@@ -395,6 +406,8 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu
395406
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
396407
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
397408
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
409+
github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY=
410+
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
398411
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
399412
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
400413
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=

gateway/managers/syncman/store_kube.go

+3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ func onAddOrUpdateAdminConfig(obj interface{}, clusters []*config.Admin) {
6464
logrus.Errorf("error while watching projects in kube store unable to unmarshal data - %v", err)
6565
return
6666
}
67+
if clusters[0].ClusterConfig == nil {
68+
clusters[0].ClusterConfig = getDefaultAdminConfig().ClusterConfig
69+
}
6770
}
6871

6972
func onAddOrUpdateProjects(obj interface{}, projectMap map[string]*config.Project) map[string]*config.Project {

gateway/managers/syncman/syncman_eventing.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
)
1414

1515
// SetEventingRule sets the eventing rules
16-
func (s *Manager) SetEventingRule(ctx context.Context, project, ruleName string, value config.EventingRule, params model.RequestParams) (int, error) {
16+
func (s *Manager) SetEventingRule(ctx context.Context, project, ruleName string, value *config.EventingRule, params model.RequestParams) (int, error) {
1717
// Acquire a lock
1818
s.lock.Lock()
1919
defer s.lock.Unlock()
@@ -25,7 +25,7 @@ func (s *Manager) SetEventingRule(ctx context.Context, project, ruleName string,
2525
}
2626

2727
if projectConfig.Modules.Eventing.Rules == nil {
28-
projectConfig.Modules.Eventing.Rules = map[string]config.EventingRule{}
28+
projectConfig.Modules.Eventing.Rules = map[string]*config.EventingRule{}
2929
}
3030
projectConfig.Modules.Eventing.Rules[ruleName] = value
3131

0 commit comments

Comments
 (0)