Skip to content

Commit 2375a30

Browse files
authored
Move sparkctl to cmd directory (#2347)
* Move spark-operator Signed-off-by: Yi Chen <github@chenyicn.net> * Move sparkctl to cmd directory Signed-off-by: Yi Chen <github@chenyicn.net> * Remove unnecessary app package/directory Signed-off-by: Yi Chen <github@chenyicn.net> --------- Signed-off-by: Yi Chen <github@chenyicn.net>
1 parent 5dd91c4 commit 2375a30

File tree

21 files changed

+30
-51
lines changed

21 files changed

+30
-51
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,12 @@ override LDFLAGS += \
173173
.PHONY: build-operator
174174
build-operator: ## Build Spark operator.
175175
echo "Building spark-operator binary..."
176-
go build -o $(SPARK_OPERATOR) -ldflags '${LDFLAGS}' cmd/main.go
176+
go build -o $(SPARK_OPERATOR) -ldflags '${LDFLAGS}' cmd/operator/main.go
177177

178178
.PHONY: build-sparkctl
179179
build-sparkctl: ## Build sparkctl binary.
180180
echo "Building sparkctl binary..."
181-
CGO_ENABLED=0 go build -o $(SPARKCTL) -buildvcs=false sparkctl/main.go
181+
CGO_ENABLED=0 go build -o $(SPARKCTL) -buildvcs=false cmd/sparkctl/main.go
182182

183183
.PHONY: install-sparkctl
184184
install-sparkctl: build-sparkctl ## Install sparkctl binary.
@@ -191,7 +191,7 @@ clean: ## Clean spark-operator and sparktcl binaries.
191191
rm -f $(SPARKCTL)
192192

193193
.PHONY: build-api-docs
194-
build-api-docs: gen-crd-api-reference-docs ## Build api documentaion.
194+
build-api-docs: gen-crd-api-reference-docs ## Build api documentation.
195195
$(GEN_CRD_API_REFERENCE_DOCS) \
196196
-config hack/api-docs/config.json \
197197
-api-dir github.com/kubeflow/spark-operator/api/v1beta2 \

cmd/main.go

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
77
8-
https://www.apache.org/licenses/LICENSE-2.0
8+
http://www.apache.org/licenses/LICENSE-2.0
99
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,9 +14,12 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package operator
17+
package main
1818

1919
import (
20+
"fmt"
21+
"os"
22+
2023
"github.com/spf13/cobra"
2124

2225
"github.com/kubeflow/spark-operator/cmd/operator/controller"
@@ -37,3 +40,10 @@ func NewCommand() *cobra.Command {
3740
command.AddCommand(version.NewCommand())
3841
return command
3942
}
43+
44+
func main() {
45+
if err := NewCommand().Execute(); err != nil {
46+
fmt.Fprintf(os.Stderr, "%v\n", err)
47+
os.Exit(1)
48+
}
49+
}
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package cmd
17+
package app
1818

1919
import (
2020
"context"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package cmd
17+
package app
1818

1919
import (
2020
"context"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package cmd
17+
package app
1818

1919
import (
2020
"strings"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package cmd
17+
package app
1818

1919
import (
2020
"context"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package cmd
17+
package app
1818

1919
import (
2020
"context"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package cmd
17+
package app
1818

1919
import (
2020
"context"

0 commit comments

Comments
 (0)