Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix codegen script and update generated code #1724

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
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