Skip to content

Commit

Permalink
wip: try get codegen working
Browse files Browse the repository at this point in the history
  • Loading branch information
Theo Barber-Bany committed Nov 2, 2021
1 parent 6c4649c commit 4068972
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apis/workloads/v1alpha1/console_authorisation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ConsoleAuthorisationSpec defines the desired state of ConsoleAuthorisation
type ConsoleAuthorisationSpec struct {
// The reference to the console by name that this console authorisation belongs to.
Expand All @@ -21,6 +23,8 @@ type ConsoleAuthorisationStatus struct{}
// +kubebuilder:object:root=true
// +kubebuilder:storageversion

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ConsoleAuthorisation is the Schema for the consoleauthorisations API
type ConsoleAuthorisation struct {
metav1.TypeMeta `json:",inline"`
Expand Down
4 changes: 4 additions & 0 deletions apis/workloads/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// workloads v1alpha1 is the v1alpha1 version of the API.
// +k8s:deepcopy-gen=package,register
// +groupName=workloads.crd.gocardless.io
package v1alpha1
10 changes: 10 additions & 0 deletions client_codegen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ROOT_PACKAGE="github.com/gocardless/theatre"
CUSTOM_RESOURCE_NAME="workloads"
CUSTOM_RESOURCE_VERSION="v1alpha1"

//go get -u k8s.io/code-generator/...
cd $GOPATH/src/k8s.io/code-generator

./generate-groups.sh all "$ROOT_PACKAGE/pkg/client" "$ROOT_PACKAGE/apis/workloads" "$CUSTOM_RESOURCE_NAME:$CUSTOM_RESOURCE_VERSION"

tree $GOPATH/src/$ROOT_PACKAGE/pkg/client

0 comments on commit 4068972

Please sign in to comment.