-
Notifications
You must be signed in to change notification settings - Fork 770
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix driver:local in prefixing volumes
If we have a docker-file with root level volumes and we do a kompose up using that docker-file, libcompose will add an additional _ followed by the current directory name. Since kubernetes doesn't allow _ in the objects created so kompose up will fail to deploy it. As a solution we replace _ to - and we can then deploy it successfully.
- Loading branch information
Abhishek
committed
Apr 26, 2017
1 parent
f1d2268
commit 7eccb37
Showing
5 changed files
with
776 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
script/test/fixtures/service-name-change/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: '2' | ||
services: | ||
mariadb: | ||
image: 'bitnami/mariadb:latest' | ||
volumes: | ||
- 'mariadb-data:/bitnami/mariadb' | ||
environment: | ||
- MARIADB_USER=bn_wordpress | ||
- MARIADB_DATABASE=bitnami_wordpress | ||
- ALLOW_EMPTY_PASSWORD=yes | ||
wordpress: | ||
image: 'bitnami/wordpress:latest' | ||
ports: | ||
- '80:80' | ||
- '443:443' | ||
volumes: | ||
- 'wordpress-data:/bitnami/wordpress' | ||
- 'apache-data:/bitnami/apache' | ||
- 'php-data:/bitnami/php' | ||
depends_on: | ||
- mariadb | ||
environment: | ||
- MARIADB_HOST=mariadb | ||
- MARIADB_PORT=3306 | ||
- WORDPRESS_DATABASE_USER=bn_wordpress | ||
- WORDPRESS_DATABASE_NAME=bitnami_wordpress | ||
- ALLOW_EMPTY_PASSWORD=yes | ||
volumes: | ||
mariadb-data: | ||
driver: local | ||
wordpress-data: | ||
driver: local | ||
apache-data: | ||
driver: local | ||
php-data: | ||
driver: local |
311 changes: 311 additions & 0 deletions
311
script/test/fixtures/service-name-change/output-k8s.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,311 @@ | ||
{ | ||
"kind": "List", | ||
"apiVersion": "v1", | ||
"metadata": {}, | ||
"items": [ | ||
{ | ||
"kind": "Service", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "mariadb", | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "mariadb" | ||
} | ||
}, | ||
"spec": { | ||
"ports": [ | ||
{ | ||
"name": "headless", | ||
"port": 55555, | ||
"targetPort": 0 | ||
} | ||
], | ||
"selector": { | ||
"io.kompose.service": "mariadb" | ||
}, | ||
"clusterIP": "None" | ||
}, | ||
"status": { | ||
"loadBalancer": {} | ||
} | ||
}, | ||
{ | ||
"kind": "Service", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "wordpress", | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "wordpress" | ||
} | ||
}, | ||
"spec": { | ||
"ports": [ | ||
{ | ||
"name": "80", | ||
"port": 80, | ||
"targetPort": 80 | ||
}, | ||
{ | ||
"name": "443", | ||
"port": 443, | ||
"targetPort": 443 | ||
} | ||
], | ||
"selector": { | ||
"io.kompose.service": "wordpress" | ||
} | ||
}, | ||
"status": { | ||
"loadBalancer": {} | ||
} | ||
}, | ||
{ | ||
"kind": "Deployment", | ||
"apiVersion": "extensions/v1beta1", | ||
"metadata": { | ||
"name": "mariadb", | ||
"creationTimestamp": null | ||
}, | ||
"spec": { | ||
"replicas": 1, | ||
"template": { | ||
"metadata": { | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "mariadb" | ||
} | ||
}, | ||
"spec": { | ||
"volumes": [ | ||
{ | ||
"name": "servicenamechange-mariadb-data", | ||
"persistentVolumeClaim": { | ||
"claimName": "servicenamechange-mariadb-data" | ||
} | ||
} | ||
], | ||
"containers": [ | ||
{ | ||
"name": "mariadb", | ||
"image": "bitnami/mariadb:latest", | ||
"env": [ | ||
{ | ||
"name": "MARIADB_USER", | ||
"value": "bn_wordpress" | ||
}, | ||
{ | ||
"name": "MARIADB_DATABASE", | ||
"value": "bitnami_wordpress" | ||
}, | ||
{ | ||
"name": "ALLOW_EMPTY_PASSWORD", | ||
"value": "yes" | ||
} | ||
], | ||
"resources": {}, | ||
"volumeMounts": [ | ||
{ | ||
"name": "servicenamechange-mariadb-data", | ||
"mountPath": "/bitnami/mariadb" | ||
} | ||
] | ||
} | ||
], | ||
"restartPolicy": "Always" | ||
} | ||
}, | ||
"strategy": { | ||
"type": "Recreate" | ||
} | ||
}, | ||
"status": {} | ||
}, | ||
{ | ||
"kind": "PersistentVolumeClaim", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "servicenamechange-mariadb-data", | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "servicenamechange-mariadb-data" | ||
} | ||
}, | ||
"spec": { | ||
"accessModes": [ | ||
"ReadWriteOnce" | ||
], | ||
"resources": { | ||
"requests": { | ||
"storage": "100Mi" | ||
} | ||
} | ||
}, | ||
"status": {} | ||
}, | ||
{ | ||
"kind": "Deployment", | ||
"apiVersion": "extensions/v1beta1", | ||
"metadata": { | ||
"name": "wordpress", | ||
"creationTimestamp": null | ||
}, | ||
"spec": { | ||
"replicas": 1, | ||
"template": { | ||
"metadata": { | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "wordpress" | ||
} | ||
}, | ||
"spec": { | ||
"volumes": [ | ||
{ | ||
"name": "servicenamechange-wordpress-data", | ||
"persistentVolumeClaim": { | ||
"claimName": "servicenamechange-wordpress-data" | ||
} | ||
}, | ||
{ | ||
"name": "servicenamechange-apache-data", | ||
"persistentVolumeClaim": { | ||
"claimName": "servicenamechange-apache-data" | ||
} | ||
}, | ||
{ | ||
"name": "servicenamechange-php-data", | ||
"persistentVolumeClaim": { | ||
"claimName": "servicenamechange-php-data" | ||
} | ||
} | ||
], | ||
"containers": [ | ||
{ | ||
"name": "wordpress", | ||
"image": "bitnami/wordpress:latest", | ||
"ports": [ | ||
{ | ||
"containerPort": 80 | ||
}, | ||
{ | ||
"containerPort": 443 | ||
} | ||
], | ||
"env": [ | ||
{ | ||
"name": "MARIADB_HOST", | ||
"value": "mariadb" | ||
}, | ||
{ | ||
"name": "MARIADB_PORT", | ||
"value": "3306" | ||
}, | ||
{ | ||
"name": "WORDPRESS_DATABASE_USER", | ||
"value": "bn_wordpress" | ||
}, | ||
{ | ||
"name": "WORDPRESS_DATABASE_NAME", | ||
"value": "bitnami_wordpress" | ||
}, | ||
{ | ||
"name": "ALLOW_EMPTY_PASSWORD", | ||
"value": "yes" | ||
} | ||
], | ||
"resources": {}, | ||
"volumeMounts": [ | ||
{ | ||
"name": "servicenamechange-wordpress-data", | ||
"mountPath": "/bitnami/wordpress" | ||
}, | ||
{ | ||
"name": "servicenamechange-apache-data", | ||
"mountPath": "/bitnami/apache" | ||
}, | ||
{ | ||
"name": "servicenamechange-php-data", | ||
"mountPath": "/bitnami/php" | ||
} | ||
] | ||
} | ||
], | ||
"restartPolicy": "Always" | ||
} | ||
}, | ||
"strategy": { | ||
"type": "Recreate" | ||
} | ||
}, | ||
"status": {} | ||
}, | ||
{ | ||
"kind": "PersistentVolumeClaim", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "servicenamechange-wordpress-data", | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "servicenamechange-wordpress-data" | ||
} | ||
}, | ||
"spec": { | ||
"accessModes": [ | ||
"ReadWriteOnce" | ||
], | ||
"resources": { | ||
"requests": { | ||
"storage": "100Mi" | ||
} | ||
} | ||
}, | ||
"status": {} | ||
}, | ||
{ | ||
"kind": "PersistentVolumeClaim", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "servicenamechange-apache-data", | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "servicenamechange-apache-data" | ||
} | ||
}, | ||
"spec": { | ||
"accessModes": [ | ||
"ReadWriteOnce" | ||
], | ||
"resources": { | ||
"requests": { | ||
"storage": "100Mi" | ||
} | ||
} | ||
}, | ||
"status": {} | ||
}, | ||
{ | ||
"kind": "PersistentVolumeClaim", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "servicenamechange-php-data", | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "servicenamechange-php-data" | ||
} | ||
}, | ||
"spec": { | ||
"accessModes": [ | ||
"ReadWriteOnce" | ||
], | ||
"resources": { | ||
"requests": { | ||
"storage": "100Mi" | ||
} | ||
} | ||
}, | ||
"status": {} | ||
} | ||
] | ||
} |
Oops, something went wrong.