Skip to content

Commit

Permalink
Support uninstallation on intra-dependency
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Fan <fanyuchensx@gmail.com>
  • Loading branch information
Daniel-Fan committed Mar 25, 2024
1 parent 702e443 commit 83539a5
Show file tree
Hide file tree
Showing 20 changed files with 2,331 additions and 2,116 deletions.
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL)
endif
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)

# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
Expand Down Expand Up @@ -199,7 +196,7 @@ deploy-e2e: kustomize ## Deploy controller in the configured Kubernetes cluster
##@ Generate code and manifests

manifests: controller-gen ## Generate manifests e.g. CRD, RBAC etc.
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=operand-deployment-lifecycle-manager webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) crd rbac:roleName=operand-deployment-lifecycle-manager webhook paths="./..." output:crd:artifacts:config=config/crd/bases

generate: controller-gen ## Generate code e.g. API etc.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/operandbindinfo_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ type OperandBindInfoStatus struct {
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status

// OperandBindInfo is the Schema for the operandbindinfoes API.
// OperandBindInfo is the Schema for the operandbindinfoes API. Documentation For additional details regarding install parameters check https://ibm.biz/icpfs39install. License By installing this product you accept the license terms https://ibm.biz/icpfs39license
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=operandbindinfos,shortName=opbi,scope=Namespaced
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=.metadata.creationTimestamp
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/operandconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ type CrStatus struct {
CrStatus map[string]ServicePhase `json:"customResourceStatus,omitempty"`
}

// OperandConfig is the Schema for the operandconfigs API.
// OperandConfig is the Schema for the operandconfigs API. Documentation For additional details regarding install parameters check https://ibm.biz/icpfs39install. License By installing this product you accept the license terms https://ibm.biz/icpfs39license
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=operandconfigs,shortName=opcon,scope=Namespaced
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/operandregistry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ type ReconcileRequest struct {
// +kubebuilder:printcolumn:name="Created At",type=string,JSONPath=.metadata.creationTimestamp
// +operator-sdk:csv:customresourcedefinitions:displayName="OperandRegistry"

// OperandRegistry is the Schema for the operandregistries API.
// OperandRegistry is the Schema for the operandregistries API. Documentation For additional details regarding install parameters check https://ibm.biz/icpfs39install. License By installing this product you accept the license terms https://ibm.biz/icpfs39license
type OperandRegistry struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/operandrequest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ type MemberStatus struct {
// +kubebuilder:printcolumn:name="Created At",type=string,JSONPath=.metadata.creationTimestamp
// +operator-sdk:csv:customresourcedefinitions:displayName="OperandRequest"

// OperandRequest is the Schema for the operandrequests API.
// OperandRequest is the Schema for the operandrequests API. Documentation For additional details regarding install parameters check https://ibm.biz/icpfs39install. License By installing this product you accept the license terms https://ibm.biz/icpfs39license
type OperandRequest struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ metadata:
categories: Developer Tools, Monitoring, Logging & Tracing, Security
certified: "false"
containerImage: icr.io/cpopen/odlm:latest
createdAt: "2024-03-13T21:38:26Z"
createdAt: "2024-03-20T04:25:43Z"
description: The Operand Deployment Lifecycle Manager provides a Kubernetes CRD-based API to manage the lifecycle of operands.
nss.operator.ibm.com/managed-operators: ibm-odlm
olm.skipRange: '>=1.2.0 <4.3.0'
Expand All @@ -149,7 +149,7 @@ spec:
apiservicedefinitions: {}
customresourcedefinitions:
owned:
- description: OperandBindInfo is the Schema for the operandbindinfoes API.
- description: OperandBindInfo is the Schema for the operandbindinfoes API. Documentation For additional details regarding install parameters check https://ibm.biz/icpfs39install. License By installing this product you accept the license terms https://ibm.biz/icpfs39license
displayName: OperandBindInfo
kind: OperandBindInfo
name: operandbindinfos.operator.ibm.com
Expand All @@ -160,7 +160,7 @@ spec:
x-descriptors:
- urn:alm:descriptor:io.kubernetes.phase
version: v1alpha1
- description: OperandConfig is the Schema for the operandconfigs API.
- description: OperandConfig is the Schema for the operandconfigs API. Documentation For additional details regarding install parameters check https://ibm.biz/icpfs39install. License By installing this product you accept the license terms https://ibm.biz/icpfs39license
displayName: OperandConfig
kind: OperandConfig
name: operandconfigs.operator.ibm.com
Expand All @@ -175,7 +175,7 @@ spec:
x-descriptors:
- urn:alm:descriptor:io.kubernetes.phase
version: v1alpha1
- description: OperandRegistry is the Schema for the operandregistries API.
- description: OperandRegistry is the Schema for the operandregistries API. Documentation For additional details regarding install parameters check https://ibm.biz/icpfs39install. License By installing this product you accept the license terms https://ibm.biz/icpfs39license
displayName: OperandRegistry
kind: OperandRegistry
name: operandregistries.operator.ibm.com
Expand All @@ -195,7 +195,7 @@ spec:
x-descriptors:
- urn:alm:descriptor:io.kubernetes.phase
version: v1alpha1
- description: OperandRequest is the Schema for the operandrequests API.
- description: OperandRequest is the Schema for the operandrequests API. Documentation For additional details regarding install parameters check https://ibm.biz/icpfs39install. License By installing this product you accept the license terms https://ibm.biz/icpfs39license
displayName: OperandRequest
kind: OperandRequest
name: operandrequests.operator.ibm.com
Expand Down Expand Up @@ -562,22 +562,22 @@ spec:
install:
spec:
clusterPermissions:
- rules:
- apiGroups:
- operators.coreos.com
resources:
- catalogsources
verbs:
- get
- apiGroups:
- operator.ibm.com
resources:
- certmanagers
- auditloggings
verbs:
- get
- delete
serviceAccountName: operand-deployment-lifecycle-manager
- rules:
- apiGroups:
- operators.coreos.com
resources:
- catalogsources
verbs:
- get
- apiGroups:
- operator.ibm.com
resources:
- certmanagers
- auditloggings
verbs:
- get
- delete
serviceAccountName: operand-deployment-lifecycle-manager
deployments:
- label:
app.kubernetes.io/instance: operand-deployment-lifecycle-manager
Expand Down
70 changes: 41 additions & 29 deletions bundle/manifests/operator.ibm.com_operandbindinfos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
controller-gen.kubebuilder.io/version: v0.14.0
creationTimestamp: null
labels:
app.kubernetes.io/instance: operand-deployment-lifecycle-manager
Expand Down Expand Up @@ -35,16 +35,24 @@ spec:
schema:
openAPIV3Schema:
description: OperandBindInfo is the Schema for the operandbindinfoes API.
Documentation For additional details regarding install parameters check
https://ibm.biz/icpfs39install. License By installing this product you accept
the license terms https://ibm.biz/icpfs39license
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'
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'
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
Expand All @@ -53,28 +61,30 @@ spec:
properties:
bindings:
additionalProperties:
description: Bindable is a Kubernetes resources to be shared from
one namespace to another. List of supported resources are Secrets,
Configmaps, Services, and Routes. Secrets and Configmaps will
be copied such that a new Secret/Configmap with exactly the same
data will be created in the target namespace. Services and Routes
data will be copied into a configmap in the target namespace.
description: |-
Bindable is a Kubernetes resources to be shared from one namespace to another.
List of supported resources are Secrets, Configmaps, Services, and Routes.
Secrets and Configmaps will be copied such that a new Secret/Configmap with
exactly the same data will be created in the target namespace.
Services and Routes data will be copied into a configmap in the target
namespace.
properties:
configmap:
description: The configmap identifies an existing configmap
object. if it exists, the ODLM will share to the namespace
of the OperandRequest.
type: string
route:
description: Route data will be shared by copying it into a
configmap which is then created in the target namespace
description: |-
Route data will be shared by copying it into a configmap which is then
created in the target namespace
properties:
data:
additionalProperties:
type: string
description: Data is a key-value pair where the value is
a YAML path to a value in the OpenShift Route, e.g. .spec.host
or .spec.tls.termination
description: |-
Data is a key-value pair where the value is a YAML path to a value in the
OpenShift Route, e.g. .spec.host or .spec.tls.termination
type: object
name:
description: Name is the name of the OpenShift Route resource
Expand All @@ -85,15 +95,16 @@ spec:
exists, the ODLM will share to the namespace of the OperandRequest.
type: string
service:
description: Service data will be shared by copying it into
a configmap which is then created in the target namespace
description: |-
Service data will be shared by copying it into a configmap which is then
created in the target namespace
properties:
data:
additionalProperties:
type: string
description: Data is a key-value pair where the value is
a YAML path to a value in the Kubernetes Service, e.g.
.spec.ports[0]port
description: |-
Data is a key-value pair where the value is a YAML path to a value in the
Kubernetes Service, e.g. .spec.ports[0]port
type: object
name:
description: Name is the name of the Kubernetes Service
Expand All @@ -107,17 +118,18 @@ spec:
description:
type: string
operand:
description: The deployed service identifies itself with its operand.
description: |-
The deployed service identifies itself with its operand.
This must match the name in the OperandRegistry in the current namespace.
type: string
registry:
description: The registry identifies the name of the name of the OperandRegistry
CR from which this operand deployment is being requested.
type: string
registryNamespace:
description: Specifies the namespace in which the OperandRegistry
reside. The default is the current namespace in which the request
is defined.
description: |-
Specifies the namespace in which the OperandRegistry reside.
The default is the current namespace in which the request is defined.
type: string
required:
- operand
Expand Down Expand Up @@ -146,5 +158,5 @@ status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
conditions: null
storedVersions: null
39 changes: 24 additions & 15 deletions bundle/manifests/operator.ibm.com_operandconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
controller-gen.kubebuilder.io/version: v0.14.0
creationTimestamp: null
labels:
app.kubernetes.io/instance: operand-deployment-lifecycle-manager
Expand Down Expand Up @@ -34,17 +34,24 @@ spec:
name: v1alpha1
schema:
openAPIV3Schema:
description: OperandConfig is the Schema for the operandconfigs API.
description: OperandConfig is the Schema for the operandconfigs API. Documentation
For additional details regarding install parameters check https://ibm.biz/icpfs39install.
License By installing this product you accept the license terms https://ibm.biz/icpfs39license
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'
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'
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
Expand Down Expand Up @@ -110,14 +117,16 @@ spec:
description: API version of the referent.
type: string
blockOwnerDeletion:
description: If true, AND if the owner has the "foregroundDeletion"
finalizer, then the owner cannot be deleted from
the key-value store until this reference is removed.
description: |-
If true, AND if the owner has the "foregroundDeletion" finalizer, then
the owner cannot be deleted from the key-value store until this
reference is removed.
Defaults to false.
type: boolean
controller:
description: If true, this reference points to the
managing controller. Default is false.
description: |-
If true, this reference points to the managing controller.
Default is false.
type: boolean
kind:
description: Kind of the referent.
Expand Down Expand Up @@ -183,5 +192,5 @@ status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
conditions: null
storedVersions: null
Loading

0 comments on commit 83539a5

Please sign in to comment.