Go to file
Márton Elek 98921f9faa satellite/overlay: fix placement selection config parsing
When we do `satellite run api --placement '...'`, the placement rules are not parsed well.

The problem is based on `viper.AllSettings()`, and the main logic is sg. like this (from a new unit test):

```
		r := ConfigurablePlacementRule{}
		err := r.Set(p)
		require.NoError(t, err)
		serialized := r.String()

		r2 := ConfigurablePlacementRule{}
		err = r2.Set(serialized)
		require.NoError(t, err)

		require.Equal(t, p, r2.String())
```

All settings evaluates the placement rules in `ConfigurablePlacementRules` and stores the string representation.

The problem is that we don't have proper `String()` implementation (it prints out the structs instead of the original definition.

There are two main solutions for this problem:

 1. We can fix the `String()`. When we parse a placement rule, the `String()` method should print out the original definition
 2. We can switch to use pure string as configuration parameter, and parse the rules only when required.

I feel that 1 is error prone, we can do it (and in this patch I added a lot of `String()` implementations, but it's hard to be sure that our `String()` logic is inline with the parsing logic.

Therefore I decided to make the configuration value of the placements a string (or a wrapper around string).

That's the main reason why this patch seems to be big, as I updated all the usages.

But the main part is in beginning of the `placement.go` (configuration parsing is not a pflag.Value implementation any more, but a separated step).

And `filter.go`, (a few more String implementation for filters.

https://github.com/storj/storj/issues/6248

Change-Id: I47c762d3514342b76a2e85683b1c891502a0756a
2023-09-21 14:31:41 +00:00
.github .github: remove invalid codeowners 2022-11-10 15:52:48 +02:00
certificate private/kvstore: move storage package 2023-04-06 17:26:29 +03:00
cmd satellite/overlay: fix placement selection config parsing 2023-09-21 14:31:41 +00:00
crashcollect crashcollect: removed redundant structure 2021-04-28 00:35:39 +03:00
docs docs/testplan: add project cowbell testplan (#6001) 2023-07-10 11:23:55 +02:00
installer/windows storj/storj: more domain changes 2021-04-15 20:51:43 +00:00
multinode satellite/satellitedb,multinode/multinodedb: update to latest dbx 2023-09-11 17:21:02 +00:00
private private/apigen/example: Add description to endpoint 2023-09-19 18:31:20 +00:00
resources cmd: add ca-certificates to Docker images (#3986) 2020-12-08 01:38:33 +01:00
satellite satellite/overlay: fix placement selection config parsing 2023-09-21 14:31:41 +00:00
scripts go.mod: bump common 2023-09-15 17:43:44 +00:00
storagenode cmd/storagenode: add forget-satellite subcommand 2023-09-13 19:06:55 +00:00
testsuite go.mod: bump dependencies (uplink,common,monkit) 2023-09-19 00:35:07 +00:00
versioncontrol versioncontrol: implement partial version rollout automation 2023-06-02 16:01:33 +00:00
web web/satellite/vuetify-poc: implement Manage Passphrase dialog 2023-09-20 18:36:21 -05:00
.dockerignore Forward-port release-alpha8 build script issues (#1726) 2019-04-09 23:01:10 -06:00
.earthlyignore build: provides earthfile for nightly build 2022-10-27 09:25:17 +00:00
.gitattributes web/: add check for change to eslint import 2021-12-21 15:59:23 +00:00
.gitignore gitignore: add go workspace files 2022-12-13 10:15:53 -07:00
.gitreview add config file for git review usage 2021-10-14 18:01:30 +00:00
CODE_OF_CONDUCT.md Adding CODE_OF_CONDUCT to storj/storj repo (#779) 2018-12-07 15:10:02 -05:00
CODEOWNERS update CODEOWNERS 2023-02-02 10:01:50 +00:00
CONTRIBUTING.md go.mod: update to minimum supported go version (#4239) 2021-10-22 21:12:13 +02:00
DEVELOPING.md Makefile: run lint locally in docker 2022-05-25 12:30:15 -05:00
docker-compose.tests.yaml Makefile: disable postgres fsync in the test container 2022-12-01 22:03:31 +00:00
Earthfile web/satellite: Update build script to build vuetify app 2023-08-22 13:55:10 +00:00
go.mod go.mod: bump dependencies (uplink,common,monkit) 2023-09-19 00:35:07 +00:00
go.sum go.mod: bump dependencies (uplink,common,monkit) 2023-09-19 00:35:07 +00:00
Jenkinsfile {Jenkinsfile, Makefile}: update Go to 1.20.6 2023-07-20 09:20:30 +00:00
Jenkinsfile.premerge ci: move go-licenses check to premerge 2023-03-20 09:20:28 +00:00
Jenkinsfile.public private/kvstore: move storage package 2023-04-06 17:26:29 +03:00
Jenkinsfile.verify testsuite/ui: bump gateway-mt and enable vet 2023-04-17 22:07:57 +00:00
LICENSE license code with agplv3 (#126) 2018-07-05 10:24:26 -04:00
MAINTAINERS.md Maintainers: remove link 2022-03-14 14:16:31 +02:00
Makefile Makefile: add sha256sums checksum file with release binaries 2023-08-23 20:43:12 +00:00
monkit.lock satellite/accounting/tally: save tallies in a batches 2023-06-22 17:02:26 +00:00
proto.lock certificate/certificatepb: add definitions for migration 2023-01-25 10:28:36 +02:00
README.md web/satellite: update wording from decentralized to distributed cloud 2023-05-24 17:12:52 +00:00

Storj V3 Network

Go Report Card Go Doc Coverage Status

Storj is building a distributed cloud storage network. Check out our white paper for more info!


Storj is an S3-compatible platform and suite of distributed applications that allows you to store data in a secure and distributed manner. Your files are encrypted, broken into little pieces and stored in a global distributed network of computers. Luckily, we also support allowing you (and only you) to retrieve those files!

Table of Contents

Contributing to Storj

All of our code for Storj v3 is open source. If anything feels off, or if you feel that some functionality is missing, please check out the contributing page. There you will find instructions for sharing your feedback, building the tool locally, and submitting pull requests to the project.

A Note about Versioning

While we are practicing semantic versioning for our client libraries such as uplink, we are not practicing semantic versioning in this repo, as we do not intend for it to be used via Go modules. We may have backwards-incompatible changes between minor and patch releases in this repo.

Start using Storj

Our wiki has documentation and tutorials. Check out these three tutorials:

License

This repository is currently licensed with the AGPLv3 license.

For code released under the AGPLv3, we request that contributors sign our Contributor License Agreement (CLA) so that we can relicense the code under Apache v2, or other licenses in the future.

Support

If you have any questions or suggestions please reach out to us on our community forum or file a ticket at https://support.storj.io/.