File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -120,10 +120,31 @@ func initProfiles(f *factory.Factory) error {
120120 return err
121121 }
122122
123- ctxFile = & servicecontext.Context {}
123+ configFile , err := f .Config .Load ()
124+
125+ if err != nil {
126+ return err
127+ }
128+
129+ kafkaId , _ := configFile .GetKafkaIdOk ()
130+ serviceRegistryId , _ := configFile .GetServiceRegistryIdOk ()
131+ ctxFile = & servicecontext.Context {
132+ CurrentContext : "default" ,
133+ Contexts : map [string ]servicecontext.ServiceConfig {
134+ "default" : {
135+ KafkaID : kafkaId ,
136+ ServiceRegistryID : serviceRegistryId ,
137+ },
138+ },
139+ }
140+
124141 if err := f .ServiceContext .Save (ctxFile ); err != nil {
125142 return err
126143 }
144+
145+ configFile .Services = config.ServiceConfigMap {}
146+ _ = f .Config .Save (configFile )
147+
127148 return nil
128149}
129150
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ type Config struct {
2828
2929// ServiceConfigMap is a map of configs for the application services
3030type ServiceConfigMap struct {
31- Kafka * KafkaConfig `json:"kafka"`
32- ServiceRegistry * ServiceRegistryConfig `json:"serviceregistry"`
31+ Kafka * KafkaConfig `json:"kafka,omitempty "`
32+ ServiceRegistry * ServiceRegistryConfig `json:"serviceregistry,omitempty "`
3333}
3434
3535// KafkaConfig is the config for the Kafka service
You can’t perform that action at this time.
0 commit comments