Skip to content

Commit

Permalink
fix: fix codegen script and update generated code
Browse files Browse the repository at this point in the history
Signed-off-by: Sanskar Jaiswal <[email protected]>
  • Loading branch information
aryan9600 committed Nov 23, 2024
1 parent 7cd1476 commit 398fc90
Show file tree
Hide file tree
Showing 38 changed files with 144 additions and 124 deletions.
10 changes: 6 additions & 4 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ mkdir -p "${TEMP_DIR}/${PACKAGE_PATH_BASE}/pkg/client/informers" \
# Ensure we can execute.
chmod +x ${CODEGEN_PKG}/kube_codegen.sh

source ${CODEGEN_PKG}/kube_codegen.sh kube::codegen::gen_client \
--output-dir "${TEMP_DIR}" \
source ${CODEGEN_PKG}/kube_codegen.sh

kube::codegen::gen_client \
--output-dir "${TEMP_DIR}/${PACKAGE_PATH_BASE}/pkg/client" \
--output-pkg "${PACKAGE_PATH_BASE}/pkg/client" \
--with-watch \
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
./pkgs/apis
./pkg/apis

ls -lha $TEMP_DIR
tree $TEMP_DIR/${PACKAGE_PATH_BASE/pkg/client}/

# Copy everything back.
cp -r "${TEMP_DIR}/${PACKAGE_PATH_BASE}/." "${SCRIPT_ROOT}/"
3 changes: 1 addition & 2 deletions pkg/apis/gloo/register.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package gloo

const (
GlooGroupName = "gloo.solo.io"
GatewayGroupName = "gateway.solo.io"
GlooGroupName = "gloo.solo.io"
)
File renamed without changes.
File renamed without changes.
9 changes: 7 additions & 2 deletions pkg/apis/gloo/gloo/v1/types.go → pkg/apis/gloo/v1/types.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package v1

import (
v1 "github.com/fluxcd/flagger/pkg/apis/gloo/gateway/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -44,7 +43,7 @@ type UpstreamSslConfig struct {

/** SSLSecrets -- only one of these should be set */
*UpstreamSslConfig_Sds `json:"sds,omitempty"`
SecretRef *v1.ResourceRef `json:"secretRef,omitempty"`
SecretRef *ResourceRef `json:"secretRef,omitempty"`
*UpstreamSslConfig_SslFiles `json:"sslFiles,omitempty"`
}

Expand Down Expand Up @@ -139,3 +138,9 @@ type UpstreamList struct {

Items []Upstream `json:"items"`
}

// ResourceRef references resources across namespaces
type ResourceRef struct {
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,omitempty"`
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/gloogateway/register.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package gloogateway

const (
GatewayGroupName = "gateway.solo.io"
)
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package v1

import (
"github.com/fluxcd/flagger/pkg/apis/gloo"
"github.com/fluxcd/flagger/pkg/apis/gloogateway"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)

// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: gloo.GatewayGroupName, Version: "v1"}
var SchemeGroupVersion = schema.GroupVersion{Group: gloogateway.GatewayGroupName, Version: "v1"}

// Kind takes an unqualified kind and returns back a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
Expand Down
File renamed without changes.
56 changes: 28 additions & 28 deletions pkg/client/clientset/versioned/clientset.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions pkg/client/clientset/versioned/fake/clientset_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions pkg/client/clientset/versioned/fake/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 398fc90

Please sign in to comment.