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

Implement testing logic to compare the Shoot-spec generated by provisioner with the shoot-spec generated by KIM #185

Closed
4 tasks done
tobiscr opened this issue Apr 18, 2024 · 4 comments
Assignees

Comments

@tobiscr
Copy link
Contributor

tobiscr commented Apr 18, 2024

Reason
We want to ensure that our migration from Provisioner to Kyma-Infrastructure-Manager will go without any issues. To create a shoot cluster in Gardener, we have to fill gardener's shoot spec.

How
Ideas on how to achieve that:

1. Comparing shoot spec of created clusters

  1. Prepare two KEB deployments. First should be still configured to use the old provisioner, and the second should use KIM.
  2. Send the very same instance creation requests to KEB.
  3. Compare the shoot specs of created clusters.

2. Comparing created shoot spec, before sending them to Gardener

  1. Create a feature flag in the provisioner for dumping shoot spec before sending it to gardener
  2. Save those specs
  3. Compare shoot specs generated in KIM with those generated in provisioner

Acceptance criteria

  • Each KEB's plan should be covered
  • compare (manually) the Shoot-spec generated by provisioner with the shoot-spec generated by KIM
  • the above comparison step should be automated (descoped for now)
  • It is possible for devlopers to compare the generated shoot-spec of KIM and the one generated by the provisioner
@Disper
Copy link
Member

Disper commented Apr 26, 2024

How shoots specs can be compared using yq:

  1. set KUBECONFIG env variable to the gardener's service account's kubeconfig
  2. Download shoot specs you want to compare kubectl get shoot -n GARDENER_PROJECT_NAME -ojson | jq '.items[] | select(.metadata.name == "SHOOT_NAME")' > SHOOT_NAME.yml
  3. Use yq and diff to compare them diff <(yq -P 'sort_keys(..)' -o=props SHOOT_NAME1.yml) <(yq -P 'sort_keys(..)' -o=props SHOOT_NAME2.yml)

This prints output in following manner:

< metadata.name = ag-test
---
> metadata.name = vogfkd3r2s
< spec.kubernetes.enableStaticTokenKubeconfig = true
---
> spec.kubernetes.enableStaticTokenKubeconfig = false

As it might come handy during manual testing, I'm not sure if we can use it in our golang test suite.

@koala7659
Copy link
Contributor

PR with feature flag to dump shoot spec created by Provisioner kyma-project/control-plane#3433

@Disper Disper assigned m00g3n and unassigned koala7659 May 14, 2024
@Disper
Copy link
Member

Disper commented May 22, 2024

Blocked by #215

@akgalwas
Copy link
Contributor

akgalwas commented Jul 9, 2024

Work plan

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

No branches or pull requests

5 participants