github.com/alex123012/deckhouse-controller-tools@v0.0.0-20230510090815-d594daf1af8c/pkg/crd/markers/doc.go (about)

     1  /*
     2  Copyright 2019 The Kubernetes 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 markers defines markers for generating schema valiation
    18  // and CRD structure.
    19  //
    20  // All markers related to CRD generation live in AllDefinitions.
    21  //
    22  // # Validation Markers
    23  //
    24  // Validation markers have values that implement ApplyToSchema
    25  // (crd.SchemaMarker).  Any marker implementing this will automatically
    26  // be run after the rest of a given schema node has been generated.
    27  // Markers that need to be run before any other markers can also
    28  // implement ApplyFirst, but this is discouraged and may change
    29  // in the future.
    30  //
    31  // All validation markers start with "+kubebuilder:validation", and
    32  // have the same name as their type name.
    33  //
    34  // # CRD Markers
    35  //
    36  // Markers that modify anything in the CRD itself *except* for the schema
    37  // implement ApplyToCRD (crd.CRDMarker).  They are expected to detect whether
    38  // they should apply themselves to a specific version in the CRD (as passed to
    39  // them), or to the root-level CRD for legacy cases.  They are applied *after*
    40  // the rest of the CRD is computed.
    41  //
    42  // # Misc
    43  //
    44  // This package also defines the "+groupName" and "+versionName" package-level
    45  // markers, for defining package<->group-version mappings.
    46  package markers