Skip to content

Commit

Permalink
Fixes command headings in install instructions.
Browse files Browse the repository at this point in the history
Signed-off-by: merobi-hub <merobi@gmail.com>
  • Loading branch information
merobi-hub committed Oct 13, 2023
2 parents c3dcc26 + 6844397 commit 581151b
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 8 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,27 @@ Kompose is released via GitHub on a three-week cycle, you can see all current re
**Linux and macOS:**

```sh
<<<<<<< HEAD
# Linux (Debian)
curl -L https://github.com/kubernetes/kompose/releases/download/v1.31.1/kompose-linux-amd64 -o kompose
=======
# Linux
curl -L https://github.com/kubernetes/kompose/releases/download/v1.31.2/kompose-linux-amd64 -o kompose
>>>>>>> 68443971f3bdc681a93ab4d20d0862ddb7c7f94c

# Linux (Mint)
curl -L -o kompose https://github.com/kubernetes/kompose/releases/download/v1.31.1/kompose-linux-amd64

# macOS
curl -L https://github.com/kubernetes/kompose/releases/download/v1.31.1/kompose-darwin-amd64 -o kompose
curl -L https://github.com/kubernetes/kompose/releases/download/v1.31.2/kompose-darwin-amd64 -o kompose

chmod +x kompose
sudo mv ./kompose /usr/local/bin/kompose
```

**Windows:**

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

## Shell autocompletion

Expand Down
2 changes: 1 addition & 1 deletion build/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.31.1
1.31.2
14 changes: 11 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,30 @@ We have multiple ways to install Kompose. Our preferred (and most up-to-date) me

Kompose is released via GitHub, you can see all current releases on the [GitHub release page](https://github.com/kubernetes/kompose/releases).

This is the **recommended** way of installing Kompose.

**Linux and macOS:**

```sh
# Linux
curl -L https://github.com/kubernetes/kompose/releases/download/v1.31.1/kompose-linux-amd64 -o kompose
curl -L https://github.com/kubernetes/kompose/releases/download/v1.31.2/kompose-linux-amd64 -o kompose

# Linux ARM64
curl -L https://github.com/kubernetes/kompose/releases/download/v1.31.2/kompose-linux-arm64 -o kompose

# macOS
curl -L https://github.com/kubernetes/kompose/releases/download/v1.31.1/kompose-darwin-amd64 -o kompose
curl -L https://github.com/kubernetes/kompose/releases/download/v1.31.2/kompose-darwin-amd64 -o kompose

# macOS ARM64
curl -L https://github.com/kubernetes/kompose/releases/download/v1.31.2/kompose-darwin-arm64 -o kompose

chmod +x kompose
sudo mv ./kompose /usr/local/bin/kompose
```

**Windows:**

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

## Go

Expand Down
6 changes: 5 additions & 1 deletion pkg/transformer/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,11 @@ func (k *Kubernetes) Transform(komposeObject kobject.KomposeObject, opt kobject.
// sort all object so Services are first
k.SortServicesFirst(&allobjects)
k.RemoveDupObjects(&allobjects)
transformer.AssignNamespaceToObjects(&allobjects, komposeObject.Namespace)

// Only append namespaces if --namespace has been passed in
if komposeObject.Namespace != "" {
transformer.AssignNamespaceToObjects(&allobjects, komposeObject.Namespace)
}
// k.FixWorkloadVersion(&allobjects)
return allobjects, nil
}
Expand Down
26 changes: 26 additions & 0 deletions pkg/transformer/kubernetes/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1119,3 +1119,29 @@ func TestNamespaceGeneration(t *testing.T) {
}
}
}

// Test namespace generation with namespace being blank / ""
func TestNamespaceGenerationBlank(t *testing.T) {
ns := ""
komposeObject := kobject.KomposeObject{
ServiceConfigs: map[string]kobject.ServiceConfig{"app": newServiceConfig()},
Namespace: ns,
}
k := Kubernetes{}
objs, err := k.Transform(komposeObject, kobject.ConvertOptions{})
if err != nil {
t.Error(errors.Wrap(err, "k.Transform failed"))
}
for _, obj := range objs {
if namespace, ok := obj.(*api.Namespace); ok {
if strings.ToLower(ns) != strings.ToLower(namespace.ObjectMeta.Name) {
t.Errorf("Expected namespace name %v, got %v", ns, namespace.ObjectMeta.Name)
}
}
if dep, ok := obj.(*appsv1.Deployment); ok {
if dep.ObjectMeta.Namespace != ns {
t.Errorf("Expected deployment namespace %v, got %v", ns, dep.ObjectMeta.Namespace)
}
}
}
}
2 changes: 1 addition & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package version

var (
// VERSION is version number that will be displayed when running ./kompose version
VERSION = "1.31.1"
VERSION = "1.31.2"
// GITCOMMIT is hash of the commit that will be displayed when running ./kompose version
// this will be overwritten when running build like this: go build -ldflags="-X github.com/kubernetes/kompose/pkg/version.GITCOMMIT=$(GITCOMMIT)"
// HEAD is default indicating that this was not set during build
Expand Down
6 changes: 6 additions & 0 deletions script/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,15 @@ __Linux and macOS:__
# Linux
curl -L https://github.com/kubernetes/kompose/releases/download/v$1/kompose-linux-amd64 -o kompose
# Linux ARM64
curl -L https://github.com/kubernetes/kompose/releases/download/v$1/kompose-linux-arm64 -o kompose
# macOS
curl -L https://github.com/kubernetes/kompose/releases/download/v$1/kompose-darwin-amd64 -o kompose
# macOS ARM64
curl -L https://github.com/kubernetes/kompose/releases/download/v$1/kompose-darwin-arm64 -o kompose
chmod +x kompose
sudo mv ./kompose /usr/local/bin/kompose
\`\`\`
Expand Down

0 comments on commit 581151b

Please sign in to comment.