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

Commit

Permalink
Bump Bundle Deployment version to v1alpha2
Browse files Browse the repository at this point in the history
Signed-off-by: Varsha Prasad Narsing <[email protected]>
  • Loading branch information
varshaprasad96 committed Dec 21, 2023
1 parent be01f5f commit fa65678
Show file tree
Hide file tree
Showing 49 changed files with 833 additions and 967 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ORG := github.com/operator-framework
PKG := $(ORG)/rukpak
export IMAGE_REPO ?= quay.io/operator-framework/rukpak
export IMAGE_TAG ?= main
export IMAGE_TAG ?= devel
export GO_BUILD_TAGS ?= ''
IMAGE?=$(IMAGE_REPO):$(IMAGE_TAG)
KIND_CLUSTER_NAME ?= rukpak
Expand Down Expand Up @@ -111,7 +111,7 @@ test-e2e: $(GINKGO) ## Run the e2e tests
$(GINKGO) --tags $(GO_BUILD_TAGS) $(E2E_FLAGS) --trace $(FOCUS) test/e2e

e2e: KIND_CLUSTER_NAME=rukpak-e2e
e2e: rukpakctl run image-registry local-git kind-load-bundles registry-load-bundles test-e2e ## Run e2e tests against an ephemeral kind cluster
e2e: rukpakctl run image-registry local-git kind-load-bundles registry-load-bundles test-e2e kind-cluster-cleanup ## Run e2e tests against an ephemeral kind cluster

kind-cluster: $(KIND) kind-cluster-cleanup ## Standup a kind cluster
$(KIND) create cluster --name ${KIND_CLUSTER_NAME} ${KIND_CLUSTER_CONFIG}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1
package v1alpha2

import (
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -134,5 +134,3 @@ type Authorization struct {
type UploadSource struct{}

type ProvisionerID string


Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1
package v1alpha2

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -59,7 +59,6 @@ type BundleDeploymentSpec struct {
Config runtime.RawExtension `json:"config,omitempty"`
}


// BundleDeploymentStatus defines the observed state of BundleDeployment
type BundleDeploymentStatus struct {
Conditions []metav1.Condition `json:"conditions,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha1 contains API Schema definitions for the core v1alpha1 API group
// Package v1alpha2 contains API Schema definitions for the core v1alpha2 API group
// +kubebuilder:object:generate=true
// +groupName=core.rukpak.io
package v1alpha1
package v1alpha2

import (
"k8s.io/apimachinery/pkg/runtime/schema"
Expand All @@ -26,7 +26,7 @@ import (

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "core.rukpak.io", Version: "v1alpha1"}
GroupVersion = schema.GroupVersion{Group: "core.rukpak.io", Version: "v1alpha2"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 10 additions & 11 deletions cmd/core/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

rukpakv1alpha1 "github.com/operator-framework/rukpak/api/v1alpha1"
rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2"
"github.com/operator-framework/rukpak/internal/controllers/bundledeployment"
"github.com/operator-framework/rukpak/internal/finalizer"
"github.com/operator-framework/rukpak/internal/provisioner/plain"
Expand All @@ -64,7 +64,7 @@ var (
func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(apiextensionsv1.AddToScheme(scheme))
utilruntime.Must(rukpakv1alpha1.AddToScheme(scheme))
utilruntime.Must(rukpakv1alpha2.AddToScheme(scheme))
utilruntime.Must(apiregistration.AddToScheme(scheme))
//+kubebuilder:scaffold:scheme
}
Expand Down Expand Up @@ -115,7 +115,7 @@ func main() {
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
setupLog.Info("starting up the core controllers and servers", "git commit", version.String(), "unpacker image", unpackImage)

dependentRequirement, err := labels.NewRequirement(util.CoreOwnerKindKey, selection.In, []string{rukpakv1alpha1.BundleKind, rukpakv1alpha1.BundleDeploymentKind})
dependentRequirement, err := labels.NewRequirement(util.CoreOwnerKindKey, selection.In, []string{rukpakv1alpha2.BundleKind, rukpakv1alpha2.BundleDeploymentKind})
if err != nil {
setupLog.Error(err, "unable to create dependent label selector for cache")
os.Exit(1)
Expand Down Expand Up @@ -144,7 +144,7 @@ func main() {
LeaderElectionID: "core.rukpak.io",
NewCache: cache.BuilderWithOptions(cache.Options{
SelectorsByObject: cache.SelectorsByObject{
&rukpakv1alpha1.BundleDeployment{}: {},
&rukpakv1alpha2.BundleDeployment{}: {},
},
DefaultSelector: cache.ObjectSelector{
Label: dependentSelector,
Expand Down Expand Up @@ -238,26 +238,25 @@ func main() {
bundledeployment.WithStorage(bundleStorage),
}


if err := bundledeployment.SetupWithManager(mgr,systemNsCluster.GetCache(), systemNamespace,append(
if err := bundledeployment.SetupWithManager(mgr, systemNsCluster.GetCache(), systemNamespace, append(
commonBDProvisionerOptions,
bundledeployment.WithUnpacker(unpacker),
bundledeployment.WithProvisionerID(plain.ProvisionerID),
bundledeployment.WithBundleDeplymentProcessor(bundledeployment.BundleDeploymentProcessorFunc(plain.ProcessBundleDeployment)),
bundledeployment.WithBundleDeplymentProcessor(bundledeployment.ProcessorFunc(plain.ProcessBundleDeployment)),
bundledeployment.WithHandler(bundledeployment.HandlerFunc(plain.HandleBundleDeployment)),
)...); err != nil {
setupLog.Error(err, "unable to create controller", "controller", rukpakv1alpha1.BundleDeploymentKind, "provisionerID", plain.ProvisionerID)
setupLog.Error(err, "unable to create controller", "controller", rukpakv1alpha2.BundleDeploymentKind, "provisionerID", plain.ProvisionerID)
os.Exit(1)
}

if err := bundledeployment.SetupWithManager(mgr, systemNsCluster.GetCache(), systemNamespace,append(
if err := bundledeployment.SetupWithManager(mgr, systemNsCluster.GetCache(), systemNamespace, append(
commonBDProvisionerOptions,
bundledeployment.WithUnpacker(unpacker),
bundledeployment.WithProvisionerID(registry.ProvisionerID),
bundledeployment.WithBundleDeplymentProcessor(bundledeployment.BundleDeploymentProcessorFunc(registry.ProcessBundleDeployment)),
bundledeployment.WithBundleDeplymentProcessor(bundledeployment.ProcessorFunc(registry.ProcessBundleDeployment)),
bundledeployment.WithHandler(bundledeployment.HandlerFunc(plain.HandleBundleDeployment)),
)...); err != nil {
setupLog.Error(err, "unable to create controller", "controller", rukpakv1alpha1.BundleDeploymentKind, "provisionerID", plain.ProvisionerID)
setupLog.Error(err, "unable to create controller", "controller", rukpakv1alpha2.BundleDeploymentKind, "provisionerID", plain.ProvisionerID)
os.Exit(1)
}
//+kubebuilder:scaffold:builder
Expand Down
14 changes: 7 additions & 7 deletions cmd/helm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

rukpakv1alpha1 "github.com/operator-framework/rukpak/api/v1alpha1"
rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2"
"github.com/operator-framework/rukpak/internal/controllers/bundledeployment"
"github.com/operator-framework/rukpak/internal/finalizer"
"github.com/operator-framework/rukpak/internal/provisioner/helm"
Expand All @@ -55,7 +55,7 @@ var (
func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(apiextensionsv1.AddToScheme(scheme))
utilruntime.Must(rukpakv1alpha1.AddToScheme(scheme))
utilruntime.Must(rukpakv1alpha2.AddToScheme(scheme))
//+kubebuilder:scaffold:scheme
}

Expand Down Expand Up @@ -98,7 +98,7 @@ func main() {
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
setupLog.Info("starting up the provisioner", "git commit", version.String())

dependentRequirement, err := labels.NewRequirement(util.CoreOwnerKindKey, selection.In, []string{rukpakv1alpha1.BundleDeploymentKind})
dependentRequirement, err := labels.NewRequirement(util.CoreOwnerKindKey, selection.In, []string{rukpakv1alpha2.BundleDeploymentKind})
if err != nil {
setupLog.Error(err, "unable to create dependent label selector for cache")
os.Exit(1)
Expand Down Expand Up @@ -126,7 +126,7 @@ func main() {
LeaderElectionID: "helm.core.rukpak.io",
NewCache: cache.BuilderWithOptions(cache.Options{
SelectorsByObject: cache.SelectorsByObject{
&rukpakv1alpha1.BundleDeployment{}: {},
&rukpakv1alpha2.BundleDeployment{}: {},
},
DefaultSelector: cache.ObjectSelector{
Label: dependentSelector,
Expand Down Expand Up @@ -212,14 +212,14 @@ func main() {
bundledeployment.WithStorage(bundleStorage),
}

if err := bundledeployment.SetupWithManager(mgr, systemNsCluster.GetCache(), systemNamespace,append(
if err := bundledeployment.SetupWithManager(mgr, systemNsCluster.GetCache(), systemNamespace, append(
commonBDProvisionerOptions,
bundledeployment.WithProvisionerID(helm.ProvisionerID),
bundledeployment.WithUnpacker(unpacker),
bundledeployment.WithBundleDeplymentProcessor(bundledeployment.BundleDeploymentProcessorFunc(helm.ProcessBundleDeployment)),
bundledeployment.WithBundleDeplymentProcessor(bundledeployment.ProcessorFunc(helm.ProcessBundleDeployment)),
bundledeployment.WithHandler(bundledeployment.HandlerFunc(helm.HandleBundleDeployment)),
)...); err != nil {
setupLog.Error(err, "unable to create controller", "controller", rukpakv1alpha1.BundleDeploymentKind, "provisionerID", helm.ProvisionerID)
setupLog.Error(err, "unable to create controller", "controller", rukpakv1alpha2.BundleDeploymentKind, "provisionerID", helm.ProvisionerID)
os.Exit(1)
}
//+kubebuilder:scaffold:builder
Expand Down
6 changes: 3 additions & 3 deletions cmd/rukpakctl/cmd/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
runtimeclient "sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/config"

rukpakv1alpha1 "github.com/operator-framework/rukpak/api/v1alpha1"
rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2"
"github.com/operator-framework/rukpak/internal/util"
)

Expand All @@ -56,7 +56,7 @@ func newContentCmd() *cobra.Command {
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
sch := runtime.NewScheme()
if err := rukpakv1alpha1.AddToScheme(sch); err != nil {
if err := rukpakv1alpha2.AddToScheme(sch); err != nil {
log.Fatalf("failed to add rukpak types to scheme: %v", err)
}

Expand Down Expand Up @@ -121,7 +121,7 @@ func content(ctx context.Context, opt options, args []string) error {
return fmt.Errorf("failed to create a service account: %v", err)
}

bundledeployment := &rukpakv1alpha1.BundleDeployment{}
bundledeployment := &rukpakv1alpha2.BundleDeployment{}
err = opt.Get(ctx, runtimeclient.ObjectKey{Name: args[0]}, bundledeployment)
if err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions cmd/webhooks/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log/zap"
crwebhook "sigs.k8s.io/controller-runtime/pkg/webhook"

rukpakv1alpha1 "github.com/operator-framework/rukpak/api/v1alpha1"
rukpakv1alpha2 "github.com/operator-framework/rukpak/api/v1alpha2"
"github.com/operator-framework/rukpak/internal/util"
"github.com/operator-framework/rukpak/internal/version"
"github.com/operator-framework/rukpak/internal/webhook"
Expand All @@ -43,7 +43,7 @@ var (

func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(rukpakv1alpha1.AddToScheme(scheme))
utilruntime.Must(rukpakv1alpha2.AddToScheme(scheme))
//+kubebuilder:scaffold:scheme
}

Expand Down Expand Up @@ -108,7 +108,7 @@ func main() {
Client: mgr.GetClient(),
SystemNamespace: systemNamespace,
}).SetupWebhookWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create webhook", "webhook", rukpakv1alpha1.BundleDeploymentKind)
setupLog.Error(err, "unable to create webhook", "webhook", rukpakv1alpha2.BundleDeploymentKind)
os.Exit(1)
}
if err = (&webhook.ConfigMap{
Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ require (
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
golang.org/x/crypto v0.14.0
golang.org/x/sync v0.3.0
golang.org/x/crypto v0.16.0
golang.org/x/sync v0.5.0
helm.sh/helm/v3 v3.11.1
k8s.io/api v0.26.10
k8s.io/apiextensions-apiserver v0.26.10
Expand Down Expand Up @@ -174,14 +174,14 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.org/x/tools v0.16.1 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
Expand Down
Loading

0 comments on commit fa65678

Please sign in to comment.