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

Cope when syncing a helm-provided CRD and resources using the CRD #1941

Closed
brantb opened this issue Apr 15, 2019 · 2 comments · Fixed by #1943
Closed

Cope when syncing a helm-provided CRD and resources using the CRD #1941

brantb opened this issue Apr 15, 2019 · 2 comments · Fixed by #1943

Comments

@brantb
Copy link
Contributor

brantb commented Apr 15, 2019

#1825 describes an issue where a commit cannot be synced if it contains both a CRD and a resource that uses that CRD. A fix was implemented in #1876 to look in the git repo for the manifest, however, this does not work if the CRD is installed via helm.

To reproduce:

  • Have a git repository containing a HelmRelease for rbac-manager and an RBACDefinition manifest
  • Create a new Kubernetes cluster
  • Install flux (v1.12.0) and flux-helm-operator

Expected result:

Flux applies the HelmRelease, which creates the RBACDefinition CRD, which allows Flux to apply the RBACDefinition manifest. In flux <= 1.10.1 this would take multiple sync passes, but the cluster would eventually reach the desired state.

Actual result:

After cloning the git repo, flux writes the following message to the log, and does not sync anything:

s=2019-04-15T19:43:02.307951117Z caller=images.go:24 component=sync-loop error="getting unlocked automated resources: error looking up API resources for RBACDefinition.rbacmanager.reactiveops.io/v1beta1: not found"

Since the CRD is part of the rbac-manager helm chart the code path added in #1876 doesn't seem to find it.

@2opremio 2opremio changed the title Flux can't sync when resources using a CRD are present unless the CRD is present in the git repo Cope when syncing a helm-provided CRD and resources using the CRD Apr 15, 2019
@2opremio 2opremio added the bug label Apr 15, 2019
@2opremio
Copy link
Contributor

This one's tricky and calls for implementing the approach suggested by @squaremo in #1825 (comment)

@2opremio
Copy link
Contributor

BTW, the workaround here is to first add the HelmRelease, wait for it to sync and then add the CRD instances. Sorry for the inconvenience.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants