From 7ac03867c337f57c896f0b8b4529703de474c5d5 Mon Sep 17 00:00:00 2001 From: Chris Doan Date: Tue, 11 Aug 2026 18:41:57 -0700 Subject: [PATCH] ROSAENG-65009: close passthrough codegen round-trip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire codegen-registry output into passthrough-gen so the pipeline is: committed markers → scanner → registry → passthrough-gen → same file. - Remove stale embedded registry, require -registry flag - Add -type-overrides flag for local mirror types (ClusterConfiguration) - Fix conversion-gen and scanner to parse zz_generated.passthrough.go - Extract parseStructType() to reduce cyclomatic complexity - Update Makefile: codegen-passthrough depends on codegen-registry - Add design doc at docs/api/codegen-design.md Co-Authored-By: Claude Opus 4.6 --- Makefile | 7 +- .../hostedclusterspecpassthrough_types.go | 54 -- .../public/nodepoolspecpassthrough_types.go | 20 - api/v1alpha1/public/zz_generated.deepcopy.go | 39 +- api/v1alpha1/zz_generated.deepcopy.go | 2 +- api/v1alpha1/zz_generated.passthrough.go | 14 +- docs/api/codegen-design.md | 149 +++++ .../cmd/passthrough-gen/field_metadata.json | 577 ------------------ hack/api-codegen/cmd/passthrough-gen/main.go | 62 +- hack/api-codegen/pkg/conversion/generator.go | 52 +- hack/api-codegen/pkg/markers/scanner.go | 12 +- hack/api-codegen/pkg/passthrough/loader.go | 11 +- .../pkg/passthrough/loader_test.go | 35 ++ hack/api-codegen/pkg/passthrough/types.go | 4 + .../pkg/registry/field_metadata.go | 428 +++++++++++++ .../pkg/registry/field_metadata.json | 428 +++++++++++++ platform-api/pkg/conversion/types.go | 93 +++ 17 files changed, 1227 insertions(+), 760 deletions(-) create mode 100644 docs/api/codegen-design.md delete mode 100644 hack/api-codegen/cmd/passthrough-gen/field_metadata.json diff --git a/Makefile b/Makefile index 6c79a3ff..15d5d542 100644 --- a/Makefile +++ b/Makefile @@ -334,12 +334,15 @@ generate-clientset: codegen-conversion $(CLIENT_GEN) $(BRIDGE_GEN) verify-clientset: generate-clientset git diff --exit-code clientset/ -codegen-passthrough: build-api-codegen +codegen-passthrough: codegen-registry cd api && ../bin/passthrough-gen \ -import-path github.com/openshift/hypershift/api/hypershift/v1beta1 \ -types HostedClusterSpec,NodePoolSpec \ -output-dir v1alpha1 \ - -package v1alpha1 + -package v1alpha1 \ + -registry ../hack/api-codegen/pkg/registry/field_metadata.json \ + -type-overrides "hypershiftv1beta1.ClusterConfiguration=ClusterConfiguration" + rm -f api/v1alpha1/zz_generated.passthrough.go.raw codegen-registry: codegen-passthrough generate-deepcopy build-api-codegen ./bin/marker-scanner \ diff --git a/api/v1alpha1/public/hostedclusterspecpassthrough_types.go b/api/v1alpha1/public/hostedclusterspecpassthrough_types.go index 337159da..f728d760 100644 --- a/api/v1alpha1/public/hostedclusterspecpassthrough_types.go +++ b/api/v1alpha1/public/hostedclusterspecpassthrough_types.go @@ -2,60 +2,6 @@ package public -import ( - hypershiftv1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" -) - // HostedClusterSpecPassthrough mirrors HostedClusterSpec from upstream HyperShift type HostedClusterSpecPassthrough struct { - // release specifies the desired OCP release payload for all the hosted cluster components. - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=mutable - Release hypershiftv1beta1.Release `json:"release"` - // channel is an identifier for explicitly requesting that a non-default set of updates be applied to this cluster. - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=service-set - Channel string `json:"channel,omitempty"` - // platform specifies the underlying infrastructure provider for the cluster - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=mutable - Platform hypershiftv1beta1.PlatformSpec `json:"platform"` - // networking specifies network configuration for the hosted cluster. - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=mutable - Networking hypershiftv1beta1.ClusterNetworking `json:"networking"` - // autoNode specifies the configuration for automatic node provisioning and lifecycle management. - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=service-set - // +optional - AutoNode hypershiftv1beta1.AutoNode `json:"autoNode,omitzero"` - // etcd specifies configuration for the control plane etcd cluster. The - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=mutable - Etcd hypershiftv1beta1.EtcdSpec `json:"etcd"` - // issuerURL is an OIDC issuer URL which will be used as the issuer in all - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=mutable - IssuerURL string `json:"issuerURL,omitempty"` - // configuration specifies configuration for individual OCP components in the - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=service-set - Configuration *ClusterConfiguration `json:"configuration,omitempty"` - // operatorConfiguration specifies configuration for individual OCP operators in the cluster. - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=service-set - OperatorConfiguration *hypershiftv1beta1.OperatorConfiguration `json:"operatorConfiguration,omitempty"` - // imageContentSources specifies image mirrors that can be used by cluster - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=mutable - // +kubebuilder:validation:MaxItems=50 - ImageContentSources []hypershiftv1beta1.ImageContentSource `json:"imageContentSources,omitempty"` - // fips indicates whether this cluster's nodes will be running in FIPS mode. - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=service-set - FIPS bool `json:"fips"` - // pausedUntil is a field that can be used to pause reconciliation on the HostedCluster controller, resulting in any change to the HostedCluster being ignored. - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=service-set - PausedUntil *string `json:"pausedUntil,omitempty"` } diff --git a/api/v1alpha1/public/nodepoolspecpassthrough_types.go b/api/v1alpha1/public/nodepoolspecpassthrough_types.go index cf8cf446..9a298a15 100644 --- a/api/v1alpha1/public/nodepoolspecpassthrough_types.go +++ b/api/v1alpha1/public/nodepoolspecpassthrough_types.go @@ -2,26 +2,6 @@ package public -import ( - hypershiftv1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" -) - // NodePoolSpecPassthrough mirrors NodePoolSpec from upstream HyperShift type NodePoolSpecPassthrough struct { - // clusterName is the name of the HostedCluster this NodePool belongs to. - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=mutable - ClusterName string `json:"clusterName"` - // release specifies the OCP release used for this NodePool. It drives the machine ignition configuration (including - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=mutable - Release hypershiftv1beta1.Release `json:"release"` - // platform specifies the underlying infrastructure provider for the NodePool - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=mutable - Platform hypershiftv1beta1.NodePoolPlatform `json:"platform"` - // replicas is the desired number of nodes the pool should maintain. If unset, the controller default value is 0. - // +k8s:openapi-gen=true - // +hyperfleet:write-mode=mutable - Replicas *int32 `json:"replicas,omitempty"` } diff --git a/api/v1alpha1/public/zz_generated.deepcopy.go b/api/v1alpha1/public/zz_generated.deepcopy.go index 5e1925da..50a98cef 100644 --- a/api/v1alpha1/public/zz_generated.deepcopy.go +++ b/api/v1alpha1/public/zz_generated.deepcopy.go @@ -5,7 +5,6 @@ package public import ( - "github.com/openshift/hypershift/api/hypershift/v1beta1" "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) @@ -120,7 +119,7 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { (*out)[key] = val } } - in.HostedCluster.DeepCopyInto(&out.HostedCluster) + out.HostedCluster = in.HostedCluster if in.ControlPlaneUpgradePolicy != nil { in, out := &in.ControlPlaneUpgradePolicy, &out.ControlPlaneUpgradePolicy *out = new(ControlPlaneUpgradePolicySpec) @@ -257,33 +256,6 @@ func (in *FileSpec) DeepCopy() *FileSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HostedClusterSpecPassthrough) DeepCopyInto(out *HostedClusterSpecPassthrough) { *out = *in - out.Release = in.Release - in.Platform.DeepCopyInto(&out.Platform) - in.Networking.DeepCopyInto(&out.Networking) - out.AutoNode = in.AutoNode - in.Etcd.DeepCopyInto(&out.Etcd) - if in.Configuration != nil { - in, out := &in.Configuration, &out.Configuration - *out = new(ClusterConfiguration) - (*in).DeepCopyInto(*out) - } - if in.OperatorConfiguration != nil { - in, out := &in.OperatorConfiguration, &out.OperatorConfiguration - *out = new(v1beta1.OperatorConfiguration) - (*in).DeepCopyInto(*out) - } - if in.ImageContentSources != nil { - in, out := &in.ImageContentSources, &out.ImageContentSources - *out = make([]v1beta1.ImageContentSource, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.PausedUntil != nil { - in, out := &in.PausedUntil, &out.PausedUntil - *out = new(string) - **out = **in - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostedClusterSpecPassthrough. @@ -680,7 +652,7 @@ func (in *NodePoolSpec) DeepCopyInto(out *NodePoolSpec) { (*out)[key] = val } } - in.NodePool.DeepCopyInto(&out.NodePool) + out.NodePool = in.NodePool } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePoolSpec. @@ -696,13 +668,6 @@ func (in *NodePoolSpec) DeepCopy() *NodePoolSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodePoolSpecPassthrough) DeepCopyInto(out *NodePoolSpecPassthrough) { *out = *in - out.Release = in.Release - in.Platform.DeepCopyInto(&out.Platform) - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePoolSpecPassthrough. diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 4a6cea83..e3ed3108 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -376,7 +376,7 @@ func (in *HostedClusterSpecPassthrough) DeepCopyInto(out *HostedClusterSpecPasst } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(v1beta1.ClusterConfiguration) + *out = new(ClusterConfiguration) (*in).DeepCopyInto(*out) } if in.OperatorConfiguration != nil { diff --git a/api/v1alpha1/zz_generated.passthrough.go b/api/v1alpha1/zz_generated.passthrough.go index 9144772a..56e4998f 100644 --- a/api/v1alpha1/zz_generated.passthrough.go +++ b/api/v1alpha1/zz_generated.passthrough.go @@ -37,7 +37,7 @@ type HostedClusterSpecPassthrough struct { // +optional UpdateService configv1.URL `json:"updateService,omitempty"` // channel is an identifier for explicitly requesting that a non-default set of updates be applied to this cluster. - // +k8s:openapi-gen=true + // +k8s:openapi-gen=false // +hyperfleet:write-mode=service-set // +optional Channel string `json:"channel,omitempty"` @@ -77,7 +77,7 @@ type HostedClusterSpecPassthrough struct { // +optional Autoscaling hypershiftv1beta1.ClusterAutoscaling `json:"autoscaling,omitempty"` // autoNode specifies the configuration for automatic node provisioning and lifecycle management. - // +k8s:openapi-gen=true + // +k8s:openapi-gen=false // +hyperfleet:write-mode=service-set // +optional AutoNode hypershiftv1beta1.AutoNode `json:"autoNode,omitzero"` @@ -112,12 +112,12 @@ type HostedClusterSpecPassthrough struct { // +optional ServiceAccountSigningKey *corev1.LocalObjectReference `json:"serviceAccountSigningKey,omitempty"` // configuration specifies configuration for individual OCP components in the - // +k8s:openapi-gen=true + // +k8s:openapi-gen=false // +hyperfleet:write-mode=service-set // +optional - Configuration *hypershiftv1beta1.ClusterConfiguration `json:"configuration,omitempty"` + Configuration *ClusterConfiguration `json:"configuration,omitempty"` // operatorConfiguration specifies configuration for individual OCP operators in the cluster. - // +k8s:openapi-gen=true + // +k8s:openapi-gen=false // +hyperfleet:write-mode=service-set // +optional OperatorConfiguration *hypershiftv1beta1.OperatorConfiguration `json:"operatorConfiguration,omitempty"` @@ -142,12 +142,12 @@ type HostedClusterSpecPassthrough struct { // +optional SecretEncryption *hypershiftv1beta1.SecretEncryptionSpec `json:"secretEncryption,omitempty"` // fips indicates whether this cluster's nodes will be running in FIPS mode. - // +k8s:openapi-gen=true + // +k8s:openapi-gen=false // +hyperfleet:write-mode=service-set // +optional FIPS bool `json:"fips"` // pausedUntil is a field that can be used to pause reconciliation on the HostedCluster controller, resulting in any change to the HostedCluster being ignored. - // +k8s:openapi-gen=true + // +k8s:openapi-gen=false // +hyperfleet:write-mode=service-set // +optional PausedUntil *string `json:"pausedUntil,omitempty"` diff --git a/docs/api/codegen-design.md b/docs/api/codegen-design.md new file mode 100644 index 00000000..ec90aa1a --- /dev/null +++ b/docs/api/codegen-design.md @@ -0,0 +1,149 @@ +# Passthrough Codegen Design + +## Overview + +The passthrough codegen pipeline generates Go struct types that mirror upstream HyperShift API types (`HostedClusterSpec`, `NodePoolSpec`) into the HyperFleet `api/v1alpha1` package. Each mirrored struct (e.g., `HostedClusterSpecPassthrough`) carries curated markers that control field visibility, mutability, validation, and feature gating. These markers drive all downstream codegen: OpenAPI schemas, REST types, conversion functions, and CRD variants. + +## Goals + +1. When HyperShift adds, removes, or renames fields, `make codegen-passthrough` picks up the change and adds it with safe defaults. +2. Human-curated markers (visibility, write-mode, validation constraints) survive the regeneration round-trip. +3. A single source of truth (the committed passthrough file) feeds both the field registry and the regenerated output. +4. The pipeline is verifiable: `git diff --exit-code` after regeneration confirms nothing drifted. + +## File roles + +| File | Role | +|------|------| +| `api/v1alpha1/zz_generated.passthrough.go` | The committed passthrough types. Human-curated markers live here. This is the source of truth for field policy. Despite the `zz_generated` prefix, this file is intentionally hand-edited to curate markers, then regenerated to pick up upstream struct changes. | +| `api/v1alpha1/configuration.go` | Local mirror of `hypershiftv1beta1.ClusterConfiguration` with granular markers on nested fields (kubelet, machineConfig). Referenced by the passthrough file via a type override. | +| `hack/api-codegen/pkg/registry/field_metadata.json` | Generated field registry (JSON). Produced by `marker-scanner` from the passthrough file. Consumed by `passthrough-gen`, `conversion-gen`, and `openapi-gen`. | +| `hack/api-codegen/pkg/registry/field_metadata.go` | Generated field registry (Go). Same data as the JSON, importable by Go code. | + +## Pipeline + +``` + ┌──────────────────────────────────────────┐ + │ api/v1alpha1/zz_generated.passthrough.go │ + │ (committed, human-curated markers) │ + └─────────────┬────────────────────────────┘ + │ + make codegen-registry + (marker-scanner scans markers) + │ + ▼ + ┌──────────────────────────────────────┐ + │ hack/api-codegen/pkg/registry/ │ + │ field_metadata.json │ + │ field_metadata.go │ + └─────────────┬────────────────────────┘ + │ + make codegen-passthrough + (passthrough-gen reads registry + + HyperShift source via go list) + │ + ▼ + ┌──────────────────────────────────────────┐ + │ api/v1alpha1/zz_generated.passthrough.go │ + │ (regenerated, markers preserved) │ + └──────────────────────────────────────────┘ + │ + ┌──────────────┼──────────────┐ + ▼ ▼ ▼ + codegen-conversion generate-openapi codegen (CRD verify) +``` + +The loop is closed: the committed file feeds the registry, and the registry feeds regeneration. When the round-trip is correct, `git diff` after regeneration shows no changes. + +## Curation workflow + +### Adding markers to an existing field + +1. Edit `api/v1alpha1/zz_generated.passthrough.go` — change markers on the field (e.g., set `+k8s:openapi-gen=true` to make it visible, or add `+kubebuilder:validation:MaxItems=50`). +2. Run `make codegen-registry` to update the registry. +3. Run `make codegen-passthrough` to verify the round-trip (should produce no diff). +4. Run downstream codegen (`make codegen-conversion`, `make generate-openapi`) to propagate the change to REST types and OpenAPI. +5. Commit. + +### Picking up new fields from a HyperShift bump + +1. Update the HyperShift dependency in `api/go.mod` and `hack/api-codegen/go.mod`. +2. Run `make codegen-registry` (unchanged — scans existing committed file). +3. Run `make codegen-passthrough` — new fields appear with safe defaults: + - `+k8s:openapi-gen=false` (hidden from public API) + - `+hyperfleet:write-mode=service-set` (not customer-writable) +4. Review the diff. Curate markers on any new fields that should be visible or mutable. +5. Re-run `make codegen-registry && make codegen-passthrough` to verify round-trip. +6. Run downstream codegen and commit. + +### Removing fields after a HyperShift bump + +If HyperShift removes a field from `HostedClusterSpec` or `NodePoolSpec`, `make codegen-passthrough` will regenerate the file without that field. The registry will contain a stale entry for it, but that is harmless — unused registry entries don't affect codegen. The stale entry is cleaned up the next time `make codegen-registry` runs after the regenerated file is committed. + +## Marker types + +The registry captures the following marker categories from the passthrough file: + +| Marker | Registry field | Purpose | +|--------|---------------|---------| +| `+k8s:openapi-gen=false` | `hidden: true` | Field excluded from public OpenAPI and REST types | +| `+hyperfleet:write-mode=mutable\|immutable\|service-set` | `writeMode` | Controls customer mutability | +| `+openshift:enable:FeatureGate=X` | `featureGate` | Field gated behind a feature flag | +| `+hyperfleet:validation:FeatureGateAwareWriteMode:...` | `featureGateAwareWriteModes` | Write-mode varies by active feature gates | +| `+kubebuilder:validation:*` | `extraMarkers` | Validation constraints (MaxItems, MaxProperties, etc.) | +| `+optional` | `extraMarkers` | Field is optional (affects CRD schema) | + +The first four are modeled as structured fields in the registry. The last two are stored as opaque strings in `extraMarkers` and passed through verbatim to the generated output. + +## Type overrides + +The passthrough file uses `*ClusterConfiguration` (a local type defined in `api/v1alpha1/configuration.go`) instead of the upstream `*hypershiftv1beta1.ClusterConfiguration`. This allows HyperFleet to add granular markers to nested fields (kubelet config, machineConfig) that the upstream type doesn't have. + +Type overrides are specified via the `-type-overrides` flag on `passthrough-gen`: + +``` +-type-overrides "hypershiftv1beta1.ClusterConfiguration=ClusterConfiguration" +``` + +The override is applied during type resolution, before import collection, so local types don't generate unnecessary import statements. + +## Safe defaults + +When `passthrough-gen` encounters a field from HyperShift that has no entry in the registry (i.e., a newly added field), it applies safe defaults: + +- `+k8s:openapi-gen=false` — hidden from the public API until explicitly curated +- `+hyperfleet:write-mode=service-set` — not customer-writable until explicitly allowed + +This ensures new upstream fields don't accidentally become visible or mutable. + +## Makefile targets + +``` +make codegen-passthrough # registry → passthrough-gen → zz_generated.passthrough.go +make codegen-registry # marker-scanner → field_metadata.{json,go} +make codegen # full pipeline (registry + verify) +make verify-codegen # CI check: codegen outputs match committed files +``` + +### Dependency chain + +``` +codegen-passthrough + └─ codegen-registry + ├─ generate (controller-gen deepcopy) + └─ build-api-codegen (builds passthrough-gen, marker-scanner, etc.) +``` + +`codegen-passthrough` depends on `codegen-registry` to ensure the registry JSON is fresh before regeneration. + +## Verification + +The round-trip is verified by: + +```bash +make codegen-registry +make codegen-passthrough +git diff --exit-code api/v1alpha1/zz_generated.passthrough.go +``` + +This can be added to CI via `verify-codegen` or a dedicated `verify-passthrough` target. diff --git a/hack/api-codegen/cmd/passthrough-gen/field_metadata.json b/hack/api-codegen/cmd/passthrough-gen/field_metadata.json deleted file mode 100644 index 167ecff8..00000000 --- a/hack/api-codegen/cmd/passthrough-gen/field_metadata.json +++ /dev/null @@ -1,577 +0,0 @@ -[ - { - "fieldPath": "allowedUnsafeSysctls", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "apiServer", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "authentication", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "containerLogMaxFiles", - "writeMode": "mutable" - }, - { - "fieldPath": "containerLogMaxSize", - "writeMode": "mutable" - }, - { - "fieldPath": "cpuManagerPolicy", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "cpuManagerPolicyOptions", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "cpuManagerReconcilePeriod", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "evictionHard", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "evictionSoft", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "evictionSoftGracePeriod", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "featureGate", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "image", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "imageGCHighThresholdPercent", - "writeMode": "mutable" - }, - { - "fieldPath": "imageGCLowThresholdPercent", - "writeMode": "mutable" - }, - { - "fieldPath": "imageMinimumGCAge", - "writeMode": "mutable" - }, - { - "fieldPath": "ingress", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "kubeReserved", - "writeMode": "immutable" - }, - { - "fieldPath": "kubelet", - "writeMode": "service-set" - }, - { - "fieldPath": "kubelet.allowedUnsafeSysctls", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "kubelet.containerLogMaxFiles", - "writeMode": "mutable" - }, - { - "fieldPath": "kubelet.containerLogMaxSize", - "writeMode": "mutable" - }, - { - "fieldPath": "kubelet.cpuManagerPolicy", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "kubelet.cpuManagerPolicyOptions", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "kubelet.cpuManagerReconcilePeriod", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "kubelet.evictionHard", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "kubelet.evictionSoft", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "kubelet.evictionSoftGracePeriod", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "kubelet.imageGCHighThresholdPercent", - "writeMode": "mutable" - }, - { - "fieldPath": "kubelet.imageGCLowThresholdPercent", - "writeMode": "mutable" - }, - { - "fieldPath": "kubelet.imageMinimumGCAge", - "writeMode": "mutable" - }, - { - "fieldPath": "kubelet.kubeReserved", - "writeMode": "immutable" - }, - { - "fieldPath": "kubelet.maxPods", - "writeMode": "mutable" - }, - { - "fieldPath": "kubelet.memoryThrottlingFactor", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "kubelet.podPidsLimit", - "writeMode": "mutable" - }, - { - "fieldPath": "kubelet.registryBurst", - "writeMode": "mutable", - "featureGate": "HyperFleetKubeletAdvanced" - }, - { - "fieldPath": "kubelet.registryPullQPS", - "writeMode": "mutable", - "featureGate": "HyperFleetKubeletAdvanced" - }, - { - "fieldPath": "kubelet.serializeImagePulls", - "writeMode": "mutable", - "featureGate": "HyperFleetKubeletAdvanced" - }, - { - "fieldPath": "kubelet.streamingConnectionIdleTimeout", - "writeMode": "mutable" - }, - { - "fieldPath": "kubelet.systemReserved", - "writeMode": "immutable" - }, - { - "fieldPath": "kubelet.topologyManagerPolicy", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "kubelet.topologyManagerScope", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "machineConfig", - "writeMode": "service-set" - }, - { - "fieldPath": "machineConfig.allowedKernelArguments", - "writeMode": "immutable", - "featureGate": "HyperFleetMachineConfig" - }, - { - "fieldPath": "machineConfig.extensions", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "machineConfig.files", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "machineConfig.fips", - "writeMode": "immutable" - }, - { - "fieldPath": "machineConfig.kernelArguments", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "machineConfig.kernelType", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "machineConfig.systemdUnits", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "maxPods", - "writeMode": "mutable" - }, - { - "fieldPath": "memoryThrottlingFactor", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "network", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "oauth", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "podPidsLimit", - "writeMode": "mutable" - }, - { - "fieldPath": "proxy", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "registryBurst", - "writeMode": "mutable", - "featureGate": "HyperFleetKubeletAdvanced" - }, - { - "fieldPath": "registryPullQPS", - "writeMode": "mutable", - "featureGate": "HyperFleetKubeletAdvanced" - }, - { - "fieldPath": "scheduler", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "serializeImagePulls", - "writeMode": "mutable", - "featureGate": "HyperFleetKubeletAdvanced" - }, - { - "fieldPath": "spec.accountId", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.autoRepair", - "writeMode": "mutable" - }, - { - "fieldPath": "spec.creatorARN", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.deleteProtection", - "writeMode": "mutable" - }, - { - "fieldPath": "spec.displayName", - "writeMode": "mutable" - }, - { - "fieldPath": "spec.expirationTimestamp", - "writeMode": "mutable" - }, - { - "fieldPath": "spec.hostedCluster.additionalTrustBundle", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.auditWebhook", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.autoNode", - "writeMode": "service-set" - }, - { - "fieldPath": "spec.hostedCluster.autoscaling", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.capabilities", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.channel", - "writeMode": "service-set" - }, - { - "fieldPath": "spec.hostedCluster.clusterID", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.configuration", - "writeMode": "service-set" - }, - { - "fieldPath": "spec.hostedCluster.controlPlaneRelease", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.controllerAvailabilityPolicy", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.dns", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.etcd", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.fips", - "writeMode": "service-set" - }, - { - "fieldPath": "spec.hostedCluster.imageContentSources", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.infraID", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.infrastructureAvailabilityPolicy", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.issuerURL", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.kubeAPIServerDNSName", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.labels", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.networking", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.nodeSelector", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.olmCatalogPlacement", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.operatorConfiguration", - "writeMode": "service-set" - }, - { - "fieldPath": "spec.hostedCluster.pausedUntil", - "writeMode": "service-set" - }, - { - "fieldPath": "spec.hostedCluster.platform", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.pullSecret", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.release", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.secretEncryption", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.serviceAccountSigningKey", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.services", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.sshKey", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.tolerations", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.hostedCluster.updateService", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.internalId", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.internalPoolId", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.labels", - "writeMode": "mutable" - }, - { - "fieldPath": "spec.nodePool.arch", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.nodePool.autoScaling", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.nodePool.clusterName", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.nodePool.config", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.nodePool.management", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.nodePool.nodeDrainTimeout", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.nodePool.nodeLabels", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.nodePool.nodeVolumeDetachTimeout", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.nodePool.pausedUntil", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.nodePool.platform", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.nodePool.release", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.nodePool.replicas", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.nodePool.taints", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.nodePool.tuningConfig", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "spec.properties", - "writeMode": "mutable" - }, - { - "fieldPath": "spec.tags", - "writeMode": "mutable", - "featureGate": "HyperFleetAutoScaling" - }, - { - "fieldPath": "streamingConnectionIdleTimeout", - "writeMode": "mutable" - }, - { - "fieldPath": "systemReserved", - "writeMode": "immutable" - }, - { - "fieldPath": "topologyManagerPolicy", - "writeMode": "service-set", - "hidden": true - }, - { - "fieldPath": "topologyManagerScope", - "writeMode": "service-set", - "hidden": true - } -] \ No newline at end of file diff --git a/hack/api-codegen/cmd/passthrough-gen/main.go b/hack/api-codegen/cmd/passthrough-gen/main.go index cc6295b5..b6ef0d1d 100644 --- a/hack/api-codegen/cmd/passthrough-gen/main.go +++ b/hack/api-codegen/cmd/passthrough-gen/main.go @@ -1,7 +1,6 @@ package main import ( - _ "embed" "flag" "fmt" "log" @@ -12,27 +11,26 @@ import ( "github.com/openshift-online/rosa-hyperfleet-api/hack/api-codegen/pkg/passthrough" ) -//go:embed field_metadata.json -var embeddedRegistry []byte - func main() { var ( - sourceDir string - importPath string - outputDir string - typeNames string - registryFile string - packageName string - fieldPrefix string + sourceDir string + importPath string + outputDir string + typeNames string + registryFile string + packageName string + fieldPrefix string + typeOverrides string ) flag.StringVar(&sourceDir, "source-dir", "", "Directory containing source Go files (use this OR -import-path)") flag.StringVar(&importPath, "import-path", "", "Go import path to resolve via go.mod (use this OR -source-dir)") flag.StringVar(&outputDir, "output-dir", "", "Directory for generated output (required)") flag.StringVar(&typeNames, "types", "", "Comma-separated list of type names to generate (required)") - flag.StringVar(®istryFile, "registry", "", "Path to field metadata registry (optional)") + flag.StringVar(®istryFile, "registry", "", "Path to field metadata registry (required)") flag.StringVar(&packageName, "package", "v1alpha1", "Package name for generated code") flag.StringVar(&fieldPrefix, "field-prefix", "", "Dotted path prefix for registry lookups (e.g., spec.hostedCluster)") + flag.StringVar(&typeOverrides, "type-overrides", "", "Comma-separated type overrides in from=to format (e.g., hypershiftv1beta1.ClusterConfiguration=ClusterConfiguration)") flag.Parse() // Validate flags @@ -55,28 +53,19 @@ func main() { types[i] = strings.TrimSpace(types[i]) } - // Load registry: use explicit file if provided, otherwise use embedded default - var registry markers.FieldRegistry - if registryFile != "" { - log.Printf("Loading field registry from: %s", registryFile) - var err error - registry, err = markers.LoadRegistryFromJSON(registryFile) - if err != nil { - log.Fatalf("Failed to load registry: %v", err) - } - log.Printf("Loaded %d field markers from registry", len(registry)) - } else { - var err error - registry, err = markers.LoadRegistryFromJSONBytes(embeddedRegistry) - if err != nil { - log.Fatalf("Failed to load embedded registry: %v", err) - } - log.Printf("Loaded %d field markers from embedded registry", len(registry)) + // Load registry + if registryFile == "" { + log.Fatalf("-registry flag is required (path to field_metadata.json)") + } + log.Printf("Loading field registry from: %s", registryFile) + registry, err := markers.LoadRegistryFromJSON(registryFile) + if err != nil { + log.Fatalf("Failed to load registry: %v", err) } + log.Printf("Loaded %d field markers from registry", len(registry)) // Create generator var gen *passthrough.Generator - var err error if importPath != "" { log.Printf("Resolving import path: %s", importPath) @@ -92,6 +81,19 @@ func main() { gen.OutputPackage = packageName gen.FieldPrefix = fieldPrefix + if typeOverrides != "" { + overrides := make(map[string]string) + for _, pair := range strings.Split(typeOverrides, ",") { + parts := strings.SplitN(strings.TrimSpace(pair), "=", 2) + if len(parts) != 2 { + log.Fatalf("Invalid type override format %q, expected from=to", pair) + } + overrides[parts[0]] = parts[1] + } + gen.TypeOverrides = overrides + log.Printf("Type overrides: %v", overrides) + } + // Load source files log.Printf("Loading source files from: %s", gen.SourceDir) if err := gen.LoadSourceFiles(gen.SourceDir); err != nil { diff --git a/hack/api-codegen/pkg/conversion/generator.go b/hack/api-codegen/pkg/conversion/generator.go index 2d16f7fe..7085bc98 100644 --- a/hack/api-codegen/pkg/conversion/generator.go +++ b/hack/api-codegen/pkg/conversion/generator.go @@ -138,7 +138,7 @@ func (g *Generator) parseTypes() error { pkgs, err := parser.ParseDir(fset, dir, func(fi os.FileInfo) bool { name := fi.Name() return !strings.HasSuffix(name, "_test.go") && - !strings.HasPrefix(name, "zz_generated") + (!strings.HasPrefix(name, "zz_generated") || name == "zz_generated.passthrough.go") }, parser.ParseComments) if err != nil { return fmt.Errorf("parsing directory %s: %w", dir, err) @@ -165,29 +165,7 @@ func (g *Generator) parseTypes() error { structType, ok := typeSpec.Type.(*ast.StructType) if ok { - ti := &typeInfo{ - Name: typeName, - StructType: structType, - Doc: genDecl.Doc, - } - - for _, field := range structType.Fields.List { - if len(field.Names) == 0 { - ti.Embeds = append(ti.Embeds, g.exprToString(field.Type)) - continue - } - for _, name := range field.Names { - if !name.IsExported() { - continue - } - fi := g.parseField(typeName, field, name) - if fi != nil { - ti.Fields = append(ti.Fields, fi) - } - } - } - - g.typeInfos[typeName] = ti + g.typeInfos[typeName] = g.parseStructType(typeName, structType, genDecl.Doc) continue } @@ -239,6 +217,32 @@ func (g *Generator) parseTypes() error { return nil } +func (g *Generator) parseStructType(typeName string, structType *ast.StructType, doc *ast.CommentGroup) *typeInfo { + ti := &typeInfo{ + Name: typeName, + StructType: structType, + Doc: doc, + } + + for _, field := range structType.Fields.List { + if len(field.Names) == 0 { + ti.Embeds = append(ti.Embeds, g.exprToString(field.Type)) + continue + } + for _, name := range field.Names { + if !name.IsExported() { + continue + } + fi := g.parseField(typeName, field, name) + if fi != nil { + ti.Fields = append(ti.Fields, fi) + } + } + } + + return ti +} + // extractClientMarkers scans all comment groups in a file for +genclient and // +bridge:* markers that appear in floating comment blocks (separated by a blank // line from the type's doc comment). It associates each marker set with the diff --git a/hack/api-codegen/pkg/markers/scanner.go b/hack/api-codegen/pkg/markers/scanner.go index 10096dd8..aa3ca3f4 100644 --- a/hack/api-codegen/pkg/markers/scanner.go +++ b/hack/api-codegen/pkg/markers/scanner.go @@ -56,7 +56,7 @@ func (s *MarkerScanner) scanDir(dir string) error { // Skip test files and generated files name := fi.Name() return !strings.HasSuffix(name, "_test.go") && - !strings.HasPrefix(name, "zz_generated") + (!strings.HasPrefix(name, "zz_generated") || name == "zz_generated.passthrough.go") }, parser.ParseComments) if err != nil { @@ -241,12 +241,14 @@ func (s *MarkerScanner) extractMarkers(field *ast.Field, fieldPath string) *Fiel meta.FeatureGateAwareWriteModes = gatedModes } - // Only include in registry if at least one marker was found - if meta.Hidden || meta.WriteMode != "" || meta.FeatureGate != "" || len(meta.FeatureGateAwareWriteModes) > 0 { - return meta + // Only include in registry if at least one primary marker was found + hasPrimaryMarker := meta.Hidden || meta.WriteMode != "" || meta.FeatureGate != "" || + len(meta.FeatureGateAwareWriteModes) > 0 + if !hasPrimaryMarker { + return nil } - return nil + return meta } // getJSONName extracts the JSON field name from struct tags diff --git a/hack/api-codegen/pkg/passthrough/loader.go b/hack/api-codegen/pkg/passthrough/loader.go index 1b8fe279..6cfd4855 100644 --- a/hack/api-codegen/pkg/passthrough/loader.go +++ b/hack/api-codegen/pkg/passthrough/loader.go @@ -171,14 +171,19 @@ func isForwardedMarker(marker string) bool { return false } -// typeToString converts an AST type expression to a string +// typeToString converts an AST type expression to a string, applying type overrides. func (g *Generator) typeToString(expr ast.Expr) string { switch t := expr.(type) { case *ast.Ident: - // Check if this is a type from the source package that needs to be qualified typeName := t.Name if g.SourcePackageAlias != "" && g.isSourcePackageType(typeName) { - return g.SourcePackageAlias + "." + typeName + qualified := g.SourcePackageAlias + "." + typeName + if g.TypeOverrides != nil { + if override, ok := g.TypeOverrides[qualified]; ok { + return override + } + } + return qualified } return typeName case *ast.StarExpr: diff --git a/hack/api-codegen/pkg/passthrough/loader_test.go b/hack/api-codegen/pkg/passthrough/loader_test.go index fc2bbe2d..56b64eab 100644 --- a/hack/api-codegen/pkg/passthrough/loader_test.go +++ b/hack/api-codegen/pkg/passthrough/loader_test.go @@ -126,6 +126,41 @@ func TestGetMarkersForField_WithRegistry(t *testing.T) { } } +func TestTypeOverrides(t *testing.T) { + gen, err := NewGeneratorFromImportPath( + "github.com/openshift/hypershift/api/hypershift/v1beta1", + []string{"HostedClusterSpec"}, + make(markers.FieldRegistry), + ) + if err != nil { + t.Fatalf("Failed to create generator: %v", err) + } + + gen.TypeOverrides = map[string]string{ + "hypershiftv1beta1.ClusterConfiguration": "ClusterConfiguration", + } + + if err := gen.LoadSourceFiles(gen.SourceDir); err != nil { + t.Fatalf("Failed to load source files: %v", err) + } + + typeDef, err := gen.GenerateTypeDef("HostedClusterSpec") + if err != nil { + t.Fatalf("Failed to generate type def: %v", err) + } + + for _, field := range typeDef.Fields { + if field.Name == "Configuration" { + want := "*ClusterConfiguration" + if field.Type != want { + t.Errorf("Configuration type = %q, want %q", field.Type, want) + } + return + } + } + t.Error("Configuration field not found in generated type def") +} + func TestGetMarkersForField_NoPrefix(t *testing.T) { registry := markers.FieldRegistry{ "autoNode": markers.FieldMeta{ diff --git a/hack/api-codegen/pkg/passthrough/types.go b/hack/api-codegen/pkg/passthrough/types.go index eb379506..6ed8954b 100644 --- a/hack/api-codegen/pkg/passthrough/types.go +++ b/hack/api-codegen/pkg/passthrough/types.go @@ -29,6 +29,10 @@ type Generator struct { // FieldPrefix is the dotted path prefix for registry lookups (e.g., "spec.hostedCluster") FieldPrefix string + // TypeOverrides maps upstream qualified type names to local replacements + // (e.g., "hypershiftv1beta1.ClusterConfiguration" → "ClusterConfiguration"). + TypeOverrides map[string]string + // parsedFiles holds parsed AST of source files parsedFiles map[string]*ast.File } diff --git a/hack/api-codegen/pkg/registry/field_metadata.go b/hack/api-codegen/pkg/registry/field_metadata.go index 18583288..1f963bd7 100644 --- a/hack/api-codegen/pkg/registry/field_metadata.go +++ b/hack/api-codegen/pkg/registry/field_metadata.go @@ -321,6 +321,359 @@ var FieldRegistry = map[string]FieldMeta{ FieldPath: "spec.expirationTimestamp", WriteMode: Mutable, }, + "spec.hostedCluster.additionalTrustBundle": { + FieldPath: "spec.hostedCluster.additionalTrustBundle", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.auditWebhook": { + FieldPath: "spec.hostedCluster.auditWebhook", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.autoNode": { + FieldPath: "spec.hostedCluster.autoNode", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.autoscaling": { + FieldPath: "spec.hostedCluster.autoscaling", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.capabilities": { + FieldPath: "spec.hostedCluster.capabilities", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.channel": { + FieldPath: "spec.hostedCluster.channel", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.clusterID": { + FieldPath: "spec.hostedCluster.clusterID", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration": { + FieldPath: "spec.hostedCluster.configuration", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.apiServer": { + FieldPath: "spec.hostedCluster.configuration.apiServer", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.authentication": { + FieldPath: "spec.hostedCluster.configuration.authentication", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.featureGate": { + FieldPath: "spec.hostedCluster.configuration.featureGate", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.image": { + FieldPath: "spec.hostedCluster.configuration.image", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.ingress": { + FieldPath: "spec.hostedCluster.configuration.ingress", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.kubelet": { + FieldPath: "spec.hostedCluster.configuration.kubelet", + WriteMode: ServiceSet, + }, + "spec.hostedCluster.configuration.kubelet.allowedUnsafeSysctls": { + FieldPath: "spec.hostedCluster.configuration.kubelet.allowedUnsafeSysctls", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.kubelet.containerLogMaxFiles": { + FieldPath: "spec.hostedCluster.configuration.kubelet.containerLogMaxFiles", + WriteMode: Mutable, + }, + "spec.hostedCluster.configuration.kubelet.containerLogMaxSize": { + FieldPath: "spec.hostedCluster.configuration.kubelet.containerLogMaxSize", + WriteMode: Mutable, + }, + "spec.hostedCluster.configuration.kubelet.cpuManagerPolicy": { + FieldPath: "spec.hostedCluster.configuration.kubelet.cpuManagerPolicy", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.kubelet.cpuManagerPolicyOptions": { + FieldPath: "spec.hostedCluster.configuration.kubelet.cpuManagerPolicyOptions", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.kubelet.cpuManagerReconcilePeriod": { + FieldPath: "spec.hostedCluster.configuration.kubelet.cpuManagerReconcilePeriod", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.kubelet.evictionHard": { + FieldPath: "spec.hostedCluster.configuration.kubelet.evictionHard", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.kubelet.evictionSoft": { + FieldPath: "spec.hostedCluster.configuration.kubelet.evictionSoft", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.kubelet.evictionSoftGracePeriod": { + FieldPath: "spec.hostedCluster.configuration.kubelet.evictionSoftGracePeriod", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.kubelet.imageGCHighThresholdPercent": { + FieldPath: "spec.hostedCluster.configuration.kubelet.imageGCHighThresholdPercent", + WriteMode: Mutable, + }, + "spec.hostedCluster.configuration.kubelet.imageGCLowThresholdPercent": { + FieldPath: "spec.hostedCluster.configuration.kubelet.imageGCLowThresholdPercent", + WriteMode: Mutable, + }, + "spec.hostedCluster.configuration.kubelet.imageMinimumGCAge": { + FieldPath: "spec.hostedCluster.configuration.kubelet.imageMinimumGCAge", + WriteMode: Mutable, + }, + "spec.hostedCluster.configuration.kubelet.kubeReserved": { + FieldPath: "spec.hostedCluster.configuration.kubelet.kubeReserved", + WriteMode: Immutable, + }, + "spec.hostedCluster.configuration.kubelet.maxPods": { + FieldPath: "spec.hostedCluster.configuration.kubelet.maxPods", + WriteMode: Mutable, + }, + "spec.hostedCluster.configuration.kubelet.memoryThrottlingFactor": { + FieldPath: "spec.hostedCluster.configuration.kubelet.memoryThrottlingFactor", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.kubelet.podPidsLimit": { + FieldPath: "spec.hostedCluster.configuration.kubelet.podPidsLimit", + WriteMode: Mutable, + }, + "spec.hostedCluster.configuration.kubelet.registryBurst": { + FieldPath: "spec.hostedCluster.configuration.kubelet.registryBurst", + WriteMode: Mutable, + FeatureGate: "HyperFleetKubeletAdvanced", + }, + "spec.hostedCluster.configuration.kubelet.registryPullQPS": { + FieldPath: "spec.hostedCluster.configuration.kubelet.registryPullQPS", + WriteMode: Mutable, + FeatureGate: "HyperFleetKubeletAdvanced", + }, + "spec.hostedCluster.configuration.kubelet.serializeImagePulls": { + FieldPath: "spec.hostedCluster.configuration.kubelet.serializeImagePulls", + WriteMode: Mutable, + FeatureGate: "HyperFleetKubeletAdvanced", + }, + "spec.hostedCluster.configuration.kubelet.streamingConnectionIdleTimeout": { + FieldPath: "spec.hostedCluster.configuration.kubelet.streamingConnectionIdleTimeout", + WriteMode: Mutable, + }, + "spec.hostedCluster.configuration.kubelet.systemReserved": { + FieldPath: "spec.hostedCluster.configuration.kubelet.systemReserved", + WriteMode: Immutable, + }, + "spec.hostedCluster.configuration.kubelet.topologyManagerPolicy": { + FieldPath: "spec.hostedCluster.configuration.kubelet.topologyManagerPolicy", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.kubelet.topologyManagerScope": { + FieldPath: "spec.hostedCluster.configuration.kubelet.topologyManagerScope", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.machineConfig": { + FieldPath: "spec.hostedCluster.configuration.machineConfig", + WriteMode: ServiceSet, + }, + "spec.hostedCluster.configuration.machineConfig.allowedKernelArguments": { + FieldPath: "spec.hostedCluster.configuration.machineConfig.allowedKernelArguments", + WriteMode: Immutable, + FeatureGate: "HyperFleetMachineConfig", + }, + "spec.hostedCluster.configuration.machineConfig.extensions": { + FieldPath: "spec.hostedCluster.configuration.machineConfig.extensions", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.machineConfig.files": { + FieldPath: "spec.hostedCluster.configuration.machineConfig.files", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.machineConfig.kernelArguments": { + FieldPath: "spec.hostedCluster.configuration.machineConfig.kernelArguments", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.machineConfig.kernelType": { + FieldPath: "spec.hostedCluster.configuration.machineConfig.kernelType", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.machineConfig.systemdUnits": { + FieldPath: "spec.hostedCluster.configuration.machineConfig.systemdUnits", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.network": { + FieldPath: "spec.hostedCluster.configuration.network", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.oauth": { + FieldPath: "spec.hostedCluster.configuration.oauth", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.proxy": { + FieldPath: "spec.hostedCluster.configuration.proxy", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.configuration.scheduler": { + FieldPath: "spec.hostedCluster.configuration.scheduler", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.controlPlaneRelease": { + FieldPath: "spec.hostedCluster.controlPlaneRelease", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.controllerAvailabilityPolicy": { + FieldPath: "spec.hostedCluster.controllerAvailabilityPolicy", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.dns": { + FieldPath: "spec.hostedCluster.dns", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.etcd": { + FieldPath: "spec.hostedCluster.etcd", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.fips": { + FieldPath: "spec.hostedCluster.fips", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.imageContentSources": { + FieldPath: "spec.hostedCluster.imageContentSources", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.infraID": { + FieldPath: "spec.hostedCluster.infraID", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.infrastructureAvailabilityPolicy": { + FieldPath: "spec.hostedCluster.infrastructureAvailabilityPolicy", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.issuerURL": { + FieldPath: "spec.hostedCluster.issuerURL", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.kubeAPIServerDNSName": { + FieldPath: "spec.hostedCluster.kubeAPIServerDNSName", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.labels": { + FieldPath: "spec.hostedCluster.labels", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.networking": { + FieldPath: "spec.hostedCluster.networking", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.nodeSelector": { + FieldPath: "spec.hostedCluster.nodeSelector", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.olmCatalogPlacement": { + FieldPath: "spec.hostedCluster.olmCatalogPlacement", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.operatorConfiguration": { + FieldPath: "spec.hostedCluster.operatorConfiguration", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.pausedUntil": { + FieldPath: "spec.hostedCluster.pausedUntil", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.platform": { + FieldPath: "spec.hostedCluster.platform", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.pullSecret": { + FieldPath: "spec.hostedCluster.pullSecret", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.release": { + FieldPath: "spec.hostedCluster.release", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.secretEncryption": { + FieldPath: "spec.hostedCluster.secretEncryption", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.serviceAccountSigningKey": { + FieldPath: "spec.hostedCluster.serviceAccountSigningKey", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.services": { + FieldPath: "spec.hostedCluster.services", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.sshKey": { + FieldPath: "spec.hostedCluster.sshKey", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.tolerations": { + FieldPath: "spec.hostedCluster.tolerations", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.hostedCluster.updateService": { + FieldPath: "spec.hostedCluster.updateService", + WriteMode: ServiceSet, + Hidden: true, + }, "spec.internalId": { FieldPath: "spec.internalId", WriteMode: ServiceSet, @@ -335,6 +688,81 @@ var FieldRegistry = map[string]FieldMeta{ FieldPath: "spec.labels", WriteMode: Mutable, }, + "spec.nodePool.arch": { + FieldPath: "spec.nodePool.arch", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.nodePool.autoScaling": { + FieldPath: "spec.nodePool.autoScaling", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.nodePool.clusterName": { + FieldPath: "spec.nodePool.clusterName", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.nodePool.config": { + FieldPath: "spec.nodePool.config", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.nodePool.management": { + FieldPath: "spec.nodePool.management", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.nodePool.nodeDrainTimeout": { + FieldPath: "spec.nodePool.nodeDrainTimeout", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.nodePool.nodeLabels": { + FieldPath: "spec.nodePool.nodeLabels", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.nodePool.nodeVolumeDetachTimeout": { + FieldPath: "spec.nodePool.nodeVolumeDetachTimeout", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.nodePool.osImageStream": { + FieldPath: "spec.nodePool.osImageStream", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.nodePool.pausedUntil": { + FieldPath: "spec.nodePool.pausedUntil", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.nodePool.platform": { + FieldPath: "spec.nodePool.platform", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.nodePool.release": { + FieldPath: "spec.nodePool.release", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.nodePool.replicas": { + FieldPath: "spec.nodePool.replicas", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.nodePool.taints": { + FieldPath: "spec.nodePool.taints", + WriteMode: ServiceSet, + Hidden: true, + }, + "spec.nodePool.tuningConfig": { + FieldPath: "spec.nodePool.tuningConfig", + WriteMode: ServiceSet, + Hidden: true, + }, "spec.properties": { FieldPath: "spec.properties", WriteMode: Mutable, diff --git a/hack/api-codegen/pkg/registry/field_metadata.json b/hack/api-codegen/pkg/registry/field_metadata.json index d83072b8..3b3be0a6 100644 --- a/hack/api-codegen/pkg/registry/field_metadata.json +++ b/hack/api-codegen/pkg/registry/field_metadata.json @@ -300,6 +300,359 @@ "fieldPath": "spec.expirationTimestamp", "writeMode": "mutable" }, + { + "fieldPath": "spec.hostedCluster.additionalTrustBundle", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.auditWebhook", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.autoNode", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.autoscaling", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.capabilities", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.channel", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.clusterID", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.apiServer", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.authentication", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.featureGate", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.image", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.ingress", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet", + "writeMode": "service-set" + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.allowedUnsafeSysctls", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.containerLogMaxFiles", + "writeMode": "mutable" + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.containerLogMaxSize", + "writeMode": "mutable" + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.cpuManagerPolicy", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.cpuManagerPolicyOptions", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.cpuManagerReconcilePeriod", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.evictionHard", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.evictionSoft", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.evictionSoftGracePeriod", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.imageGCHighThresholdPercent", + "writeMode": "mutable" + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.imageGCLowThresholdPercent", + "writeMode": "mutable" + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.imageMinimumGCAge", + "writeMode": "mutable" + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.kubeReserved", + "writeMode": "immutable" + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.maxPods", + "writeMode": "mutable" + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.memoryThrottlingFactor", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.podPidsLimit", + "writeMode": "mutable" + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.registryBurst", + "writeMode": "mutable", + "featureGate": "HyperFleetKubeletAdvanced" + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.registryPullQPS", + "writeMode": "mutable", + "featureGate": "HyperFleetKubeletAdvanced" + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.serializeImagePulls", + "writeMode": "mutable", + "featureGate": "HyperFleetKubeletAdvanced" + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.streamingConnectionIdleTimeout", + "writeMode": "mutable" + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.systemReserved", + "writeMode": "immutable" + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.topologyManagerPolicy", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.kubelet.topologyManagerScope", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.machineConfig", + "writeMode": "service-set" + }, + { + "fieldPath": "spec.hostedCluster.configuration.machineConfig.allowedKernelArguments", + "writeMode": "immutable", + "featureGate": "HyperFleetMachineConfig" + }, + { + "fieldPath": "spec.hostedCluster.configuration.machineConfig.extensions", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.machineConfig.files", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.machineConfig.kernelArguments", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.machineConfig.kernelType", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.machineConfig.systemdUnits", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.network", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.oauth", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.proxy", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.configuration.scheduler", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.controlPlaneRelease", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.controllerAvailabilityPolicy", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.dns", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.etcd", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.fips", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.imageContentSources", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.infraID", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.infrastructureAvailabilityPolicy", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.issuerURL", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.kubeAPIServerDNSName", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.labels", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.networking", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.nodeSelector", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.olmCatalogPlacement", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.operatorConfiguration", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.pausedUntil", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.platform", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.pullSecret", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.release", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.secretEncryption", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.serviceAccountSigningKey", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.services", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.sshKey", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.tolerations", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.hostedCluster.updateService", + "writeMode": "service-set", + "hidden": true + }, { "fieldPath": "spec.internalId", "writeMode": "service-set", @@ -314,6 +667,81 @@ "fieldPath": "spec.labels", "writeMode": "mutable" }, + { + "fieldPath": "spec.nodePool.arch", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.nodePool.autoScaling", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.nodePool.clusterName", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.nodePool.config", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.nodePool.management", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.nodePool.nodeDrainTimeout", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.nodePool.nodeLabels", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.nodePool.nodeVolumeDetachTimeout", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.nodePool.osImageStream", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.nodePool.pausedUntil", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.nodePool.platform", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.nodePool.release", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.nodePool.replicas", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.nodePool.taints", + "writeMode": "service-set", + "hidden": true + }, + { + "fieldPath": "spec.nodePool.tuningConfig", + "writeMode": "service-set", + "hidden": true + }, { "fieldPath": "spec.properties", "writeMode": "mutable" diff --git a/platform-api/pkg/conversion/types.go b/platform-api/pkg/conversion/types.go index 91c5dfc6..7272a5ac 100644 --- a/platform-api/pkg/conversion/types.go +++ b/platform-api/pkg/conversion/types.go @@ -4,6 +4,9 @@ package conversion import ( v1alpha1 "github.com/openshift-online/rosa-hyperfleet-api/api/v1alpha1" + configv1 "github.com/openshift/api/config/v1" + hypershiftv1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -11,12 +14,40 @@ import ( type ServiceSetFields struct { // AccountID is service-set (platform-managed, hidden from API) AccountID string `json:"accountId"` + // AdditionalTrustBundle is service-set (platform-managed, hidden from API) + AdditionalTrustBundle *corev1.LocalObjectReference `json:"additionalTrustBundle"` // AllowedUnsafeSysctls is service-set (platform-managed, hidden from API) AllowedUnsafeSysctls []string `json:"allowedUnsafeSysctls"` // ApiServer is service-set (platform-managed, hidden from API) ApiServer *v1alpha1.APIServerNetworkConfiguration `json:"apiServer"` + // Arch is service-set (platform-managed, hidden from API) + Arch string `json:"arch"` + // AuditWebhook is service-set (platform-managed, hidden from API) + AuditWebhook *corev1.LocalObjectReference `json:"auditWebhook"` // Authentication is service-set (platform-managed, hidden from API) Authentication *v1alpha1.ClusterAuthentication `json:"authentication"` + // AutoNode is service-set (platform-managed, hidden from API) + AutoNode hypershiftv1beta1.AutoNode `json:"autoNode"` + // AutoScaling is service-set (platform-managed, hidden from API) + AutoScaling *hypershiftv1beta1.NodePoolAutoScaling `json:"autoScaling"` + // Autoscaling is service-set (platform-managed, hidden from API) + Autoscaling hypershiftv1beta1.ClusterAutoscaling `json:"autoscaling"` + // Capabilities is service-set (platform-managed, hidden from API) + Capabilities *hypershiftv1beta1.Capabilities `json:"capabilities"` + // Channel is service-set (platform-managed, hidden from API) + Channel string `json:"channel"` + // ClusterID is service-set (platform-managed, hidden from API) + ClusterID string `json:"clusterID"` + // ClusterName is service-set (platform-managed, hidden from API) + ClusterName string `json:"clusterName"` + // Config is service-set (platform-managed, hidden from API) + Config []corev1.LocalObjectReference `json:"config"` + // Configuration is service-set (platform-managed, hidden from API) + Configuration *v1alpha1.ClusterConfiguration `json:"configuration"` + // ControlPlaneRelease is service-set (platform-managed, hidden from API) + ControlPlaneRelease *hypershiftv1beta1.Release `json:"controlPlaneRelease"` + // ControllerAvailabilityPolicy is service-set (platform-managed, hidden from API) + ControllerAvailabilityPolicy hypershiftv1beta1.AvailabilityPolicy `json:"controllerAvailabilityPolicy"` // CpuManagerPolicy is service-set (platform-managed, hidden from API) CpuManagerPolicy *string `json:"cpuManagerPolicy"` // CpuManagerPolicyOptions is service-set (platform-managed, hidden from API) @@ -25,6 +56,10 @@ type ServiceSetFields struct { CpuManagerReconcilePeriod *metav1.Duration `json:"cpuManagerReconcilePeriod"` // CreatorARN is service-set (platform-managed, hidden from API) CreatorARN string `json:"creatorARN"` + // Dns is service-set (platform-managed, hidden from API) + Dns hypershiftv1beta1.DNSSpec `json:"dns"` + // Etcd is service-set (platform-managed, hidden from API) + Etcd hypershiftv1beta1.EtcdSpec `json:"etcd"` // EvictionHard is service-set (platform-managed, hidden from API) EvictionHard map[string]string `json:"evictionHard"` // EvictionSoft is service-set (platform-managed, hidden from API) @@ -37,36 +72,94 @@ type ServiceSetFields struct { FeatureGate *v1alpha1.FeatureGateConfiguration `json:"featureGate"` // Files is service-set (platform-managed, hidden from API) Files []v1alpha1.FileSpec `json:"files"` + // Fips is service-set (platform-managed, hidden from API) + Fips bool `json:"fips"` // Image is service-set (platform-managed, hidden from API) Image *v1alpha1.ImageConfiguration `json:"image"` + // ImageContentSources is service-set (platform-managed, hidden from API) + ImageContentSources []hypershiftv1beta1.ImageContentSource `json:"imageContentSources"` + // InfraID is service-set (platform-managed, hidden from API) + InfraID string `json:"infraID"` + // InfrastructureAvailabilityPolicy is service-set (platform-managed, hidden from API) + InfrastructureAvailabilityPolicy hypershiftv1beta1.AvailabilityPolicy `json:"infrastructureAvailabilityPolicy"` // Ingress is service-set (platform-managed, hidden from API) Ingress *v1alpha1.IngressConfiguration `json:"ingress"` // InternalID is service-set (platform-managed, hidden from API) InternalID string `json:"internalId"` // InternalPoolID is service-set (platform-managed, hidden from API) InternalPoolID string `json:"internalPoolId"` + // IssuerURL is service-set (platform-managed, hidden from API) + IssuerURL string `json:"issuerURL"` // KernelArguments is service-set (platform-managed, hidden from API) KernelArguments []string `json:"kernelArguments"` // KernelType is service-set (platform-managed, hidden from API) KernelType *string `json:"kernelType"` + // KubeAPIServerDNSName is service-set (platform-managed, hidden from API) + KubeAPIServerDNSName string `json:"kubeAPIServerDNSName"` // Kubelet is service-set (platform-managed, hidden from API) Kubelet *v1alpha1.KubeletConfig `json:"kubelet"` + // Labels is service-set (platform-managed, hidden from API) + Labels map[string]string `json:"labels"` // MachineConfig is service-set (platform-managed, hidden from API) MachineConfig *v1alpha1.MachineConfigSpec `json:"machineConfig"` + // Management is service-set (platform-managed, hidden from API) + Management hypershiftv1beta1.NodePoolManagement `json:"management"` // MemoryThrottlingFactor is service-set (platform-managed, hidden from API) MemoryThrottlingFactor *float64 `json:"memoryThrottlingFactor"` // Network is service-set (platform-managed, hidden from API) Network *v1alpha1.NetworkConfiguration `json:"network"` + // Networking is service-set (platform-managed, hidden from API) + Networking hypershiftv1beta1.ClusterNetworking `json:"networking"` + // NodeDrainTimeout is service-set (platform-managed, hidden from API) + NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout"` + // NodeLabels is service-set (platform-managed, hidden from API) + NodeLabels map[string]string `json:"nodeLabels"` + // NodeSelector is service-set (platform-managed, hidden from API) + NodeSelector map[string]string `json:"nodeSelector"` + // NodeVolumeDetachTimeout is service-set (platform-managed, hidden from API) + NodeVolumeDetachTimeout *metav1.Duration `json:"nodeVolumeDetachTimeout"` // Oauth is service-set (platform-managed, hidden from API) Oauth *v1alpha1.OAuthConfiguration `json:"oauth"` + // OlmCatalogPlacement is service-set (platform-managed, hidden from API) + OlmCatalogPlacement hypershiftv1beta1.OLMCatalogPlacement `json:"olmCatalogPlacement"` + // OperatorConfiguration is service-set (platform-managed, hidden from API) + OperatorConfiguration *hypershiftv1beta1.OperatorConfiguration `json:"operatorConfiguration"` + // OsImageStream is service-set (platform-managed, hidden from API) + OsImageStream hypershiftv1beta1.OSImageStreamReference `json:"osImageStream"` + // PausedUntil is service-set (platform-managed, hidden from API) + PausedUntil *string `json:"pausedUntil"` + // Platform is service-set (platform-managed, hidden from API) + Platform hypershiftv1beta1.NodePoolPlatform `json:"platform"` // Proxy is service-set (platform-managed, hidden from API) Proxy *v1alpha1.ProxyConfiguration `json:"proxy"` + // PullSecret is service-set (platform-managed, hidden from API) + PullSecret corev1.LocalObjectReference `json:"pullSecret"` + // Release is service-set (platform-managed, hidden from API) + Release hypershiftv1beta1.Release `json:"release"` + // Replicas is service-set (platform-managed, hidden from API) + Replicas *int32 `json:"replicas"` // Scheduler is service-set (platform-managed, hidden from API) Scheduler *v1alpha1.SchedulerConfiguration `json:"scheduler"` + // SecretEncryption is service-set (platform-managed, hidden from API) + SecretEncryption *hypershiftv1beta1.SecretEncryptionSpec `json:"secretEncryption"` + // ServiceAccountSigningKey is service-set (platform-managed, hidden from API) + ServiceAccountSigningKey *corev1.LocalObjectReference `json:"serviceAccountSigningKey"` + // Services is service-set (platform-managed, hidden from API) + Services []hypershiftv1beta1.ServicePublishingStrategyMapping `json:"services"` + // SshKey is service-set (platform-managed, hidden from API) + SshKey corev1.LocalObjectReference `json:"sshKey"` // SystemdUnits is service-set (platform-managed, hidden from API) SystemdUnits []v1alpha1.SystemdUnit `json:"systemdUnits"` + // Taints is service-set (platform-managed, hidden from API) + Taints []hypershiftv1beta1.Taint `json:"taints"` + // Tolerations is service-set (platform-managed, hidden from API) + Tolerations []corev1.Toleration `json:"tolerations"` // TopologyManagerPolicy is service-set (platform-managed, hidden from API) TopologyManagerPolicy *string `json:"topologyManagerPolicy"` // TopologyManagerScope is service-set (platform-managed, hidden from API) TopologyManagerScope *string `json:"topologyManagerScope"` + // TuningConfig is service-set (platform-managed, hidden from API) + TuningConfig []corev1.LocalObjectReference `json:"tuningConfig"` + // UpdateService is service-set (platform-managed, hidden from API) + UpdateService configv1.URL `json:"updateService"` }