-
Notifications
You must be signed in to change notification settings - Fork 783
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
chore: updating pubsub system #3646
chore: updating pubsub system #3646
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3646 +/- ##
==========================================
- Coverage 54.49% 47.72% -6.78%
==========================================
Files 134 234 +100
Lines 12329 19864 +7535
==========================================
+ Hits 6719 9480 +2761
- Misses 5116 9493 +4377
- Partials 494 891 +397
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
570505d
to
7c48595
Compare
Still working on doc changes. |
@@ -26,37 +26,37 @@ import ( | |||
) | |||
|
|||
var ( | |||
PubsubEnabled = flag.Bool("enable-pub-sub", false, "(alpha) Enabled pubsub to publish messages") | |||
ExportEnabled = flag.Bool("enable-pub-sub", false, "(alpha) Enabled pubsub to publish messages") |
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.
Do we want to rename the flag to remove pub-sub
word?
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.
May as well while it's still alpha
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.
should we provide a warning for the user if we change the name? we can remove it after a release?
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.
What do you mean? How would we provide warning for changing a name before release?
Fixes #3497 |
@@ -114,22 +114,22 @@ func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) ( | |||
} | |||
|
|||
if len(cfg.Data) == 0 { | |||
return reconcile.Result{}, fmt.Errorf(fmt.Sprintf("data missing in configmap %s, unable to configure respective pubsub", request.NamespacedName)) | |||
return reconcile.Result{}, fmt.Errorf(fmt.Sprintf("data missing in configmap %s, unable to establish connection", request.NamespacedName)) |
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.
is it a "connection" necessarily?
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.
"link" may be? I just couldn't come up with better alternative at the time.
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.
"unable to configure exporter"?
} | ||
if _, ok := cfg.Data["provider"]; !ok { | ||
return reconcile.Result{}, fmt.Errorf(fmt.Sprintf("missing provider field in configmap %s, unable to configure respective pubsub", request.NamespacedName)) | ||
if _, ok := cfg.Data["driver"]; !ok { |
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.
Is changing from config map to CRD coming later?
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.
I can raise a follow up PR, we have the design finalized as per last discussion.
bf0c5cf
to
1f2905e
Compare
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.
minor comments, otherwise LGTM
} | ||
|
||
func (a *Adder) Add(mgr manager.Manager) error { | ||
if !*PubsubEnabled { | ||
if !*ExportEnabled { | ||
return nil | ||
} | ||
log.Info("Warning: Alpha flag enable-pub-sub is set to true. This flag may change in the future.") |
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.
update this too if we change the flag name
@@ -114,22 +114,22 @@ func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) ( | |||
} | |||
|
|||
if len(cfg.Data) == 0 { | |||
return reconcile.Result{}, fmt.Errorf(fmt.Sprintf("data missing in configmap %s, unable to configure respective pubsub", request.NamespacedName)) | |||
return reconcile.Result{}, fmt.Errorf(fmt.Sprintf("data missing in configmap %s, unable to establish connection", request.NamespacedName)) |
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.
"unable to configure exporter"?
title: Export Interface/Driver walkthrough | ||
--- | ||
|
||
This guide provides an overview of the driver interface, including details of its structure and functionality. Additionally, it offers instructions on adding a new driver and utilizing different backends to export violations. |
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.
This guide provides an overview of the driver interface, including details of its structure and functionality. Additionally, it offers instructions on adding a new driver and utilizing different backends to export violations. | |
This guide provides an overview of the driver interface, including details of its structure and functionality. Additionally, it offers instructions on adding a new driver and utilizing different backends to export audit violations. |
Signed-off-by: Jaydip Gabani <[email protected]>
1b578cb
to
2fba5c2
Compare
Signed-off-by: Jaydip Gabani <[email protected]>
cabc202
to
95b5ab7
Compare
Signed-off-by: Jaydip Gabani <[email protected]>
@@ -1,18 +1,18 @@ | |||
name: dapr-pubsub |
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.
since you are renaming everything, does this yaml need to be renamed too?
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.
good call, ty!
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.
Updated the file name.
Signed-off-by: Jaydip Gabani <[email protected]>
68424cf
to
f4d5631
Compare
website/docs/audit.md
Outdated
|
||
This feature uses publish and subscribe (pubsub) model that allows Gatekeeper to export audit violations over a broker that can be consumed by a subscriber independently. Therefore, pubsub violations are not subject to reporting limits. Please refer to [this](pubsub.md) guide to configure audit to push violations over a channel. | ||
This feature allows plugging in different backends that allows Gatekeeper to export audit violations. Therefore, violations are not subject to reporting limits. Please refer to [this](export.md) guide to configure audit to push violations via this feature. |
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.
This feature allows plugging in different backends that allows Gatekeeper to export audit violations. Therefore, violations are not subject to reporting limits. Please refer to [this](export.md) guide to configure audit to push violations via this feature. | |
This feature allows different systems to be provided for Gatekeeper to export audit violations. Thereby, ensuing violations are not subject to reporting limits. Please refer to [this](export.md) guide to configure audit to push violations via this feature. |
website/docs/audit.md
Outdated
- There is an inherent risk of messages getting dropped. You might not receive all the published violations. | ||
- Additional dependency on pubsub broker. | ||
- There is a risk of messages getting dropped. You might not receive all the exported violations. This depends on the type of backend you are using for delivery. For example, using a network as backend to export violation has the risk of messages getting dropped. | ||
- Additional dependency depending on what is plugged in. For example, using pubsub tools to export violations. |
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.
- Additional dependency depending on what is plugged in. For example, using pubsub tools to export violations. | |
- Additional dependency on the backend system provided. For example, using pubsub tools to export violations. |
website/docs/audit.md
Outdated
|
||
## Running Audit | ||
For more details on how to deploy audit and | ||
number of instances to run, please refer to [operations audit](operations.md#audit). | ||
|
||
## Configuring Audit | ||
|
||
- Audit violations per constraint: set `--constraint-violations-limit=123` (defaults to `20`). NOTE: This flag only impacts when gathering audit results using the constraint status model. If you are gathering audit results using the pubsub model, please refer to the [pubsub](pubsub.md) guide. Both approaches for getting audit violations can be configured independently and work simultaneously without any interference. | ||
- Audit violations per constraint: set `--constraint-violations-limit=123` (defaults to `20`). NOTE: This flag only impacts when gathering audit results using the constraint status model. If you want to gather audit results via other means, please refer to the [exporting audit results](export.md) guide. Both approaches for getting audit violations can be configured independently and work simultaneously without any interference. |
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.
- Audit violations per constraint: set `--constraint-violations-limit=123` (defaults to `20`). NOTE: This flag only impacts when gathering audit results using the constraint status model. If you want to gather audit results via other means, please refer to the [exporting audit results](export.md) guide. Both approaches for getting audit violations can be configured independently and work simultaneously without any interference. | |
- Audit violations per constraint: set `--constraint-violations-limit=123` (defaults to `20`). NOTE: This flag only impacts when gathering audit results using the constraint status model. If you want to export audit results via other means, please refer to the [exporting audit results](export.md) guide. Both approaches for getting audit violations can be configured independently and work simultaneously without any interference. |
id: pubsub | ||
title: Consuming violations using Pubsub | ||
id: export | ||
title: Exporting violations |
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.
do we want to add something like "Previously known as pubsub feature"?
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.
I like this idea if we will be removing it when we go beta or in couple of releases.
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.
Added This feature was previously known as "Consuming violations using Pubsub"
below feature state.
@@ -34,7 +34,7 @@ module.exports = { | |||
'expansion', | |||
'gator', | |||
'workload-resources', | |||
'pubsub', | |||
'export', |
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.
How does this impact older versions of docs?
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.
It doesn't, with older version of website it will route to pubsub.md
. And once this PR gets merged, I doubt there would be any maintenance work for old docs since we are changing lots of things in the feature including name.
Signed-off-by: Jaydip Gabani <[email protected]>
Signed-off-by: Jaydip Gabani <[email protected]>
website/docs/audit.md
Outdated
|
||
This feature uses publish and subscribe (pubsub) model that allows Gatekeeper to export audit violations over a broker that can be consumed by a subscriber independently. Therefore, pubsub violations are not subject to reporting limits. Please refer to [this](pubsub.md) guide to configure audit to push violations over a channel. | ||
This feature allows different systems to be provided for Gatekeeper to export audit violations. Thereby, ensuing violations are not subject to reporting limits. Please refer to [this](export.md) guide to configure audit to push violations via this feature. |
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.
This feature allows different systems to be provided for Gatekeeper to export audit violations. Thereby, ensuing violations are not subject to reporting limits. Please refer to [this](export.md) guide to configure audit to push violations via this feature. | |
This feature allows different systems to be provided for Gatekeeper to export audit violations. Thereby, ensuring violations are not subject to reporting limits. Please refer to [the export guide](export.md) to configure audit to push violations via this feature. |
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.
Updated the docs.
website/docs/audit.md
Outdated
|
||
## Running Audit | ||
For more details on how to deploy audit and | ||
number of instances to run, please refer to [operations audit](operations.md#audit). | ||
|
||
## Configuring Audit | ||
|
||
- Audit violations per constraint: set `--constraint-violations-limit=123` (defaults to `20`). NOTE: This flag only impacts when gathering audit results using the constraint status model. If you are gathering audit results using the pubsub model, please refer to the [pubsub](pubsub.md) guide. Both approaches for getting audit violations can be configured independently and work simultaneously without any interference. | ||
- Audit violations per constraint: set `--constraint-violations-limit=123` (defaults to `20`). NOTE: This flag only impacts when gathering audit results using the constraint status model. If you want to export audit results via other means, please refer to the [exporting audit results](export.md) guide. Both approaches for getting audit violations can be configured independently and work simultaneously without any interference. |
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.
- Audit violations per constraint: set `--constraint-violations-limit=123` (defaults to `20`). NOTE: This flag only impacts when gathering audit results using the constraint status model. If you want to export audit results via other means, please refer to the [exporting audit results](export.md) guide. Both approaches for getting audit violations can be configured independently and work simultaneously without any interference. | |
- Audit violations per constraint: set `--constraint-violations-limit=123` (defaults to `20`). NOTE: This flag only impacts when gathering audit results using the constraint status model. If you want to export audit results via other means, please refer to [the export guide](export.md). Both approaches for getting audit violations can be configured independently and work simultaneously without any interference. |
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.
Done
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.
Nit, otherwise LGTM
Signed-off-by: Jaydip Gabani <[email protected]>
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.
LGTM
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when the PR gets merged):Fixes #1037 #3497
Special notes for your reviewer: