Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update typescript open API generator to handle the IntOrString type #741

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/gen/model/v1HTTPGetAction.ts
Expand Up @@ -11,6 +11,7 @@
*/

import { RequestFile } from './models';
import { IntOrString } from '../../types';
import { V1HTTPHeader } from './v1HTTPHeader';

/**
Expand All @@ -30,9 +31,9 @@ export class V1HTTPGetAction {
*/
'path'?: string;
/**
* Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
* IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.
*/
'port': object;
'port': IntOrString;
/**
* Scheme to use for connecting to the host. Defaults to HTTP.
*/
Expand All @@ -59,7 +60,7 @@ export class V1HTTPGetAction {
{
"name": "port",
"baseName": "port",
"type": "object"
"type": "IntOrString"
},
{
"name": "scheme",
Expand Down
7 changes: 4 additions & 3 deletions src/gen/model/v1NetworkPolicyPort.ts
Expand Up @@ -11,6 +11,7 @@
*/

import { RequestFile } from './models';
import { IntOrString } from '../../types';

/**
* NetworkPolicyPort describes a port to allow traffic on
Expand All @@ -21,9 +22,9 @@ export class V1NetworkPolicyPort {
*/
'endPort'?: number;
/**
* The port on the given protocol. This can either be a numerical or named port on a pod. If this field is not provided, this matches all port names and numbers. If present, only traffic on the specified protocol AND port will be matched.
* IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.
*/
'port'?: object;
'port'?: IntOrString;
/**
* The protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP.
*/
Expand All @@ -40,7 +41,7 @@ export class V1NetworkPolicyPort {
{
"name": "port",
"baseName": "port",
"type": "object"
"type": "IntOrString"
},
{
"name": "protocol",
Expand Down
13 changes: 7 additions & 6 deletions src/gen/model/v1PodDisruptionBudgetSpec.ts
Expand Up @@ -11,20 +11,21 @@
*/

import { RequestFile } from './models';
import { IntOrString } from '../../types';
import { V1LabelSelector } from './v1LabelSelector';

/**
* PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.
*/
export class V1PodDisruptionBudgetSpec {
/**
* An eviction is allowed if at most \"maxUnavailable\" pods selected by \"selector\" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with \"minAvailable\".
* IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.
*/
'maxUnavailable'?: object;
'maxUnavailable'?: IntOrString;
/**
* An eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying \"100%\".
* IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.
*/
'minAvailable'?: object;
'minAvailable'?: IntOrString;
'selector'?: V1LabelSelector;

static discriminator: string | undefined = undefined;
Expand All @@ -33,12 +34,12 @@ export class V1PodDisruptionBudgetSpec {
{
"name": "maxUnavailable",
"baseName": "maxUnavailable",
"type": "object"
"type": "IntOrString"
},
{
"name": "minAvailable",
"baseName": "minAvailable",
"type": "object"
"type": "IntOrString"
},
{
"name": "selector",
Expand Down
13 changes: 7 additions & 6 deletions src/gen/model/v1RollingUpdateDaemonSet.ts
Expand Up @@ -11,32 +11,33 @@
*/

import { RequestFile } from './models';
import { IntOrString } from '../../types';

/**
* Spec to control the desired behavior of daemon set rolling update.
*/
export class V1RollingUpdateDaemonSet {
/**
* The maximum number of nodes with an existing available DaemonSet pod that can have an updated DaemonSet pod during during an update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up to a minimum of 1. Default value is 0. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their a new pod created before the old pod is marked as deleted. The update starts by launching new pods on 30% of nodes. Once an updated pod is available (Ready for at least minReadySeconds) the old DaemonSet pod on that node is marked deleted. If the old pod becomes unavailable for any reason (Ready transitions to false, is evicted, or is drained) an updated pod is immediatedly created on that node without considering surge limits. Allowing surge implies the possibility that the resources consumed by the daemonset on any given node can double if the readiness check fails, and so resource intensive daemonsets should take into account that they may cause evictions during disruption. This is beta field and enabled/disabled by DaemonSetUpdateSurge feature gate.
* IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.
*/
'maxSurge'?: object;
'maxSurge'?: IntOrString;
/**
* The maximum number of DaemonSet pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of total number of DaemonSet pods at the start of the update (ex: 10%). Absolute number is calculated from percentage by rounding up. This cannot be 0 if MaxSurge is 0 Default value is 1. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their pods stopped for an update at any given time. The update starts by stopping at most 30% of those DaemonSet pods and then brings up new DaemonSet pods in their place. Once the new pods are available, it then proceeds onto other DaemonSet pods, thus ensuring that at least 70% of original number of DaemonSet pods are available at all times during the update.
* IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.
*/
'maxUnavailable'?: object;
'maxUnavailable'?: IntOrString;

static discriminator: string | undefined = undefined;

static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "maxSurge",
"baseName": "maxSurge",
"type": "object"
"type": "IntOrString"
},
{
"name": "maxUnavailable",
"baseName": "maxUnavailable",
"type": "object"
"type": "IntOrString"
} ];

static getAttributeTypeMap() {
Expand Down
13 changes: 7 additions & 6 deletions src/gen/model/v1RollingUpdateDeployment.ts
Expand Up @@ -11,32 +11,33 @@
*/

import { RequestFile } from './models';
import { IntOrString } from '../../types';

/**
* Spec to control the desired behavior of rolling update.
*/
export class V1RollingUpdateDeployment {
/**
* The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 25%. Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new ReplicaSet can be scaled up further, ensuring that total number of pods running at any time during the update is at most 130% of desired pods.
* IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.
*/
'maxSurge'?: object;
'maxSurge'?: IntOrString;
/**
* The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 25%. Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old ReplicaSet can be scaled down further, followed by scaling up the new ReplicaSet, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods.
* IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.
*/
'maxUnavailable'?: object;
'maxUnavailable'?: IntOrString;

static discriminator: string | undefined = undefined;

static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "maxSurge",
"baseName": "maxSurge",
"type": "object"
"type": "IntOrString"
},
{
"name": "maxUnavailable",
"baseName": "maxUnavailable",
"type": "object"
"type": "IntOrString"
} ];

static getAttributeTypeMap() {
Expand Down
7 changes: 4 additions & 3 deletions src/gen/model/v1ServicePort.ts
Expand Up @@ -11,6 +11,7 @@
*/

import { RequestFile } from './models';
import { IntOrString } from '../../types';

/**
* ServicePort contains information on service\'s port.
Expand All @@ -37,9 +38,9 @@ export class V1ServicePort {
*/
'protocol'?: string;
/**
* Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod\'s container ports. If this is not specified, the value of the \'port\' field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the \'port\' field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service
* IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.
*/
'targetPort'?: object;
'targetPort'?: IntOrString;

static discriminator: string | undefined = undefined;

Expand Down Expand Up @@ -72,7 +73,7 @@ export class V1ServicePort {
{
"name": "targetPort",
"baseName": "targetPort",
"type": "object"
"type": "IntOrString"
} ];

static getAttributeTypeMap() {
Expand Down
7 changes: 4 additions & 3 deletions src/gen/model/v1TCPSocketAction.ts
Expand Up @@ -11,6 +11,7 @@
*/

import { RequestFile } from './models';
import { IntOrString } from '../../types';

/**
* TCPSocketAction describes an action based on opening a socket
Expand All @@ -21,9 +22,9 @@ export class V1TCPSocketAction {
*/
'host'?: string;
/**
* Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
* IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.
*/
'port': object;
'port': IntOrString;

static discriminator: string | undefined = undefined;

Expand All @@ -36,7 +37,7 @@ export class V1TCPSocketAction {
{
"name": "port",
"baseName": "port",
"type": "object"
"type": "IntOrString"
} ];

static getAttributeTypeMap() {
Expand Down
13 changes: 7 additions & 6 deletions src/gen/model/v1beta1PodDisruptionBudgetSpec.ts
Expand Up @@ -11,20 +11,21 @@
*/

import { RequestFile } from './models';
import { IntOrString } from '../../types';
import { V1LabelSelector } from './v1LabelSelector';

/**
* PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.
*/
export class V1beta1PodDisruptionBudgetSpec {
/**
* An eviction is allowed if at most \"maxUnavailable\" pods selected by \"selector\" are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with \"minAvailable\".
* IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.
*/
'maxUnavailable'?: object;
'maxUnavailable'?: IntOrString;
/**
* An eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying \"100%\".
* IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.
*/
'minAvailable'?: object;
'minAvailable'?: IntOrString;
'selector'?: V1LabelSelector;

static discriminator: string | undefined = undefined;
Expand All @@ -33,12 +34,12 @@ export class V1beta1PodDisruptionBudgetSpec {
{
"name": "maxUnavailable",
"baseName": "maxUnavailable",
"type": "object"
"type": "IntOrString"
},
{
"name": "minAvailable",
"baseName": "minAvailable",
"type": "object"
"type": "IntOrString"
},
{
"name": "selector",
Expand Down