github.com/openebs/node-disk-manager@v1.9.1-0.20230225014141-4531f06ffa1e/pkg/setup/build_crd.go (about)

     1  /*
     2  Copyright 2019 The OpenEBS Authors
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package setup
    18  
    19  // import (
    20  // 	apis "github.com/openebs/node-disk-manager/api/v1alpha1"
    21  // 	"github.com/openebs/node-disk-manager/pkg/crds"
    22  // 	apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
    23  // )
    24  
    25  // // buildBlockDeviceCRD is used to build the blockdevice CRD
    26  // func buildBlockDeviceCRD() (*apiext.CustomResourceDefinition, error) {
    27  // 	crdBuilder := crds.NewBuilder()
    28  // 	crdBuilder.WithName(apis.BlockDeviceResourceName).
    29  // 		WithGroup(apis.GroupName).
    30  // 		WithVersion(apis.APIVersion).
    31  // 		WithScope(apiext.NamespaceScoped).
    32  // 		WithKind(apis.BlockDeviceResourceKind).
    33  // 		WithListKind(apis.BlockDeviceResourceListKind).
    34  // 		WithPlural(apis.BlockDeviceResourcePlural).
    35  // 		WithShortNames([]string{apis.BlockDeviceResourceShort}).
    36  // 		WithPrinterColumns("NodeName", "string", ".spec.nodeAttributes.nodeName").
    37  // 		WithPriorityPrinterColumns("Path", "string", ".spec.path", 1).
    38  // 		WithPriorityPrinterColumns("FSType", "string", ".spec.filesystem.fsType", 1).
    39  // 		WithPrinterColumns("Size", "string", ".spec.capacity.storage").
    40  // 		WithPrinterColumns("ClaimState", "string", ".status.claimState").
    41  // 		WithPrinterColumns("Status", "string", ".status.state").
    42  // 		WithPrinterColumns("Age", "date", ".metadata.creationTimestamp")
    43  // 	return crdBuilder.Build()
    44  // }
    45  
    46  // // buildBlockDeviceClaimCRD is used to build the blockdevice claim CRD
    47  // func buildBlockDeviceClaimCRD() (*apiext.CustomResourceDefinition, error) {
    48  // 	crdBuilder := crds.NewBuilder()
    49  // 	crdBuilder.WithName(apis.BlockDeviceClaimResourceName).
    50  // 		WithGroup(apis.GroupName).
    51  // 		WithVersion(apis.APIVersion).
    52  // 		WithScope(apiext.NamespaceScoped).
    53  // 		WithKind(apis.BlockDeviceClaimResourceKind).
    54  // 		WithListKind(apis.BlockDeviceClaimResourceListKind).
    55  // 		WithPlural(apis.BlockDeviceClaimResourcePlural).
    56  // 		WithShortNames([]string{apis.BlockDeviceClaimResourceShort}).
    57  // 		WithPrinterColumns("BlockDeviceName", "string", ".spec.blockDeviceName").
    58  // 		WithPrinterColumns("Phase", "string", ".status.phase").
    59  // 		WithPrinterColumns("Age", "date", ".metadata.creationTimestamp")
    60  // 	return crdBuilder.Build()
    61  // }