Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Nov 18, 2024
1 parent 6c7f787 commit b09cd5b
Show file tree
Hide file tree
Showing 26 changed files with 623 additions and 19 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ require (
k8s.io/kube-openapi v0.0.0-20240726031636-6f6746feab9c
k8s.io/kubectl v0.30.1
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
kmodules.xyz/client-go v0.30.37
kmodules.xyz/client-go v0.30.38
kmodules.xyz/fake-apiserver v0.0.4
kmodules.xyz/resource-metadata v0.22.2
kmodules.xyz/resource-metadata v0.22.3
kubepack.dev/lib-app v0.1.0
kubepack.dev/lib-helm v0.29.13
open-cluster-management.io/api v0.14.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1056,16 +1056,16 @@ kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk=
kmodules.xyz/apiversion v0.2.0/go.mod h1:oPX8g8LvlPdPX3Yc5YvCzJHQnw3YF/X4/jdW0b1am80=
kmodules.xyz/apply v0.29.0 h1:0OXGfE2IPuvXHk6uI9zp6KCYdBibx8mK4PEl0g3LZ44=
kmodules.xyz/apply v0.29.0/go.mod h1:bwToXErB+DC7/EEWjQVARCSbJBjGx5hIEuV1n0tC73g=
kmodules.xyz/client-go v0.30.37 h1:hj4BMsNDgRVc2aDPB6Y3x5iCylXTZDZeQPJp/oA6lxs=
kmodules.xyz/client-go v0.30.37/go.mod h1:CAu+JlA8RVGtj6LQHu0Q1w2mnFUajuti49c7T1AvGdM=
kmodules.xyz/client-go v0.30.38 h1:kAQ3FdgX2HbkmfFGEoeKz7fmJYWo1Ndgdum50aaHyI0=
kmodules.xyz/client-go v0.30.38/go.mod h1:CAu+JlA8RVGtj6LQHu0Q1w2mnFUajuti49c7T1AvGdM=
kmodules.xyz/fake-apiserver v0.0.4 h1:yegZJ0w/rn/gG/QAPiXaEgwOc7h+svFGm1Hwdu7+zw8=
kmodules.xyz/fake-apiserver v0.0.4/go.mod h1:roaYuCY02IfuO5adpbEZf3z/JSMOIrpUOWhHglFM2kY=
kmodules.xyz/go-containerregistry v0.0.12 h1:Tl32QGmSqRVm9PUEb/f3dgDeu9zW5fVzt3qmAFIE37I=
kmodules.xyz/go-containerregistry v0.0.12/go.mod h1:KgeNg0hDsgeda+qc0NzWk0iVRdF0+ZIg/oRzGoYh78I=
kmodules.xyz/offshoot-api v0.30.1 h1:TrulAYO+oBsXe9sZZGTmNWIuI8qD2izMpgcTSPvgAmI=
kmodules.xyz/offshoot-api v0.30.1/go.mod h1:T3mpjR6fui0QzOcmQvIuANytW48fe9ytmy/1cgx6D4g=
kmodules.xyz/resource-metadata v0.22.2 h1:TJDSTeyuYdLPnHW3biTNlB6OtJfdQfkZ3C0Tukxsoy8=
kmodules.xyz/resource-metadata v0.22.2/go.mod h1:G57v46vQOq5P1HIs9Rl7lJ5Y4dBcjJG5OyxApTdSyNs=
kmodules.xyz/resource-metadata v0.22.3 h1:cDxIvOYcWPnv372puDmhB0klHXaaQrV98JloeTkC4wU=
kmodules.xyz/resource-metadata v0.22.3/go.mod h1:zq0gtycDR21iPzhhqrbOGF4lwffIgQ9xiS8T34aJqjk=
kmodules.xyz/resource-metrics v0.30.5 h1:ZhpGeR9DCz1HTrKUg/mWhr95wlFzCPRdgVAqwaggy1o=
kmodules.xyz/resource-metrics v0.30.5/go.mod h1:w9+rz7/s/kGP1GWzYSuRdCn+l7EwpesmESSEHkLBnIQ=
kubepack.dev/kubepack v0.29.2-0.20240914155715-3a591859b705 h1:fFn0CdYpDKTUFA4t6AV9DSVJLMwLZy8Q6RKPhNgLO+g=
Expand Down
9 changes: 9 additions & 0 deletions vendor/kmodules.xyz/client-go/api/v1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,21 @@ const (
HostingProviderGeneric HostingProvider = "Generic"
HostingProviderGKE HostingProvider = "GKE"
HostingProviderLinode HostingProvider = "Linode"
HostingProviderAkamai HostingProvider = "Akamai"
HostingProviderPacket HostingProvider = "Packet"
HostingProviderRancher HostingProvider = "Rancher"
HostingProviderScaleway HostingProvider = "Scaleway"
HostingProviderVultr HostingProvider = "Vultr"
)

func (h HostingProvider) ConvertToPreferredProvider() HostingProvider {
switch h {
case HostingProviderLinode:
return HostingProviderAkamai
}
return h
}

const (
AceInfoConfigMapName = "ace-info"

Expand Down
60 changes: 51 additions & 9 deletions vendor/kmodules.xyz/client-go/client/delegated.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package client

import (
"context"
"net/http"
"strings"

apiutil2 "kmodules.xyz/client-go/client/apiutil"
Expand All @@ -26,7 +27,9 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apiserver/pkg/authentication/user"
restclient "k8s.io/client-go/rest"
"k8s.io/client-go/transport"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"
)
Expand All @@ -36,6 +39,9 @@ import (

// NewDelegatingClientInput encapsulates the input parameters to create a new delegating client.
type NewDelegatingClientInput struct {
config *restclient.Config
options client.Options

CacheReader client.Reader
Client client.Client
UncachedObjects []client.Object
Expand All @@ -58,9 +64,11 @@ func NewDelegatingClient(in NewDelegatingClientInput) (client.Client, error) {
uncachedGVKs[gvk] = struct{}{}
}

return &delegatingClient{
scheme: in.Client.Scheme(),
mapper: in.Client.RESTMapper(),
return &DelegatingClient{
config: in.config,
options: in.options,
scheme: in.Client.Scheme(),
mapper: in.Client.RESTMapper(),
Reader: &delegatingReader{
CacheReader: in.CacheReader,
ClientReader: in.Client,
Expand All @@ -75,33 +83,65 @@ func NewDelegatingClient(in NewDelegatingClientInput) (client.Client, error) {
}, nil
}

type delegatingClient struct {
type DelegatingClient struct {
client.Reader
client.Writer
client.StatusClient
client.SubResourceClientConstructor

scheme *runtime.Scheme
mapper meta.RESTMapper

config *restclient.Config
options client.Options
}

func (d *DelegatingClient) RestConfig() *restclient.Config {
return d.config
}

func (d *DelegatingClient) Impersonate(u user.Info) (*restclient.Config, client.Client, error) {
config := restclient.CopyConfig(d.config)
config.Impersonate = restclient.ImpersonationConfig{
UserName: u.GetName(),
UID: u.GetUID(),
Groups: u.GetGroups(),
Extra: u.GetExtra(),
}

// share the transport between all clients
optionsShallowCopy := d.options
if d.options.HTTPClient != nil {
optionsShallowCopy.HTTPClient = &http.Client{
Transport: transport.NewImpersonatingRoundTripper(transport.ImpersonationConfig{
UserName: u.GetName(),
UID: u.GetUID(),
Groups: u.GetGroups(),
Extra: u.GetExtra(),
}, d.options.HTTPClient.Transport),
}
}
cc, err := NewClient(config, optionsShallowCopy)
return config, cc, err
}

// GroupVersionKindFor returns the GroupVersionKind for the given object.
func (d *delegatingClient) GroupVersionKindFor(obj runtime.Object) (schema.GroupVersionKind, error) {
func (d *DelegatingClient) GroupVersionKindFor(obj runtime.Object) (schema.GroupVersionKind, error) {
return apiutil.GVKForObject(obj, d.scheme)
}

// IsObjectNamespaced returns true if the GroupVersionKind of the object is namespaced.
func (d *delegatingClient) IsObjectNamespaced(obj runtime.Object) (bool, error) {
func (d *DelegatingClient) IsObjectNamespaced(obj runtime.Object) (bool, error) {
return apiutil.IsObjectNamespaced(obj, d.scheme, d.mapper)
}

// Scheme returns the scheme this client is using.
func (d *delegatingClient) Scheme() *runtime.Scheme {
func (d *DelegatingClient) Scheme() *runtime.Scheme {
return d.scheme
}

// RESTMapper returns the rest mapper this client is using.
func (d *delegatingClient) RESTMapper() meta.RESTMapper {
func (d *DelegatingClient) RESTMapper() meta.RESTMapper {
return d.mapper
}

Expand Down Expand Up @@ -167,7 +207,7 @@ func (d *delegatingReader) List(ctx context.Context, list client.ObjectList, opt
return d.CacheReader.List(ctx, list, opts...)
}

func (d *delegatingClient) SubResource(subResource string) client.SubResourceClient {
func (d *DelegatingClient) SubResource(subResource string) client.SubResourceClient {
return d.SubResourceClientConstructor.SubResource(subResource)
}

Expand All @@ -181,6 +221,8 @@ func NewClient(config *restclient.Config, options client.Options) (client.Client
return nil, err
}
co := NewDelegatingClientInput{
config: config,
options: options,
Client: c,
Cachable: cachable,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
Copyright AppsCode Inc. and Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
ResourceKindGatewayInfo = "GatewayInfo"
ResourceGatewayInfo = "gatewayinfo"
ResourceGatewayInfos = "gatewayinfos"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type GatewayInfo struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec GatewayInfoSpec `json:"spec,omitempty"`
}

type GatewayInfoSpec struct {
GatewayClassName string `json:"gatewayClassName"`
ServiceType string `json:"serviceType"`
HostName string `json:"hostName,omitempty"`
IP string `json:"ip,omitempty"`
}
Loading

0 comments on commit b09cd5b

Please sign in to comment.