Skip to content

Commit

Permalink
Merge pull request #587 from m3ngyang/mydev
Browse files Browse the repository at this point in the history
fix error in types and cancel dir pkg under dir go
  • Loading branch information
typhoonzero authored Feb 8, 2018
2 parents 03a8102 + 2d0b51c commit a714199
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ matrix:
RESULT=$?; if [ $RESULT -eq 0 ]; then true; else exit 1 ; fi;
- ln -s $GOPATH/src/github.com/PaddlePaddle $GOPATH/src/github.com/paddlepaddle
- cd go && glide install && go get k8s.io/kubernetes || echo 1
- bash ./vendor/k8s.io/code-generator/generate-groups.sh "deepcopy,client,informer,lister" github.com/PaddlePaddle/cloud/go/pkg/client github.com/PaddlePaddle/cloud/go/pkg/apis paddlepaddle:v1alpha1
- grep "github.com/paddlepaddle/cloud" -nR pkg/client | awk -F ':' '{print $1}' | xargs sed -i 's|github.com/paddlepaddle/cloud|github.com/PaddlePaddle/cloud|g'
- bash ./vendor/k8s.io/code-generator/generate-groups.sh "deepcopy,client,informer,lister" github.com/PaddlePaddle/cloud/go/client github.com/PaddlePaddle/cloud/go/apis paddlepaddle:v1alpha1
- grep "github.com/paddlepaddle/cloud" -nR client | awk -F ':' '{print $1}' | xargs sed -i 's|github.com/paddlepaddle/cloud|github.com/PaddlePaddle/cloud|g'
- glide install --strip-vendor && go test $(glide novendor)
- language: python
python: 2.7
Expand Down
2 changes: 1 addition & 1 deletion doc/edl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ $ scripts/update-codegen.sh
```
For more details, please refer to [article](https://blog.openshift.com/kubernetes-deep-dive-code-generation-customresources/).
When the definition of resource is stable, we will commit generated dependent codes.
Just skip `go/pkg` when running `go test` during your development.
Just skip `go/apis` when running `go test` during your development.

By the way, if you want to generate these codes by yourself, due to this [issue](https://github.com/kubernetes/code-generator/issues/20),
you have to deal with the import problem.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import (

const (
// CRDKind is the kind of K8s CRD.
CRDKind = "TraingingJob"
CRDKind = "TrainingJob"
// CRDKindPlural is the plural of CRDKind.
CRDKindPlural = "traingingjobs"
CRDKindPlural = "trainingjobs"
// CRDShortName is the short name of CRD.
CRDShortName = "tj"
// CRDGroup is the name of group.
CRDGroup = "paddlepaddle.org"
// CRDVersion is the version of CRD.
Expand All @@ -25,7 +27,6 @@ func CRDName() string {

// +genclient
// +genclient:noStatus
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +resource:path=trainingjob

Expand All @@ -40,7 +41,11 @@ type TrainingJob struct {
// TrainingJobSpec is the spec for a TrainingJob resource
type TrainingJobSpec struct {
// General job attributes.
Image string `json:"image,omitempty"`
Image string `json:"image,omitempty"`
// If you want to use the hostnetwork instead of container network
// portmanager is necessary. About portmanager, please refer to
// https://github.com/PaddlePaddle/cloud/blob/develop/doc/hostnetwork/hostnetwork.md
HostNetwork bool `json:"host_network,omitempty"`
Port int `json:"port,omitempty"`
PortsNum int `json:"ports_num,omitempty"`
PortsNumForSparse int `json:"ports_num_for_sparse,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion go/scripts/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ echo ${CODEGEN_PKG}
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
# instead of the $GOPATH directly. For normal projects this can be dropped.
${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
github.com/PaddlePaddle/cloud/go/pkg/client github.com/PaddlePaddle/cloud/go/pkg/apis \
github.com/PaddlePaddle/cloud/go/client github.com/PaddlePaddle/cloud/go/apis \
paddlepaddle:v1alpha1 \
--go-header-file ${SCRIPT_ROOT}/scripts/custom-boilerplate.go.txt

0 comments on commit a714199

Please sign in to comment.