Closed kishoreallwynraj closed 3 years ago
@kishoreallwynraj the manifest should be passed as an array of Dictionary<string, Object>
, not a string. Each dictionary representing a different resource.
The reason the string is accepted is because the typescript method signature uses any[]
, which translates to Object[]
in C# (and Java as well).
I'm repurposing this issue to change the signature to accept a Record<string, any>[]
.
Thanks!
Thanks @iliapolo .. i am able to add the manifest now by using the approach you mentioned like below
var nsManifest = new Dictionary<string, object> {
{ "apiVersion", "v1" },
{ "kind", "Namespace" },
{ "metadata", new Dictionary<string, string> { { "name", "examples" } } }
};
cluster.AddManifest("ns", nsManifest);
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
With this issue brokes when you passed a object, I undertand you want to have map, but with data object now doesn't work
Reproduction Steps
I am trying to apply a simple K8s manifest to create a namespace in the Fargate cluster, but while execution it fails to apply
What did you expect to happen?
Provided manifest gets applies to the cluster and a new namespace gets created.
What actually happened?
Received below error while running the cdk deploy step
On checking the generated template fragment, i see the manifest is created with extra backslashes like below.
Environment
Other
I also tried to create custom structs and tried to apply it instead of passing the manifest json as string like below
But the cdk synth process fails with below error
This is :bug: Bug Report