codify-plugin-lib 1.0.117 → 1.0.119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugin/plugin.js +4 -3
- package/package.json +1 -1
- package/src/plugin/plugin.ts +7 -4
package/dist/plugin/plugin.js
CHANGED
|
@@ -55,9 +55,9 @@ export class Plugin {
|
|
|
55
55
|
if (!this.resourceControllers.has(data.config.type)) {
|
|
56
56
|
throw new Error(`Cannot get info for resource ${data.config.type}, resource doesn't exist`);
|
|
57
57
|
}
|
|
58
|
-
const result = await this.resourceControllers
|
|
58
|
+
const result = await ptyLocalStorage.run(this.planPty, () => this.resourceControllers
|
|
59
59
|
.get(data.config.type)
|
|
60
|
-
?.import(data.config);
|
|
60
|
+
?.import(data.config));
|
|
61
61
|
return {
|
|
62
62
|
request: data.config,
|
|
63
63
|
result: result ?? [],
|
|
@@ -98,8 +98,9 @@ export class Plugin {
|
|
|
98
98
|
throw new Error('Malformed plan with resource that cannot be found');
|
|
99
99
|
}
|
|
100
100
|
await resource.apply(plan);
|
|
101
|
+
// Validate using desired/desired. If the apply was successful, no changes should be reported back
|
|
101
102
|
const validationPlan = await ptyLocalStorage.run(new BackgroundPty(), async () => {
|
|
102
|
-
const result = await resource.plan(plan.desiredConfig, plan.
|
|
103
|
+
const result = await resource.plan(plan.desiredConfig, plan.desiredConfig, plan.statefulMode);
|
|
103
104
|
await getPty().kill();
|
|
104
105
|
return result;
|
|
105
106
|
});
|
package/package.json
CHANGED
package/src/plugin/plugin.ts
CHANGED
|
@@ -87,9 +87,11 @@ export class Plugin {
|
|
|
87
87
|
throw new Error(`Cannot get info for resource ${data.config.type}, resource doesn't exist`);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
const result = await this.
|
|
91
|
-
.
|
|
92
|
-
|
|
90
|
+
const result = await ptyLocalStorage.run(this.planPty, () =>
|
|
91
|
+
this.resourceControllers
|
|
92
|
+
.get(data.config.type!)
|
|
93
|
+
?.import(data.config)
|
|
94
|
+
)
|
|
93
95
|
|
|
94
96
|
return {
|
|
95
97
|
request: data.config,
|
|
@@ -149,10 +151,11 @@ export class Plugin {
|
|
|
149
151
|
|
|
150
152
|
await resource.apply(plan);
|
|
151
153
|
|
|
154
|
+
// Validate using desired/desired. If the apply was successful, no changes should be reported back
|
|
152
155
|
const validationPlan = await ptyLocalStorage.run(new BackgroundPty(), async () => {
|
|
153
156
|
const result = await resource.plan(
|
|
154
157
|
plan.desiredConfig,
|
|
155
|
-
plan.
|
|
158
|
+
plan.desiredConfig,
|
|
156
159
|
plan.statefulMode
|
|
157
160
|
);
|
|
158
161
|
|