Skip to content

Commit

Permalink
Merge pull request #1 from Mirantis/rename-to-blueprint
Browse files Browse the repository at this point in the history
BOP-43 Rename the CRD from Cluster to Blueprint
  • Loading branch information
ranyodh authored Oct 31, 2023
2 parents 6eec807 + 2b250bd commit 5ad1934
Show file tree
Hide file tree
Showing 16 changed files with 116 additions and 109 deletions.
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
24 changes: 12 additions & 12 deletions api/v1alpha1/cluster_types.go → api/v1alpha1/blueprint_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -26,33 +26,33 @@ 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
}

//+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{})
}
82 changes: 41 additions & 41 deletions api/v1alpha1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -13,13 +13,15 @@ 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.
# patches here are for enabling the CA injection for each CRD
#- 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -26,6 +26,6 @@ rules:
- apiGroups:
- boundless.mirantis.com
resources:
- clusters/status
- blueprints/status
verbs:
- get
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# 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
- watch
- apiGroups:
- boundless.mirantis.com
resources:
- clusters/status
- blueprints/status
verbs:
- get
6 changes: 3 additions & 3 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ rules:
- apiGroups:
- boundless.mirantis.com
resources:
- clusters
- blueprints
verbs:
- create
- delete
Expand All @@ -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
Expand Down
Loading

0 comments on commit 5ad1934

Please sign in to comment.