Skip to content

Commit

Permalink
class-generator: Fix --update-schema regenerate when no new updates (#…
Browse files Browse the repository at this point in the history
…2039)

* class-generator: Fix --update-schema regenerate when no new updates

* class-generator: update the README
  • Loading branch information
myakove authored Aug 15, 2024
1 parent 202c2c1 commit b8b2420
Show file tree
Hide file tree
Showing 21 changed files with 6,618 additions and 10,939 deletions.
21 changes: 3 additions & 18 deletions class_generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Usage

###### Installation
### Installation

- Using [pipx](https://github.com/pypa/pipx) (recommended)

Expand All @@ -29,7 +29,7 @@ For shell completion Add this to ~/.bashrc or ~/.zshrc:
if type class-generator > /dev/null; then eval "$(_CLASS_GENERATOR_COMPLETE=zsh_source class-generator)"; fi
```

###### Call the script
#### Usage

- All available options:

Expand Down Expand Up @@ -74,7 +74,7 @@ pipx install --python python3.9 openapi2jsonschema
- Clone this repository

```bash
got clone https://github.com/RedHatQE/openshift-python-wrapper.git
git clone https://github.com/RedHatQE/openshift-python-wrapper.git
cd openshift-python-wrapper
```

Expand All @@ -95,18 +95,3 @@ oc login <clster api URL> -u <username> -p <password>
```bash
poetry run python class_generator/class-generator --update-schema
```

## Reporting an issue

- Running with debug mode and `--debug` flag:

```bash
class-generator --kind <kind> --debug
```

`<kind>-debug.json` will be located under `scripts/resource/debug`
Issue should include:

- The script executed command
- debug file from the above command
- oc/kubectl version
2 changes: 1 addition & 1 deletion class_generator/class_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def map_kind_to_namespaced():
is_kind_futures: List[Future] = []
with ThreadPoolExecutor() as executor:
for _kind in kind_set:
if resources_mapping.get(_kind):
if resources_mapping.get(_kind.lower()): # resource_mappings store all keys in lowercase
continue

# Check if the kind we work on is a real kind
Expand Down
9,187 changes: 3,516 additions & 5,671 deletions class_generator/schema/_definitions.json

Large diffs are not rendered by default.

1,731 changes: 772 additions & 959 deletions class_generator/schema/alertmanager.json

Large diffs are not rendered by default.

643 changes: 317 additions & 326 deletions class_generator/schema/alertmanagerconfig.json

Large diffs are not rendered by default.

44 changes: 0 additions & 44 deletions class_generator/schema/console.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,50 +58,6 @@
"ROSA"
]
},
"capabilities": {
"description": "capabilities defines an array of capabilities that can be interacted with in the console UI. Each capability defines a visual state that can be interacted with the console to render in the UI. Available capabilities are LightspeedButton. Each of the available capabilities may appear only once in the list.",
"type": "array",
"maxItems": 1,
"minItems": 1,
"items": {
"description": "Capabilities contains set of UI capabilities and their state in the console UI.",
"type": "object",
"required": [
"name",
"visibility"
],
"properties": {
"name": {
"description": "name is the unique name of a capability. Available capabilities are LightspeedButton.",
"type": "string",
"enum": [
"LightspeedButton"
]
},
"visibility": {
"description": "visibility defines the visibility state of the capability.",
"type": "object",
"required": [
"state"
],
"properties": {
"state": {
"description": "state defines if the capability is enabled or disabled in the console UI. Enabling the capability in the console UI is represented by the \"Enabled\" value. Disabling the capability in the console UI is represented by the \"Disabled\" value.",
"type": "string",
"enum": [
"Enabled",
"Disabled"
]
}
}
}
}
},
"x-kubernetes-list-map-keys": [
"name"
],
"x-kubernetes-list-type": "map"
},
"customLogoFile": {
"description": "customLogoFile replaces the default OpenShift logo in the masthead and about dialog. It is a reference to a ConfigMap in the openshift-config namespace. This can be created with a command like 'oc create configmap custom-logo --from-file=/path/to/file -n openshift-config'. Image size must be less than 1 MB due to constraints on the ConfigMap size. The ConfigMap key should include a file extension so that the console serves the file with the correct MIME type. Recommended logo specifications: Dimensions: Max height of 68px and max width of 200px SVG format preferred",
"type": "object",
Expand Down
6 changes: 2 additions & 4 deletions class_generator/schema/containerruntimeconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,10 @@
"type": "array",
"items": {
"type": "string"
},
"x-kubernetes-list-type": "atomic"
}
}
}
},
"x-kubernetes-list-type": "atomic"
}
},
"matchLabels": {
"description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.",
Expand Down
6 changes: 0 additions & 6 deletions class_generator/schema/featuregate.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@
"featureSet": {
"description": "featureSet changes the list of features in the cluster. The default is empty. Be very careful adjusting this setting. Turning on or off features may cause irreversible changes in your cluster which cannot be undone.",
"type": "string",
"enum": [
"CustomNoUpgrade",
"DevPreviewNoUpgrade",
"TechPreviewNoUpgrade",
""
],
"x-kubernetes-validations": [
{
"message": "CustomNoUpgrade may not be changed",
Expand Down
Loading

0 comments on commit b8b2420

Please sign in to comment.