aws-quickstart / cdk-eks-blueprints

AWS Quick Start Team
Apache License 2.0
447 stars 198 forks source link

helm-addon.kubectl-provider.ts : string replacement data lost #460

Closed laptua closed 2 years ago

laptua commented 2 years ago

Describe the bug

The code: https://github.com/aws-quickstart/cdk-eks-blueprints/blob/main/lib/addons/helm-addon/kubectl-provider.ts

    public static applyManifestTemplate = function(document: any, values: Values) : any {
        const valueMap = new Map(Object.entries(values));
        let data = JSON.stringify(document);
        valueMap.forEach((value: string, key: string) => {
            data.replace(`{{${key}}}`, value);
        });
        return JSON.parse(data);
    };

should be:

          data=data.replace(`{{${key}}}`, value);

Expected Behavior

string replacement

Current Behavior

string replacement do not occur

Reproduction Steps

see code above

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.25.0 (build ae1cb4b)

EKS Blueprints Version

1.1.0

Node.js Version

v14.19.3

Environment details (OS name and version, etc.)

mac

Other information

No response

shapirov103 commented 2 years ago

Thank you for catching it. This was fixed in #445 link

shapirov103 commented 2 years ago

@laptua can you verify when you get a chance on 1.2.0? We can reopen if you observe any issues.