Skip to content

bug: created client inconsistencies #7

@Anmol1696

Description

@Anmol1696
  1. Comments and types are not consistent:
    /* Requested common name X509 certificate subject attribute.
    More info: https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6
    NOTE: TLS clients will ignore this value when any subject alternative name is
    set (see https://tools.ietf.org/html/rfc6125#section-6.4.4).
    
    Should have a length of 64 characters or fewer to avoid generating invalid CSRs.
    Cannot be set if the `literalSubject` field is set. */
    commonName?: string;
    /* Requested DNS subject alternative names. */dnsNames?: string[];
    /* Requested 'duration' (i.e. lifetime) of the Certificate. Note that the
    issuer may choose to ignore the requested duration, just like any other
    requested attribute.

dnsName? should be on the new line. This is solved for older definations, so something wrong with param resloving (?)

  1. Conflicting interface definations into the single index.ts file:
/* dev.knative.internal.networking.v1alpha1.Certificate */
/* Certificate is responsible for provisioning a SSL certificate for the
given hosts. It is a Knative abstraction for various SSL certificate
provisioning solutions (such as cert-manager or self-signed SSL certificate). */
export interface Certificate {
  // ...
}

/* io.cert-manager.v1.Certificate */
/* A Certificate resource should be created to ensure an up to date and signed
X.509 certificate is stored in the Kubernetes Secret resource named in `spec.secretName`.

The stored certificate will be renewed before it expires (as configured by `spec.renewBefore`). */
export interface Certificate {
  // ...
}

Maybe a better solution api base file based exports. (?)

Similar issues with types:

  • HorizontalPodAutoscalerStatus: io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerStatus, io.k8s.api.autoscaling.v2.HorizontalPodAutoscalerStatus
  • Service: io.k8s.api.core.v1.Service, dev.knative.serving.v1.Service
  • Ingress: io.k8s.api.networking.v1.Ingress, dev.knative.internal.networking.v1alpha1.Ingress
  1. Missing some params
export interface CreateFlowcontrolApiserverV1FlowSchemaRequest {
  query: {
    pretty?: string;
    dryRun?: string;
    fieldManager?: string;
    fieldValidation?: string;
  };
  body: FlowSchema;    // this is not defined anywhere.
}

In swagger this is defined in body:

"operationId": "createFlowcontrolApiserverV1FlowSchema",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/io.k8s.api.flowcontrol.v1.FlowSchema"
            }
          },

but this defination does not seem to be resolved.

  1. Similar to 3, the reponse is also not resolved properly
  async listFlowcontrolApiserverV1FlowSchema(params: ListFlowcontrolApiserverV1FlowSchemaRequest, opts?: APIClientRequestOpts): Promise<FlowSchemaList> {
    const path = `/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas`;
    return await this.get<FlowSchemaList>(path, null, null, opts);
  }

Here the FlowSchemaList is not defined.
In swagger we have:

"responses": {
  "200": {
    "description": "OK",
    "schema": {
      "$ref": "#/definitions/io.k8s.api.flowcontrol.v1.FlowSchemaList"
    }
  },
  "401": {
    "description": "Unauthorized"
  }
},

SImilar issues with others:

  • PriorityLevelConfiguration;
  1. Client construstor created does not have proper types.
export class InterwebClient extends APIClient {
  constructor(options) {
    super(options);
  }

options of any type

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions