Skip to content

Commit 0ca53bc

Browse files
author
Feroze Mohideen
authored
addons in cloud contract and datadog addon type (#227)
* addons in cloud contract and datadog addon * remove * resources
1 parent e2024af commit 0ca53bc

File tree

8 files changed

+539
-82
lines changed

8 files changed

+539
-82
lines changed

Diff for: generated/go/porter/v1/addons.pb.go

+195-29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: generated/go/porter/v1/cloud_contract.pb.go

+148-53
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: generated/js/src/porter/v1/addons_pb.d.ts

+85
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ export declare enum AddonType {
3131
* @generated from enum value: ADDON_TYPE_REDIS = 2;
3232
*/
3333
REDIS = 2,
34+
35+
/**
36+
* ADDON_TYPE_DATADOG is the datadog addon type
37+
*
38+
* @generated from enum value: ADDON_TYPE_DATADOG = 3;
39+
*/
40+
DATADOG = 3,
3441
}
3542

3643
/**
@@ -110,6 +117,14 @@ export declare class Addon extends Message<Addon> {
110117
*/
111118
value: Redis;
112119
case: "redis";
120+
} | {
121+
/**
122+
* datadog is the configuration for the datadog addon
123+
*
124+
* @generated from field: porter.v1.Datadog datadog = 6;
125+
*/
126+
value: Datadog;
127+
case: "datadog";
113128
} | { case: undefined; value?: undefined };
114129

115130
constructor(data?: PartialMessage<Addon>);
@@ -232,3 +247,73 @@ export declare class Redis extends Message<Redis> {
232247
static equals(a: Redis | PlainMessage<Redis> | undefined, b: Redis | PlainMessage<Redis> | undefined): boolean;
233248
}
234249

250+
/**
251+
* Datadog is the configuration for Datadog
252+
*
253+
* @generated from message porter.v1.Datadog
254+
*/
255+
export declare class Datadog extends Message<Datadog> {
256+
/**
257+
* site is the datadog site url
258+
*
259+
* @generated from field: optional string site = 1;
260+
*/
261+
site?: string;
262+
263+
/**
264+
* api_key is the api key
265+
*
266+
* @generated from field: optional string api_key = 2;
267+
*/
268+
apiKey?: string;
269+
270+
/**
271+
* logging_enabled determines whether all container logs go to datadog
272+
*
273+
* @generated from field: optional bool logging_enabled = 3;
274+
*/
275+
loggingEnabled?: boolean;
276+
277+
/**
278+
* dogstatsd_enabled determines whether dogstatsd is enabled
279+
*
280+
* @generated from field: optional bool dogstatsd_enabled = 4;
281+
*/
282+
dogstatsdEnabled?: boolean;
283+
284+
/**
285+
* apm_enabled determines whether apm is enabled
286+
*
287+
* @generated from field: optional bool apm_enabled = 5;
288+
*/
289+
apmEnabled?: boolean;
290+
291+
/**
292+
* cpu_cores is the number of CPU cores to allocate to datadog
293+
*
294+
* @generated from field: optional float cpu_cores = 6;
295+
*/
296+
cpuCores?: number;
297+
298+
/**
299+
* ram_megabytes is the amount of memory to allocate to datadog
300+
*
301+
* @generated from field: optional int32 ram_megabytes = 7;
302+
*/
303+
ramMegabytes?: number;
304+
305+
constructor(data?: PartialMessage<Datadog>);
306+
307+
static readonly runtime: typeof proto3;
308+
static readonly typeName = "porter.v1.Datadog";
309+
static readonly fields: FieldList;
310+
311+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Datadog;
312+
313+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Datadog;
314+
315+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Datadog;
316+
317+
static equals(a: Datadog | PlainMessage<Datadog> | undefined, b: Datadog | PlainMessage<Datadog> | undefined): boolean;
318+
}
319+

Diff for: generated/js/src/porter/v1/addons_pb.js

+20
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const AddonType = /*@__PURE__*/ proto3.makeEnum(
1515
{no: 0, name: "ADDON_TYPE_UNSPECIFIED", localName: "UNSPECIFIED"},
1616
{no: 1, name: "ADDON_TYPE_POSTGRES", localName: "POSTGRES"},
1717
{no: 2, name: "ADDON_TYPE_REDIS", localName: "REDIS"},
18+
{no: 3, name: "ADDON_TYPE_DATADOG", localName: "DATADOG"},
1819
],
1920
);
2021

@@ -44,6 +45,7 @@ export const Addon = /*@__PURE__*/ proto3.makeMessageType(
4445
{ no: 3, name: "env_groups", kind: "message", T: EnvGroup, repeated: true },
4546
{ no: 4, name: "postgres", kind: "message", T: Postgres, oneof: "config" },
4647
{ no: 5, name: "redis", kind: "message", T: Redis, oneof: "config" },
48+
{ no: 6, name: "datadog", kind: "message", T: Datadog, oneof: "config" },
4749
],
4850
);
4951

@@ -78,3 +80,21 @@ export const Redis = /*@__PURE__*/ proto3.makeMessageType(
7880
],
7981
);
8082

83+
/**
84+
* Datadog is the configuration for Datadog
85+
*
86+
* @generated from message porter.v1.Datadog
87+
*/
88+
export const Datadog = /*@__PURE__*/ proto3.makeMessageType(
89+
"porter.v1.Datadog",
90+
() => [
91+
{ no: 1, name: "site", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
92+
{ no: 2, name: "api_key", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
93+
{ no: 3, name: "logging_enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
94+
{ no: 4, name: "dogstatsd_enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
95+
{ no: 5, name: "apm_enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
96+
{ no: 6, name: "cpu_cores", kind: "scalar", T: 2 /* ScalarType.FLOAT */, opt: true },
97+
{ no: 7, name: "ram_megabytes", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true },
98+
],
99+
);
100+

Diff for: generated/js/src/porter/v1/cloud_contract_pb.d.ts

+43
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
77
import { Message, proto3 } from "@bufbuild/protobuf";
88
import type { ManagedDatastore } from "./datastore_pb.js";
9+
import type { Addon } from "./addons_pb.js";
910

1011
/**
1112
* CloudContract is a contract for all Porter-managed infrastructure within a project
@@ -20,6 +21,13 @@ export declare class CloudContract extends Message<CloudContract> {
2021
*/
2122
datastores: ManagedDatastore[];
2223

24+
/**
25+
* addons is the list of addons associated with the project
26+
*
27+
* @generated from field: repeated porter.v1.CloudContractAddon addons = 2;
28+
*/
29+
addons: CloudContractAddon[];
30+
2331
constructor(data?: PartialMessage<CloudContract>);
2432

2533
static readonly runtime: typeof proto3;
@@ -35,6 +43,41 @@ export declare class CloudContract extends Message<CloudContract> {
3543
static equals(a: CloudContract | PlainMessage<CloudContract> | undefined, b: CloudContract | PlainMessage<CloudContract> | undefined): boolean;
3644
}
3745

46+
/**
47+
* CloudContractAddon is a contract for an addon managed by the cloud contract
48+
*
49+
* @generated from message porter.v1.CloudContractAddon
50+
*/
51+
export declare class CloudContractAddon extends Message<CloudContractAddon> {
52+
/**
53+
* cluster_id is the id of the cluster that the addon is deployed on
54+
*
55+
* @generated from field: int32 cluster_id = 1;
56+
*/
57+
clusterId: number;
58+
59+
/**
60+
* addon is the addon configuration
61+
*
62+
* @generated from field: porter.v1.Addon addon = 2;
63+
*/
64+
addon?: Addon;
65+
66+
constructor(data?: PartialMessage<CloudContractAddon>);
67+
68+
static readonly runtime: typeof proto3;
69+
static readonly typeName = "porter.v1.CloudContractAddon";
70+
static readonly fields: FieldList;
71+
72+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CloudContractAddon;
73+
74+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CloudContractAddon;
75+
76+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CloudContractAddon;
77+
78+
static equals(a: CloudContractAddon | PlainMessage<CloudContractAddon> | undefined, b: CloudContractAddon | PlainMessage<CloudContractAddon> | undefined): boolean;
79+
}
80+
3881
/**
3982
* CloudContractRevision represents a cloud contract revision which should be reconciled
4083
*

Diff for: generated/js/src/porter/v1/cloud_contract_pb.js

+15
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import { proto3 } from "@bufbuild/protobuf";
77
import { ManagedDatastore } from "./datastore_pb.js";
8+
import { Addon } from "./addons_pb.js";
89

910
/**
1011
* CloudContract is a contract for all Porter-managed infrastructure within a project
@@ -15,6 +16,20 @@ export const CloudContract = /*@__PURE__*/ proto3.makeMessageType(
1516
"porter.v1.CloudContract",
1617
() => [
1718
{ no: 1, name: "datastores", kind: "message", T: ManagedDatastore, repeated: true },
19+
{ no: 2, name: "addons", kind: "message", T: CloudContractAddon, repeated: true },
20+
],
21+
);
22+
23+
/**
24+
* CloudContractAddon is a contract for an addon managed by the cloud contract
25+
*
26+
* @generated from message porter.v1.CloudContractAddon
27+
*/
28+
export const CloudContractAddon = /*@__PURE__*/ proto3.makeMessageType(
29+
"porter.v1.CloudContractAddon",
30+
() => [
31+
{ no: 1, name: "cluster_id", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
32+
{ no: 2, name: "addon", kind: "message", T: Addon },
1833
],
1934
);
2035

Diff for: porter/v1/addons.proto

+22
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ enum AddonType {
1111
ADDON_TYPE_POSTGRES = 1;
1212
// ADDON_TYPE_REDIS is the redis addon type
1313
ADDON_TYPE_REDIS = 2;
14+
// ADDON_TYPE_DATADOG is the datadog addon type
15+
ADDON_TYPE_DATADOG = 3;
1416
}
1517

1618
// PrerequisiteAddon specifies an addon that must be installed before any apps can be installed
@@ -34,6 +36,8 @@ message Addon {
3436
Postgres postgres = 4;
3537
// redis is the configuration for the redis addon
3638
Redis redis = 5;
39+
// datadog is the configuration for the datadog addon
40+
Datadog datadog = 6;
3741
}
3842
}
3943

@@ -62,3 +66,21 @@ message Redis {
6266
// master_user_password_literal is the string value of the password; this is only used for creating the datastore password secret and is wiped when the contract is saved
6367
optional string master_user_password_literal = 4;
6468
}
69+
70+
// Datadog is the configuration for Datadog
71+
message Datadog {
72+
// site is the datadog site url
73+
optional string site = 1;
74+
// api_key is the api key
75+
optional string api_key = 2;
76+
// logging_enabled determines whether all container logs go to datadog
77+
optional bool logging_enabled = 3;
78+
// dogstatsd_enabled determines whether dogstatsd is enabled
79+
optional bool dogstatsd_enabled = 4;
80+
// apm_enabled determines whether apm is enabled
81+
optional bool apm_enabled = 5;
82+
// cpu_cores is the number of CPU cores to allocate to datadog
83+
optional float cpu_cores = 6;
84+
// ram_megabytes is the amount of memory to allocate to datadog
85+
optional int32 ram_megabytes = 7;
86+
}

Diff for: porter/v1/cloud_contract.proto

+11
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,23 @@ syntax = "proto3";
22

33
package porter.v1;
44

5+
import "porter/v1/addons.proto";
56
import "porter/v1/datastore.proto";
67

78
// CloudContract is a contract for all Porter-managed infrastructure within a project
89
message CloudContract {
910
// datastores is the list of datastores associated with the project
1011
repeated ManagedDatastore datastores = 1;
12+
// addons is the list of addons associated with the project
13+
repeated CloudContractAddon addons = 2;
14+
}
15+
16+
// CloudContractAddon is a contract for an addon managed by the cloud contract
17+
message CloudContractAddon {
18+
// cluster_id is the id of the cluster that the addon is deployed on
19+
int32 cluster_id = 1;
20+
// addon is the addon configuration
21+
Addon addon = 2;
1122
}
1223

1324
// CloudContractRevision represents a cloud contract revision which should be reconciled

0 commit comments

Comments
 (0)