From 89b68cf0c1c51843018971740411fa260b4e0553 Mon Sep 17 00:00:00 2001 From: enxebre Date: Thu, 17 Oct 2024 22:10:17 +0200 Subject: [PATCH] Add omitempty tag for imageStreamImportMode This seems to match the original proposal https://github.com/openshift/enhancements/pull/1605/files#diff-c3558e7ce5705e060c3f6ccbbf7430be6fe4dac2b8bad05220360bd977f81e70R214, recomendations and consistency with the rest of this API. The reason I came across this is that hypershift seralizes this API and use that as input to generate a hash that now transparently changes. While that fundamental problem is solved this will happen to buy hypershift some time. --- config/v1/types_image.go | 2 +- openapi/generated_openapi/zz_generated.openapi.go | 1 - openapi/openapi.json | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/config/v1/types_image.go b/config/v1/types_image.go index d3c694a56f3..7e298a6866b 100644 --- a/config/v1/types_image.go +++ b/config/v1/types_image.go @@ -100,7 +100,7 @@ type ImageSpec struct { // implies the import mode is Legacy and multi payload implies PreserveOriginal. // +openshift:enable:FeatureGate=ImageStreamImportMode // +optional - ImageStreamImportMode ImportModeType `json:"imageStreamImportMode"` + ImageStreamImportMode ImportModeType `json:"imageStreamImportMode,omitempty"` } type ImageStatus struct { diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 53d69dce110..ebf2e383048 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -13772,7 +13772,6 @@ func schema_openshift_api_config_v1_ImageSpec(ref common.ReferenceCallback) comm "imageStreamImportMode": { SchemaProps: spec.SchemaProps{ Description: "imageStreamImportMode controls the import mode behaviour of imagestreams. It can be set to `Legacy` or `PreserveOriginal` or the empty string. If this value is specified, this setting is applied to all newly created imagestreams which do not have the value set. `Legacy` indicates that the legacy behaviour should be used. For manifest lists, the legacy behaviour will discard the manifest list and import a single sub-manifest. In this case, the platform is chosen in the following order of priority: 1. tag annotations; 2. control plane arch/os; 3. linux/amd64; 4. the first manifest in the list. `PreserveOriginal` indicates that the original manifest will be preserved. For manifest lists, the manifest list and all its sub-manifests will be imported. When empty, the behaviour will be decided based on the payload type advertised by the ClusterVersion status, i.e single arch payload implies the import mode is Legacy and multi payload implies PreserveOriginal.\n\nPossible enum values:\n - `\"Legacy\"` indicates that the legacy behaviour should be used. For manifest lists, the legacy behaviour will discard the manifest list and import a single sub-manifest. In this case, the platform is chosen in the following order of priority: 1. tag annotations; 2. control plane arch/os; 3. linux/amd64; 4. the first manifest in the list. This mode is the default.\n - `\"PreserveOriginal\"` indicates that the original manifest will be preserved. For manifest lists, the manifest list and all its sub-manifests will be imported.", - Default: "", Type: []string{"string"}, Format: "", Enum: []interface{}{"Legacy", "PreserveOriginal"}, diff --git a/openapi/openapi.json b/openapi/openapi.json index 4fe157bf21e..86724521ad0 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -7242,7 +7242,6 @@ "imageStreamImportMode": { "description": "imageStreamImportMode controls the import mode behaviour of imagestreams. It can be set to `Legacy` or `PreserveOriginal` or the empty string. If this value is specified, this setting is applied to all newly created imagestreams which do not have the value set. `Legacy` indicates that the legacy behaviour should be used. For manifest lists, the legacy behaviour will discard the manifest list and import a single sub-manifest. In this case, the platform is chosen in the following order of priority: 1. tag annotations; 2. control plane arch/os; 3. linux/amd64; 4. the first manifest in the list. `PreserveOriginal` indicates that the original manifest will be preserved. For manifest lists, the manifest list and all its sub-manifests will be imported. When empty, the behaviour will be decided based on the payload type advertised by the ClusterVersion status, i.e single arch payload implies the import mode is Legacy and multi payload implies PreserveOriginal.\n\nPossible enum values:\n - `\"Legacy\"` indicates that the legacy behaviour should be used. For manifest lists, the legacy behaviour will discard the manifest list and import a single sub-manifest. In this case, the platform is chosen in the following order of priority: 1. tag annotations; 2. control plane arch/os; 3. linux/amd64; 4. the first manifest in the list. This mode is the default.\n - `\"PreserveOriginal\"` indicates that the original manifest will be preserved. For manifest lists, the manifest list and all its sub-manifests will be imported.", "type": "string", - "default": "", "enum": [ "Legacy", "PreserveOriginal"