fix(cloudly-client): correct Cloudly request handling for cluster config, cluster updates, and image pushes
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@serve.zone/api',
|
||||
version: '5.3.6',
|
||||
version: '5.3.7',
|
||||
description: 'Type-safe API client for Cloudly and the serve.zone control plane.'
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ export class CloudlyApiClient {
|
||||
*/
|
||||
public async getClusterConfigFromCloudlyByIdentity(
|
||||
identityArg: plugins.servezoneInterfaces.data.IIdentity = this.identity
|
||||
): Promise<plugins.servezoneInterfaces.data.ICluster> {
|
||||
): Promise<plugins.servezoneInterfaces.requests.config.IRequest_Any_Cloudly_GetClusterConfig['response']> {
|
||||
const clusterConfigRequest =
|
||||
this.typedsocketClient.createTypedRequest<plugins.servezoneInterfaces.requests.config.IRequest_Any_Cloudly_GetClusterConfig>(
|
||||
'getClusterConfig'
|
||||
@@ -133,7 +133,7 @@ export class CloudlyApiClient {
|
||||
const response = await clusterConfigRequest.fire({
|
||||
identity: identityArg,
|
||||
});
|
||||
return response.configData;
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,7 +170,7 @@ export class CloudlyApiClient {
|
||||
'getCertificateForDomain'
|
||||
);
|
||||
const typedResponse = await typedCertificateRequest.fire({
|
||||
identity: this.identity, // do proper auth here
|
||||
identity: optionsArg.identity,
|
||||
domainName: optionsArg.domainName,
|
||||
type: optionsArg.type,
|
||||
});
|
||||
|
||||
@@ -61,8 +61,9 @@ export class Cluster implements plugins.servezoneInterfaces.data.ICluster {
|
||||
);
|
||||
const response = await updateClusterTR.fire({
|
||||
identity: this.cloudlyClientRef.identity,
|
||||
clusterId: this.id,
|
||||
clusterData: this.data,
|
||||
});
|
||||
} as any);
|
||||
|
||||
const resultClusterData = response.resultCluster.data;
|
||||
plugins.smartexpect.expect(resultClusterData).toEqual(this.data);
|
||||
|
||||
+4
-1
@@ -86,9 +86,12 @@ export class Image implements plugins.servezoneInterfaces.data.IImage {
|
||||
const response = await pushImageTR.fire({
|
||||
identity: this.cloudlyClientRef.identity,
|
||||
imageId: this.id,
|
||||
versionString: '',
|
||||
versionString: imageVersion,
|
||||
imageStream: virtualStream,
|
||||
});
|
||||
if (!response.allowed) {
|
||||
throw new Error(`Cloudly rejected image push for ${this.id}:${imageVersion}`);
|
||||
}
|
||||
await virtualStream.readFromWebstream(imageReadableArg);
|
||||
await this.update();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user