Skip to content

Commit ba5480a

Browse files
authored
Merge branch 'kubernetes:main' into main
2 parents ffbe054 + ae2a394 commit ba5480a

File tree

33 files changed

+601
-147
lines changed

33 files changed

+601
-147
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Alpine Builder
2-
FROM alpine as builder
2+
FROM alpine AS builder
33

44
RUN apk add --no-cache curl
55
COPY ./build/VERSION VERSION

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ Kompose is released via GitHub on a three-week cycle, you can see all current re
4949

5050
```sh
5151
# Linux
52-
curl -L https://github.com/kubernetes/kompose/releases/download/v1.35.0/kompose-linux-amd64 -o kompose
52+
curl -L https://github.com/kubernetes/kompose/releases/download/v1.36.0/kompose-linux-amd64 -o kompose
5353

5454
# macOS
55-
curl -L https://github.com/kubernetes/kompose/releases/download/v1.35.0/kompose-darwin-amd64 -o kompose
55+
curl -L https://github.com/kubernetes/kompose/releases/download/v1.36.0/kompose-darwin-amd64 -o kompose
5656

5757
chmod +x kompose
5858
sudo mv ./kompose /usr/local/bin/kompose
5959
```
6060

6161
**Windows:**
6262

63-
Download from [GitHub](https://github.com/kubernetes/kompose/releases/download/v1.35.0/kompose-windows-amd64.exe) and add the binary to your PATH.
63+
Download from [GitHub](https://github.com/kubernetes/kompose/releases/download/v1.36.0/kompose-windows-amd64.exe) and add the binary to your PATH.
6464

6565
## Shell autocompletion
6666

build/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.35.0
1+
1.36.0

cmd/convert.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ var (
6262
// default is true.
6363
WithKomposeAnnotation bool
6464

65+
// NoInterpolation decides if we will interpolate environment variables in the compose file.
66+
NoInterpolate bool
67+
6568
// MultipleContainerMode which enables creating multi containers in a single pod is a developing function.
6669
// default is false
6770
MultipleContainerMode bool
@@ -121,6 +124,7 @@ var convertCmd = &cobra.Command{
121124
YAMLIndent: ConvertYAMLIndent,
122125
Profiles: ConvertProfiles,
123126
WithKomposeAnnotation: WithKomposeAnnotation,
127+
NoInterpolate: NoInterpolate,
124128
MultipleContainerMode: MultipleContainerMode,
125129
ServiceGroupMode: ServiceGroupMode,
126130
ServiceGroupName: ServiceGroupName,
@@ -202,6 +206,7 @@ func init() {
202206
convertCmd.Flags().BoolVar(&GenerateNetworkPolicies, "generate-network-policies", false, "Specify whether to generate network policies or not")
203207

204208
convertCmd.Flags().BoolVar(&WithKomposeAnnotation, "with-kompose-annotation", true, "Add kompose annotations to generated resource")
209+
convertCmd.Flags().BoolVar(&NoInterpolate, "no-interpolate", false, "Keep environment variable names in the Compose file")
205210

206211
// Deprecated commands
207212
convertCmd.Flags().BoolVar(&ConvertEmptyVols, "emptyvols", false, "Use Empty Volumes. Do not generate PVCs")

docs/conversion.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ We're doing our best to keep it up to date as soon as possible in our releases t
112112
| external | x | x | x | | |
113113
| | | | | | |
114114
| **Configs** | x | x | x | | |
115-
| environment | x | y | y | | |
116-
| file | y | y | y | | |
117-
| content | x | y | y | | |
115+
| environment | x | | | | |
116+
| file | | | | | |
117+
| content | x | | | | |
118118
| labels | x | x | x | | |
119119
| external | x | x | x | | |

docs/installation.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,24 @@ This is the **recommended** way of installing Kompose.
2424

2525
```sh
2626
# Linux
27-
curl -L https://github.com/kubernetes/kompose/releases/download/v1.35.0/kompose-linux-amd64 -o kompose
27+
curl -L https://github.com/kubernetes/kompose/releases/download/v1.36.0/kompose-linux-amd64 -o kompose
2828

2929
# Linux ARM64
30-
curl -L https://github.com/kubernetes/kompose/releases/download/v1.35.0/kompose-linux-arm64 -o kompose
30+
curl -L https://github.com/kubernetes/kompose/releases/download/v1.36.0/kompose-linux-arm64 -o kompose
3131

3232
# macOS
33-
curl -L https://github.com/kubernetes/kompose/releases/download/v1.35.0/kompose-darwin-amd64 -o kompose
33+
curl -L https://github.com/kubernetes/kompose/releases/download/v1.36.0/kompose-darwin-amd64 -o kompose
3434

3535
# macOS ARM64
36-
curl -L https://github.com/kubernetes/kompose/releases/download/v1.35.0/kompose-darwin-arm64 -o kompose
36+
curl -L https://github.com/kubernetes/kompose/releases/download/v1.36.0/kompose-darwin-arm64 -o kompose
3737

3838
chmod +x kompose
3939
sudo mv ./kompose /usr/local/bin/kompose
4040
```
4141

4242
**Windows:**
4343

44-
Download from [GitHub](https://github.com/kubernetes/kompose/releases/download/v1.35.0/kompose-windows-amd64.exe) and add the binary to your PATH.
44+
Download from [GitHub](https://github.com/kubernetes/kompose/releases/download/v1.36.0/kompose-windows-amd64.exe) and add the binary to your PATH.
4545

4646
## Go
4747

@@ -95,5 +95,5 @@ docker build -t kompose https://github.com/kubernetes/kompose.git\#main
9595
To run the built image against the current directory, run the following command:
9696

9797
```bash
98-
docker run --rm -it -v $PWD:/opt kompose sh -c "cd /opt && kompose convert"
99-
```
98+
docker run --rm -it -v $PWD:/opt -w /opt kompose kompose convert
99+
```

docs/user-guide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Labels are an important kompose concept as they allow you to add Kubernetes modi
140140
| `String` | `1Gi` |
141141
| [`kompose.volume.storage-class-name`](#komposevolumestorage-class-name) | StorageClassName for provisioning volumes |
142142
| `String` | `standard` |
143-
| [`kompose.volume.sub-path`](#komposevolumesub-path) | Subpath inside the mounted volume |
143+
| [`kompose.volume.subpath`](#komposevolumesubpath) | Subpath inside the mounted volume |
144144
| `String` | `/data` |
145145
| [`kompose.volume.type`](#komposevolumetype) | Type of Kubernetes volume |
146146
| `String` | `configMap`, `persistentVolumeClaim`, `emptyDir`, `hostPath` |
@@ -541,14 +541,14 @@ services:
541541
- db-data:/var/lib/postgresql/data
542542
```
543543
544-
### kompose.volume.sub-path
544+
### kompose.volume.subpath
545545
546546
```yaml
547547
services:
548548
pgadmin:
549549
image: postgres
550550
labels:
551-
kompose.volume.sub-path: pg-data
551+
kompose.volume.subpath: pg-data
552552
```
553553
554554
### kompose.volume.type
@@ -642,4 +642,4 @@ If you want to customize the build and push processes and use another containers
642642
Kompose offers you the possibility to do that. You can use `--build-command` and `--push-command` flags
643643
to achieve that.
644644

645-
e.g: `kompose -f convert --build-command 'whatever command --you-use' --push-command 'whatever command --you-use'`
645+
e.g: `kompose -f convert --build-command 'whatever command --you-use' --push-command 'whatever command --you-use'`

pkg/app/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func Convert(opt kobject.ConvertOptions) ([]runtime.Object, error) {
218218
komposeObject := kobject.KomposeObject{
219219
ServiceConfigs: make(map[string]kobject.ServiceConfig),
220220
}
221-
komposeObject, err = l.LoadFile(opt.InputFiles, opt.Profiles)
221+
komposeObject, err = l.LoadFile(opt.InputFiles, opt.Profiles, opt.NoInterpolate)
222222
if err != nil {
223223
log.Fatalf(err.Error())
224224
}

pkg/kobject/kobject.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ type ConvertOptions struct {
9292
ServiceGroupName string
9393
SecretsAsFiles bool
9494
GenerateNetworkPolicies bool
95+
NoInterpolate bool
9596
}
9697

9798
// IsPodController indicate if the user want to use a controller

pkg/loader/compose/compose.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func checkUnsupportedKey(composeProject *types.Project) []string {
151151
}
152152

153153
// LoadFile loads a compose file into KomposeObject
154-
func (c *Compose) LoadFile(files []string, profiles []string) (kobject.KomposeObject, error) {
154+
func (c *Compose) LoadFile(files []string, profiles []string, noInterpolate bool) (kobject.KomposeObject, error) {
155155
// Gather the working directory
156156
workingDir, err := transformer.GetComposeFileDir(files)
157157
if err != nil {
@@ -161,8 +161,10 @@ func (c *Compose) LoadFile(files []string, profiles []string) (kobject.KomposeOb
161161
projectOptions, err := cli.NewProjectOptions(
162162
files, cli.WithOsEnv,
163163
cli.WithWorkingDirectory(workingDir),
164-
cli.WithInterpolation(true),
164+
cli.WithInterpolation(!noInterpolate),
165165
cli.WithProfiles(profiles),
166+
cli.WithEnvFiles([]string{}...),
167+
cli.WithDotEnv,
166168
)
167169
if err != nil {
168170
return kobject.KomposeObject{}, errors.Wrap(err, "Unable to create compose options")

0 commit comments

Comments
 (0)