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

Add dependency to Crossplane min version of v1.12.1-0 #472

Merged
merged 1 commit into from
Jun 14, 2023

Conversation

ulucinar
Copy link
Collaborator

@ulucinar ulucinar commented Jun 14, 2023

Description of your changes

Fixes #470

This PR adds a dependency to Crossplane min version of v1.12.1 for the family packages including the config package. The new dependency is not added to the monolithic packages.

I have:

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

How has this code been tested

Built 3 packages with this PR for the monolithic, config & devices providers. Here are the relevant metadata:

...
spec:
  controller: {}
  crossplane:
    version: '>=v1.12.1-0'
...
spec:
  controller: {}
...
spec:
  controller: {}
  crossplane:
    version: '>=v1.12.1-0'
  dependsOn:
  - provider: index.docker.io/ulucinar/provider-family-azure
    version: '>= 0.0.0-0'

Installation on Crossplane 1.12.1 goes fine as expected:

❯ kubectl get providers.pkg

NAME                             INSTALLED   HEALTHY   PACKAGE                                                         AGE
provider-azure-devices           True        True      index.docker.io/ulucinar/provider-azure-devices:v0.1.0-fix470   2m43s
ulucinar-provider-family-azure   True        True      index.docker.io/ulucinar/provider-family-azure:v0.1.0-fix470    2m32s

Installation on Crossplane 1.12.0 fails as expected:

❯ k get providerrevisions

NAME                                  HEALTHY   REVISION   IMAGE                                                           STATE    DEP-FOUND   DEP-INSTALLED   AGE
provider-azure-devices-fddcd0ad7043   False     1          index.docker.io/ulucinar/provider-azure-devices:v0.1.0-fix470   Active                               12m

❯ k get events -n default --field-selector 'involvedObject.name=provider-azure-devices-fddcd0ad7043'
LAST SEEN   TYPE      REASON              OBJECT                                                 MESSAGE
12m         Normal    BindClusterRole     providerrevision/provider-azure-devices-fddcd0ad7043   Bound system ClusterRole to provider ServiceAccount(s)
12s         Warning   ApplyClusterRoles   providerrevision/provider-azure-devices-fddcd0ad7043   cannot apply ClusterRole: cannot create object: ClusterRole.rbac.authorization.k8s.io "crossplane:provider:provider-azure-devices-fddcd0ad7043:system" is invalid: rules[0].apiGroups: Required value: resource rules must supply at least one api group
12m         Warning   LintPackage         providerrevision/provider-azure-devices-fddcd0ad7043   incompatible Crossplane version: package is not compatible with Crossplane version (v1.12.0)
6m14s       Warning   LintPackage         providerrevision/provider-azure-devices-fddcd0ad7043   incompatible Crossplane version: package is not compatible with Crossplane version (v1.12.0)

Also tested an upgrade scenario where a previous installation of upbound/provider-azure-devices, with no Crossplane version constraints, on Crossplane v1.12.0 is upgraded with a upbound/provider-azure-devices package that declares a dependency to Crossplane min version v1.12.1. The package manager is refusing to activate the associated ProviderRevision:

❯ k get providerrevisions.pkg.crossplane.io
NAME                                          HEALTHY   REVISION   IMAGE                                                           STATE      DEP-FOUND   DEP-INSTALLED   AGE
provider-azure-devices-becc562718e4           True      1          index.docker.io/ulucinar/provider-azure-devices:v0.2.0-fix470   Inactive                               7m39s
provider-azure-devices-fddcd0ad7043           False     2          index.docker.io/ulucinar/provider-azure-devices:v0.3.0-fix470   Active                                 4m5s
ulucinar-provider-family-azure-dc8eec55cb2e   True      2          index.docker.io/ulucinar/provider-family-azure:v0.2.0-fix470    Active                                 6m54s

❯ k get events -n default --field-selector 'involvedObject.name=provider-azure-devices-fddcd0ad7043'
LAST SEEN   TYPE      REASON              OBJECT                                                 MESSAGE
25m         Warning   ApplyClusterRoles   providerrevision/provider-azure-devices-fddcd0ad7043   cannot apply ClusterRole: cannot create object: ClusterRole.rbac.authorization.k8s.io "crossplane:provider:provider-azure-devices-fddcd0ad7043:system" is invalid: rules[0].apiGroups: Required value: resource rules must supply at least one api group
5m59s       Normal    BindClusterRole     providerrevision/provider-azure-devices-fddcd0ad7043   Bound system ClusterRole to provider ServiceAccount(s)
57s         Warning   ApplyClusterRoles   providerrevision/provider-azure-devices-fddcd0ad7043   cannot apply ClusterRole: cannot create object: ClusterRole.rbac.authorization.k8s.io "crossplane:provider:provider-azure-devices-fddcd0ad7043:system" is invalid: rules[0].apiGroups: Required value: resource rules must supply at least one api group
5m50s       Warning   LintPackage         providerrevision/provider-azure-devices-fddcd0ad7043   incompatible Crossplane version: package is not compatible with Crossplane version (v1.12.0)
5m56s       Warning   SyncPackage         providerrevision/provider-azure-devices-fddcd0ad7043   cannot update annotations for package revision: Operation cannot be fulfilled on providerrevisions.pkg.crossplane.io "provider-azure-devices-fddcd0ad7043": the object has been modified; please apply your changes to the latest version and try again

Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
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.

provider-azure-managedidentity missing rbac required to use resourceGroupNameRef field
2 participants