Skip to content

Commit

Permalink
go/runtime/config: Rename bundle repository to registry
Browse files Browse the repository at this point in the history
  • Loading branch information
peternose committed Jan 11, 2025
1 parent c3a765f commit b7ff57d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .changelog/5962.cfg.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ The following configuration options have been added:

- `runtime.runtimes.config` is the runtime local configuration,

- `runtime.runtimes.repositories` is the list of runtime specific URLs
- `runtime.runtimes.registries` is the list of runtime specific URLs
used to fetch runtime bundle metadata,

- `runtime.repositories` is the list of global URLs used to fetch
- `runtime.registries` is the list of global URLs used to fetch
runtime bundle metadata,

- `runtime.max_bundle_size` is the maximum allowed bundle size.
2 changes: 1 addition & 1 deletion go/oasis-test-runner/oasis/keymanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func (km *Keymanager) ModifyConfig() error {

km.Config.Runtime.Runtimes = append(km.Config.Runtime.Runtimes, rtCfg)
km.Config.Runtime.Paths = append(km.Config.Runtime.Paths, km.runtime.BundlePaths()...)
km.Config.Runtime.Repositories = []string{fmt.Sprintf("http://127.0.0.1:%d", km.net.getProvisionedPort(netPortRepository))}
km.Config.Runtime.Registries = []string{fmt.Sprintf("http://127.0.0.1:%d", km.net.getProvisionedPort(netPortRegistry))}

km.Config.Keymanager.RuntimeID = km.runtime.ID().String()
km.Config.Keymanager.PrivatePeerPubKeys = km.privatePeerPubKeys
Expand Down
4 changes: 2 additions & 2 deletions go/oasis-test-runner/oasis/oasis.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const (
nodePortP2P = "p2p"
nodePortP2PSeed = "p2p-seed"
nodePortPprof = "pprof"
netPortRepository = "repository"
netPortRegistry = "registry"

allInterfacesAddr = "tcp://0.0.0.0"
localhostAddr = "tcp://127.0.0.1"
Expand Down Expand Up @@ -303,7 +303,7 @@ func (n *Node) Start() error {
n.Config.Runtime.Paths = append(n.Config.Runtime.Paths, hosted.runtime.BundlePaths()...)
}

n.Config.Runtime.Repositories = []string{fmt.Sprintf("http://127.0.0.1:%d", n.net.getProvisionedPort(netPortRepository))}
n.Config.Runtime.Registries = []string{fmt.Sprintf("http://127.0.0.1:%d", n.net.getProvisionedPort(netPortRegistry))}

if n.consensus.EnableArchiveMode {
n.Config.Mode = config.ModeArchive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (sc *KmUpgradeImpl) Run(ctx context.Context, childEnv *env.Env) error {
}

// Determine the port on which the nodes are trying to fetch bundles.
rawURL := sc.Net.Clients()[0].Config.Runtime.Repositories[0]
rawURL := sc.Net.Clients()[0].Config.Runtime.Registries[0]
parsedURL, err := url.Parse(rawURL)
if err != nil {
return err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (sc *runtimeUpgradeImpl) Run(ctx context.Context, childEnv *env.Env) error
}

// Determine the port on which the nodes are trying to fetch bundles.
rawURL := sc.Net.Clients()[0].Config.Runtime.Repositories[0]
rawURL := sc.Net.Clients()[0].Config.Runtime.Registries[0]
parsedURL, err := url.Parse(rawURL)
if err != nil {
return err
Expand Down
8 changes: 4 additions & 4 deletions go/runtime/bundle/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,17 @@ func (d *Discovery) Init() error {
return err
}

// Validate global repository URLs.
globalBaseURLs, err := validateAndNormalizeURLs(config.GlobalConfig.Runtime.Repositories)
// Validate global registry URLs.
globalBaseURLs, err := validateAndNormalizeURLs(config.GlobalConfig.Runtime.Registries)
if err != nil {
return err
}

// Validate each runtime's repository URLs.
// Validate each runtime's registry URLs.
runtimeBaseURLs := make(map[common.Namespace][]string)

for _, runtime := range config.GlobalConfig.Runtime.Runtimes {
urls, err := validateAndNormalizeURLs(runtime.Repositories)
urls, err := validateAndNormalizeURLs(runtime.Registries)
if err != nil {
return err
}
Expand Down
10 changes: 5 additions & 5 deletions go/runtime/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ type Config struct {
// LoadBalancer is the load balancer configuration.
LoadBalancer LoadBalancerConfig `yaml:"load_balancer,omitempty"`

// Repositories is the list of URLs used to fetch runtime bundle metadata.
Repositories []string `yaml:"repositories,omitempty"`
// Registries is the list of URLs used to fetch runtime bundle metadata.
Registries []string `yaml:"registries,omitempty"`

// MaxBundleSize is the maximum allowed bundle size.
//
Expand Down Expand Up @@ -187,8 +187,8 @@ type RuntimeConfig struct {
// Config contains runtime local configuration.
Config map[string]interface{} `yaml:"config,omitempty"`

// Repositories is the list of URLs used to fetch runtime bundle metadata.
Repositories []string `yaml:"repositories,omitempty"`
// Registries is the list of URLs used to fetch runtime bundle metadata.
Registries []string `yaml:"registries,omitempty"`
}

// Validate validates the runtime configuration.
Expand Down Expand Up @@ -351,6 +351,6 @@ func DefaultConfig() Config {
LoadBalancer: LoadBalancerConfig{
NumInstances: 0,
},
Repositories: []string{oasisBundleRegistryURL},
Registries: []string{oasisBundleRegistryURL},
}
}

0 comments on commit b7ff57d

Please sign in to comment.