Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
Make provisioner logic external
Browse files Browse the repository at this point in the history
This commit pulls the provisioner logic in rukpak
under pkg/, so that it can be easily be used
by operator-controller.

Signed-off-by: Varsha Prasad Narsing <[email protected]>
  • Loading branch information
varshaprasad96 committed Jun 12, 2024
1 parent ac1802e commit 9a4d550
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ generate: $(CONTROLLER_GEN) ## Generate code and manifests
$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=./api/...
$(CONTROLLER_GEN) rbac:roleName=core-admin \
paths=./internal/controllers/bundledeployment/... \
paths=./internal/provisioner/plain/... \
paths=./internal/provisioner/registry/... \
paths=./pkg/provisioner/plain/... \
paths=./pkg/provisioner/registry/... \
output:stdout > ./manifests/base/core/resources/cluster_role.yaml
$(CONTROLLER_GEN) rbac:roleName=webhooks-admin paths=./internal/webhook/... output:stdout > ./manifests/base/apis/webhooks/resources/cluster_role.yaml
$(CONTROLLER_GEN) rbac:roleName=helm-provisioner-admin \
paths=./internal/controllers/bundledeployment/... \
paths=./internal/provisioner/helm/... \
paths=./pkg/provisioner/helm/... \
output:stdout > ./manifests/base/provisioners/helm/resources/cluster_role.yaml

verify: tidy fmt generate ## Verify the current code generation and lint
Expand Down
4 changes: 2 additions & 2 deletions cmd/core/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ import (

rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2"
"github.com/operator-framework/rukpak/internal/controllers/bundledeployment"
"github.com/operator-framework/rukpak/internal/provisioner/plain"
"github.com/operator-framework/rukpak/internal/provisioner/registry"
"github.com/operator-framework/rukpak/internal/version"
"github.com/operator-framework/rukpak/pkg/features"
"github.com/operator-framework/rukpak/pkg/finalizer"
"github.com/operator-framework/rukpak/pkg/preflights/crdupgradesafety"
"github.com/operator-framework/rukpak/pkg/provisioner/plain"
"github.com/operator-framework/rukpak/pkg/provisioner/registry"
"github.com/operator-framework/rukpak/pkg/source"
"github.com/operator-framework/rukpak/pkg/storage"
"github.com/operator-framework/rukpak/pkg/util"
Expand Down
2 changes: 1 addition & 1 deletion cmd/helm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ import (

rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2"
"github.com/operator-framework/rukpak/internal/controllers/bundledeployment"
"github.com/operator-framework/rukpak/internal/provisioner/helm"
"github.com/operator-framework/rukpak/internal/version"
"github.com/operator-framework/rukpak/pkg/finalizer"
"github.com/operator-framework/rukpak/pkg/provisioner/helm"
"github.com/operator-framework/rukpak/pkg/source"
"github.com/operator-framework/rukpak/pkg/storage"
"github.com/operator-framework/rukpak/pkg/util"
Expand Down
2 changes: 1 addition & 1 deletion docs/provisioners/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Summary

The `helm` provisioner is one of the [provisioners](https://github.com/operator-framework/rukpak/tree/main/internal/provisioner) of RukPak.
The `helm` provisioner is one of the [provisioners](https://github.com/operator-framework/rukpak/tree/main/pkg/provisioner) of RukPak.
It is able to instantiate a given `helm+v3` bundle with a specified helm chart onto a cluster where it then installs the content. It does so by reconciling `Bundle` and `BundleDeployment` types that have
the `spec.provisionerClassName` field set to `core-rukpak-io-helm`. This field must be set to the correct provisioner
name in order for the `helm` provisioner to see and interact with the bundle.
Expand Down
2 changes: 1 addition & 1 deletion docs/provisioners/plain.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Summary

The `plain` provisioner is one of core RukPak [provisioners](https://github.com/operator-framework/rukpak/tree/main/internal/provisioner)
The `plain` provisioner is one of core RukPak [provisioners](https://github.com/operator-framework/rukpak/tree/main/pkg/provisioner)
that knows how to interact with bundles of a particular format.
These `plain+v0` bundles, or plain bundles, are simply container images containing a set of static Kubernetes YAML
manifests in a given directory. For more information on the `plain+v0` format, see
Expand Down
2 changes: 1 addition & 1 deletion docs/provisioners/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Summary

The `registry` provisioner is one of core Rukpak [provisioners](https://github.com/operator-framework/rukpak/tree/main/internal/provisioner)
The `registry` provisioner is one of core Rukpak [provisioners](https://github.com/operator-framework/rukpak/tree/main/pkg/provisioner)
that knows how to interact with bundles of a particular format.
These `registry+v1` bundles, or `registry` bundles, are container images containing a set of static Kubernetes YAML
manifests organized in the legacy Operator Lifecycle Manger (OLM) format. For more information on the `registry+v1` format, see
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2"
"github.com/operator-framework/rukpak/internal/provisioner/plain"
"github.com/operator-framework/rukpak/pkg/convert"
"github.com/operator-framework/rukpak/pkg/provisioner/plain"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/api_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2"
"github.com/operator-framework/rukpak/internal/provisioner/plain"
"github.com/operator-framework/rukpak/pkg/provisioner/plain"
)

var _ = Describe("bundle api validation", func() {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/helm_provisioner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2"
"github.com/operator-framework/rukpak/internal/provisioner/helm"
"github.com/operator-framework/rukpak/pkg/provisioner/helm"
)

var _ = Describe("helm provisioner bundledeployment", func() {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/plain_provisioner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2"
"github.com/operator-framework/rukpak/internal/provisioner/plain"
"github.com/operator-framework/rukpak/pkg/provisioner/plain"
"github.com/operator-framework/rukpak/pkg/storage"
"github.com/operator-framework/rukpak/pkg/util"
)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/registry_provisioner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2"
registryprovisioner "github.com/operator-framework/rukpak/internal/provisioner/registry"
registryprovisioner "github.com/operator-framework/rukpak/pkg/provisioner/registry"
)

var _ = Describe("registry provisioner bundle", func() {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2"
"github.com/operator-framework/rukpak/internal/provisioner/plain"
"github.com/operator-framework/rukpak/pkg/provisioner/plain"
)

var _ = Describe("bundle deployment api validating webhook", func() {
Expand Down

0 comments on commit 9a4d550

Please sign in to comment.