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

New metering labels #679

Merged
merged 6 commits into from Nov 29, 2021
Merged

New metering labels #679

merged 6 commits into from Nov 29, 2021

Conversation

eguzki
Copy link
Member

@eguzki eguzki commented Oct 28, 2021

https://issues.redhat.com/browse/THREESCALE-7750

Spec doc: https://docs.google.com/document/d/1bd9VnZ9jKwDBOOKAJltAtvhz3COUYYmRe3-BGE6fDGE/edit#bookmark=id.27cia5h5kj9j

example of one pod

❯ k get pods apicast-production-1-stm67 -o jsonpath="{.metadata.labels}" | jq '.'
{
  "app": "3scale-api-management",
  "deployment": "apicast-production-1",
  "deploymentConfig": "apicast-production",
  "deploymentconfig": "apicast-production",
  "rht.comp": "3scale",
  "rht.comp_ver": "master",
  "rht.prod_name": "Red_Hat_Integration",
  "rht.prod_ver": "master", 
  "rht.subcomp": "apicast-production",
  "rht.subcomp_t": "application",
  "threescale_component": "apicast",
  "threescale_component_element": "production"
}

@openshift-ci
Copy link

openshift-ci bot commented Oct 28, 2021

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@eguzki
Copy link
Member Author

eguzki commented Nov 10, 2021

ready for review @miguelsorianod

return reconcile.Result{Requeue: updated}, nil
}

func (u *UpgradeApiManager) ensurePodTemplateLabels(desired *appsv1.DeploymentConfig) (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

With this changes here we will ensure new labels are added, but the old labels will still be there. Should we clean them too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added procedure to remove old labels

Copy link
Contributor

Choose a reason for hiding this comment

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

This method will need to be reused in future 3scale versions, without the part that removes the old metering labels. If you want you can add a comment to remember to delete that part

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@miguelsorianod miguelsorianod left a comment

Choose a reason for hiding this comment

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

I left some comments. Overall it looks good 👍

pkg/helper/labels.go Outdated Show resolved Hide resolved
@eguzki
Copy link
Member Author

eguzki commented Nov 26, 2021

/retest

control-plane: controller-manager
rht.comp: 3scale
rht.comp_ver: master
Copy link
Contributor

Choose a reason for hiding this comment

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

We will need to be careful when preparing the 2.12 candidate and stable branches about this value too

Copy link
Contributor

@miguelsorianod miguelsorianod left a comment

Choose a reason for hiding this comment

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

I left a minor comment. Looks good to me

@codeclimate
Copy link

codeclimate bot commented Nov 29, 2021

Code Climate has analyzed commit 1447c1c and detected 5 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2
Duplication 2
Style 1

View more on Code Climate.

@eguzki eguzki merged commit 049d287 into master Nov 29, 2021
@eguzki eguzki deleted the new-metering-labels branch November 29, 2021 17:49
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.

None yet

2 participants