Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
domain: entando.org
layout:
- go.kubebuilder.io/v3
multigroup: true
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
Expand All @@ -16,4 +17,12 @@ resources:
kind: EntandoAppV2
path: github.com/entgigi/upgrade-operator.git/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: entando.org
group: entando.org
kind: EntandoApp
path: github.com/entgigi/upgrade-operator.git/api/entando.org/v1
version: v1
version: "3"
64 changes: 64 additions & 0 deletions api/entando.org/v1/entandoapp_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
Copyright 2022.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// 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.

// EntandoAppSpec defines the desired state of EntandoApp
type EntandoAppSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Foo is an example field of EntandoApp. Edit entandoapp_types.go to remove/update
//Foo string `json:"foo,omitempty"`
}

// EntandoAppStatus defines the observed state of EntandoApp
type EntandoAppStatus 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

// EntandoApp is the Schema for the entandoapps API
type EntandoApp struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec EntandoAppSpec `json:"spec,omitempty"`
Status EntandoAppStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// EntandoAppList contains a list of EntandoApp
type EntandoAppList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []EntandoApp `json:"items"`
}

func init() {
SchemeBuilder.Register(&EntandoApp{}, &EntandoAppList{})
}
36 changes: 36 additions & 0 deletions api/entando.org/v1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright 2022.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1 contains API Schema definitions for the entando.org v1 API group
//+kubebuilder:object:generate=true
//+groupName=entando.org
package v1

import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "entando.org", Version: "v1"}

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

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
115 changes: 115 additions & 0 deletions api/entando.org/v1/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions api/v1alpha1/entandoappv2_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ type EntandoAppV2Status struct {
// An EntandoAppV2 deploys the components required to upgrade an Entando App. The server side
// components that are deployed include the Entando App Engine, the Entando Component Manager,
// the Entando App Builder, and the user facing application.
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=`.status.conditions[?(@.type=="Ready")].status`,description="state of EntandoApp"
type EntandoAppV2 struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
7 changes: 6 additions & 1 deletion config/crd/bases/app.entando.org_entandoappv2s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ spec:
singular: entandoappv2
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: state of EntandoApp
jsonPath: .status.conditions[?(@.type=="Ready")].status
name: Ready
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: An EntandoAppV2 deploys the components required to upgrade an
Expand Down
50 changes: 50 additions & 0 deletions config/crd/bases/entando.org.entando.org_entandoapps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: entandoapps.entando.org.entando.org
spec:
group: entando.org.entando.org
names:
kind: EntandoApp
listKind: EntandoAppList
plural: entandoapps
singular: entandoapp
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: EntandoApp is the Schema for the entandoapps 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'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: EntandoAppSpec defines the desired state of EntandoApp
properties:
foo:
description: Foo is an example field of EntandoApp. Edit entandoapp_types.go
to remove/update
type: string
type: object
status:
description: EntandoAppStatus defines the observed state of EntandoApp
type: object
type: object
served: true
storage: true
subresources:
status: {}
45 changes: 45 additions & 0 deletions config/crd/bases/entando.org_entandoapps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: entandoapps.entando.org
spec:
group: entando.org
names:
kind: EntandoApp
listKind: EntandoAppList
plural: entandoapps
singular: entandoapp
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: EntandoApp is the Schema for the entandoapps 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'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: EntandoAppSpec defines the desired state of EntandoApp
type: object
status:
description: EntandoAppStatus defines the observed state of EntandoApp
type: object
type: object
served: true
storage: true
subresources:
status: {}
3 changes: 3 additions & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
# It should be run by config/default
resources:
- bases/app.entando.org_entandoappv2s.yaml
- bases/entando.org.entando.org_entandoapps.yaml
#+kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
#- patches/webhook_in_entandoappv2s.yaml
#- patches/webhook_in_entandoapps.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_entandoappv2s.yaml
#- patches/cainjection_in_entandoapps.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
@@ -0,0 +1,7 @@
# The following patch adds a directive for certmanager to inject CA into the CRD
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: entandoapps.entando.org.entando.org
Loading