feat: k8s informer for ServiceAdapter CRDs, bump CI to go1.26
- Add dynamic-client informer to watch ServiceAdapter CRs in-cluster - Remove typed scheme registration (dynamic client needs no DeepCopy) - Bump Dockerfile + CI images from golang:1.25 to golang:1.26 (k8s.io/[email protected] requires go>=1.26) - Wire informer into main.go startup with graceful fallback
This commit is contained in:
@@ -21,16 +21,9 @@ package v1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"sigs.k8s.io/controller-runtime/pkg/scheme"
|
||||
)
|
||||
|
||||
var (
|
||||
// GroupVersion is group version used to register these objects
|
||||
// GroupVersion is group version used to register these objects.
|
||||
GroupVersion = schema.GroupVersion{Group: "gateway.riotpiao.com", Version: "v1"}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
|
||||
|
||||
// AddToScheme adds the types in this group-version to the given scheme.
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
@@ -154,6 +154,7 @@ type ServiceAdapterList struct {
|
||||
Items []ServiceAdapter `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(&ServiceAdapter{}, &ServiceAdapterList{})
|
||||
}
|
||||
// Note: DeepCopyObject is not generated. The gateway uses the dynamic
|
||||
// (unstructured) k8s client, so typed scheme registration is unnecessary.
|
||||
// If a typed client is needed later, run controller-gen to generate
|
||||
// the DeepCopy methods and re-enable SchemeBuilder.Register here.
|
||||
|
||||
Reference in New Issue
Block a user