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

Have A CI task to verify the CRD folder in sync #480

Closed
jenting opened this issue Jul 26, 2023 · 8 comments · Fixed by #483
Closed

Have A CI task to verify the CRD folder in sync #480

jenting opened this issue Jul 26, 2023 · 8 comments · Fixed by #483
Assignees
Labels

Comments

@jenting
Copy link
Collaborator

jenting commented Jul 26, 2023

Describe the problem/challenge you have
[A description of the current limitation/problem/challenge that you are experiencing.]

Currently, the CI does not check the CRD folder YAML manifests are synced with the Velero image.

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Have a CI task to verify the CRD folder YAML manifests are synced with the Velero image.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • helm version (use helm version):
  • helm chart version and app version (use helm list -n <YOUR NAMESPACE>):
  • Kubernetes version (use kubectl version):
  • Kubernetes installer & version:
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
@tungbq
Copy link
Contributor

tungbq commented Aug 1, 2023

Hello, may I know the step verify the CRD folder YAML manifests are synced with the Velero image manually?

@jenting
Copy link
Collaborator Author

jenting commented Aug 1, 2023

@tungbq
Compare the YAML between
velero install --crds-only --dry-run -o yaml and crds folder.

@tungbq
Copy link
Contributor

tungbq commented Aug 1, 2023

@tungbq Compare the YAML between velero install --crds-only --dry-run -o yaml and crds folder.

Thanks @jenting for your prompt response.
I'm thinking about the approach to create 2 yaml output files:

  • velero install --crds-only --dry-run -o yaml > debug_velero.yml
  • kubectl apply --dry-run=client -f crds/ -o yaml > debug_origin.yaml

Then we compare the debug_velero.yml with debug_origin.yaml to see if they are synced.
Not sure it the right approach, could you please advise and correct if I was wrong? Thanks

@jenting
Copy link
Collaborator Author

jenting commented Aug 2, 2023

@tungbq
Sounds good.

Be aware that the YAML output ordering and some extra labels or annotations added/removed from the Velero CLI output.
Essentially, the Velero helm chart labels and annotations should be the same as Velero CLI output. but I am not 100% sure if fully the same or not right now.

@jenting jenting added the good first issue Good for newcomers label Aug 2, 2023
@tungbq
Copy link
Contributor

tungbq commented Aug 2, 2023

@tungbq Sounds good.

Be aware that the YAML output ordering and some extra labels or annotations added/removed from the Velero CLI output. Essentially, the Velero helm chart labels and annotations should be the same as Velero CLI output. but I am not 100% sure if fully the same or not right now.

As I observed, the diff part mostly is:

    status:
      acceptedNames:
        kind: ''
        plural: ''
      conditions: []
      storedVersions: []

and

kubectl.kubernetes.io/last-applied-configuration: >
    SOME_EXTRA_METADATA...

image

Trying to find a way to automate this. Not quite simple than I thought.
If you have any advice, please let me know. Thanks!

@jenting
Copy link
Collaborator Author

jenting commented Aug 2, 2023

I'd suggest not using kubectl --dry-run=client to generate the CRDs YAML.
Instead, tried to find a way to aggregate the CRDs YAML into one file with the same ordering as velero install --crds-only --dry-run -o yaml.

@jenting
Copy link
Collaborator Author

jenting commented Aug 2, 2023

Or as an alternative, you could compare the two results.

velero install --crds-only --dry-run -o yaml | kubectl apply --dry-run=client -f - -oyaml > debug_velero.yml
kubectl apply --dry-run=client -f crds/ -o yaml > debug_origin.yaml

@tungbq
Copy link
Contributor

tungbq commented Aug 2, 2023

Thanks @jenting. I'm implementing the workflow upon your suggestion!

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 a pull request may close this issue.

2 participants