vfarcic / devops-toolkit-crossplane

MIT License
76 stars 100 forks source link

Cannot resolve package dependencies #8

Open hany opened 4 months ago

hany commented 4 months ago

Hi, I'm new to the whole Crossplane ecosystem, and I'm attempting to explore your dot-gitops Configuration.

I see that this configuration depends on the provider-helm provider being installed:

https://github.com/vfarcic/devops-toolkit-crossplane/blob/master/packages/gitops/crossplane.yaml#L13-L14

Which I have installed in my k8s cluster:

apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
  name: provider-helm
spec:
  package: xpkg.upbound.io/crossplane-contrib/provider-helm:v0.17.0
$ kubectl get provider.pkg/provider-helm
NAME            INSTALLED   HEALTHY   PACKAGE                                                    AGE
provider-helm   True        True      xpkg.upbound.io/crossplane-contrib/provider-helm:v0.17.0   7m26s

However, when I proceed to install your configuration using the following:

apiVersion: pkg.crossplane.io/v1
kind: Configuration
metadata:
  name: dot-gitops
spec:
  package: xpkg.upbound.io/devops-toolkit/dot-gitops:v0.2.14

I'm getting this error for the config:

Status:
  Conditions:
    Last Transition Time:  2024-03-10T15:27:06Z
    Message:               cannot resolve package dependencies: missing dependencies: [crossplane/provider-helm]
    Reason:                UnknownPackageRevisionHealth
    Status:                Unknown
    Type:                  Healthy
    Last Transition Time:  2024-03-10T15:27:04Z
    Reason:                ActivePackageRevision
    Status:                True
    Type:                  Installed
  Current Identifier:      xpkg.upbound.io/devops-toolkit/dot-gitops:v0.2.14
  Current Revision:        dot-gitops-00637ccddc9b
Events:
  Type     Reason                  Age              From                                      Message
  ----     ------                  ----             ----                                      -------
  Warning  InstallPackageRevision  7s (x6 over 9s)  packages/configuration.pkg.crossplane.io  current package revision health is unknown

I'm not sure how to effectively troubleshoot this issue. Any guidance would be greatly appreciated.

vfarcic commented 4 months ago

That's one of the packages I haven't maintained in a while. Actually, all the packages in that repo are old. I moved some of them to separate repos and maintain/work them regularly. You can find those at https://github.com/vfarcic/crossplane-kubernetes and https://github.com/vfarcic/crossplane-sql.

Going back to the GitOps composition...

The idea behind dependencies is that they should be installed automatically when the configuration itself is applied. But, since Helm provider is installed separately (it requires additional configuration), you do not have to have it as a dependency in crossplane.yaml. Otherwise, if you do keep it as a dependency, the name needs to match a specific format. I haven't been putting dependencies that should not be installed through the configuration (but manually) in a while now so I forgot the exact naming convention. I think you should give it the name crossplane-provider-helm. I might be wrong though. If I am, I can figure it out and get back to you but I still think that it's better to simply remove that one from crossplane.yaml.

P.S. Are you following one of my Gists and/or videos? If you are, please let me know which one it is so that I correct it.

hany commented 4 months ago

Thanks for replying so quick! I gave it a shot of renaming the Helm provider to crossplane-provider-helm:

apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
  name: crossplane-provider-helm
spec:
  package: xpkg.upbound.io/crossplane-contrib/provider-helm:v0.17.0

But it still appears to be erroring out:

    Message:               cannot resolve package dependencies: missing dependencies: [crossplane/provider-helm]

I actually came across this from browsing the Upbound Marketplace. Is there a better way of testing out your dot-gitops config?

vfarcic commented 4 months ago

For now, I suggest you remove it from crossplane.yaml since you're installing it manually anyways. Please do that and let me know if it worked.

If you're free now, we can do a call and go through it together. We can also use that opportunity to go through any other questions you might have. I'll be in https://meet.google.com/qji-rpcu-cqt for the next 30 min. in case you can join (no obligations if you can't).

From my side, I will go through that package, move it to a separate repo, add tests (like in those repos I mentioned previously), create examples, add docs, etc. The only problem is that KubeCon is coming soon and weeks before it tend to be very busy so I won't be able to start working on this until the week after KubeCon (last week of March).