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

make resource names configurable #902

Closed
wants to merge 1 commit into from

Conversation

tamcore
Copy link
Contributor

@tamcore tamcore commented Mar 1, 2023

Description

This adds configurable name-fields where needed, so it becomes possible to provision multiple Grafana instances in the same namespace.

I would've prefered to simply use cr.Name everywhere, but that would be a breaking change. Doing like this instead, should keep the old behaviour.

Although, another idea, and probably prettier, could be a boolean flag spec.useResourceName or something, which then could just reference cr.Name everywhere. If that's desired, please let me know. I'd happily update the PR :)

Relevant issues/tickets

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • This change requires a documentation update
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a test case that will be used to verify my changes
  • Verified independently on a cluster by reviewer

Verification steps

apiVersion: integreatly.org/v1alpha1
kind: Grafana
metadata:
  name: my-grafana
spec:
  adminSecretName: "my-adminsecret"
  configName: "my-config"
  deployment:
    name: "my-deployment"
  datasourceConfig: 
    name: "my-datasourceconfig"
  serviceAccount:
    name: "my-serviceaccount"
  service:
    name: "my-service"
  ingress:
    name: "my-ingress"

@Maximilian-Pfau-P
Copy link

Hello tamcore,
to use the cr.Name would be perfect, could you please implement this as well?

But already many thanks for the solution, this will help us too.

@Maximilian-Pfau-P
Copy link

Just found out that the config map grafana-config & grafana-datasource is also hard-coded.

The boolean flag could be the solution for this problem as well

@tamcore
Copy link
Contributor Author

tamcore commented Mar 3, 2023

I guess there's not much of a chance for this PR, in any shape or form. v5 of the operator (https://github.com/grafana-operator/grafana-operator-experimental) will take care of that. I'm already playing around with it.

@NissesSenap
Copy link
Collaborator

@tamcore I really wished that you would have reached out on slack/issue saying that you where willing to work on this, but just as you write in your last comment we won't merge this due to this is supported in version 5.

But thanks for all your work and hopefully you are willing to take a look version 5 issues.

@NissesSenap NissesSenap closed this Mar 8, 2023
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.

3 participants