Skip to content

Commit

Permalink
Merge pull request #774 from brendandburns/intorstring
Browse files Browse the repository at this point in the history
Fix generation of IntOrString
  • Loading branch information
k8s-ci-robot authored Feb 9, 2022
2 parents b8382b6 + 3df7390 commit 640a72d
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 76 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kubernetes/client-node",
"version": "0.16.1",
"version": "0.16.3",
"description": "NodeJS client for kubernetes",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion settings
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.

# kubernetes-client/gen commit to use for code generation.
export GEN_COMMIT=a3aef4d
export GEN_COMMIT=82c3ff5

# GitHub username/organization to clone kubernetes repo from.
export USERNAME=kubernetes
Expand Down
2 changes: 1 addition & 1 deletion src/gen/.openapi-generator/swagger.json-default.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4dbc0536a9330c99ca0874d9b9d577fd581a1820517a27f20b4dbf5af0f6fb75
a5685a88a8d1b58674feda167bae22437c9580a1664511293db4508c164603d2
7 changes: 4 additions & 3 deletions src/gen/model/v1HTTPGetAction.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 640a72d

Please sign in to comment.