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

fix: use default storage class when class is not defined #651

Merged

Conversation

MasayaAoyama
Copy link
Contributor

@MasayaAoyama MasayaAoyama commented Dec 9, 2021

Thank you for your great works! I fixed some behavior.

This PR is for v4 contribution of #430 .

Description

use default storage class when class is not defined

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

When Grafana.spec.dataStorage.class is not defined or set nil, generated PVC.spec.storageClassName is set "".
But I think we prefer to use default storageClass.

apiVersion: integreatly.org/v1alpha1
kind: Grafana
metadata:
  name: grafana
spec:
  baseImage: grafana/grafana:7.4.3
  ...
  dataStorage:
    accessModes:
    - ReadWriteOnce
    size: 5Gi
#    class: null
  • default bahavior
$ k -n grafana get pvc grafana-pvc -oyaml | k neat
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: grafana-pvc
  namespace: grafana
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
  storageClassName: ""
  • newer bahavior
$ k -n grafana get pvc grafana-pvc -oyaml | k neat
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: grafana-pvc
  namespace: grafana
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
  storageClassName: my-default-storageclass

@MasayaAoyama
Copy link
Contributor Author

Cc: @pb82 @HubertStefanski

@pb82 pb82 merged commit f8d2237 into grafana:master Dec 14, 2021
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.

2 participants