Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Move to CLI schema #161

Merged
merged 1 commit into from
Mar 30, 2022
Merged

Conversation

ezgidemirel
Copy link
Collaborator

Description of your changes

This change updates the provider to use CLI schema. It is opened on top of this PR.

Fixes #142

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

  • Ran "make generate"
  • Deployed CRDs to local cluster
  • Created/Deleted resource group, storage account and MSSQL resources.

@ezgidemirel ezgidemirel requested review from ulucinar and turkenh March 8, 2022 16:33
@ezgidemirel ezgidemirel changed the title Move to cli schema Move to CLI schema Mar 9, 2022
@ezgidemirel ezgidemirel force-pushed the move-to-cli-schema branch 6 times, most recently from 883081d to 43af7d3 Compare March 10, 2022 12:17
@ulucinar
Copy link
Collaborator

Hi @ezgidemirel,
Could you please rebase this PR for a review?

@ezgidemirel
Copy link
Collaborator Author

Hi @ezgidemirel, Could you please rebase this PR for a review?

rebased :)

Copy link
Collaborator

@turkenh turkenh left a comment

Choose a reason for hiding this comment

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

Looking good to me!

config/provider.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@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.

Thank you @ezgidemirel for working on this, very much appreciated. I've left a few nits but the PR looks good to me. Could you please point me to an MR API change which introduces floats? Could you please also rebase the PR?

@@ -30,6 +31,12 @@ import (
func Configure(p *config.Provider) {
p.AddResourceConfigurator("azurerm_iothub", func(r *config.Resource) {
r.Version = common.VersionV1Alpha2
r.TerraformResource.Schema["endpoint"].Elem.(*schema.Resource).
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: We may consider documenting why we need to explicitly mark these as sensitive with code comments. If we have a related issue, we may also refer to that issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -31,6 +32,22 @@ import (
func Configure(p *config.Provider) {
p.AddResourceConfigurator("azurerm_kubernetes_cluster", func(r *config.Resource) {
r.Version = common.VersionV1Alpha2
r.TerraformResource.Schema["kube_admin_config"].Elem.(*schema.Resource).
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: We may consider documenting why we need to explicitly mark these as sensitive with code comments. If we have a related issue, we may also refer to that issue.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -49,10 +50,8 @@ import (
"github.com/crossplane-contrib/provider-jet-azure/config/subnet"
)

const (
resourcePrefix = "azure"
modulePath = "github.com/crossplane-contrib/provider-jet-azure"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like we still need this constant in line 136.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added it back :)

@@ -49,10 +50,8 @@ import (
"github.com/crossplane-contrib/provider-jet-azure/config/subnet"
)

const (
resourcePrefix = "azure"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like we still need this constant in line 136.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added it back :)

@ulucinar
Copy link
Collaborator

@ezgidemirel, could you please also take a look at the upgrade procedure? I assume we will need to do a minor version bump and because of the breaking API changes, we will not have a smooth upgrade, correct?

@ezgidemirel
Copy link
Collaborator Author

@ezgidemirel, could you please also take a look at the upgrade procedure? I assume we will need to do a minor version bump and because of the breaking API changes, we will not have a smooth upgrade, correct?

I've tested the upgrade scenario by updating v0.8.0 provider package to the one built on my branch and there were no issues.

Copy link
Collaborator

@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.

Thank you very much @ezgidemirel for working on this! Very much appreciated.

@ulucinar ulucinar merged commit 3295c3a into crossplane-contrib:main Mar 30, 2022
@ezgidemirel ezgidemirel deleted the move-to-cli-schema branch March 30, 2022 12:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to use CLI schema
4 participants