Package org.cdk8s.plus25.k8s
Class CustomResourceDefinitionSpec.Builder
- java.lang.Object
-
- org.cdk8s.plus25.k8s.CustomResourceDefinitionSpec.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<CustomResourceDefinitionSpec>
- Enclosing interface:
- CustomResourceDefinitionSpec
@Stability(Stable) public static final class CustomResourceDefinitionSpec.Builder extends Object implements software.amazon.jsii.Builder<CustomResourceDefinitionSpec>
A builder forCustomResourceDefinitionSpec
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
group
@Stability(Stable) public CustomResourceDefinitionSpec.Builder group(String group)
Sets the value ofCustomResourceDefinitionSpec.getGroup()- Parameters:
group- group is the API group of the defined custom resource. This parameter is required. The custom resources are served under/apis/<group>/.... Must match the name of the CustomResourceDefinition (in the form<names.plural>.<group>).- Returns:
this
-
names
@Stability(Stable) public CustomResourceDefinitionSpec.Builder names(CustomResourceDefinitionNames names)
Sets the value ofCustomResourceDefinitionSpec.getNames()- Parameters:
names- names specify the resource and kind names for the custom resource. This parameter is required.- Returns:
this
-
scope
@Stability(Stable) public CustomResourceDefinitionSpec.Builder scope(String scope)
Sets the value ofCustomResourceDefinitionSpec.getScope()- Parameters:
scope- scope indicates whether the defined custom resource is cluster- or namespace-scoped. This parameter is required. Allowed values areClusterandNamespaced.- Returns:
this
-
versions
@Stability(Stable) public CustomResourceDefinitionSpec.Builder versions(List<? extends CustomResourceDefinitionVersion> versions)
Sets the value ofCustomResourceDefinitionSpec.getVersions()- Parameters:
versions- versions is the list of all API versions of the defined custom resource. This parameter is required. Version names are used to compute the order in which served versions are listed in API discovery. If the version string is "kube-like", it will sort above non "kube-like" version strings, which are ordered lexicographically. "Kube-like" versions start with a "v", then are followed by a number (the major version), then optionally the string "alpha" or "beta" and another number (the minor version). These are sorted first by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing major version, then minor version. An example sorted list of versions: v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.- Returns:
this
-
conversion
@Stability(Stable) public CustomResourceDefinitionSpec.Builder conversion(CustomResourceConversion conversion)
Sets the value ofCustomResourceDefinitionSpec.getConversion()- Parameters:
conversion- conversion defines conversion settings for the CRD.- Returns:
this
-
preserveUnknownFields
@Stability(Stable) public CustomResourceDefinitionSpec.Builder preserveUnknownFields(Boolean preserveUnknownFields)
Sets the value ofCustomResourceDefinitionSpec.getPreserveUnknownFields()- Parameters:
preserveUnknownFields- preserveUnknownFields indicates that object fields which are not specified in the OpenAPI schema should be preserved when persisting to storage. apiVersion, kind, metadata and known fields inside metadata are always preserved. This field is deprecated in favor of settingx-preserve-unknown-fieldsto true inspec.versions[*].schema.openAPIV3Schema. See https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#pruning-versus-preserving-unknown-fields for details.- Returns:
this
-
build
@Stability(Stable) public CustomResourceDefinitionSpec build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<CustomResourceDefinitionSpec>- Returns:
- a new instance of
CustomResourceDefinitionSpec - Throws:
NullPointerException- if any required attribute was not provided
-
-