forked from intel/pmem-csi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pmem-csi-operator: delete obsolete objects of a deployment
Different operator releases might result in obsolete sub-resources that were created for a deployment. Operator shall detect these obsolete objects if any and delete them in the reconcile loop. There is no direct API to detect all the objects owned by an object. So, we keep hard-coded list of all types that operator could deal and we use this list to query and fetch the pre-deployed objects and check if that object is owned by the deployment. For tesing this pperator creates an additional dummy ConfigMap object for pre-known test version. The test ensures that the ConfigMap gets deleted upon change in the operator version. FIXES intel#595
Showing
11 changed files
with
652 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
267 changes: 267 additions & 0 deletions
267
deploy/olm-catalog/0.7.0/pmem-csi-operator.clusterserviceversion.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
deploy/olm-catalog/0.7.0/pmem-csi-operator_v1_serviceaccount.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
creationTimestamp: null | ||
name: pmem-csi-operator | ||
namespace: default |
154 changes: 154 additions & 0 deletions
154
deploy/olm-catalog/0.7.0/pmem-csi.intel.com_deployments.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.3.0 | ||
creationTimestamp: null | ||
name: deployments.pmem-csi.intel.com | ||
spec: | ||
group: pmem-csi.intel.com | ||
names: | ||
kind: Deployment | ||
listKind: DeploymentList | ||
plural: deployments | ||
singular: deployment | ||
scope: Cluster | ||
subresources: | ||
status: {} | ||
validation: | ||
openAPIV3Schema: | ||
description: Deployment is the Schema for the deployments 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: DeploymentSpec defines the desired state of Deployment | ||
properties: | ||
caCert: | ||
description: CACert encoded root certificate of the CA by which the registry and node controller certificates are signed If not provided operator uses a self-signed CA certificate | ||
format: byte | ||
type: string | ||
controllerResources: | ||
description: ControllerResources Compute resources required by Controller driver | ||
properties: | ||
limits: | ||
additionalProperties: | ||
anyOf: | ||
- type: integer | ||
- type: string | ||
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ | ||
x-kubernetes-int-or-string: true | ||
description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' | ||
type: object | ||
requests: | ||
additionalProperties: | ||
anyOf: | ||
- type: integer | ||
- type: string | ||
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ | ||
x-kubernetes-int-or-string: true | ||
description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' | ||
type: object | ||
type: object | ||
deviceMode: | ||
description: DeviceMode to use to manage PMEM devices. One of lvm, direct | ||
type: string | ||
image: | ||
description: PMEM-CSI driver container image | ||
type: string | ||
imagePullPolicy: | ||
description: PullPolicy image pull policy one of Always, Never, IfNotPresent | ||
type: string | ||
kubeletDir: | ||
description: KubeletDir kubelet's root directory path | ||
type: string | ||
labels: | ||
additionalProperties: | ||
type: string | ||
description: Labels contains additional labels for all objects created by the operator. | ||
type: object | ||
logLevel: | ||
description: LogLevel number for the log verbosity kubebuilder:default=3 | ||
type: integer | ||
nodeControllerCert: | ||
description: NodeControllerCert encoded certificate signed by a CA for node controller server authentication If not provided, provisioned one by the operator using self-signed CA | ||
format: byte | ||
type: string | ||
nodeControllerKey: | ||
description: NodeControllerPrivateKey encoded private key used for node controller server certificate If not provided, provisioned one by the operator | ||
format: byte | ||
type: string | ||
nodeRegistrarImage: | ||
description: NodeRegistrarImage CSI node driver registrar sidecar image | ||
type: string | ||
nodeResources: | ||
description: NodeResources Compute resources required by Node driver | ||
properties: | ||
limits: | ||
additionalProperties: | ||
anyOf: | ||
- type: integer | ||
- type: string | ||
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ | ||
x-kubernetes-int-or-string: true | ||
description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' | ||
type: object | ||
requests: | ||
additionalProperties: | ||
anyOf: | ||
- type: integer | ||
- type: string | ||
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ | ||
x-kubernetes-int-or-string: true | ||
description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' | ||
type: object | ||
type: object | ||
nodeSelector: | ||
additionalProperties: | ||
type: string | ||
description: NodeSelector node labels to use for selection of driver node | ||
type: object | ||
pmemPercentage: | ||
description: PMEMPercentage represents the percentage of space to be used by the driver in each PMEM region on every node. This is only valid for driver in LVM mode. -kubebuilder:validation:Minimum=1 -kubebuilder:validation:Maximum=100 -kubebuilder:default=100 | ||
type: integer | ||
provisionerImage: | ||
description: ProvisionerImage CSI provisioner sidecar image | ||
type: string | ||
registryCert: | ||
description: RegistryCert encoded certificate signed by a CA for registry server authentication If not provided, provisioned one by the operator using self-signed CA | ||
format: byte | ||
type: string | ||
registryKey: | ||
description: RegistryPrivateKey encoded private key used for registry server certificate If not provided, provisioned one by the operator | ||
format: byte | ||
type: string | ||
type: object | ||
status: | ||
description: DeploymentStatus defines the observed state of Deployment | ||
properties: | ||
lastUpdated: | ||
description: LastUpdated time of the deployment status | ||
format: date-time | ||
type: string | ||
phase: | ||
description: Phase indicates the state of the deployment | ||
type: string | ||
type: object | ||
type: object | ||
version: v1alpha1 | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
channels: | ||
- currentCSV: pmem-csi-operator.v0.7.0 | ||
name: alpha | ||
defaultChannel: alpha | ||
packageName: pmem-csi-operator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
scorecard: | ||
output: json | ||
olmdeployed: true | ||
plugins: | ||
- basic: | ||
cr-manifest: | ||
- "deploy/common/pmem-csi.intel.com_v1alpha1_deployment_cr.yaml" | ||
- olm: | ||
cr-manifest: | ||
- "deploy/common/pmem-csi.intel.com_v1alpha1_deployment_cr.yaml" | ||
csv-path: "deploy/olm-catalog/0.7.0/pmem-csi.operator.clusterserviceversion.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters