-
Notifications
You must be signed in to change notification settings - Fork 64
✨ Starting Helm POC - pull in some rukpak #756
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
Conversation
Signed-off-by: Todd Short <[email protected]>
@@ -221,6 +228,15 @@ func SetDeprecationStatus(ext *ocv1alpha1.ClusterExtension, bundle *catalogmetad | |||
} | |||
} | |||
|
|||
func (r *ClusterExtensionReconciler) GenerateExpectedBundleSource(o ocv1alpha1.ClusterExtension, bundlePath string) *rukpakapi.BundleSource { | |||
return &rukpakapi.BundleSource{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That could be a follow on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]> * 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 <[email protected]> * fixup! Copy over some rukpak code and replace BundleDeployment --------- Signed-off-by: Todd Short <[email protected]>
* Fix suite_test.go Signed-off-by: Todd Short <[email protected]> * 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 <[email protected]> * fixup! Copy over some rukpak code and replace BundleDeployment --------- Signed-off-by: Todd Short <[email protected]>
plug in resolver Deal with removal of HigherBundleVersion Removed in e079129 Signed-off-by: Todd Short <[email protected]> :sparkles: Starting Helm POC - pull in some rukpak (#756) * Fix suite_test.go Signed-off-by: Todd Short <[email protected]> * 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 <[email protected]> * fixup! Copy over some rukpak code and replace BundleDeployment --------- Signed-off-by: Todd Short <[email protected]> Plugin unpacker, add Handler (#757) Signed-off-by: Varsha Prasad Narsing <[email protected]> Co-authored-by: [email protected] <[email protected]> A bit of cleanup (#761) Signed-off-by: Todd Short <[email protected]> :warning: Install the helm chart (#762) * Install the helm chart Signed-off-by: Todd Short <[email protected]> * fixup! Install the helm chart Signed-off-by: Todd Short <[email protected]> --------- Signed-off-by: Todd Short <[email protected]> Set up right watches and all labels to postrenderer (#763) Co-authored-by: [email protected] <[email protected]> :warning: Update owner keys (#765) * Update owner keys Signed-off-by: Todd Short <[email protected]> * fixup! Update owner keys Signed-off-by: Todd Short <[email protected]> --------- Signed-off-by: Todd Short <[email protected]> No more panics (#767) Signed-off-by: Todd Short <[email protected]> Add relevant RBAC to enable controller to watch resources (#776) Co-authored-by: [email protected] <[email protected]> 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: [email protected] <[email protected]> Fix some lints (#793) Signed-off-by: Todd Short <[email protected]> :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 <[email protected]> Consolidate error message generation (#807) Signed-off-by: Todd Short <[email protected]> Add make kind-redeploy (#808) Signed-off-by: Todd Short <[email protected]> Use rukpak as a library (#821) Signed-off-by: Todd Short <[email protected]> Improve caching and fix constant reconciles (#825) Improve performance by caching objects that only have ClusterExtension as owners. Signed-off-by: Varsha Prasad Narsing <[email protected]> Fix linter (#826) Signed-off-by: Varsha Prasad Narsing <[email protected]> Move helm-operator-plugin (#828) Signed-off-by: Todd Short <[email protected]> Really fix linter (#833) Signed-off-by: Todd Short <[email protected]>
plug in resolver Deal with removal of HigherBundleVersion Removed in e079129 Signed-off-by: Todd Short <[email protected]> :sparkles: Starting Helm POC - pull in some rukpak (#756) * Fix suite_test.go Signed-off-by: Todd Short <[email protected]> * 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 <[email protected]> * fixup! Copy over some rukpak code and replace BundleDeployment --------- Signed-off-by: Todd Short <[email protected]> Plugin unpacker, add Handler (#757) Signed-off-by: Varsha Prasad Narsing <[email protected]> Co-authored-by: [email protected] <[email protected]> A bit of cleanup (#761) Signed-off-by: Todd Short <[email protected]> :warning: Install the helm chart (#762) * Install the helm chart Signed-off-by: Todd Short <[email protected]> * fixup! Install the helm chart Signed-off-by: Todd Short <[email protected]> --------- Signed-off-by: Todd Short <[email protected]> Set up right watches and all labels to postrenderer (#763) Co-authored-by: [email protected] <[email protected]> :warning: Update owner keys (#765) * Update owner keys Signed-off-by: Todd Short <[email protected]> * fixup! Update owner keys Signed-off-by: Todd Short <[email protected]> --------- Signed-off-by: Todd Short <[email protected]> No more panics (#767) Signed-off-by: Todd Short <[email protected]> Add relevant RBAC to enable controller to watch resources (#776) Co-authored-by: [email protected] <[email protected]> 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: [email protected] <[email protected]> Fix some lints (#793) Signed-off-by: Todd Short <[email protected]> :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 <[email protected]> Consolidate error message generation (#807) Signed-off-by: Todd Short <[email protected]> Add make kind-redeploy (#808) Signed-off-by: Todd Short <[email protected]> Use rukpak as a library (#821) Signed-off-by: Todd Short <[email protected]> Improve caching and fix constant reconciles (#825) Improve performance by caching objects that only have ClusterExtension as owners. Signed-off-by: Varsha Prasad Narsing <[email protected]> Fix linter (#826) Signed-off-by: Varsha Prasad Narsing <[email protected]> Move helm-operator-plugin (#828) Signed-off-by: Todd Short <[email protected]> Really fix linter (#833) Signed-off-by: Todd Short <[email protected]>
plug in resolver Deal with removal of HigherBundleVersion Removed in e079129 Signed-off-by: Todd Short <[email protected]> :sparkles: Starting Helm POC - pull in some rukpak (operator-framework#756) * Fix suite_test.go Signed-off-by: Todd Short <[email protected]> * 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 <[email protected]> * fixup! Copy over some rukpak code and replace BundleDeployment --------- Signed-off-by: Todd Short <[email protected]> Plugin unpacker, add Handler (operator-framework#757) Signed-off-by: Varsha Prasad Narsing <[email protected]> Co-authored-by: [email protected] <[email protected]> A bit of cleanup (operator-framework#761) Signed-off-by: Todd Short <[email protected]> :warning: Install the helm chart (operator-framework#762) * Install the helm chart Signed-off-by: Todd Short <[email protected]> * fixup! Install the helm chart Signed-off-by: Todd Short <[email protected]> --------- Signed-off-by: Todd Short <[email protected]> Set up right watches and all labels to postrenderer (operator-framework#763) Co-authored-by: [email protected] <[email protected]> :warning: Update owner keys (operator-framework#765) * Update owner keys Signed-off-by: Todd Short <[email protected]> * fixup! Update owner keys Signed-off-by: Todd Short <[email protected]> --------- Signed-off-by: Todd Short <[email protected]> No more panics (operator-framework#767) Signed-off-by: Todd Short <[email protected]> Add relevant RBAC to enable controller to watch resources (operator-framework#776) Co-authored-by: [email protected] <[email protected]> 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: [email protected] <[email protected]> Fix some lints (operator-framework#793) Signed-off-by: Todd Short <[email protected]> :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 <[email protected]> Consolidate error message generation (operator-framework#807) Signed-off-by: Todd Short <[email protected]> Add make kind-redeploy (operator-framework#808) Signed-off-by: Todd Short <[email protected]> Use rukpak as a library (operator-framework#821) Signed-off-by: Todd Short <[email protected]> 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 <[email protected]> Fix linter (operator-framework#826) Signed-off-by: Varsha Prasad Narsing <[email protected]> Move helm-operator-plugin (operator-framework#828) Signed-off-by: Todd Short <[email protected]> Really fix linter (operator-framework#833) Signed-off-by: Todd Short <[email protected]>
plug in resolver Deal with removal of HigherBundleVersion Removed in e079129 Signed-off-by: Todd Short <[email protected]> :sparkles: Starting Helm POC - pull in some rukpak (#756) * Fix suite_test.go Signed-off-by: Todd Short <[email protected]> * 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 <[email protected]> * fixup! Copy over some rukpak code and replace BundleDeployment --------- Signed-off-by: Todd Short <[email protected]> Plugin unpacker, add Handler (#757) Signed-off-by: Varsha Prasad Narsing <[email protected]> Co-authored-by: [email protected] <[email protected]> A bit of cleanup (#761) Signed-off-by: Todd Short <[email protected]> :warning: Install the helm chart (#762) * Install the helm chart Signed-off-by: Todd Short <[email protected]> * fixup! Install the helm chart Signed-off-by: Todd Short <[email protected]> --------- Signed-off-by: Todd Short <[email protected]> Set up right watches and all labels to postrenderer (#763) Co-authored-by: [email protected] <[email protected]> :warning: Update owner keys (#765) * Update owner keys Signed-off-by: Todd Short <[email protected]> * fixup! Update owner keys Signed-off-by: Todd Short <[email protected]> --------- Signed-off-by: Todd Short <[email protected]> No more panics (#767) Signed-off-by: Todd Short <[email protected]> Add relevant RBAC to enable controller to watch resources (#776) Co-authored-by: [email protected] <[email protected]> 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: [email protected] <[email protected]> Fix some lints (#793) Signed-off-by: Todd Short <[email protected]> :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 <[email protected]> Consolidate error message generation (#807) Signed-off-by: Todd Short <[email protected]> Add make kind-redeploy (#808) Signed-off-by: Todd Short <[email protected]> Use rukpak as a library (#821) Signed-off-by: Todd Short <[email protected]> Improve caching and fix constant reconciles (#825) Improve performance by caching objects that only have ClusterExtension as owners. Signed-off-by: Varsha Prasad Narsing <[email protected]> Fix linter (#826) Signed-off-by: Varsha Prasad Narsing <[email protected]> Move helm-operator-plugin (#828) Signed-off-by: Todd Short <[email protected]> Really fix linter (#833) Signed-off-by: Todd Short <[email protected]>
plug in resolver Deal with removal of HigherBundleVersion Removed in e079129 Signed-off-by: Todd Short <[email protected]> :sparkles: Starting Helm POC - pull in some rukpak (#756) * Fix suite_test.go Signed-off-by: Todd Short <[email protected]> * 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 <[email protected]> * fixup! Copy over some rukpak code and replace BundleDeployment --------- Signed-off-by: Todd Short <[email protected]> Plugin unpacker, add Handler (#757) Signed-off-by: Varsha Prasad Narsing <[email protected]> Co-authored-by: [email protected] <[email protected]> A bit of cleanup (#761) Signed-off-by: Todd Short <[email protected]> :warning: Install the helm chart (#762) * Install the helm chart Signed-off-by: Todd Short <[email protected]> * fixup! Install the helm chart Signed-off-by: Todd Short <[email protected]> --------- Signed-off-by: Todd Short <[email protected]> Set up right watches and all labels to postrenderer (#763) Co-authored-by: [email protected] <[email protected]> :warning: Update owner keys (#765) * Update owner keys Signed-off-by: Todd Short <[email protected]> * fixup! Update owner keys Signed-off-by: Todd Short <[email protected]> --------- Signed-off-by: Todd Short <[email protected]> No more panics (#767) Signed-off-by: Todd Short <[email protected]> Add relevant RBAC to enable controller to watch resources (#776) Co-authored-by: [email protected] <[email protected]> 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: [email protected] <[email protected]> Fix some lints (#793) Signed-off-by: Todd Short <[email protected]> :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 <[email protected]> Consolidate error message generation (#807) Signed-off-by: Todd Short <[email protected]> Add make kind-redeploy (#808) Signed-off-by: Todd Short <[email protected]> Use rukpak as a library (#821) Signed-off-by: Todd Short <[email protected]> Improve caching and fix constant reconciles (#825) Improve performance by caching objects that only have ClusterExtension as owners. Signed-off-by: Varsha Prasad Narsing <[email protected]> Fix linter (#826) Signed-off-by: Varsha Prasad Narsing <[email protected]> Move helm-operator-plugin (#828) Signed-off-by: Todd Short <[email protected]> Really fix linter (#833) Signed-off-by: Todd Short <[email protected]>
Description
Reviewer Checklist