Skip to content

Commit e8a416e

Browse files
committed
refactor(domain-name): replace kwasm.sh with spinkube.dev
Signed-off-by: Sven Pfennig <[email protected]>
1 parent 39eee92 commit e8a416e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+318
-435
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ registry: ghcr.io/your-gh-username/runtime-class-manager
5252
5353
The `Tiltfile` included in this repository will take care of the following:
5454

55-
- Create the `kwasm` namespace and install the controller helm-chart in it.
55+
- Create the `runtime-class-manager` namespace and install the controller helm-chart in it.
5656
- Inject the development image in the deployment.
5757
- Automatically reload the controller when you make changes to the code.
5858

5959
To run the controller, you just need to run the following command against an empty cluster:
6060

6161
```console
62-
$ tilt up --stream
62+
tilt up --stream
6363
```

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,11 @@ $(ENVTEST): $(LOCALBIN)
198198

199199
.PHONY: create-test-cluster
200200
create-kind-cluster:
201-
kind create cluster --config ./hack/kind.yaml --name kwasm
201+
kind create cluster --config ./hack/kind.yaml --name rcm
202202

203203
.PHONY: kind-delete
204204
kind-delete:
205-
kind delete cluster --name kwasm
205+
kind delete cluster --name rcm
206206

207207
.PHONY: kind
208208
kind: create-kind-cluster install

PROJECT

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This file is used to track the info used to scaffold your project
33
# and allow the plugins properly work.
44
# More info: https://book.kubebuilder.io/reference/project-config.html
5-
domain: kwasm.sh
5+
domain: spinkube.dev
66
layout:
77
- go.kubebuilder.io/v4
88
projectName: runtime-class-manager
@@ -12,18 +12,18 @@ resources:
1212
crdVersion: v1
1313
namespaced: true
1414
controller: true
15-
domain: kwasm.sh
15+
domain: spinkube.dev
1616
group: runtime
1717
kind: Shim
1818
path: github.com/spinkube/runtime-class-manager/api/v1alpha1
1919
version: v1alpha1
2020
- controller: true
21-
domain: kwasm.sh
21+
domain: spinkube.dev
2222
group: runtime
2323
kind: Node
2424
version: v1alpha1
2525
- controller: true
26-
domain: kwasm.sh
26+
domain: spinkube.dev
2727
group: runtime
2828
kind: Job
2929
version: v1alpha1

api/v1alpha1/groupversion_info.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ limitations under the License.
1616

1717
// Package v1alpha1 contains API Schema definitions for the runtime v1alpha1 API group
1818
// +kubebuilder:object:generate=true
19-
// +groupName=runtime.kwasm.sh
19+
// +groupName=runtime.spinkube.dev
2020
package v1alpha1
2121

2222
import (
@@ -26,7 +26,7 @@ import (
2626

2727
var (
2828
// GroupVersion is group version used to register these objects
29-
GroupVersion = schema.GroupVersion{Group: "runtime.kwasm.sh", Version: "v1alpha1"}
29+
GroupVersion = schema.GroupVersion{Group: "runtime.spinkube.dev", Version: "v1alpha1"}
3030

3131
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
3232
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

cmd/node-installer/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type Config struct {
2121
Name string
2222
ConfigPath string
2323
}
24-
Kwasm struct {
24+
RCM struct {
2525
Path string
2626
AssetPath string
2727
}

cmd/node-installer/detect_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func Test_DetectDistro(t *testing.T) {
4949
struct {
5050
Path string
5151
AssetPath string
52-
}{"/opt/kwasm", "/assets"},
52+
}{"/opt/rcm", "/assets"},
5353
struct{ RootPath string }{""},
5454
},
5555
tests.FixtureFs("../../testdata/node-installer/distros/default"),
@@ -68,7 +68,7 @@ func Test_DetectDistro(t *testing.T) {
6868
struct {
6969
Path string
7070
AssetPath string
71-
}{"/opt/kwasm", "/assets"},
71+
}{"/opt/rcm", "/assets"},
7272
struct{ RootPath string }{""},
7373
},
7474
tests.FixtureFs("../../testdata/node-installer/distros/default"),
@@ -87,7 +87,7 @@ func Test_DetectDistro(t *testing.T) {
8787
struct {
8888
Path string
8989
AssetPath string
90-
}{"/opt/kwasm", "/assets"},
90+
}{"/opt/rcm", "/assets"},
9191
struct{ RootPath string }{""},
9292
},
9393
tests.FixtureFs("../../testdata/node-installer/distros/unsupported"),
@@ -106,7 +106,7 @@ func Test_DetectDistro(t *testing.T) {
106106
struct {
107107
Path string
108108
AssetPath string
109-
}{"/opt/kwasm", "/assets"},
109+
}{"/opt/rcm", "/assets"},
110110
struct{ RootPath string }{""},
111111
},
112112
tests.FixtureFs("../../testdata/node-installer/distros/microk8s"),
@@ -125,7 +125,7 @@ func Test_DetectDistro(t *testing.T) {
125125
struct {
126126
Path string
127127
AssetPath string
128-
}{"/opt/kwasm", "/assets"},
128+
}{"/opt/rcm", "/assets"},
129129
struct{ RootPath string }{""},
130130
},
131131
tests.FixtureFs("../../testdata/node-installer/distros/k0s"),
@@ -144,7 +144,7 @@ func Test_DetectDistro(t *testing.T) {
144144
struct {
145145
Path string
146146
AssetPath string
147-
}{"/opt/kwasm", "/assets"},
147+
}{"/opt/rcm", "/assets"},
148148
struct{ RootPath string }{""},
149149
},
150150
tests.FixtureFs("../../testdata/node-installer/distros/k3s"),
@@ -163,7 +163,7 @@ func Test_DetectDistro(t *testing.T) {
163163
struct {
164164
Path string
165165
AssetPath string
166-
}{"/opt/kwasm", "/assets"},
166+
}{"/opt/rcm", "/assets"},
167167
struct{ RootPath string }{""},
168168
},
169169
tests.FixtureFs("../../testdata/node-installer/distros/rke2"),

cmd/node-installer/install.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,32 +58,32 @@ var installCmd = &cobra.Command{
5858
}
5959

6060
func init() {
61-
installCmd.Flags().StringVarP(&config.Kwasm.AssetPath, "asset-path", "a", "/assets", "Path to the asset to install")
61+
installCmd.Flags().StringVarP(&config.RCM.AssetPath, "asset-path", "a", "/assets", "Path to the asset to install")
6262
rootCmd.AddCommand(installCmd)
6363
}
6464

6565
func RunInstall(config Config, rootFs, hostFs afero.Fs, restarter containerd.Restarter) error {
6666
// Get file or directory information.
67-
info, err := rootFs.Stat(config.Kwasm.AssetPath)
67+
info, err := rootFs.Stat(config.RCM.AssetPath)
6868
if err != nil {
6969
return err
7070
}
7171

7272
var files []fs.FileInfo
7373
// Check if the path is a directory.
7474
if info.IsDir() {
75-
files, err = afero.ReadDir(rootFs, config.Kwasm.AssetPath)
75+
files, err = afero.ReadDir(rootFs, config.RCM.AssetPath)
7676
if err != nil {
7777
return err
7878
}
7979
} else {
8080
// If the path is not a directory, add the file to the list of files.
8181
files = append(files, info)
82-
config.Kwasm.AssetPath = path.Dir(config.Kwasm.AssetPath)
82+
config.RCM.AssetPath = path.Dir(config.RCM.AssetPath)
8383
}
8484

8585
containerdConfig := containerd.NewConfig(hostFs, config.Runtime.ConfigPath, restarter)
86-
shimConfig := shim.NewConfig(rootFs, hostFs, config.Kwasm.AssetPath, config.Kwasm.Path)
86+
shimConfig := shim.NewConfig(rootFs, hostFs, config.RCM.AssetPath, config.RCM.Path)
8787

8888
anythingChanged := false
8989
for _, file := range files {

cmd/node-installer/install_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func Test_RunInstall(t *testing.T) {
5353
struct {
5454
Path string
5555
AssetPath string
56-
}{"/opt/kwasm", "/assets"},
56+
}{"/opt/rcm", "/assets"},
5757
struct{ RootPath string }{"/containerd/missing-containerd-shim-config"},
5858
},
5959
tests.FixtureFs("../../testdata/node-installer"),
@@ -72,7 +72,7 @@ func Test_RunInstall(t *testing.T) {
7272
struct {
7373
Path string
7474
AssetPath string
75-
}{"/opt/kwasm", "/assets"},
75+
}{"/opt/rcm", "/assets"},
7676
struct{ RootPath string }{"/containerd/existing-containerd-shim-config"},
7777
},
7878
tests.FixtureFs("../../testdata/node-installer"),

cmd/node-installer/root.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@ import (
2727
"github.com/spf13/viper"
2828
)
2929

30-
var (
31-
config Config
32-
)
30+
var config Config
3331

3432
// rootCmd represents the base command when called without any subcommands.
3533
var rootCmd = &cobra.Command{
36-
Use: "kwasm-node-installer",
37-
Short: "kwasm-node-installer manages containerd shims",
34+
Use: "rcm-node-installer",
35+
Short: "rcm-node-installer manages containerd shims",
3836
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
3937
return initializeConfig(cmd)
4038
},
@@ -52,14 +50,14 @@ func Execute() {
5250
func init() {
5351
rootCmd.PersistentFlags().StringVarP(&config.Runtime.Name, "runtime", "r", "containerd", "Set the container runtime to configure (containerd, cri-o)")
5452
rootCmd.PersistentFlags().StringVarP(&config.Runtime.ConfigPath, "runtime-config", "c", "", "Path to the runtime config file. Will try to autodetect if left empty")
55-
rootCmd.PersistentFlags().StringVarP(&config.Kwasm.Path, "kwasm-path", "k", "/opt/kwasm", "Working directory for kwasm on the host")
53+
rootCmd.PersistentFlags().StringVarP(&config.RCM.Path, "rcm-path", "k", "/opt/rcm", "Working directory for the RuntimeClassManager on the host")
5654
rootCmd.PersistentFlags().StringVarP(&config.Host.RootPath, "host-root", "H", "/", "Path to the host root path")
5755
}
5856

5957
func initializeConfig(cmd *cobra.Command) error {
6058
v := viper.New()
6159

62-
v.SetConfigName("kwasm")
60+
v.SetConfigName("rcm")
6361

6462
v.AddConfigPath(".")
6563
v.AddConfigPath("/etc")
@@ -70,8 +68,8 @@ func initializeConfig(cmd *cobra.Command) error {
7068
}
7169
}
7270

73-
// Environment variables are prefixed with KWASM_
74-
v.SetEnvPrefix("KWASM")
71+
// Environment variables are prefixed with RCM_
72+
v.SetEnvPrefix("RCM")
7573

7674
// - is replaced with _ in environment variables
7775
v.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))

cmd/node-installer/uninstall.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ func init() {
5959
func RunUninstall(config Config, rootFs, hostFs afero.Fs, restarter containerd.Restarter) error {
6060
slog.Info("uninstall called", "shim", config.Runtime.Name)
6161
shimName := config.Runtime.Name
62-
runtimeName := path.Join(config.Kwasm.Path, "bin", shimName)
62+
runtimeName := path.Join(config.RCM.Path, "bin", shimName)
6363

6464
containerdConfig := containerd.NewConfig(hostFs, config.Runtime.ConfigPath, restarter)
65-
shimConfig := shim.NewConfig(rootFs, hostFs, config.Kwasm.AssetPath, config.Kwasm.Path)
65+
shimConfig := shim.NewConfig(rootFs, hostFs, config.RCM.AssetPath, config.RCM.Path)
6666

6767
binPath, err := shimConfig.Uninstall(shimName)
6868
if err != nil {

0 commit comments

Comments
 (0)