diff --git a/containers/aws.w b/containers/aws.w index 6b3e613f..056d9aa1 100644 --- a/containers/aws.w +++ b/containers/aws.w @@ -13,7 +13,7 @@ pub class Aws { accountData: aws.dataAwsCallerIdentity.DataAwsCallerIdentity; - init() { + new() { this.regionData = new aws.dataAwsRegion.DataAwsRegion(); this.accountData = new aws.dataAwsCallerIdentity.DataAwsCallerIdentity(); } diff --git a/containers/package.json b/containers/package.json index ba00f0e2..66013348 100644 --- a/containers/package.json +++ b/containers/package.json @@ -1,6 +1,6 @@ { "name": "@winglibs/containers", - "version": "0.0.10", + "version": "0.0.11", "description": "Container support for Wing", "repository": { "type": "git", diff --git a/containers/test/containers.test.w b/containers/test/containers.test.w index 43fbde3f..f9b4363f 100644 --- a/containers/test/containers.test.w +++ b/containers/test/containers.test.w @@ -27,9 +27,7 @@ let echo = new containers.Workload( let httpGet = inflight (url: str?): str => { if let url = url { - if let body = http.get(url).body { - return body; - } + return http.get(url).body; } throw "no body"; diff --git a/containers/test/local-build.test.w b/containers/test/local-build.test.w index 0a5cf216..27d8951f 100644 --- a/containers/test/local-build.test.w +++ b/containers/test/local-build.test.w @@ -10,9 +10,5 @@ let app = new containers.Workload( test "can access container" { let response = http.get("${app.publicUrl}"); - if let body = response.body { - log(body); - } - - assert((response.body ?? "") == "Hello, Wingnuts!"); + assert(response.body == "Hello, Wingnuts!"); } \ No newline at end of file diff --git a/containers/test/simple.test.w b/containers/test/simple.test.w index fae513fb..99e41e4b 100644 --- a/containers/test/simple.test.w +++ b/containers/test/simple.test.w @@ -18,9 +18,6 @@ new cloud.Function(inflight () => { test "http get" { if let url = app.publicUrl { let response = http.get(url); - log(response.body ?? ""); - if let body = response.body { - assert(body.contains("bang_bang")); - } + assert(response.body.contains("bang_bang")); } } diff --git a/containers/tfaws-ecr.w b/containers/tfaws-ecr.w index fb42f31b..2c0eb639 100644 --- a/containers/tfaws-ecr.w +++ b/containers/tfaws-ecr.w @@ -13,7 +13,7 @@ pub class Repository { pub image: str; pub deps: Array; - init(props: RepositoryProps) { + new(props: RepositoryProps) { let deps = MutArray[]; let count = 5; diff --git a/containers/tfaws-eks.w b/containers/tfaws-eks.w index 72e9f875..75e92049 100644 --- a/containers/tfaws-eks.w +++ b/containers/tfaws-eks.w @@ -68,7 +68,7 @@ pub class ClusterBase impl ICluster { class ClusterRef extends ClusterBase impl ICluster { _attributes: ClusterAttributes; - init(attributes: ClusterAttributes) { + new(attributes: ClusterAttributes) { this._attributes = attributes; } @@ -115,7 +115,7 @@ pub class Cluster extends ClusterBase impl ICluster { vpc: vpc.Vpc; - init(clusterName: str) { + new(clusterName: str) { let privateSubnetTags = MutMap{}; privateSubnetTags.set("kubernetes.io/role/internal-elb", "1"); privateSubnetTags.set("kubernetes.io/cluster/${clusterName}", "shared"); diff --git a/containers/tfaws-vpc.w b/containers/tfaws-vpc.w index c3dec015..52c0bfe2 100644 --- a/containers/tfaws-vpc.w +++ b/containers/tfaws-vpc.w @@ -11,7 +11,7 @@ pub class Vpc { pub privateSubnets: Array; pub publicSubnets: Array; - init(props: VpcProps?) { + new(props: VpcProps?) { let available = new aws.dataAwsAvailabilityZones.DataAwsAvailabilityZones(filter: { name: "opt-in-status", values: ["opt-in-not-required"] diff --git a/containers/workload.sim.w b/containers/workload.sim.w index db163fe1..9643b71a 100644 --- a/containers/workload.sim.w +++ b/containers/workload.sim.w @@ -16,7 +16,7 @@ pub class Workload_sim impl api.IWorkload { public: bool; state: sim.State; - init(props: api.WorkloadProps) { + new(props: api.WorkloadProps) { this.appDir = utils.entrypointDir(this); this.props = props; this.state = new sim.State(); diff --git a/containers/workload.tfaws.w b/containers/workload.tfaws.w index d151e864..8bae6ed4 100644 --- a/containers/workload.tfaws.w +++ b/containers/workload.tfaws.w @@ -12,7 +12,7 @@ pub class Workload_tfaws impl api.IWorkload { internalUrl: str?; publicUrl: str?; - init(props: api.WorkloadProps) { + new(props: api.WorkloadProps) { let cluster = eks.Cluster.getOrCreate(this); let var image = props.image; @@ -36,7 +36,7 @@ pub class Workload_tfaws impl api.IWorkload { class _Chart extends cdk8s.Chart { name: str; - init(props: api.WorkloadProps) { + new(props: api.WorkloadProps) { let env = props.env ?? {}; let envVariables = MutMap{}; diff --git a/containers/workload.w b/containers/workload.w index f7aaf059..2bb13345 100644 --- a/containers/workload.w +++ b/containers/workload.w @@ -9,7 +9,7 @@ pub class Workload impl api.IWorkload { pub internalUrl: str?; pub publicUrl: str?; - init(props: api.WorkloadProps) { + new(props: api.WorkloadProps) { let target = util.env("WING_TARGET"); if target == "sim" {