Skip to content

Commit 5c0f9d8

Browse files
committed
Put back ServiceID as it's still referenced in older pulumi state file
1 parent 7a509e7 commit 5c0f9d8

File tree

3 files changed

+227
-15
lines changed

3 files changed

+227
-15
lines changed

io/defang/v1/fabric.proto

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -445,40 +445,46 @@ message ProjectUpdate {
445445
}
446446

447447
enum Platform {
448-
option deprecated = true; // still used by pulumi-defang provider
448+
option deprecated = true; // still used by pulumi-defang provider in state files
449449
LINUX_AMD64 = 0;
450450
LINUX_ARM64 = 1;
451451
LINUX_ANY = 2;
452452
}
453453

454-
message GetRequest { // was GetRequest
454+
message ServiceID {
455+
option deprecated = true; // still used by pulumi-defang provider in state files
456+
string name = 1;
457+
string project = 2;
458+
}
459+
460+
message GetRequest { // was ServiceID
455461
string name = 1;
456462
string project = 2;
457463
}
458464

459465
message Device {
460-
option deprecated = true; // still used by pulumi-defang provider
466+
option deprecated = true; // still used by pulumi-defang provider in state files
461467
repeated string capabilities = 1; // "gpu", "tpu", etc.
462468
string driver = 2; // "nvidia", "amd", etc.
463469
uint32 count = 3; // number of devices to reserve
464470
}
465471

466472
message Resource {
467-
option deprecated = true; // still used by pulumi-defang provider
473+
option deprecated = true; // still used by pulumi-defang provider in state files
468474
float memory = 1; // in MiB
469475
float cpus = 2; // fractional vCPUs
470476
repeated Device devices = 3; // devices & capabilities
471477
}
472478

473479
message Resources {
474-
option deprecated = true; // still used by pulumi-defang provider
480+
option deprecated = true; // still used by pulumi-defang provider in state files
475481
Resource reservations = 1; // requested resources
476482

477483
// Resource limits = 2; // hard limits
478484
}
479485

480486
message Deploy {
481-
option deprecated = true; // still used by pulumi-defang provider
487+
option deprecated = true; // still used by pulumi-defang provider in state files
482488
uint32 replicas = 1; // number of initial replicas
483489
Resources resources = 2; // reservations and limits
484490

@@ -488,7 +494,7 @@ message Deploy {
488494
}
489495

490496
enum Protocol {
491-
option deprecated = true; // still used by pulumi-defang provider
497+
option deprecated = true; // still used by pulumi-defang provider in state files
492498
ANY = 0; // unspecified means any protocol
493499
UDP = 1;
494500
TCP = 2;
@@ -498,13 +504,13 @@ enum Protocol {
498504
}
499505

500506
enum Mode {
501-
option deprecated = true; // still used by pulumi-defang provider
507+
option deprecated = true; // still used by pulumi-defang provider in state files
502508
HOST = 0; // no load-balancer; suitable for internal services and functions
503509
INGRESS = 1; // with load-balancer; suitable for public services
504510
}
505511

506512
message Port {
507-
option deprecated = true; // still used by pulumi-defang provider
513+
option deprecated = true; // still used by pulumi-defang provider in state files
508514
uint32 target = 1;
509515
Protocol protocol = 2;
510516
Mode mode = 3; // load-balanced (ingress) or not (host)
@@ -514,13 +520,13 @@ message Port {
514520
}
515521

516522
message Secret {
517-
option deprecated = true; // still used by pulumi-defang provider
523+
option deprecated = true; // still used by pulumi-defang provider in state files
518524
string source = 1; // name of the secret
519525
// string target = 2;
520526
}
521527

522528
message Build {
523-
option deprecated = true; // still used by pulumi-defang provider
529+
option deprecated = true; // still used by pulumi-defang provider in state files
524530
string context = 1; // path or URL to the build context
525531
string dockerfile = 2; // path to the Dockerfile
526532
map<string, string> args = 3; // build-time variables
@@ -529,22 +535,22 @@ message Build {
529535
}
530536

531537
message HealthCheck {
532-
option deprecated = true; // still used by pulumi-defang provider
538+
option deprecated = true; // still used by pulumi-defang provider in state files
533539
repeated string test = 1;
534540
uint32 interval = 2; // in seconds
535541
uint32 timeout = 3; // in seconds; must be less than interval
536542
uint32 retries = 4;
537543
}
538544

539545
enum Network {
540-
option deprecated = true; // still used by pulumi-defang provider
546+
option deprecated = true; // still used by pulumi-defang provider in state files
541547
UNSPECIFIED = 0; // was: internal=false
542548
PRIVATE = 1; // was: internal=true
543549
PUBLIC = 2;
544550
}
545551

546552
message Service {
547-
option deprecated = true; // still used by pulumi-defang provider
553+
option deprecated = true; // still used by pulumi-defang provider in state files
548554
string name = 1;
549555
string image = 2;
550556
Platform platform = 3;
@@ -568,7 +574,7 @@ message Service {
568574
}
569575

570576
message StaticFiles {
571-
option deprecated = true; // still used by pulumi-defang provider
577+
option deprecated = true; // still used by pulumi-defang provider in state files
572578
string folder = 1;
573579
repeated string redirects = 2;
574580
}

protos/io/defang/v1/fabric_pb.d.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,6 +1398,30 @@ export namespace ProjectUpdate {
13981398
}
13991399
}
14001400

1401+
export class ServiceID extends jspb.Message {
1402+
getName(): string;
1403+
setName(value: string): void;
1404+
1405+
getProject(): string;
1406+
setProject(value: string): void;
1407+
1408+
serializeBinary(): Uint8Array;
1409+
toObject(includeInstance?: boolean): ServiceID.AsObject;
1410+
static toObject(includeInstance: boolean, msg: ServiceID): ServiceID.AsObject;
1411+
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
1412+
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
1413+
static serializeBinaryToWriter(message: ServiceID, writer: jspb.BinaryWriter): void;
1414+
static deserializeBinary(bytes: Uint8Array): ServiceID;
1415+
static deserializeBinaryFromReader(message: ServiceID, reader: jspb.BinaryReader): ServiceID;
1416+
}
1417+
1418+
export namespace ServiceID {
1419+
export type AsObject = {
1420+
name: string,
1421+
project: string,
1422+
}
1423+
}
1424+
14011425
export class GetRequest extends jspb.Message {
14021426
getName(): string;
14031427
setName(value: string): void;

protos/io/defang/v1/fabric_pb.js

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ goog.exportSymbol('proto.io.defang.v1.Secret', null, global);
8585
goog.exportSymbol('proto.io.defang.v1.SecretValue', null, global);
8686
goog.exportSymbol('proto.io.defang.v1.Secrets', null, global);
8787
goog.exportSymbol('proto.io.defang.v1.Service', null, global);
88+
goog.exportSymbol('proto.io.defang.v1.ServiceID', null, global);
8889
goog.exportSymbol('proto.io.defang.v1.ServiceInfo', null, global);
8990
goog.exportSymbol('proto.io.defang.v1.ServiceState', null, global);
9091
goog.exportSymbol('proto.io.defang.v1.SetOptionsRequest', null, global);
@@ -1113,6 +1114,27 @@ if (goog.DEBUG && !COMPILED) {
11131114
*/
11141115
proto.io.defang.v1.ProjectUpdate.displayName = 'proto.io.defang.v1.ProjectUpdate';
11151116
}
1117+
/**
1118+
* Generated by JsPbCodeGenerator.
1119+
* @param {Array=} opt_data Optional initial data array, typically from a
1120+
* server response, or constructed directly in Javascript. The array is used
1121+
* in place and becomes part of the constructed object. It is not cloned.
1122+
* If no data is provided, the constructed object will be empty, but still
1123+
* valid.
1124+
* @extends {jspb.Message}
1125+
* @constructor
1126+
*/
1127+
proto.io.defang.v1.ServiceID = function(opt_data) {
1128+
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
1129+
};
1130+
goog.inherits(proto.io.defang.v1.ServiceID, jspb.Message);
1131+
if (goog.DEBUG && !COMPILED) {
1132+
/**
1133+
* @public
1134+
* @override
1135+
*/
1136+
proto.io.defang.v1.ServiceID.displayName = 'proto.io.defang.v1.ServiceID';
1137+
}
11161138
/**
11171139
* Generated by JsPbCodeGenerator.
11181140
* @param {Array=} opt_data Optional initial data array, typically from a
@@ -11440,6 +11462,166 @@ proto.io.defang.v1.ProjectUpdate.prototype.setCdVersion = function(value) {
1144011462

1144111463

1144211464

11465+
if (jspb.Message.GENERATE_TO_OBJECT) {
11466+
/**
11467+
* Creates an object representation of this proto.
11468+
* Field names that are reserved in JavaScript and will be renamed to pb_name.
11469+
* Optional fields that are not set will be set to undefined.
11470+
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
11471+
* For the list of reserved names please see:
11472+
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
11473+
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
11474+
* JSPB instance for transitional soy proto support:
11475+
* http://goto/soy-param-migration
11476+
* @return {!Object}
11477+
*/
11478+
proto.io.defang.v1.ServiceID.prototype.toObject = function(opt_includeInstance) {
11479+
return proto.io.defang.v1.ServiceID.toObject(opt_includeInstance, this);
11480+
};
11481+
11482+
11483+
/**
11484+
* Static version of the {@see toObject} method.
11485+
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
11486+
* the JSPB instance for transitional soy proto support:
11487+
* http://goto/soy-param-migration
11488+
* @param {!proto.io.defang.v1.ServiceID} msg The msg instance to transform.
11489+
* @return {!Object}
11490+
* @suppress {unusedLocalVariables} f is only used for nested messages
11491+
*/
11492+
proto.io.defang.v1.ServiceID.toObject = function(includeInstance, msg) {
11493+
var f, obj = {
11494+
name: jspb.Message.getFieldWithDefault(msg, 1, ""),
11495+
project: jspb.Message.getFieldWithDefault(msg, 2, "")
11496+
};
11497+
11498+
if (includeInstance) {
11499+
obj.$jspbMessageInstance = msg;
11500+
}
11501+
return obj;
11502+
};
11503+
}
11504+
11505+
11506+
/**
11507+
* Deserializes binary data (in protobuf wire format).
11508+
* @param {jspb.ByteSource} bytes The bytes to deserialize.
11509+
* @return {!proto.io.defang.v1.ServiceID}
11510+
*/
11511+
proto.io.defang.v1.ServiceID.deserializeBinary = function(bytes) {
11512+
var reader = new jspb.BinaryReader(bytes);
11513+
var msg = new proto.io.defang.v1.ServiceID;
11514+
return proto.io.defang.v1.ServiceID.deserializeBinaryFromReader(msg, reader);
11515+
};
11516+
11517+
11518+
/**
11519+
* Deserializes binary data (in protobuf wire format) from the
11520+
* given reader into the given message object.
11521+
* @param {!proto.io.defang.v1.ServiceID} msg The message object to deserialize into.
11522+
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
11523+
* @return {!proto.io.defang.v1.ServiceID}
11524+
*/
11525+
proto.io.defang.v1.ServiceID.deserializeBinaryFromReader = function(msg, reader) {
11526+
while (reader.nextField()) {
11527+
if (reader.isEndGroup()) {
11528+
break;
11529+
}
11530+
var field = reader.getFieldNumber();
11531+
switch (field) {
11532+
case 1:
11533+
var value = /** @type {string} */ (reader.readString());
11534+
msg.setName(value);
11535+
break;
11536+
case 2:
11537+
var value = /** @type {string} */ (reader.readString());
11538+
msg.setProject(value);
11539+
break;
11540+
default:
11541+
reader.skipField();
11542+
break;
11543+
}
11544+
}
11545+
return msg;
11546+
};
11547+
11548+
11549+
/**
11550+
* Serializes the message to binary data (in protobuf wire format).
11551+
* @return {!Uint8Array}
11552+
*/
11553+
proto.io.defang.v1.ServiceID.prototype.serializeBinary = function() {
11554+
var writer = new jspb.BinaryWriter();
11555+
proto.io.defang.v1.ServiceID.serializeBinaryToWriter(this, writer);
11556+
return writer.getResultBuffer();
11557+
};
11558+
11559+
11560+
/**
11561+
* Serializes the given message to binary data (in protobuf wire
11562+
* format), writing to the given BinaryWriter.
11563+
* @param {!proto.io.defang.v1.ServiceID} message
11564+
* @param {!jspb.BinaryWriter} writer
11565+
* @suppress {unusedLocalVariables} f is only used for nested messages
11566+
*/
11567+
proto.io.defang.v1.ServiceID.serializeBinaryToWriter = function(message, writer) {
11568+
var f = undefined;
11569+
f = message.getName();
11570+
if (f.length > 0) {
11571+
writer.writeString(
11572+
1,
11573+
f
11574+
);
11575+
}
11576+
f = message.getProject();
11577+
if (f.length > 0) {
11578+
writer.writeString(
11579+
2,
11580+
f
11581+
);
11582+
}
11583+
};
11584+
11585+
11586+
/**
11587+
* optional string name = 1;
11588+
* @return {string}
11589+
*/
11590+
proto.io.defang.v1.ServiceID.prototype.getName = function() {
11591+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
11592+
};
11593+
11594+
11595+
/**
11596+
* @param {string} value
11597+
* @return {!proto.io.defang.v1.ServiceID} returns this
11598+
*/
11599+
proto.io.defang.v1.ServiceID.prototype.setName = function(value) {
11600+
return jspb.Message.setProto3StringField(this, 1, value);
11601+
};
11602+
11603+
11604+
/**
11605+
* optional string project = 2;
11606+
* @return {string}
11607+
*/
11608+
proto.io.defang.v1.ServiceID.prototype.getProject = function() {
11609+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
11610+
};
11611+
11612+
11613+
/**
11614+
* @param {string} value
11615+
* @return {!proto.io.defang.v1.ServiceID} returns this
11616+
*/
11617+
proto.io.defang.v1.ServiceID.prototype.setProject = function(value) {
11618+
return jspb.Message.setProto3StringField(this, 2, value);
11619+
};
11620+
11621+
11622+
11623+
11624+
1144311625
if (jspb.Message.GENERATE_TO_OBJECT) {
1144411626
/**
1144511627
* Creates an object representation of this proto.

0 commit comments

Comments
 (0)