From a2fcfb49f75c7f327a0c9f79bbfaa70b5c8669c5 Mon Sep 17 00:00:00 2001 From: Aaron Carr Date: Mon, 27 Jan 2025 17:04:40 +0000 Subject: [PATCH] Added Plural and Kind definitions to allow k8s 1.32.2 generation --- Sources/SwiftkubeModelGen/Model/Types.swift | 188 +++++++++++--------- 1 file changed, 105 insertions(+), 83 deletions(-) diff --git a/Sources/SwiftkubeModelGen/Model/Types.swift b/Sources/SwiftkubeModelGen/Model/Types.swift index a945df1..93ab132 100644 --- a/Sources/SwiftkubeModelGen/Model/Types.swift +++ b/Sources/SwiftkubeModelGen/Model/Types.swift @@ -57,67 +57,87 @@ let IgnoredSchemaTypes = Set([ ]) let PluralNames = [ - "APIService": "apiservices", - "AuditSink": "auditsinks", - "Binding": "bindings", - "CertificateSigningRequest": "certificatesigningrequests", - "ClusterRole": "clusterroles", - "ClusterRoleBinding": "clusterrolebindings", - "ComponentStatus": "componentstatuses", - "ConfigMap": "configmaps", - "ControllerRevision": "controllerrevisions", - "CronJob": "cronjobs", - "CSIDriver": "csidrivers", - "CSINode": "csinodes", - "CSIStorageCapacity": "csistoragecapacities", - "CustomResourceDefinition": "customresourcedefinitions", - "DaemonSet": "daemonsets", - "Deployment": "deployments", - "Endpoints": "endpoints", - "EndpointSlice": "endpointslices", - "Event": "events", - "FlowSchema": "flowschemas", - "HorizontalPodAutoscaler": "horizontalpodautoscalers", - "Ingress": "ingresses", - "IngressClass": "ingressclasses", - "Job": "jobs", - "Lease": "leases", - "LimitRange": "limitranges", - "LocalSubjectAccessReview": "localsubjectaccessreviews", - "MutatingWebhookConfiguration": "mutatingwebhookconfigurations", - "Namespace": "namespaces", - "NetworkPolicy": "networkpolicies", - "Node": "nodes", - "NodeMetrics": "nodes", - "PersistentVolume": "persistentvolumes", - "PersistentVolumeClaim": "persistentvolumeclaims", - "Pod": "pods", - "PodDisruptionBudget": "poddisruptionbudgets", - "PodMetrics": "pods", - "PodPreset": "podpresets", - "PodSecurityPolicy": "podsecuritypolicies", - "PodTemplate": "podtemplates", - "PriorityClass": "priorityclasses", - "PriorityLevelConfiguration": "prioritylevelconfigurations", - "ReplicaSet": "replicasets", - "ReplicationController": "replicationcontrollers", - "ResourceQuota": "resourcequotas", - "Role": "roles", - "RoleBinding": "rolebindings", - "RuntimeClass": "runtimeclasses", - "Secret": "secrets", - "SelfSubjectAccessReview": "selfsubjectaccessreviews", - "SelfSubjectRulesReview": "selfsubjectrulesreviews", - "Service": "services", - "ServiceAccount": "serviceaccounts", - "StatefulSet": "statefulsets", - "StorageClass": "storageclasses", - "StorageVersion": "storageversions", - "SubjectAccessReview": "subjectaccessreviews", - "TokenRequest": "tokenrequests", - "TokenReview": "tokenreviews", - "ValidatingWebhookConfiguration": "validatingwebhookconfigurations", - "VolumeAttachment": "volumeattachments", + "APIService": "apiservices", + "AuditSink": "auditsinks", + "Binding": "bindings", + "CertificateSigningRequest": "certificatesigningrequests", + "ClusterCIDR": "clustercidrs", + "ClusterRole": "clusterroles", + "ClusterRoleBinding": "clusterrolebindings", + "ClusterTrustBundle": "clustertrustbundles", + "ComponentStatus": "componentstatuses", + "ConfigMap": "configmaps", + "ControllerRevision": "controllerrevisions", + "CronJob": "cronjobs", + "CSIDriver": "csidrivers", + "CSINode": "csinodes", + "CSIStorageCapacity": "csistoragecapacities", + "CustomResourceDefinition": "customresourcedefinitions", + "DaemonSet": "daemonsets", + "Deployment": "deployments", + "DeviceClass": "deviceclasses", + "Endpoints": "endpoints", + "EndpointSlice": "endpointslices", + "Event": "events", + "FlowSchema": "flowschemas", + "HorizontalPodAutoscaler": "horizontalpodautoscalers", + "Ingress": "ingresses", + "IngressClass": "ingressclasses", + "IPAddress": "ipaddresses", + "Job": "jobs", + "Lease": "leases", + "LeaseCandidate": "leasecandidates", + "LimitRange": "limitranges", + "LocalSubjectAccessReview": "localsubjectaccessreviews", + "MutatingAdmissionPolicy": "mutatingadmissionpolicies", + "MutatingAdmissionPolicyBinding": "mutatingadmissionpolicybindings", + "MutatingWebhookConfiguration": "mutatingwebhookconfigurations", + "Namespace": "namespaces", + "NetworkPolicy": "networkpolicies", + "Node": "nodes", + "NodeMetrics": "nodes", + "PersistentVolume": "persistentvolumes", + "PersistentVolumeClaim": "persistentvolumeclaims", + "Pod": "pods", + "PodDisruptionBudget": "poddisruptionbudgets", + "PodMetrics": "pods", + "PodPreset": "podpresets", + "PodSchedulingContext": "podschedulingcontexts", + "PodSecurityPolicy": "podsecuritypolicies", + "PodTemplate": "podtemplates", + "PriorityClass": "priorityclasses", + "PriorityLevelConfiguration": "prioritylevelconfigurations", + "ReplicaSet": "replicasets", + "ReplicationController": "replicationcontrollers", + "ResourceClaim": "resourceclaims", + "ResourceClaimParameters": "resourceclaimparameters", + "ResourceClaimTemplate": "resourceclaimtemplates", + "ResourceClass": "resourceclasses", + "ResourceClassParameters": "resourceclassparameters", + "ResourceQuota": "resourcequotas", + "ResourceSlice": "resourceslices", + "Role": "roles", + "RoleBinding": "rolebindings", + "RuntimeClass": "runtimeclasses", + "Secret": "secrets", + "SelfSubjectAccessReview": "selfsubjectaccessreviews", + "SelfSubjectReview": "selfsubjectreviews", + "SelfSubjectRulesReview": "selfsubjectrulesreviews", + "Service": "services", + "ServiceAccount": "serviceaccounts", + "ServiceCIDR": "servicecidrs", + "StatefulSet": "statefulsets", + "StorageClass": "storageclasses", + "StorageVersion": "storageversions", + "StorageVersionMigration": "storageversionmigrations", + "SubjectAccessReview": "subjectaccessreviews", + "TokenRequest": "tokenrequests", + "TokenReview": "tokenreviews", + "ValidatingAdmissionPolicy": "validatingadmissionpolicies", + "ValidatingAdmissionPolicyBinding": "validatingadmissionpolicybindings", + "ValidatingWebhookConfiguration": "validatingwebhookconfigurations", + "VolumeAttachment": "volumeattachments", + "VolumeAttributesClass": "volumeattributesclasses", ] let ShortNames = [ @@ -152,28 +172,30 @@ let ShortNames = [ ] let APIGroups = [ - "admissionregistration.k8s.io": "AdmissionRegistration", - "apiextensions.k8s.io": "APIExtensions", - "apiregistration.k8s.io": "APIRegistration", - "apps": "Apps", - "authentication.k8s.io": "Authentication", - "authorization.k8s.io": "Authorization", - "autoscaling": "AutoScaling", - "batch": "Batch", - "certificates.k8s.io": "Certificates", - "coordination.k8s.io": "Coordination", - "core": "Core", - "discovery.k8s.io": "Discovery", - "events.k8s.io": "Events", - "extensions": "Extensions", - "flowcontrol.apiserver.k8s.io": "FlowControl", - "internal.apiserver.k8s.io": "Internal", - "networking.k8s.io": "Networking", - "node.k8s.io": "Node", - "policy": "Policy", - "rbac.authorization.k8s.io": "RBAC", - "scheduling.k8s.io": "Scheduling", - "storage.k8s.io": "Storage", + "admissionregistration.k8s.io": "AdmissionRegistration", + "apiextensions.k8s.io": "APIExtensions", + "apiregistration.k8s.io": "APIRegistration", + "apps": "Apps", + "authentication.k8s.io": "Authentication", + "authorization.k8s.io": "Authorization", + "autoscaling": "AutoScaling", + "batch": "Batch", + "certificates.k8s.io": "Certificates", + "coordination.k8s.io": "Coordination", + "core": "Core", + "discovery.k8s.io": "Discovery", + "events.k8s.io": "Events", + "extensions": "Extensions", + "flowcontrol.apiserver.k8s.io": "FlowControl", + "internal.apiserver.k8s.io": "Internal", + "networking.k8s.io": "Networking", + "node.k8s.io": "Node", + "policy": "Policy", + "rbac.authorization.k8s.io": "RBAC", + "resource.k8s.io": "Resource", + "scheduling.k8s.io": "Scheduling", + "storage.k8s.io": "Storage", + "storagemigration.k8s.io": "StorageVersionMigration" ] let Keywords = Set(["continue", "default", "internal", "operator", "protocol"])