Skip to content

Commit

Permalink
fix(k8s): remove chart-app- prefix from resource names (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
eladb authored Aug 4, 2024
1 parent c4110f8 commit 3fe148b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions k8s/examples/nodejs.main.w.snap
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: chart-app-configmap-c85bc1e0
name: configmap-c870426f
data:
index.js: console.log("hello, k8s");
immutable: false
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: chart-app-deployment-c843205c
name: deployment-c87ec702
spec:
minReadySeconds: 0
progressDeadlineSeconds: 600
replicas: 3
selector:
matchLabels:
cdk8s.io/metadata.addr: Chart-App-Deployment-c84d7818
cdk8s.io/metadata.addr: Deployment-c8c1f37c
strategy:
rollingUpdate:
maxSurge: 25%
Expand All @@ -25,7 +25,7 @@ spec:
template:
metadata:
labels:
cdk8s.io/metadata.addr: Chart-App-Deployment-c84d7818
cdk8s.io/metadata.addr: Deployment-c8c1f37c
spec:
automountServiceAccountToken: false
containers:
Expand Down Expand Up @@ -56,7 +56,7 @@ spec:
port: 80
volumeMounts:
- mountPath: /var/lib/app
name: configmap-chart-app-configmap-c85bc1e0
name: configmap-configmap-c870426f
workingDir: /var/lib/app
dnsPolicy: ClusterFirst
hostNetwork: false
Expand All @@ -68,18 +68,18 @@ spec:
terminationGracePeriodSeconds: 30
volumes:
- configMap:
name: chart-app-configmap-c85bc1e0
name: configmap-chart-app-configmap-c85bc1e0
name: configmap-c870426f
name: configmap-configmap-c870426f
---
apiVersion: v1
kind: Service
metadata:
name: chart-app-deployment-service-c857421f
name: deployment-service-c8f11c8e
spec:
externalIPs: []
ports:
- port: 80
targetPort: 80
selector:
cdk8s.io/metadata.addr: Chart-App-Deployment-c84d7818
cdk8s.io/metadata.addr: Deployment-c8c1f37c
type: LoadBalancer
6 changes: 3 additions & 3 deletions k8s/examples/ubuntu.main.w.snap
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: chart-app-deployment-c843205c
name: deployment-c87ec702
spec:
minReadySeconds: 0
progressDeadlineSeconds: 600
replicas: 3
selector:
matchLabels:
cdk8s.io/metadata.addr: Chart-App-Deployment-c84d7818
cdk8s.io/metadata.addr: Deployment-c8c1f37c
strategy:
rollingUpdate:
maxSurge: 25%
Expand All @@ -17,7 +17,7 @@ spec:
template:
metadata:
labels:
cdk8s.io/metadata.addr: Chart-App-Deployment-c84d7818
cdk8s.io/metadata.addr: Deployment-c8c1f37c
spec:
automountServiceAccountToken: false
containers:
Expand Down
4 changes: 2 additions & 2 deletions k8s/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ exports.Platform = class {

const labels = process.env.WING_K8S_LABELS ? JSON.parse(process.env.WING_K8S_LABELS) : {};
const namespace = process.env.WING_K8S_NAMESPACE;
const chart = new cdk8s.Chart(app, "Chart", { labels, namespace });
const chart = new cdk8s.Chart(app, "Default", { labels, namespace });

class App extends core.App {
_target = "cdk8s";
outdir = props.outdir;

constructor() {
super(chart, "App", props);
super(chart, "Default", props);

const root = this.node.root;
root.new = (fqn, ctor, scope, id, ...args) => this.new(fqn, ctor, scope, id, ...args);
Expand Down
4 changes: 2 additions & 2 deletions k8s/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion k8s/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@winglibs/k8s",
"description": "Wing for Kubernetes",
"version": "0.0.7",
"version": "0.0.8",
"author": {
"name": "Elad Ben-Israel",
"email": "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion k8s/root.test.w
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
bring expect;

let root = nodeof(this).root;
expect.equal(nodeof(root).path, "Chart/App/Default");
expect.equal(nodeof(root).path, "Default/Default/Default");

0 comments on commit 3fe148b

Please sign in to comment.