-
Notifications
You must be signed in to change notification settings - Fork 36
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
Support to Add, Remove and List ACLs (Fixes #6) #26
Support to Add, Remove and List ACLs (Fixes #6) #26
Conversation
Signed-off-by: Jon Graca <jon.graca@libertymutual.com>
Signed-off-by: jograca <jon.graca@gmail.com>
Signed-off-by: jograca <jon.graca@gmail.com>
Signed-off-by: jograca <jon.graca@gmail.com>
Signed-off-by: jograca <jon.graca@gmail.com>
…trolList to pass golint rules Signed-off-by: jograca <jon.graca@gmail.com>
Signed-off-by: jograca <jon.graca@gmail.com>
Signed-off-by: jograca <jon.graca@gmail.com>
Signed-off-by: jograca <jon.graca@gmail.com>
Signed-off-by: Hasan Turken <turkenh@gmail.com>
Signed-off-by: Hasan Turken <turkenh@gmail.com>
Signed-off-by: Hasan Turken <turkenh@gmail.com>
Signed-off-by: Hasan Turken <turkenh@gmail.com>
ACL fixes and readme updates
Signed-off-by: jograca <jon.graca@gmail.com>
Signed-off-by: jograca <jon.graca@gmail.com>
Signed-off-by: jograca <jon.graca@gmail.com>
Signed-off-by: jograca <jon.graca@gmail.com>
…date error message Signed-off-by: Jon Graca <jon.graca@libertymutual.com>
Signed-off-by: Jon Graca <jon.graca@libertymutual.com>
Co-authored-by: Hasan Turken <turkenh@gmail.com>
Co-authored-by: Hasan Turken <turkenh@gmail.com>
Co-authored-by: Hasan Turken <turkenh@gmail.com>
Signed-off-by: Jon Graca <jon.graca@libertymutual.com>
Signed-off-by: Jon Graca <jon.graca@libertymutual.com>
Co-authored-by: Hasan Turken <turkenh@gmail.com>
… and refactoring code to use ResourceName instead of explicit Name Signed-off-by: Jon Graca <jon.graca@libertymutual.com>
Signed-off-by: Jon Graca <jon.graca@libertymutual.com>
Signed-off-by: Jon Graca <jon.graca@libertymutual.com>
Signed-off-by: Mallory Quaintance <mallory.quaintance@libertymutual.com>
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.
Overall it looks good!
Need to run make reviewable test
, as there are some linting errors.
apis/acl/v1alpha1/acl_types.go:31: File is not `gofmt`-ed with `-s` (gofmt)
ResourceName string `json:"resourceName"`
internal/clients/kafka/acl/acl.go:19: File is not `gofmt`-ed with `-s` (gofmt)
ResourceName string
internal/controller/acl/acl.go:194: File is not `gofmt`-ed with `-s` (gofmt)
return managed.ExternalCreation{}, acl.Create(ctx, c.kafkaClient, generated)
internal/clients/kafka/topic/topic_test.go:6: File is not `goimports`-ed with -local github.com/crossplane-contrib/provider-kafka (goimports)
"github.com/crossplane-contrib/provider-kafka/apis/topic/v1alpha1"
internal/controller/acl/acl.go:146:11: ineffectual assignment to `err` (ineffassign)
extname, err := acl.ConvertFromJSON(meta.GetExternalName(cr))
Signed-off-by: Jon Graca <jon.graca@libertymutual.com>
Signed-off-by: Jon Graca <jon.graca@libertymutual.com>
Signed-off-by: Jon Graca <jon.graca@libertymutual.com>
Signed-off-by: Jon Graca <jon.graca@libertymutual.com>
Signed-off-by: Jon Graca <jon.graca@libertymutual.com>
Signed-off-by: Jon Graca <jon.graca@libertymutual.com>
Signed-off-by: Jon Graca <jon.graca@libertymutual.com>
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've approved it, but there is one linting error that comes up. (See my comment).
} | ||
|
||
// List lists all the ACLs in Kafka | ||
func List(ctx context.Context, cl *kadm.Client, accessControlList *AccessControlList) (*AccessControlList, error) { |
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.
Linting is coming up with one more issue cyclomatic complexity 11 of func
List is high (> 10)
Cyclomatic complexity is used as a metric for the complexity of tests required and we see it often in controllers. (see https://github.com/fzipp/gocyclo).
Maybe in future releases some of the logic can be factored out into functions.
To fix, add the // nolint:gocyclo
comment to the function like so:
func List(ctx context.Context, cl *kadm.Client, accessControlList *AccessControlList) (*AccessControlList, error) { // nolint:gocyclo
🎉 |
🙌 |
Description of your changes
This Pull Request adds feature complete ACL support to Add, Remove and List ACLs.
Fixes #6
I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested
Automated tests are forthcoming
kcl admin acl describe --type any --pattern match --op any --perm any