Skip to content

Commit

Permalink
fix swift: CR minor fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Chodur <m.chodur@seznam.cz>
  • Loading branch information
FUSAKLA committed Jun 17, 2020
1 parent fe43e72 commit 6b648ea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel
- [#2739](https://github.com/thanos-io/thanos/pull/2739) Changed `bucket tool bucket verify` `--id-whitelist` flag to `--id`.
- [#2748](https://github.com/thanos-io/thanos/pull/2748) Upgrade Prometheus to [@66dfb951c4ca](https://github.com/prometheus/prometheus/commit/66dfb951c4ca2c1dd3f266172a48a925403b13a5) which is after v2.19.0.
- PromQL now allow us to executed concurrent selects.
- [#TBA](https://github.com/thanos-io/thanos/pull/TBA) Swift: Switched to a new library [ncw/swift]() providing large objects support.
- [#2732](https://github.com/thanos-io/thanos/pull/2732) Swift: Switched to a new library [ncw/swift]() providing large objects support.
By default, segments will be uploaded to the same container directory `segments/` if the file is bigger than `1GB`.
To change the defaults see [the docs](./docs/storage.md#openstack-swift).

Expand Down
26 changes: 13 additions & 13 deletions pkg/objstore/swift/swift.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,18 @@ func NewContainerFromConfig(logger log.Logger, sc *Config, createContainer bool)
if sc.SegmentContainerName == "" {
sc.SegmentContainerName = sc.ContainerName
} else if _, err := ensureContainer(connection, sc.SegmentContainerName, createContainer); err != nil {
return nil, err
}
return nil, err
}
}

container := Container{
logger: logger,
name: sc.ContainerName,
connection: connection,
chunkSize: sc.ChunkSize,
segmentsContainer: sc.SegmentContainerName,
}
return &container, nil
container := Container{
logger: logger,
name: sc.ContainerName,
connection: connection,
chunkSize: sc.ChunkSize,
segmentsContainer: sc.SegmentContainerName,
}
return &container, nil
}

// Name returns the container name for swift.
Expand Down Expand Up @@ -264,10 +264,10 @@ func (c *Container) Attributes(ctx context.Context, name string) (objstore.Objec
// Exists checks if the given object exists.
func (c *Container) Exists(ctx context.Context, name string) (bool, error) {
_, _, err := c.connection.Object(c.name, name)
if c.IsObjNotFoundErr(err) {
err = nil
}
if err != nil {
if c.IsObjNotFoundErr(err) {
err = nil
}
return false, errors.Wrap(err, "swift check if file exists")
}
return true, nil
Expand Down

0 comments on commit 6b648ea

Please sign in to comment.