Skip to content

Commit 6a02408

Browse files
committed
migrate buildpacks to runpacks
1 parent 30ce5a5 commit 6a02408

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ kubero
168168
| # Can also be used to install Kubero on an existing cluster
169169
├── login (li) # Log in to Kubero and save credentials
170170
├── logout (lo) # Log out from Kubero and remove saved credentials
171-
├── remote (r) # List Kubero cluster
171+
├── remote (r) # List Kubero cluster
172172
│ ├── create # Create a cluster configuration
173173
│ ├── delete # Delete a cluster configuration
174174
│ └── select # Select a cluster
@@ -180,7 +180,7 @@ kubero
180180
│ └── delete # Delete a pipeline
181181
├── config # View available configurations
182182
│ ├── addons # List addons
183-
│ ├── buildpacks # List buildpacks
183+
│ ├── runpacks # List runpacks
184184
│ └── podsizes # List pod size configurations
185185
├── dashboard (db) # Open the Kubero dashboard
186186
├── debug # Gather debug information

cmd/kuberoCli/configBuildpacks.go renamed to cmd/kuberoCli/configRunpacks.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,49 @@ import (
99
"github.com/spf13/cobra"
1010
)
1111

12-
// buildpacksCmd represents the buildpacks command
13-
var buildpacksCmd = &cobra.Command{
14-
Use: "buildpacks",
15-
Short: "List the available buildpacks",
12+
// runpacksCmd represents the runpacks command
13+
var runpacksCmd = &cobra.Command{
14+
Use: "runpacks",
15+
Short: "List the available runpacks",
1616
Run: func(cmd *cobra.Command, args []string) {
17-
resp, _ := api.GetBuildpacks()
18-
printBuildpacks(resp)
17+
resp, _ := api.GetRunpacks()
18+
printRunpacks(resp)
1919
},
2020
}
2121

2222
func init() {
23-
configCmd.AddCommand(buildpacksCmd)
23+
configCmd.AddCommand(runpacksCmd)
2424
}
2525

26-
var buildPacksSimpleList []string
26+
var runPacksSimpleList []string
2727

28-
func loadBuildpacks() {
28+
func loadRunpacks() {
2929

30-
b, _ := api.GetBuildpacks()
30+
b, _ := api.GetRunpacks()
3131

32-
var buildPacks buildPacks
33-
json.Unmarshal(b.Body(), &buildPacks)
32+
var runPacks buildPacks
33+
json.Unmarshal(b.Body(), &runPacks)
3434

35-
for _, buildPack := range buildPacks {
36-
buildPacksSimpleList = append(buildPacksSimpleList, buildPack.Name)
35+
for _, runPack := range runPacks {
36+
runPacksSimpleList = append(runPacksSimpleList, runPack.Name)
3737
}
3838

39-
//buildPacks = []string{"java", "node", "python", "ruby", "php"}
39+
//runPacks = []string{"java", "node", "python", "ruby", "php"}
4040
}
4141

4242
// print the response as a table
43-
func printBuildpacks(r *resty.Response) {
43+
func printRunpacks(r *resty.Response) {
4444

4545
table := tablewriter.NewWriter(os.Stdout)
4646
table.SetHeader([]string{"Name", "Language", "Phase", "Image", "Command"})
4747
table.SetAutoMergeCells(true)
4848
table.SetRowLine(true)
4949
//table.SetBorder(false)
5050

51-
var buildPacksList buildPacks
52-
json.Unmarshal(r.Body(), &buildPacksList)
51+
var runPacksList buildPacks
52+
json.Unmarshal(r.Body(), &runPacksList)
5353

54-
for _, podsize := range buildPacksList {
54+
for _, podsize := range runPacksList {
5555
table.Append([]string{
5656
podsize.Name,
5757
podsize.Language,

cmd/kuberoCli/pipelineCreate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func createPipeline() kuberoApi.PipelineCRD {
5757

5858
loadRepositories()
5959
loadContexts()
60-
loadBuildpacks()
60+
loadRunpacks()
6161
pipelineCRD := pipelinesForm()
6262

6363
writePipelineYaml(pipelineCRD)
@@ -120,7 +120,7 @@ func pipelinesForm() kuberoApi.PipelineCRD {
120120
fmt.Println("")
121121
prompt := &survey.Select{
122122
Message: "Select a buildpack",
123-
Options: buildPacksSimpleList,
123+
Options: runPacksSimpleList,
124124
}
125125
askOneErr := survey.AskOne(prompt, &pipelineCRD.Spec.Buildpack.Name)
126126
if askOneErr != nil {

pkg/kuberoApi/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ func (k *KuberoClient) GetAddons() (*resty.Response, error) {
207207
return res, err
208208
}
209209

210-
func (k *KuberoClient) GetBuildpacks() (*resty.Response, error) {
210+
func (k *KuberoClient) GetRunpacks() (*resty.Response, error) {
211211
k.validateClient()
212-
res, err := k.client.Get("/api/config/buildpacks")
212+
res, err := k.client.Get("/api/config/runpacks")
213213

214214
return res, err
215215
}

0 commit comments

Comments
 (0)