-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(k8s): bump crd version to v1 (#559)
- bump crd version to v1 - refactored tests to use v1 api extensions - moved crd generation to generate-manifest script - added create crd step in integration test Signed-off-by: shubham <[email protected]>
- Loading branch information
1 parent
b77aa7f
commit ef2bb97
Showing
18 changed files
with
1,350 additions
and
811 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,7 +159,12 @@ vet: | |
fmt: | ||
find . -type f -name "*.go" | grep -v "./vendor/*" | xargs gofmt -s -w -l | ||
|
||
manifests: | ||
|
||
.PHONY: controller-gen | ||
controller-gen: | ||
TMP_DIR=$(shell mktemp -d) && cd $$TMP_DIR && go mod init tmp && go get sigs.k8s.io/controller-tools/cmd/[email protected] && rm -rf $$TMP_DIR; | ||
|
||
manifests: controller-gen | ||
@echo "+ Generating NDM manifest" | ||
$(PWD)/build/generate-manifests.sh | ||
|
||
|
@@ -288,13 +293,9 @@ push: | |
DIMAGE=${IMAGE_ORG}/node-disk-operator-${XC_ARCH} ./build/push; | ||
DIMAGE=${IMAGE_ORG}/node-disk-exporter-${XC_ARCH} ./build/push; | ||
|
||
.PHONY: crds | ||
crds: | ||
touch build/Dockerfile | ||
# Install the binary from https://github.com/operator-framework/operator-sdk/releases/tag/v0.17.0 | ||
operator-sdk-v0.17.0-x86_64-linux-gnu generate crds | ||
rm build/Dockerfile | ||
|
||
#----------------------------------------------------------------------------- | ||
# Target: docker.buildx.ndm docker.buildx.ndo docker.buildx.exporter | ||
#----------------------------------------------------------------------------- | ||
|
||
include Makefile.buildx.mk |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
updated the apiextension version to v1 and moved the installation of crds from operator deployment to the operator 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,180 @@ | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.4.0 | ||
creationTimestamp: null | ||
name: blockdeviceclaims.openebs.io | ||
spec: | ||
group: openebs.io | ||
names: | ||
kind: BlockDeviceClaim | ||
listKind: BlockDeviceClaimList | ||
plural: blockdeviceclaims | ||
shortNames: | ||
- bdc | ||
singular: blockdeviceclaim | ||
scope: Namespaced | ||
versions: | ||
- additionalPrinterColumns: | ||
- jsonPath: .spec.blockDeviceName | ||
name: BlockDeviceName | ||
type: string | ||
- jsonPath: .status.phase | ||
name: Phase | ||
type: string | ||
- jsonPath: .metadata.creationTimestamp | ||
name: Age | ||
type: date | ||
name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
description: BlockDeviceClaim is the Schema for the BlockDeviceClaim CR | ||
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: DeviceClaimSpec defines the request details for a BlockDevice | ||
properties: | ||
blockDeviceName: | ||
description: BlockDeviceName is the reference to the block-device | ||
backing this claim | ||
type: string | ||
blockDeviceNodeAttributes: | ||
description: BlockDeviceNodeAttributes is the attributes on the node | ||
from which a BD should be selected for this claim. It can include | ||
nodename, failure domain etc. | ||
properties: | ||
hostName: | ||
description: HostName represents the hostname of the Kubernetes | ||
node resource where the BD should be present | ||
type: string | ||
nodeName: | ||
description: NodeName represents the name of the Kubernetes node | ||
resource where the BD should be present | ||
type: string | ||
type: object | ||
deviceClaimDetails: | ||
description: Details of the device to be claimed | ||
properties: | ||
allowPartition: | ||
description: AllowPartition represents whether to claim a full | ||
block device or a device that is a partition | ||
type: boolean | ||
blockVolumeMode: | ||
description: 'BlockVolumeMode represents whether to claim a device | ||
in Block mode or Filesystem mode. These are use cases of BlockVolumeMode: | ||
1) Not specified: VolumeMode check will not be effective 2) | ||
VolumeModeBlock: BD should not have any filesystem or mountpoint | ||
3) VolumeModeFileSystem: BD should have a filesystem and mountpoint. | ||
If DeviceFormat is specified then the format should match | ||
with the FSType in BD' | ||
type: string | ||
formatType: | ||
description: Format of the device required, eg:ext4, xfs | ||
type: string | ||
type: object | ||
deviceType: | ||
description: DeviceType represents the type of drive like SSD, HDD | ||
etc., | ||
nullable: true | ||
type: string | ||
hostName: | ||
description: Node name from where blockdevice has to be claimed. To | ||
be deprecated. Use NodeAttributes.HostName instead | ||
type: string | ||
resources: | ||
description: Resources will help with placing claims on Capacity, | ||
IOPS | ||
properties: | ||
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 resources required. | ||
eg: if storage resource of 10G is requested minimum capacity | ||
of 10G should be available TODO for validating' | ||
type: object | ||
required: | ||
- requests | ||
type: object | ||
selector: | ||
description: Selector is used to find block devices to be considered | ||
for claiming | ||
properties: | ||
matchExpressions: | ||
description: matchExpressions is a list of label selector requirements. | ||
The requirements are ANDed. | ||
items: | ||
description: A label selector requirement is a selector that | ||
contains values, a key, and an operator that relates the key | ||
and values. | ||
properties: | ||
key: | ||
description: key is the label key that the selector applies | ||
to. | ||
type: string | ||
operator: | ||
description: operator represents a key's relationship to | ||
a set of values. Valid operators are In, NotIn, Exists | ||
and DoesNotExist. | ||
type: string | ||
values: | ||
description: values is an array of string values. If the | ||
operator is In or NotIn, the values array must be non-empty. | ||
If the operator is Exists or DoesNotExist, the values | ||
array must be empty. This array is replaced during a strategic | ||
merge patch. | ||
items: | ||
type: string | ||
type: array | ||
required: | ||
- key | ||
- operator | ||
type: object | ||
type: array | ||
matchLabels: | ||
additionalProperties: | ||
type: string | ||
description: matchLabels is a map of {key,value} pairs. A single | ||
{key,value} in the matchLabels map is equivalent to an element | ||
of matchExpressions, whose key field is "key", the operator | ||
is "In", and the values array contains only "value". The requirements | ||
are ANDed. | ||
type: object | ||
type: object | ||
type: object | ||
status: | ||
description: DeviceClaimStatus defines the observed state of BlockDeviceClaim | ||
properties: | ||
phase: | ||
description: Phase represents the current phase of the claim | ||
type: string | ||
required: | ||
- phase | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: {} | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
Oops, something went wrong.