Skip to content

Commit

Permalink
harness/k3s: Add back kubectl alias (#211)
Browse files Browse the repository at this point in the history
In a prior refactor, the kubectl alias was removed, this commit marks
the return to better times :P
  • Loading branch information
IdlePhysicist authored Oct 25, 2024
1 parent 13c3563 commit 8920c86
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/harness/k3s/k3s.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func New(opts ...Option) (*k3s, error) {
Env: []string{
"IMAGETEST=true",
"KUBECONFIG=/k3s-config/k3s.yaml",
"ENV=/root/.ashrc",
},
Contents: []*docker.Content{
docker.NewContentFromString("alias k=kubectl", "/root/.ashrc"),
},
Networks: make([]docker.NetworkAttachment, 0),
ExtraHosts: []string{
Expand Down Expand Up @@ -301,9 +305,10 @@ func (h *k3s) startSandbox(ctx context.Context, cli *docker.Client, resp *docker

h.Sandbox.Name = resp.Name + "-sandbox"

h.Sandbox.Contents = []*docker.Content{
h.Sandbox.Contents = append(
h.Sandbox.Contents,
docker.NewContentFromString(string(skcfg), "/k3s-config/k3s.yaml"),
}
)

sandbox, err := cli.Start(ctx, h.Sandbox)
if err != nil {
Expand Down

0 comments on commit 8920c86

Please sign in to comment.