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

Adds Configuration and Lock converters #12

Merged
merged 20 commits into from
Jul 7, 2023

Conversation

sergenyalcin
Copy link
Member

@sergenyalcin sergenyalcin commented Jun 20, 2023

Description of your changes

This PR adds meta.Configuration, pkg.Configuration and Lock converters.

I have:

  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Tested against crossplane/upjet#217 using the configuration package index.docker.io/ulucinar/family-migrator-test:v0.1.0 and the configuration source repo: https://github.com/ulucinar/alper-test-configuration/tree/family-migrator-test.

> /tmp/family-migrator generate

? Please specify the path for the migration plan /tmp/generated/migration-plan.yaml
? Please provide the registry and organization for the provider family packages xpkg.upbound.io/upbound
? Please select the providers that will be migrated  [Use arrows to move, space to select, <right> to all, <left> to none, type to filter]
  [ ]  provider-aws
  [x]  provider-azure
  [x]  provider-gcp
? Please specify the version of the provider-azure family. v0.34.0
? Please specify the version of the provider-gcp family. v0.33.0
? Please enter the URL of the migration source Configuration package index.docker.io/ulucinar/family-migrator-test:v0.1.0
? Please enter the URL of the migration target Configuration package index.docker.io/ulucinar/family-migrator-test-updated:v0.1.0
? Please specify the source directory for the Crossplane Configuration package /Users/user/github/alper-test-configuration/package
? Please specify the path to the directory containing the Crossplane package examples /Users/user/github/alper-test-configuration/package/examples
? Please specify the path to store the updated configuration package /tmp/generated/updated-package.pkg
? The migration plan has been generated at path: /tmp/generated/migration-plan.yaml. The referred resource manifests and the patch documents can be found under: /tmp/generated.
Would you like to proceed to the execution phase? Yes
? The migration file is here: /tmp/generated/migration-plan.yaml. The referred resource manifests and the patch documents can be found under: /tmp/generated. Please review the migraiton plan and continue to the execution step.
Did you review the generated migration plan? Yes
? The migration plan has manualExecution instructions. Do you want the instructions to be listed? Yes
sh -c "kubectl get managed -o yaml > backup/managed-resources.yaml"
sh -c "kubectl get composite -o yaml > backup/composite-resources.yaml"
sh -c "kubectl get claim --all-namespaces -o yaml > backup/claim-resources.yaml"
kubectl patch --type='merge' -f deletion-policy-orphan/alper-migration-test.resourcegroups.azure.upbound.io_v1beta1.yaml --patch-file deletion-policy-orphan/alper-migration-test.resourcegroups.azure.upbound.io_v1beta1.yaml
kubectl patch --type='merge' -f deletion-policy-orphan/alper-migration-test.serviceaccounts.cloudplatform.gcp.upbound.io_v1beta1.yaml --patch-file deletion-policy-orphan/alper-migration-test.serviceaccounts.cloudplatform.gcp.upbound.io_v1beta1.yaml
kubectl apply -f new-ssop/upbound-provider-family-azure.providers.pkg.crossplane.io_v1.yaml
kubectl apply -f new-ssop/upbound-provider-family-gcp.providers.pkg.crossplane.io_v1.yaml
sh -c "kubectl wait provider.pkg upbound-provider-family-azure --for condition=Healthy"
sh -c "kubectl wait provider.pkg upbound-provider-family-gcp --for condition=Healthy"
kubectl apply -f new-ssop/upbound-provider-gcp-cloudplatform.providers.pkg.crossplane.io_v1.yaml
sh -c "kubectl wait provider.pkg upbound-provider-gcp-cloudplatform --for condition=Healthy"
kubectl patch --type='merge' -f disable-dependency-resolution/ulucinar-family-migrator-test.configurations.pkg.crossplane.io_v1.yaml --patch-file disable-dependency-resolution/ulucinar-family-migrator-test.configurations.pkg.crossplane.io_v1.yaml
kubectl patch --type='merge' -f edit-package-lock/lock.locks.pkg.crossplane.io_v1beta1.yaml --patch-file edit-package-lock/lock.locks.pkg.crossplane.io_v1beta1.yaml
kubectl delete Provider.pkg.crossplane.io upbound-provider-azure
kubectl delete Provider.pkg.crossplane.io upbound-provider-gcp
kubectl patch --type='merge' -f activate-ssop/upbound-provider-family-azure.providers.pkg.crossplane.io_v1.yaml --patch-file activate-ssop/upbound-provider-family-azure.providers.pkg.crossplane.io_v1.yaml
kubectl patch --type='merge' -f activate-ssop/upbound-provider-family-gcp.providers.pkg.crossplane.io_v1.yaml --patch-file activate-ssop/upbound-provider-family-gcp.providers.pkg.crossplane.io_v1.yaml
sh -c "kubectl wait provider.pkg upbound-provider-family-azure --for condition=Installed"
sh -c "kubectl wait provider.pkg upbound-provider-family-gcp --for condition=Installed"
kubectl patch --type='merge' -f activate-ssop/upbound-provider-gcp-cloudplatform.providers.pkg.crossplane.io_v1.yaml --patch-file activate-ssop/upbound-provider-gcp-cloudplatform.providers.pkg.crossplane.io_v1.yaml
sh -c "kubectl wait provider.pkg upbound-provider-gcp-cloudplatform --for condition=Installed"
sh -c "cp edit-configuration-metadata/configuration-migration-test.configurations.meta.pkg.crossplane.io_v1alpha1.yaml /Users/alper/github/alper-test-configuration/package/crossplane.yaml"
sh -c "up xpkg build --package-root=/Users/alper/github/alper-test-configuration/package --examples-root=/Users/alper/github/alper-test-configuration/package/examples -o /tmp/generated/updated-package.pkg"
sh -c "up xpkg push index.docker.io/ulucinar/family-migrator-test-updated:v0.1.0 -f /tmp/generated/updated-package.pkg"
kubectl patch --type='merge' -f edit-configuration-package/ulucinar-family-migrator-test.configurations.pkg.crossplane.io_v1.yaml --patch-file edit-configuration-package/ulucinar-family-migrator-test.configurations.pkg.crossplane.io_v1.yaml
kubectl patch --type='merge' -f enable-dependency-resolution/ulucinar-family-migrator-test.configurations.pkg.crossplane.io_v1.yaml --patch-file enable-dependency-resolution/ulucinar-family-migrator-test.configurations.pkg.crossplane.io_v1.yaml
kubectl patch --type='merge' -f deletion-policy-delete/alper-migration-test.resourcegroups.azure.upbound.io_v1beta1.yaml --patch-file deletion-policy-delete/alper-migration-test.resourcegroups.azure.upbound.io_v1beta1.yaml
kubectl patch --type='merge' -f deletion-policy-delete/alper-migration-test.serviceaccounts.cloudplatform.gcp.upbound.io_v1beta1.yaml --patch-file deletion-policy-delete/alper-migration-test.serviceaccounts.cloudplatform.gcp.upbound.io_v1beta1.yaml
? Do you want to execute the migration plan with step-by-step confirmation or no interaction  [Use arrows to move, type to filter]
> Step-by-Step
  No Interaction
? Step (with name "backup-managed-resources" at index 0) to execute:
sh -c "kubectl get managed -o yaml > backup/managed-resources.yaml"

What is your execution preference? Automatically
{"level":"info","ts":"2023-07-07T16:50:50+03:00","logger":"family-migrator","msg":"Executing step...","index":0,"name":"backup-managed-resources"}
{"level":"info","ts":"2023-07-07T16:51:02+03:00","logger":"family-migrator","msg":"Step succeeded","diagnostics":"","index":0,"name":"backup-managed-resources"}
? Step (with name "backup-composite-resources" at index 1) to execute:
sh -c "kubectl get composite -o yaml > backup/composite-resources.yaml"

What is your execution preference?  [Use arrows to move, type to filter, ? for more help]
> Automatically
  Manually
  Skip

...

? Step (with name "deletion-policy-delete" at index 25) to execute:
kubectl patch --type='merge' -f deletion-policy-delete/alper-migration-test.resourcegroups.azure.upbound.io_v1beta1.yaml --patch-file deletion-policy-delete/alper-migration-test.resourcegroups.azure.upbound.io_v1beta1.yaml
kubectl patch --type='merge' -f deletion-policy-delete/alper-migration-test.serviceaccounts.cloudplatform.gcp.upbound.io_v1beta1.yaml --patch-file deletion-policy-delete/alper-migration-test.serviceaccounts.cloudplatform.gcp.upbound.io_v1beta1.yaml

What is your execution preference? Automatically
{"level":"info","ts":"2023-07-07T16:52:14+03:00","logger":"family-migrator","msg":"Executing step...","index":25,"name":"deletion-policy-delete"}
{"level":"info","ts":"2023-07-07T16:52:14+03:00","logger":"family-migrator","msg":"Step succeeded","diagnostics":"serviceaccount.cloudplatform.gcp.upbound.io/alper-migration-test patched\n","index":25,"name":"deletion-policy-delete"}

Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
@sergenyalcin sergenyalcin self-assigned this Jun 20, 2023
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
@sergenyalcin sergenyalcin changed the title Adds meta.Configuration converters Adds Configuration and Lock converters Jun 20, 2023
cmd/provider-list/converter.go Outdated Show resolved Hide resolved
cmd/provider-list/converter.go Outdated Show resolved Hide resolved
cmd/provider-list/converter.go Outdated Show resolved Hide resolved
cmd/provider-list/converter.go Outdated Show resolved Hide resolved
cmd/provider-list/converter.go Outdated Show resolved Hide resolved
cmd/provider-list/converter.go Outdated Show resolved Hide resolved
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
ulucinar and others added 4 commits July 3, 2023 14:14
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
sergenyalcin and others added 8 commits July 4, 2023 15:53
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
…es source for conditional orphaning

Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
… parent as the plan file

Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
sergenyalcin and others added 2 commits July 7, 2023 14:10
Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
Copy link
Contributor

@ulucinar ulucinar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sergenyalcin, lgtm. Let's update the upjet dependency and merge this PR.

Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
@sergenyalcin sergenyalcin merged commit 219fb84 into upbound:main Jul 7, 2023
6 checks passed
@sergenyalcin sergenyalcin deleted the config-meta-converter branch July 7, 2023 15:44
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.

None yet

2 participants