MCPcopy
hub / github.com/baetyl/baetyl / processConfiguration

Method processConfiguration

sync/desire.go:142–156  ·  view source on GitHub ↗
(cfg *specv1.Configuration)

Source from the content-addressed store, hash-verified

140}
141
142func (s *sync) processConfiguration(cfg *specv1.Configuration) error {
143 err := DownloadConfig(s.download, s.cfg.Sync.Download.Path, cfg)
144 if err != nil {
145 return errors.Trace(err)
146 }
147 key := makeKey(specv1.KindConfiguration, cfg.Name, cfg.Version)
148 if key == "" {
149 return errors.Errorf("configuration does not have name or version")
150 }
151 if err := s.store.Get(key, &specv1.Configuration{}); err == nil {
152 s.log.Info("configuration resource already exists", log.Any("key", key))
153 return nil
154 }
155 return errors.Trace(s.store.Upsert(key, cfg))
156}
157
158func (s *sync) storeApplication(app *specv1.Application) error {
159 key := makeKey(specv1.KindApplication, app.Name, app.Version)

Callers 2

processVolumesMethod · 0.95

Calls 3

DownloadConfigFunction · 0.85
makeKeyFunction · 0.70
GetMethod · 0.65

Tested by 1