-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --disable-admin-operations
flag in Compactor UI and Bucket UI
#6604
Conversation
Signed-off-by: Harsh Pratap Singh <[email protected]>
--disable-admin-operations
flag in Compactor UI and Bucket UI
If everything goes okay with this PR, I will add the changelog. Sorry for messing up a lot of times and thanks for the patience. Also how to fix this Docs CI failing!? @saswatamcode @yeya24 |
@harsh-ps-2003 you don't need to raise a new PR every time after review. you can push commits to address feedback. 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Generally LGTM mod some small nits. 🙂
Let's try to address comments here instead of opening new PR!
cmd/thanos/compact.go
Outdated
@@ -786,4 +787,6 @@ func (cc *compactConfig) registerFlag(cmd extkingpin.FlagClause) { | |||
cc.webConf.registerFlag(cmd) | |||
|
|||
cmd.Flag("bucket-web-label", "External block label to use as group title in the bucket web UI").StringVar(&cc.label) | |||
|
|||
cmd.Flag("disable-admin-operations", "Restrict access to Block Mark deletion and no compaction").Default("false").BoolVar(&cc.disableAdminOperations) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make description a bit clearer.
cmd.Flag("disable-admin-operations", "Restrict access to Block Mark deletion and no compaction").Default("false").BoolVar(&cc.disableAdminOperations) | |
cmd.Flag("disable-admin-operations", "Disable UI/API admin operations like marking blocks for deletion and no compaction.").Default("false").BoolVar(&cc.disableAdminOperations) |
cmd/thanos/tools_bucket.go
Outdated
@@ -203,6 +204,8 @@ func (tbc *bucketWebConfig) registerBucketWebFlag(cmd extkingpin.FlagClause) *bu | |||
cmd.Flag("timeout", "Timeout to download metadata from remote storage").Default("5m").DurationVar(&tbc.timeout) | |||
|
|||
cmd.Flag("label", "External block label to use as group title").StringVar(&tbc.label) | |||
|
|||
cmd.Flag("disable-admin-operations", "Restrict access to Block Mark deletion and no compaction").Default("false").BoolVar(&tbc.disableAdminOperations) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
cmd.Flag("disable-admin-operations", "Restrict access to Block Mark deletion and no compaction").Default("false").BoolVar(&tbc.disableAdminOperations) | |
cmd.Flag("disable-admin-operations", "Disable UI/API admin operations like marking blocks for deletion and no compaction.").Default("false").BoolVar(&tbc.disableAdminOperations) |
)} | ||
{!disableAdminOperations && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably render both buttons, under a single conditional?
const { response: flagsRes } = useFetch<FlagMap>(`/api/v1/status/flags`); | ||
const disableAdminOperations = flagsRes?.data?.['disable-admin-operations'] || false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's actually call this in BlocksContent and pass it to BlocksDetails as a prop, that way we won't be calling this every time we open a block detail page. This also won't change from block to block.
Thanks for the review and sorry for the closed PRs @saswatamcode |
Signed-off-by: Harsh Pratap Singh <[email protected]>
7fdaf42
to
59a5f9c
Compare
@saswatamcode @yeya24 @GiedriusS when I did
as I am on Mac OS. The invalid |
d83ca45
to
3b81398
Compare
Document the why/what from thanos-io#6257 in the Querier documentation. Signed-off-by: Giedrius Statkevičius <[email protected]>
From the Go docs: "If the map is nil, the number of iterations is 0." [1] Therefore, an additional nil check for before the loop is unnecessary. [1]: https://go.dev/ref/spec#For_range Signed-off-by: Eng Zer Jun <[email protected]>
Signed-off-by: Harsh Pratap Singh <[email protected]> Signed-off-by: Harsh Pratap Singh <[email protected]>
Signed-off-by: Harsh Pratap Singh <[email protected]>
Signed-off-by: Harsh Pratap Singh <[email protected]>
Signed-off-by: Harsh Pratap Singh <[email protected]>
Trying to build on go1.21 fails with a scary error about the GC moving heap objects. This is due to a conservative assumption around future go releases in go4.org/unsafe/assume-no-moving-gc A more recent version actually checks with the go runtime, see: https://go-review.googlesource.com/c/go/+/498121 Signed-off-by: Jon Johnson <[email protected]>
Signed-off-by: GitHub <[email protected]> Co-authored-by: fpetkovski <[email protected]>
Signed-off-by: Saswata Mukherjee <[email protected]>
Chunk reader needs to wait until the chunk loading ends in Close() because otherwise there will be a race between appending to r.chunkBytes and reading from it. Signed-off-by: Giedrius Statkevičius <[email protected]>
Signed-off-by: Saswata Mukherjee <[email protected]>
…abel (thanos-io#6605) * vertically shard binary expression even if no matching labels Signed-off-by: Ben Ye <[email protected]> * add changelog Signed-off-by: Ben Ye <[email protected]> * fix test Signed-off-by: Ben Ye <[email protected]> --------- Signed-off-by: Ben Ye <[email protected]>
…#6612) In the case that we have pushed down queries and internal labels that are overriden by external labels we are not flushing the sorted response. Signed-off-by: Michael Hoffmann <[email protected]>
The remote engine implementation currently converts warnings to errors. This prevents using partial response with the distributed engine since every warning will cause a query to fail. Signed-off-by: Filip Petkovski <[email protected]>
Signed-off-by: Vanshika <[email protected]>
…[email protected]> This reverts commit f74578b.
…[email protected]> This reverts commit a419403.
…[email protected]> This reverts commit 74ba45c.
…[email protected]> This reverts commit 1373f7d.
This reverts commit 3e3d301. Signed-off-by: Harsh Pratap Singh <[email protected]>
This reverts commit 268c6be. Signed-off-by: Harsh Pratap Singh <[email protected]>
This reverts commit 59a5f9c. Signed-off-by: Harsh Pratap Singh <[email protected]>
Signed-off-by: Harsh Pratap Singh <[email protected]>
Signed-off-by: Harsh Pratap Singh <[email protected]>
Signed-off-by: Harsh Pratap Singh <[email protected]>
3b81398
to
3b9a02e
Compare
Signed-off-by: Harsh Pratap Singh <[email protected]>
Signed-off-by: Harsh Pratap Singh [email protected]
Fixes #5390
Changes
This PR adds a flag, named
--disable-admin-operations
, to the Compactor UI and Bucket Web UI to decide whether to disable the corresponding buttons Mark Deletion and Mark No Compaction in the UI as they are admin-level operations. It also restricts the API usage for both of them.Verification
It was tested locally.
The UI test:
The API test:
cc @yeya24 @GiedriusS @saswatamcode