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

K8SPG-487: add global annotations and labels for cr.yaml #956

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

pooknull
Copy link
Contributor

@pooknull pooknull commented Nov 25, 2024

K8SPG-487 Powered by Pull Request Badge

https://perconadev.atlassian.net/browse/K8SPG-487

DESCRIPTION

Problem:
It’s not possible to set annotations / labels at a global level for all resources created by operator.

Solution:
Add .spec.metadata.labels and .spec.metadata.annotations fields to the cr.yaml.

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PG version?
  • Does the change support oldest and newest supported Kubernetes version?

if cr.CompareVersion("2.6.0") >= 0 && cr.Spec.Metadata != nil {
newCASecret.Annotations = cr.Spec.Metadata.Annotations
newCASecret.Labels = cr.Spec.Metadata.Labels
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't catch this place, if we will have different annotations (for example for extentions too), should we put it to secret annotations?

@pooknull pooknull marked this pull request as ready for review December 17, 2024 10:19
@@ -7,6 +7,11 @@ metadata:
# - percona.com/delete-ssl
spec:
crVersion: 2.6.0
# metadata:
# annotations:
# test-annotation: value
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to have a test prefix here in the CR? Maybe something like example-annotation or annotation-key. Test feels like a leftover from some testing.

Copy link
Contributor

Choose a reason for hiding this comment

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

@pooknull wdyt about this?

@inelpandzic
Copy link
Contributor

@pooknull pls check unit tests.

@JNKPercona
Copy link
Collaborator

Test name Status
custom-extensions passed
custom-tls passed
demand-backup passed
finalizers passed
init-deploy passed
monitoring passed
one-pod passed
operator-self-healing passed
pitr passed
scaling passed
scheduled-backup passed
self-healing passed
sidecars passed
start-from-backup passed
tablespaces passed
telemetry-transfer passed
upgrade-consistency passed
upgrade-minor passed
users passed
We run 19 out of 19

commit: bbcf318
image: perconalab/percona-postgresql-operator:PR-956-bbcf318a8

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

Successfully merging this pull request may close these issues.

5 participants