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

Support PersistentVolumeLastPhaseTransitionTime feature gate field lastPhaseTransitionTime in PersistentVolumeStatus #2399

Open
BBBmau opened this issue Jan 12, 2024 · 6 comments · May be fixed by #2417

Comments

@BBBmau
Copy link
Contributor

BBBmau commented Jan 12, 2024

Description

PersistentVolumeLastPhaseTransitionTime was recently graduated to beta and includes a new field as part of PersistentVolumeStatus

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@theloneexplorerquest
Copy link

Hi, I am interested to work on this issue!

@BBBmau
Copy link
Contributor Author

BBBmau commented Jan 20, 2024

@theloneexplorerquest you're more then welcome to open a PR! We appreciate contributions from the community to improve the provider. We can assist you on PR if needed

@theloneexplorerquest
Copy link

Hi @BBBmau thanks for message,

From what I understand, for the actual code, I need to have an if-else statement at https://github.com/hashicorp/terraform-provider-kubernetes/blob/main/kubernetes/resource_kubernetes_persistent_volume_v1.go#L243
eg. log.Printf("[DEBUG] Persistent volume %s status received: %#v, lastPhaseTransitionTime is %v", out.Name, statusPhase, out.Status.Phase.lastPhaseTransitionTime)

My question is: do we want to output this attribute in terraform at all? Because I did not see PersistentVolumeStatus.message and PersistentVolumeStatus.reason as log.

I will make the code change and do some test too.

@BBBmau
Copy link
Contributor Author

BBBmau commented Jan 27, 2024

@theloneexplorerquest it makes sense to include both message and reason as part of the log. You can also add those along with lastPhaseTransitionTime.

and yes it looks like depending on the phase you'll want the log to output a different message. a failed status would include message and reason

@theloneexplorerquest
Copy link

theloneexplorerquest commented Feb 9, 2024

Hi @BBBmau,

I have created the PR, can you take a look?
For such small changes, is acceptance test required? I wasn't able to get it running with my Kops cluster yet. 😓

This is the error message I got for make testacc

=== NAME  xxx
    resource_xxx:24: Step 1/2 error: Error running apply: exit status 1

        Error: Failed to configure client: unable to load root certificates: unable to parse bytes as PEM block       

          with kubernetes_ingress_v1.test,
          on terraform_plugin_test.tf line 1, in resource "kubernetes_ingress_v1" "test":
           1: resource "kubernetes_ingress_v1" "test" {

Suspect I got some issues with ca certificate but wasn't able to identify it yet. if Acceptance test is required I will figure it out in the next few weeks

@BBBmau
Copy link
Contributor Author

BBBmau commented Feb 13, 2024

No need for a test since the stateConf doesn't have one already made, this is because it's a log output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment