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

Don't deploy billing prometheus rule for tests #272

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

Kidswiss
Copy link
Contributor

@Kidswiss Kidswiss commented Nov 26, 2024

Summary

This will not deploy any billing data for instances where the claim resides in the vshn-test namespace.

Checklist

  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog
  • Update tests.
  • Link this PR to related issues.

@Kidswiss Kidswiss added the minor label Nov 26, 2024
@Kidswiss Kidswiss requested review from a team, TheBigLee, wejdross and zugao and removed request for a team November 26, 2024 11:54
@@ -22,6 +23,11 @@ func CreateBillingRecord(ctx context.Context, svc *runtime.ServiceRuntime, comp
log := controllerruntime.LoggerFrom(ctx)
log.Info("Enabling billing for service", "service", comp.GetName())

if comp.GetClaimNamespace() == "vshn-test" {
Copy link
Member

Choose a reason for hiding this comment

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

do we want to parametrize it via component, so it's not that visible to the whole world?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we parameterize it in the component and then set the default to vshn-test then the whole world will see it all the same 🤷

Copy link
Collaborator

@zugao zugao Nov 26, 2024

Choose a reason for hiding this comment

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

Let me change a bit the argument. Instead of burring this string inside the code here. Wouldn't it be better to set it into component, under billing? I mean in 6 months we will forget about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a better argument :D

However then we have yet another parameter in the already very bloated component.

Copy link
Collaborator

@zugao zugao Nov 26, 2024

Choose a reason for hiding this comment

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

I would still move it there, we will know that it exists instead of forgetting about it. There's no escape from bloating the component. And this is not the solution to un-bloat it, we will have to come up with smth else. I would really encourage to create a parameter there.

Update: I understand it's a pain in the ... but we need to better track these things otherwise everything is out of control

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've made it configurable now.

But making a value that could be a constant value configurable just so we don't forget about it also seems wrong. It's not like we remember all the stuff that's in the component as well.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would go to the component to search for smth first instead of the go code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The right place for that would be the docs, but noone ever reads them, so I also stopped documenting...

Copy link
Collaborator

Choose a reason for hiding this comment

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

that's also true

Copy link
Member

Choose a reason for hiding this comment

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

my idea was to set a global commodore parameter, this way we would keep namespace name for ourselfs

This will not deploy any billing data for instances where the claim
resides in the `vshn-test` namespace.
@Kidswiss Kidswiss force-pushed the add/ignore-vshn-test-billing branch from bd423f5 to 3908409 Compare November 26, 2024 14:00
@Kidswiss Kidswiss requested a review from wejdross November 26, 2024 14:06
@Kidswiss Kidswiss merged commit aa73d55 into master Nov 26, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants