✨ Starting Helm POC - pull in some rukpak#756
✨ Starting Helm POC - pull in some rukpak#756tmshort merged 3 commits intooperator-framework:helm-pocfrom
Conversation
Signed-off-by: Todd Short <tshort@redhat.com>
| } | ||
|
|
||
| func (r *ClusterExtensionReconciler) GenerateExpectedBundleSource(o ocv1alpha1.ClusterExtension, bundlePath string) *rukpakapi.BundleSource { | ||
| return &rukpakapi.BundleSource{ |
There was a problem hiding this comment.
The BundleSource here is stateless, and does not store any information with respect to the status.
Which means we need not create a separate API, instead just create a struct and pass it to the unpacker. This way, we can remove all the deep copy methods and not consider the bundle source as a deep copy object.
There was a problem hiding this comment.
So, this API is not a k8s API, it's just a struct as you point out. It was convenient to use. However, it's named rukpakapi since it's part of the interface to the pulled-in rukpak code.
There was a problem hiding this comment.
It had deepycopy methods, so thought this was intended to be a separate API. The naming is all good 👍
internal/rukpak/api/bundle_types.go
Outdated
| // Type defines the kind of Bundle content being sourced. | ||
| Type SourceType `json:"type"` | ||
| // Image is the bundle image that backs the content of this bundle. | ||
| Image *ImageSource `json:"image,omitempty"` |
There was a problem hiding this comment.
For now we can consider only the Image source. The less code the better and once we have the prototype ready with parts of Helm working as a applier, we can work on expanding this to other sources. Wdyt?
internal/rukpak/api/bundle_types.go
Outdated
| InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"` | ||
| } | ||
|
|
||
| type ProvisionerID string |
There was a problem hiding this comment.
We don't need Provisioners any more, since we will have just one controller handling unpacking, and installing for all kinds of bundles. Also, for now, we are going to consider only registryV1 formats.
| return out | ||
| } | ||
|
|
||
| // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. |
There was a problem hiding this comment.
We need not have BundleSource as a separate API which means as mentioned in the previous comment we can remove these deep copy methods.
| ProvisionerID = "core-rukpak-io-helm" | ||
| ) | ||
|
|
||
| func HandleBundleDeployment(_ context.Context, fsys fs.FS, bd *rukpakv1alpha2.BundleDeployment) (*chart.Chart, chartutil.Values, error) { |
There was a problem hiding this comment.
This bit of code is going to change since we don't have BundleDeployment anymore. Plus looks like this is using helm based bundles (from the provisionerID). We need to port the registryV1 piece of implementation, which would be:
- Converting registryV1 to plain bundles: the conversion code which is called here: https://github.com/operator-framework/rukpak/blob/882714a00b5d99fdfc1b65992206c4e90edfd696/internal/provisioner/registry/registry.go#L22
- The logic where we create a chart from the manifest objects: https://github.com/operator-framework/rukpak/blob/882714a00b5d99fdfc1b65992206c4e90edfd696/internal/provisioner/plain/plain.go#L28
This would need some amount of refinement in terms of creating the chart from unpacked bundle contents from the file system. Can we remove this from this PR, and work on this separately along with the helm install logic?
There was a problem hiding this comment.
Yes, this code was just pulled in, it hasn't been updated. I expect that things will be iterated and removed.
| manifestsDir = "manifests" | ||
| ) | ||
|
|
||
| func HandleBundleDeployment(_ context.Context, fsys fs.FS, _ *rukpakv1alpha2.BundleDeployment) (*chart.Chart, chartutil.Values, error) { |
There was a problem hiding this comment.
As mentioned in the previous comment, this is going to change as we no longer have BundleDeployment. What do you think about removing the Handler implementations from this PR and working on them in follow ups?
| ProvisionerID = "core-rukpak-io-registry" | ||
| ) | ||
|
|
||
| func HandleBundleDeployment(ctx context.Context, fsys fs.FS, bd *rukpakv1alpha2.BundleDeployment) (*chart.Chart, chartutil.Values, error) { |
There was a problem hiding this comment.
The same as before in terms of removing BundleDeployment related handlers.
internal/rukpak/source/configmaps.go
Outdated
| @@ -0,0 +1,85 @@ | |||
| package source | |||
|
|
|||
| import ( | |||
There was a problem hiding this comment.
We can have just the internal/rukpak/source/image.go for now, so that we figure out the unpacker for just one source for now. All the other implementations in internal/rukpak/source/ can be removed for now
| // For example, resolved image sources should reference a container image | ||
| // digest rather than an image tag, and git sources should reference a | ||
| // commit hash rather than a branch or tag. | ||
| ResolvedSource *rukpakapi.BundleSource |
There was a problem hiding this comment.
I'm wondering if we need the ResolvedSource here? What if we directly populate the ClusterExtension status with the details of resolved bundle?
There was a problem hiding this comment.
That could be a follow on.
There was a problem hiding this comment.
Also, I was trying to avoid changing k8s APIs
internal/rukpak/util/util.go
Outdated
| ErrMaxGeneratedLimit = errors.New("reached the maximum generated Bundle limit") | ||
| ) | ||
|
|
||
| func BundleDeploymentProvisionerFilter(provisionerClassName string) predicate.Predicate { |
There was a problem hiding this comment.
We are not using Provisioners here, so I think all the methods in this file can be removed and would not be useful.
|
General note: it was just easy to pull in more code than necessary, rather than trying to figure out exactly what was needed. |
|
There's still quite possibly too much code in here. |
408661e to
a7899fa
Compare
varshaprasad96
left a comment
There was a problem hiding this comment.
Just a nit, the other changes look good!
Are you going to plug in the unpacker in the reconciler in this PR, or as a follow up?
internal/rukpak/api/bundle_types.go
Outdated
| SourceTypeGit SourceType = "git" | ||
| SourceTypeConfigMaps SourceType = "configMaps" | ||
| SourceTypeHTTP SourceType = "http" |
There was a problem hiding this comment.
Nit: cleanups
| SourceTypeGit SourceType = "git" | |
| SourceTypeConfigMaps SourceType = "configMaps" | |
| SourceTypeHTTP SourceType = "http" |
internal/rukpak/source/unpacker.go
Outdated
| MinVersion: tls.VersionTLS12, | ||
| } | ||
| } | ||
| httpTransport.TLSClientConfig.RootCAs = rootCAs |
There was a problem hiding this comment.
I think we don't need the TLS client config or the rootCAs. IIRC it was used only in http source.
There was a problem hiding this comment.
Hmmm... even in the original code, it doesn't appear used. It's a clone (copy?) and isn't even referenced after this. Odd...
| // DeepHashObject writes specified object to hash using the spew library | ||
| // which follows pointers and prints actual values of the nested objects | ||
| // ensuring the hash does not change when a pointer changes. | ||
| func DeepHashObject(obj interface{}) (string, error) { |
There was a problem hiding this comment.
TODO (follow up): We can have this for now, but just wondering if we need to ever use it anywhere to hash the entire spec of the object. The linter would complain in the future anyway, we can take care as the design proceeds.
Follow up. |
Replace BundleDeployment in the Unpack APIs with a combination of BundleSource and ClusterExtension. It builds... Signed-off-by: Todd Short <tshort@redhat.com>
varshaprasad96
left a comment
There was a problem hiding this comment.
The CI may probably fail, since this is a PoC not going to worry about that.
/lgtm
/approve
|
New changes are detected. LGTM label has been removed. |
* Fix suite_test.go Signed-off-by: Todd Short <tshort@redhat.com> * Copy over some rukpak code and replace BundleDeployment Replace BundleDeployment in the Unpack APIs with a combination of BundleSource and ClusterExtension. It builds... Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Copy over some rukpak code and replace BundleDeployment --------- Signed-off-by: Todd Short <tshort@redhat.com>
* Fix suite_test.go Signed-off-by: Todd Short <tshort@redhat.com> * Copy over some rukpak code and replace BundleDeployment Replace BundleDeployment in the Unpack APIs with a combination of BundleSource and ClusterExtension. It builds... Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Copy over some rukpak code and replace BundleDeployment --------- Signed-off-by: Todd Short <tshort@redhat.com>
plug in resolver Deal with removal of HigherBundleVersion Removed in e079129 Signed-off-by: Todd Short <tshort@redhat.com> :sparkles: Starting Helm POC - pull in some rukpak (#756) * Fix suite_test.go Signed-off-by: Todd Short <tshort@redhat.com> * Copy over some rukpak code and replace BundleDeployment Replace BundleDeployment in the Unpack APIs with a combination of BundleSource and ClusterExtension. It builds... Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Copy over some rukpak code and replace BundleDeployment --------- Signed-off-by: Todd Short <tshort@redhat.com> Plugin unpacker, add Handler (#757) Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> A bit of cleanup (#761) Signed-off-by: Todd Short <tshort@redhat.com> :warning: Install the helm chart (#762) * Install the helm chart Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Install the helm chart Signed-off-by: Todd Short <tshort@redhat.com> --------- Signed-off-by: Todd Short <tshort@redhat.com> Set up right watches and all labels to postrenderer (#763) Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> :warning: Update owner keys (#765) * Update owner keys Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Update owner keys Signed-off-by: Todd Short <tshort@redhat.com> --------- Signed-off-by: Todd Short <tshort@redhat.com> No more panics (#767) Signed-off-by: Todd Short <tshort@redhat.com> Add relevant RBAC to enable controller to watch resources (#776) Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> Changes required for ClusterExtension to install an operator (#789) * Add relevant RBAC to enable controller to watch resources * Debugging iteration - one * ClusterExtension installing the operator - working --------- Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> Fix some lints (#793) Signed-off-by: Todd Short <tshort@redhat.com> :sparkles: Getting cluster extension running (#795) * Getting cluster extension running * Specify namespace to create secret Set resolved and installed versions (#806) Remove install references to rukpak (#805) Signed-off-by: Todd Short <tshort@redhat.com> Consolidate error message generation (#807) Signed-off-by: Todd Short <tshort@redhat.com> Add make kind-redeploy (#808) Signed-off-by: Todd Short <tshort@redhat.com> Use rukpak as a library (#821) Signed-off-by: Todd Short <tshort@redhat.com> Improve caching and fix constant reconciles (#825) Improve performance by caching objects that only have ClusterExtension as owners. Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> Fix linter (#826) Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> Move helm-operator-plugin (#828) Signed-off-by: Todd Short <tshort@redhat.com> Really fix linter (#833) Signed-off-by: Todd Short <tshort@redhat.com>
plug in resolver Deal with removal of HigherBundleVersion Removed in e079129 Signed-off-by: Todd Short <tshort@redhat.com> :sparkles: Starting Helm POC - pull in some rukpak (#756) * Fix suite_test.go Signed-off-by: Todd Short <tshort@redhat.com> * Copy over some rukpak code and replace BundleDeployment Replace BundleDeployment in the Unpack APIs with a combination of BundleSource and ClusterExtension. It builds... Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Copy over some rukpak code and replace BundleDeployment --------- Signed-off-by: Todd Short <tshort@redhat.com> Plugin unpacker, add Handler (#757) Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> A bit of cleanup (#761) Signed-off-by: Todd Short <tshort@redhat.com> :warning: Install the helm chart (#762) * Install the helm chart Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Install the helm chart Signed-off-by: Todd Short <tshort@redhat.com> --------- Signed-off-by: Todd Short <tshort@redhat.com> Set up right watches and all labels to postrenderer (#763) Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> :warning: Update owner keys (#765) * Update owner keys Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Update owner keys Signed-off-by: Todd Short <tshort@redhat.com> --------- Signed-off-by: Todd Short <tshort@redhat.com> No more panics (#767) Signed-off-by: Todd Short <tshort@redhat.com> Add relevant RBAC to enable controller to watch resources (#776) Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> Changes required for ClusterExtension to install an operator (#789) * Add relevant RBAC to enable controller to watch resources * Debugging iteration - one * ClusterExtension installing the operator - working --------- Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> Fix some lints (#793) Signed-off-by: Todd Short <tshort@redhat.com> :sparkles: Getting cluster extension running (#795) * Getting cluster extension running * Specify namespace to create secret Set resolved and installed versions (#806) Remove install references to rukpak (#805) Signed-off-by: Todd Short <tshort@redhat.com> Consolidate error message generation (#807) Signed-off-by: Todd Short <tshort@redhat.com> Add make kind-redeploy (#808) Signed-off-by: Todd Short <tshort@redhat.com> Use rukpak as a library (#821) Signed-off-by: Todd Short <tshort@redhat.com> Improve caching and fix constant reconciles (#825) Improve performance by caching objects that only have ClusterExtension as owners. Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> Fix linter (#826) Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> Move helm-operator-plugin (#828) Signed-off-by: Todd Short <tshort@redhat.com> Really fix linter (#833) Signed-off-by: Todd Short <tshort@redhat.com>
plug in resolver Deal with removal of HigherBundleVersion Removed in e079129 Signed-off-by: Todd Short <tshort@redhat.com> :sparkles: Starting Helm POC - pull in some rukpak (operator-framework#756) * Fix suite_test.go Signed-off-by: Todd Short <tshort@redhat.com> * Copy over some rukpak code and replace BundleDeployment Replace BundleDeployment in the Unpack APIs with a combination of BundleSource and ClusterExtension. It builds... Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Copy over some rukpak code and replace BundleDeployment --------- Signed-off-by: Todd Short <tshort@redhat.com> Plugin unpacker, add Handler (operator-framework#757) Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> A bit of cleanup (operator-framework#761) Signed-off-by: Todd Short <tshort@redhat.com> :warning: Install the helm chart (operator-framework#762) * Install the helm chart Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Install the helm chart Signed-off-by: Todd Short <tshort@redhat.com> --------- Signed-off-by: Todd Short <tshort@redhat.com> Set up right watches and all labels to postrenderer (operator-framework#763) Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> :warning: Update owner keys (operator-framework#765) * Update owner keys Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Update owner keys Signed-off-by: Todd Short <tshort@redhat.com> --------- Signed-off-by: Todd Short <tshort@redhat.com> No more panics (operator-framework#767) Signed-off-by: Todd Short <tshort@redhat.com> Add relevant RBAC to enable controller to watch resources (operator-framework#776) Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> Changes required for ClusterExtension to install an operator (operator-framework#789) * Add relevant RBAC to enable controller to watch resources * Debugging iteration - one * ClusterExtension installing the operator - working --------- Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> Fix some lints (operator-framework#793) Signed-off-by: Todd Short <tshort@redhat.com> :sparkles: Getting cluster extension running (operator-framework#795) * Getting cluster extension running * Specify namespace to create secret Set resolved and installed versions (operator-framework#806) Remove install references to rukpak (operator-framework#805) Signed-off-by: Todd Short <tshort@redhat.com> Consolidate error message generation (operator-framework#807) Signed-off-by: Todd Short <tshort@redhat.com> Add make kind-redeploy (operator-framework#808) Signed-off-by: Todd Short <tshort@redhat.com> Use rukpak as a library (operator-framework#821) Signed-off-by: Todd Short <tshort@redhat.com> Improve caching and fix constant reconciles (operator-framework#825) Improve performance by caching objects that only have ClusterExtension as owners. Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> Fix linter (operator-framework#826) Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> Move helm-operator-plugin (operator-framework#828) Signed-off-by: Todd Short <tshort@redhat.com> Really fix linter (operator-framework#833) Signed-off-by: Todd Short <tshort@redhat.com>
plug in resolver Deal with removal of HigherBundleVersion Removed in e079129 Signed-off-by: Todd Short <tshort@redhat.com> :sparkles: Starting Helm POC - pull in some rukpak (#756) * Fix suite_test.go Signed-off-by: Todd Short <tshort@redhat.com> * Copy over some rukpak code and replace BundleDeployment Replace BundleDeployment in the Unpack APIs with a combination of BundleSource and ClusterExtension. It builds... Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Copy over some rukpak code and replace BundleDeployment --------- Signed-off-by: Todd Short <tshort@redhat.com> Plugin unpacker, add Handler (#757) Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> A bit of cleanup (#761) Signed-off-by: Todd Short <tshort@redhat.com> :warning: Install the helm chart (#762) * Install the helm chart Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Install the helm chart Signed-off-by: Todd Short <tshort@redhat.com> --------- Signed-off-by: Todd Short <tshort@redhat.com> Set up right watches and all labels to postrenderer (#763) Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> :warning: Update owner keys (#765) * Update owner keys Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Update owner keys Signed-off-by: Todd Short <tshort@redhat.com> --------- Signed-off-by: Todd Short <tshort@redhat.com> No more panics (#767) Signed-off-by: Todd Short <tshort@redhat.com> Add relevant RBAC to enable controller to watch resources (#776) Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> Changes required for ClusterExtension to install an operator (#789) * Add relevant RBAC to enable controller to watch resources * Debugging iteration - one * ClusterExtension installing the operator - working --------- Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> Fix some lints (#793) Signed-off-by: Todd Short <tshort@redhat.com> :sparkles: Getting cluster extension running (#795) * Getting cluster extension running * Specify namespace to create secret Set resolved and installed versions (#806) Remove install references to rukpak (#805) Signed-off-by: Todd Short <tshort@redhat.com> Consolidate error message generation (#807) Signed-off-by: Todd Short <tshort@redhat.com> Add make kind-redeploy (#808) Signed-off-by: Todd Short <tshort@redhat.com> Use rukpak as a library (#821) Signed-off-by: Todd Short <tshort@redhat.com> Improve caching and fix constant reconciles (#825) Improve performance by caching objects that only have ClusterExtension as owners. Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> Fix linter (#826) Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> Move helm-operator-plugin (#828) Signed-off-by: Todd Short <tshort@redhat.com> Really fix linter (#833) Signed-off-by: Todd Short <tshort@redhat.com>
plug in resolver Deal with removal of HigherBundleVersion Removed in e079129 Signed-off-by: Todd Short <tshort@redhat.com> :sparkles: Starting Helm POC - pull in some rukpak (#756) * Fix suite_test.go Signed-off-by: Todd Short <tshort@redhat.com> * Copy over some rukpak code and replace BundleDeployment Replace BundleDeployment in the Unpack APIs with a combination of BundleSource and ClusterExtension. It builds... Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Copy over some rukpak code and replace BundleDeployment --------- Signed-off-by: Todd Short <tshort@redhat.com> Plugin unpacker, add Handler (#757) Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> A bit of cleanup (#761) Signed-off-by: Todd Short <tshort@redhat.com> :warning: Install the helm chart (#762) * Install the helm chart Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Install the helm chart Signed-off-by: Todd Short <tshort@redhat.com> --------- Signed-off-by: Todd Short <tshort@redhat.com> Set up right watches and all labels to postrenderer (#763) Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> :warning: Update owner keys (#765) * Update owner keys Signed-off-by: Todd Short <tshort@redhat.com> * fixup! Update owner keys Signed-off-by: Todd Short <tshort@redhat.com> --------- Signed-off-by: Todd Short <tshort@redhat.com> No more panics (#767) Signed-off-by: Todd Short <tshort@redhat.com> Add relevant RBAC to enable controller to watch resources (#776) Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> Changes required for ClusterExtension to install an operator (#789) * Add relevant RBAC to enable controller to watch resources * Debugging iteration - one * ClusterExtension installing the operator - working --------- Co-authored-by: varshaprasad96@gmail.com <vnarsing@vnarsing-mac.hsd1.ca.comcast.net> Fix some lints (#793) Signed-off-by: Todd Short <tshort@redhat.com> :sparkles: Getting cluster extension running (#795) * Getting cluster extension running * Specify namespace to create secret Set resolved and installed versions (#806) Remove install references to rukpak (#805) Signed-off-by: Todd Short <tshort@redhat.com> Consolidate error message generation (#807) Signed-off-by: Todd Short <tshort@redhat.com> Add make kind-redeploy (#808) Signed-off-by: Todd Short <tshort@redhat.com> Use rukpak as a library (#821) Signed-off-by: Todd Short <tshort@redhat.com> Improve caching and fix constant reconciles (#825) Improve performance by caching objects that only have ClusterExtension as owners. Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> Fix linter (#826) Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com> Move helm-operator-plugin (#828) Signed-off-by: Todd Short <tshort@redhat.com> Really fix linter (#833) Signed-off-by: Todd Short <tshort@redhat.com>
Description
Reviewer Checklist