diff --git a/PROJECT b/PROJECT index 7c167c05..3ac92d02 100644 --- a/PROJECT +++ b/PROJECT @@ -26,7 +26,7 @@ resources: controller: true domain: mirantis.com group: boundless - kind: Cluster + kind: Blueprint path: github.com/mirantis/boundless-operator/api/v1alpha1 version: v1alpha1 - api: diff --git a/api/v1alpha1/cluster_types.go b/api/v1alpha1/blueprint_types.go similarity index 69% rename from api/v1alpha1/cluster_types.go rename to api/v1alpha1/blueprint_types.go index e12b9947..736cd4fc 100644 --- a/api/v1alpha1/cluster_types.go +++ b/api/v1alpha1/blueprint_types.go @@ -7,8 +7,8 @@ import ( // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. -// ClusterSpec defines the desired state of Cluster -type ClusterSpec struct { +// BlueprintSpec defines the desired state of Blueprint +type BlueprintSpec struct { // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster // Important: Run "make" to regenerate code after modifying this file @@ -26,8 +26,8 @@ type Core struct { Ingress IngressSpec `json:"ingress,omitempty"` } -// ClusterStatus defines the observed state of Cluster -type ClusterStatus struct { +// BlueprintStatus defines the observed state of Blueprint +type BlueprintStatus struct { // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster // Important: Run "make" to regenerate code after modifying this file } @@ -35,24 +35,24 @@ type ClusterStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status -// Cluster is the Schema for the clusters API -type Cluster struct { +// Blueprint is the Schema for the blueprints API +type Blueprint struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec ClusterSpec `json:"spec,omitempty"` - Status ClusterStatus `json:"status,omitempty"` + Spec BlueprintSpec `json:"spec,omitempty"` + Status BlueprintStatus `json:"status,omitempty"` } //+kubebuilder:object:root=true -// ClusterList contains a list of Cluster -type ClusterList struct { +// BlueprintList contains a list of Blueprint +type BlueprintList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []Cluster `json:"items"` + Items []Blueprint `json:"items"` } func init() { - SchemeBuilder.Register(&Cluster{}, &ClusterList{}) + SchemeBuilder.Register(&Blueprint{}, &BlueprintList{}) } diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index be29881a..e5cf47bf 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -101,29 +101,7 @@ func (in *AddonStatus) DeepCopy() *AddonStatus { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Chart) DeepCopyInto(out *Chart) { - *out = *in - if in.Set != nil { - in, out := &in.Set, &out.Set - *out = make(map[string]intstr.IntOrString, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Chart. -func (in *Chart) DeepCopy() *Chart { - if in == nil { - return nil - } - out := new(Chart) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Cluster) DeepCopyInto(out *Cluster) { +func (in *Blueprint) DeepCopyInto(out *Blueprint) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -131,18 +109,18 @@ func (in *Cluster) DeepCopyInto(out *Cluster) { out.Status = in.Status } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. -func (in *Cluster) DeepCopy() *Cluster { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Blueprint. +func (in *Blueprint) DeepCopy() *Blueprint { if in == nil { return nil } - out := new(Cluster) + out := new(Blueprint) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Cluster) DeepCopyObject() runtime.Object { +func (in *Blueprint) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -150,31 +128,31 @@ func (in *Cluster) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterList) DeepCopyInto(out *ClusterList) { +func (in *BlueprintList) DeepCopyInto(out *BlueprintList) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) + *out = make([]Blueprint, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. -func (in *ClusterList) DeepCopy() *ClusterList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlueprintList. +func (in *BlueprintList) DeepCopy() *BlueprintList { if in == nil { return nil } - out := new(ClusterList) + out := new(BlueprintList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterList) DeepCopyObject() runtime.Object { +func (in *BlueprintList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -182,32 +160,54 @@ func (in *ClusterList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { +func (in *BlueprintSpec) DeepCopyInto(out *BlueprintSpec) { *out = *in in.Components.DeepCopyInto(&out.Components) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. -func (in *ClusterSpec) DeepCopy() *ClusterSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlueprintSpec. +func (in *BlueprintSpec) DeepCopy() *BlueprintSpec { if in == nil { return nil } - out := new(ClusterSpec) + out := new(BlueprintSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { +func (in *BlueprintStatus) DeepCopyInto(out *BlueprintStatus) { *out = *in } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. -func (in *ClusterStatus) DeepCopy() *ClusterStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlueprintStatus. +func (in *BlueprintStatus) DeepCopy() *BlueprintStatus { if in == nil { return nil } - out := new(ClusterStatus) + out := new(BlueprintStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Chart) DeepCopyInto(out *Chart) { + *out = *in + if in.Set != nil { + in, out := &in.Set, &out.Set + *out = make(map[string]intstr.IntOrString, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Chart. +func (in *Chart) DeepCopy() *Chart { + if in == nil { + return nil + } + out := new(Chart) in.DeepCopyInto(out) return out } diff --git a/config/crd/bases/boundless.mirantis.com_clusters.yaml b/config/crd/bases/boundless.mirantis.com_blueprints.yaml similarity index 91% rename from config/crd/bases/boundless.mirantis.com_clusters.yaml rename to config/crd/bases/boundless.mirantis.com_blueprints.yaml index 1f066a20..1466eef7 100644 --- a/config/crd/bases/boundless.mirantis.com_clusters.yaml +++ b/config/crd/bases/boundless.mirantis.com_blueprints.yaml @@ -5,20 +5,20 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.11.1 creationTimestamp: null - name: clusters.boundless.mirantis.com + name: blueprints.boundless.mirantis.com spec: group: boundless.mirantis.com names: - kind: Cluster - listKind: ClusterList - plural: clusters - singular: cluster + kind: Blueprint + listKind: BlueprintList + plural: blueprints + singular: blueprint scope: Namespaced versions: - name: v1alpha1 schema: openAPIV3Schema: - description: Cluster is the Schema for the clusters API + description: Blueprint is the Schema for the blueprints API properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation @@ -33,7 +33,7 @@ spec: metadata: type: object spec: - description: ClusterSpec defines the desired state of Cluster + description: BlueprintSpec defines the desired state of Blueprint properties: components: description: Components contains all the components that should be @@ -100,7 +100,7 @@ spec: type: object type: object status: - description: ClusterStatus defines the observed state of Cluster + description: BlueprintStatus defines the observed state of Blueprint type: object type: object served: true diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 6a0a4d0d..0c274c7f 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -3,8 +3,8 @@ # It should be run by config/default resources: - bases/boundless.mirantis.com_addons.yaml -- bases/boundless.mirantis.com_clusters.yaml - bases/boundless.mirantis.com_ingresses.yaml +- bases/boundless.mirantis.com_blueprints.yaml #+kubebuilder:scaffold:crdkustomizeresource patchesStrategicMerge: @@ -13,6 +13,7 @@ patchesStrategicMerge: #- patches/webhook_in_addons.yaml #- patches/webhook_in_clusters.yaml #- patches/webhook_in_ingresses.yaml +#- patches/webhook_in_blueprints.yaml #+kubebuilder:scaffold:crdkustomizewebhookpatch # [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix. @@ -20,6 +21,7 @@ patchesStrategicMerge: #- patches/cainjection_in_addons.yaml #- patches/cainjection_in_clusters.yaml #- patches/cainjection_in_ingresses.yaml +#- patches/cainjection_in_blueprints.yaml #+kubebuilder:scaffold:crdkustomizecainjectionpatch # the following config is for teaching kustomize how to do kustomization for CRDs. diff --git a/config/crd/patches/cainjection_in_clusters.yaml b/config/crd/patches/cainjection_in_blueprints.yaml similarity index 85% rename from config/crd/patches/cainjection_in_clusters.yaml rename to config/crd/patches/cainjection_in_blueprints.yaml index 5800ad37..71128909 100644 --- a/config/crd/patches/cainjection_in_clusters.yaml +++ b/config/crd/patches/cainjection_in_blueprints.yaml @@ -4,4 +4,4 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: clusters.boundless.mirantis.com + name: blueprints.boundless.mirantis.com diff --git a/config/crd/patches/webhook_in_clusters.yaml b/config/crd/patches/webhook_in_blueprints.yaml similarity index 89% rename from config/crd/patches/webhook_in_clusters.yaml rename to config/crd/patches/webhook_in_blueprints.yaml index c5afc2a8..497a4d02 100644 --- a/config/crd/patches/webhook_in_clusters.yaml +++ b/config/crd/patches/webhook_in_blueprints.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: clusters.boundless.mirantis.com + name: blueprints.boundless.mirantis.com spec: conversion: strategy: Webhook diff --git a/config/rbac/cluster_editor_role.yaml b/config/rbac/blueprint_editor_role.yaml similarity index 75% rename from config/rbac/cluster_editor_role.yaml rename to config/rbac/blueprint_editor_role.yaml index b9182010..2d50460b 100644 --- a/config/rbac/cluster_editor_role.yaml +++ b/config/rbac/blueprint_editor_role.yaml @@ -1,20 +1,20 @@ -# permissions for end users to edit clusters. +# permissions for end users to edit blueprints. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: labels: app.kubernetes.io/name: clusterrole - app.kubernetes.io/instance: cluster-editor-role + app.kubernetes.io/instance: blueprint-editor-role app.kubernetes.io/component: rbac app.kubernetes.io/created-by: boundless-operator app.kubernetes.io/part-of: boundless-operator app.kubernetes.io/managed-by: kustomize - name: cluster-editor-role + name: blueprint-editor-role rules: - apiGroups: - boundless.mirantis.com resources: - - clusters + - blueprints verbs: - create - delete @@ -26,6 +26,6 @@ rules: - apiGroups: - boundless.mirantis.com resources: - - clusters/status + - blueprints/status verbs: - get diff --git a/config/rbac/cluster_viewer_role.yaml b/config/rbac/blueprint_viewer_role.yaml similarity index 73% rename from config/rbac/cluster_viewer_role.yaml rename to config/rbac/blueprint_viewer_role.yaml index a3a4b491..271eb57d 100644 --- a/config/rbac/cluster_viewer_role.yaml +++ b/config/rbac/blueprint_viewer_role.yaml @@ -1,20 +1,20 @@ -# permissions for end users to view clusters. +# permissions for end users to view blueprints. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: labels: app.kubernetes.io/name: clusterrole - app.kubernetes.io/instance: cluster-viewer-role + app.kubernetes.io/instance: blueprint-viewer-role app.kubernetes.io/component: rbac app.kubernetes.io/created-by: boundless-operator app.kubernetes.io/part-of: boundless-operator app.kubernetes.io/managed-by: kustomize - name: cluster-viewer-role + name: blueprint-viewer-role rules: - apiGroups: - boundless.mirantis.com resources: - - clusters + - blueprints verbs: - get - list @@ -22,6 +22,6 @@ rules: - apiGroups: - boundless.mirantis.com resources: - - clusters/status + - blueprints/status verbs: - get diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 956237f0..ad56f397 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -34,7 +34,7 @@ rules: - apiGroups: - boundless.mirantis.com resources: - - clusters + - blueprints verbs: - create - delete @@ -46,13 +46,13 @@ rules: - apiGroups: - boundless.mirantis.com resources: - - clusters/finalizers + - blueprints/finalizers verbs: - update - apiGroups: - boundless.mirantis.com resources: - - clusters/status + - blueprints/status verbs: - get - patch diff --git a/config/samples/boundless_v1alpha1_cluster.yaml b/config/samples/boundless_v1alpha1_blueprint.yaml similarity index 66% rename from config/samples/boundless_v1alpha1_cluster.yaml rename to config/samples/boundless_v1alpha1_blueprint.yaml index 9e75463b..ad563c42 100644 --- a/config/samples/boundless_v1alpha1_cluster.yaml +++ b/config/samples/boundless_v1alpha1_blueprint.yaml @@ -1,12 +1,12 @@ apiVersion: boundless.mirantis.com/v1alpha1 -kind: Cluster +kind: Blueprint metadata: labels: - app.kubernetes.io/name: cluster - app.kubernetes.io/instance: cluster-sample + app.kubernetes.io/name: blueprint + app.kubernetes.io/instance: blueprint-sample app.kubernetes.io/part-of: boundless-operator app.kubernetes.io/managed-by: kustomize app.kubernetes.io/created-by: boundless-operator - name: cluster-sample + name: blueprint-sample spec: # TODO(user): Add fields here diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index 2fd22245..c27c175a 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -3,4 +3,5 @@ resources: - boundless_v1alpha1_addon.yaml - boundless_v1alpha1_cluster.yaml - boundless_v1alpha1_ingress.yaml +- boundless_v1alpha1_blueprint.yaml #+kubebuilder:scaffold:manifestskustomizesamples diff --git a/controllers/cluster_controller.go b/controllers/blueprint_controller.go similarity index 77% rename from controllers/cluster_controller.go rename to controllers/blueprint_controller.go index ce656eb0..3a4851de 100644 --- a/controllers/cluster_controller.go +++ b/controllers/blueprint_controller.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/go-logr/logr" - v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" @@ -13,36 +12,37 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" boundlessv1alpha1 "github.com/mirantis/boundless-operator/api/v1alpha1" + "github.com/mirantis/boundless-operator/pkg" "github.com/mirantis/boundless-operator/pkg/controllers/installation" ) -// ClusterReconciler reconciles a Cluster object -type ClusterReconciler struct { +// BlueprintReconciler reconciles a Blueprint object +type BlueprintReconciler struct { client.Client Scheme *runtime.Scheme } -//+kubebuilder:rbac:groups=boundless.mirantis.com,resources=clusters,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=boundless.mirantis.com,resources=clusters/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=boundless.mirantis.com,resources=clusters/finalizers,verbs=update +//+kubebuilder:rbac:groups=boundless.mirantis.com,resources=blueprints,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=boundless.mirantis.com,resources=blueprints/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=boundless.mirantis.com,resources=blueprints/finalizers,verbs=update // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state. // TODO(user): Modify the Reconcile function to compare the state specified by -// the Cluster object against the actual cluster state, and then +// the Blueprint object against the actual cluster state, and then // perform operations to make the cluster state reflect the state specified by // the user. // // For more details, check Reconcile and its Result here: // - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile -func (r *ClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { +func (r *BlueprintReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { _ = log.FromContext(ctx) logger := log.FromContext(ctx) - logger.Info("Reconcile request on Cluster instance", "Name", req.Name) - instance := &boundlessv1alpha1.Cluster{} + logger.Info("Reconcile request on Blueprint instance", "Name", req.Name) + instance := &boundlessv1alpha1.Blueprint{} if err := r.Get(ctx, req.NamespacedName, instance); err != nil { - logger.Error(err, "Failed to get Cluster instance") + logger.Error(err, "Failed to get Blueprint instance") return ctrl.Result{}, err } @@ -82,7 +82,7 @@ func (r *ClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct return ctrl.Result{}, nil } -func (r *ClusterReconciler) createOrUpdateAddon(ctx context.Context, logger logr.Logger, obj client.Object) error { +func (r *BlueprintReconciler) createOrUpdateAddon(ctx context.Context, logger logr.Logger, obj client.Object) error { existing := &boundlessv1alpha1.Addon{} err := r.Get(ctx, client.ObjectKey{Name: obj.GetName(), Namespace: obj.GetNamespace()}, existing) if err != nil { @@ -109,7 +109,7 @@ func (r *ClusterReconciler) createOrUpdateAddon(ctx context.Context, logger logr return nil } -func (r *ClusterReconciler) createOrUpdateIngress(ctx context.Context, logger logr.Logger, obj client.Object) error { +func (r *BlueprintReconciler) createOrUpdateIngress(ctx context.Context, logger logr.Logger, obj client.Object) error { existing := &boundlessv1alpha1.Ingress{} err := r.Get(ctx, client.ObjectKey{Name: obj.GetName(), Namespace: obj.GetNamespace()}, existing) if err != nil { @@ -137,11 +137,10 @@ func (r *ClusterReconciler) createOrUpdateIngress(ctx context.Context, logger lo } func ingressResource(spec *boundlessv1alpha1.IngressSpec) *boundlessv1alpha1.Ingress { - name := fmt.Sprintf("mke-%s", spec.Provider) return &boundlessv1alpha1.Ingress{ ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: v1.NamespaceDefault, + Name: spec.Provider, + Namespace: pkg.NamespaceBoundlessSystem, }, Spec: boundlessv1alpha1.IngressSpec{ Enabled: spec.Enabled, @@ -152,14 +151,14 @@ func ingressResource(spec *boundlessv1alpha1.IngressSpec) *boundlessv1alpha1.Ing } func addonResource(spec *boundlessv1alpha1.AddonSpec) *boundlessv1alpha1.Addon { - name := fmt.Sprintf("mke-%s", spec.Chart.Name) - return &boundlessv1alpha1.Addon{ ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: v1.NamespaceDefault, + Name: spec.Name, + Namespace: pkg.NamespaceBoundlessSystem, }, Spec: boundlessv1alpha1.AddonSpec{ + Name: spec.Name, + Namespace: spec.Namespace, Chart: boundlessv1alpha1.Chart{ Name: spec.Chart.Name, Repo: spec.Chart.Repo, @@ -172,8 +171,8 @@ func addonResource(spec *boundlessv1alpha1.AddonSpec) *boundlessv1alpha1.Addon { } // SetupWithManager sets up the controller with the Manager. -func (r *ClusterReconciler) SetupWithManager(mgr ctrl.Manager) error { +func (r *BlueprintReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). - For(&boundlessv1alpha1.Cluster{}). + For(&boundlessv1alpha1.Blueprint{}). Complete(r) } diff --git a/deploy/static/boundless-operator.yaml b/deploy/static/boundless-operator.yaml index 23d8c8ba..d438c5ab 100644 --- a/deploy/static/boundless-operator.yaml +++ b/deploy/static/boundless-operator.yaml @@ -94,20 +94,20 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.11.1 creationTimestamp: null - name: clusters.boundless.mirantis.com + name: blueprints.boundless.mirantis.com spec: group: boundless.mirantis.com names: - kind: Cluster - listKind: ClusterList - plural: clusters - singular: cluster + kind: Blueprint + listKind: BlueprintList + plural: blueprints + singular: blueprint scope: Namespaced versions: - name: v1alpha1 schema: openAPIV3Schema: - description: Cluster is the Schema for the clusters API + description: Blueprint is the Schema for the blueprints API properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' @@ -118,7 +118,7 @@ spec: metadata: type: object spec: - description: ClusterSpec defines the desired state of Cluster + description: BlueprintSpec defines the desired state of Blueprint properties: components: description: Components contains all the components that should be installed @@ -184,7 +184,7 @@ spec: type: object type: object status: - description: ClusterStatus defines the observed state of Cluster + description: BlueprintStatus defines the observed state of Blueprint type: object type: object served: true @@ -342,7 +342,7 @@ rules: - apiGroups: - boundless.mirantis.com resources: - - clusters + - blueprints verbs: - create - delete @@ -354,13 +354,13 @@ rules: - apiGroups: - boundless.mirantis.com resources: - - clusters/finalizers + - blueprints/finalizers verbs: - update - apiGroups: - boundless.mirantis.com resources: - - clusters/status + - blueprints/status verbs: - get - patch diff --git a/go.sum b/go.sum index ba1e90ff..58994950 100644 --- a/go.sum +++ b/go.sum @@ -66,6 +66,7 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -270,6 +271,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -283,6 +285,7 @@ go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= diff --git a/main.go b/main.go index d7104d1f..50c6680e 100644 --- a/main.go +++ b/main.go @@ -85,7 +85,7 @@ func main() { setupLog.Error(err, "unable to create controller", "controller", "Addon") os.Exit(1) } - if err = (&controllers.ClusterReconciler{ + if err = (&controllers.BlueprintReconciler{ Client: mgr.GetClient(), Scheme: mgr.GetScheme(), }).SetupWithManager(mgr); err != nil {