Skip to content
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 RabbitMQ operator policies #752

Merged
merged 6 commits into from
Jan 29, 2024
Merged

Support RabbitMQ operator policies #752

merged 6 commits into from
Jan 29, 2024

Conversation

ansd
Copy link
Member

@ansd ansd commented Jan 26, 2024

This closes #202

Use Golang 1.21 locally on the dev machine and bump Golang to
1.21 in Dockerfile

make manifests
since codeql does not (yet) support Go 1.21, see
github/codeql-action#1842
@ansd ansd marked this pull request as ready for review January 26, 2024 15:56
@DanielePalaia DanielePalaia self-assigned this Jan 26, 2024
Copy link
Contributor

@DanielePalaia DanielePalaia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me!

The only minor thing was the missing of GenerateOperatorPolicy tests which has been addressed.
I also tested the new controller in gke. Creation/Deletion and Update are working good. The webhook is also working good.

Thank you!

internal/operatorpolicy.go Show resolved Hide resolved
.github/workflows/codeql-analysis.yml Show resolved Hide resolved
api/v1beta1/operatorpolicy_types_test.go Show resolved Hide resolved
api/v1beta1/operatorpolicy_types_test.go Show resolved Hide resolved
docs/examples/operator-policies/operator-policy.yaml Outdated Show resolved Hide resolved
@ansd
Copy link
Member Author

ansd commented Jan 29, 2024

Thank you @DanielePalaia for the great review!

@ansd ansd merged commit b8b67df into main Jan 29, 2024
5 checks passed
@ansd ansd deleted the operator-policy branch January 29, 2024 09:48
Comment on lines +22 to +24
if err := json.Unmarshal(p.Spec.Definition.Raw, &definition); err != nil {
return nil, fmt.Errorf("failed to unmarshall policy definition: %v", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to wrap errors with %w instead of %v, because it allows the callers to use errors.Is()

Reference: https://go.dev/blog/go1.13-errors#wrapping-errors-with-w

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Be able to create/update/delete operator policies
4 participants