Skip to content

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Nov 20, 2024
1 parent 3c5b716 commit afae993
Show file tree
Hide file tree
Showing 17 changed files with 318 additions and 19 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ require (
k8s.io/apimachinery v0.30.2
k8s.io/client-go v0.30.2
k8s.io/klog/v2 v2.130.1
kmodules.xyz/client-go v0.30.31
kmodules.xyz/resource-metadata v0.21.0
kmodules.xyz/client-go v0.30.39
kmodules.xyz/resource-metadata v0.22.6
open-cluster-management.io/api v0.14.0
sigs.k8s.io/controller-runtime v0.18.4
sigs.k8s.io/yaml v1.4.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -628,12 +628,12 @@ k8s.io/kube-openapi v0.0.0-20240703190633-0aa61b46e8c2 h1:T5TEV4a+pEjc+j9Xui3MGG
k8s.io/kube-openapi v0.0.0-20240703190633-0aa61b46e8c2/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc=
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak=
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
kmodules.xyz/client-go v0.30.31 h1:P+ZslW5QcgMnMoxo1ZMJrNNcwRwA1BiFct1JvcRQEj0=
kmodules.xyz/client-go v0.30.31/go.mod h1:CAu+JlA8RVGtj6LQHu0Q1w2mnFUajuti49c7T1AvGdM=
kmodules.xyz/client-go v0.30.39 h1:/GjcgKLY1WdsHRK+956FXQdqDkJg/voJASo+IFyH0xA=
kmodules.xyz/client-go v0.30.39/go.mod h1:CAu+JlA8RVGtj6LQHu0Q1w2mnFUajuti49c7T1AvGdM=
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/resource-metadata v0.21.0 h1:sFH2sIeKo1a5xwOwBnx5RRXjEvisY2xakka2l2wK+XY=
kmodules.xyz/resource-metadata v0.21.0/go.mod h1:pdge27Crf30IeiBGhy1QIveRiUtJ/QnSSOaO2VxHAmI=
kmodules.xyz/resource-metadata v0.22.6 h1:3AbZi7n5rC565nXKq3e7G9DA+PDntRWlWvexoAZ1gHI=
kmodules.xyz/resource-metadata v0.22.6/go.mod h1:zq27dG0YA8WEdOOoyfsLn4TQK5Xxox13dwJKtr66eqU=
open-cluster-management.io/api v0.14.0 h1:yjhnNeO/QudiIoEi0i/yUYmP3iElAfUgtj4pHMV+4uM=
open-cluster-management.io/api v0.14.0/go.mod h1:ltijKJhDifrPH0csvCUmFt5lzaERv+BBfh6X3l83rT0=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down
28 changes: 28 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,18 +35,36 @@ 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"

ClusterNameKey string = "cluster.appscode.com/name"
ClusterDisplayNameKey string = "cluster.appscode.com/display-name"
ClusterProviderNameKey string = "cluster.appscode.com/provider"
ClusterProfileLabel string = "cluster.appscode.com/profile"

AceOrgIDKey string = "ace.appscode.com/org-id"
ClientOrgKey string = "ace.appscode.com/client-org"
ClientKeyPrefix string = "client.ace.appscode.com/"

ClusterClaimKeyID string = "id.k8s.io"
ClusterClaimKeyInfo string = "cluster.ace.info"
ClusterClaimKeyFeatures string = "features.ace.info"
)

type ClusterMetadata struct {
Expand Down Expand Up @@ -183,3 +201,13 @@ const (
CAPIProviderCAPZ CAPIProvider = "capz"
CAPIProviderCAPH CAPIProvider = "caph"
)

type ClusterClaimInfo struct {
ClusterMetadata ClusterInfo `json:"clusterMetadata"`
}

type ClusterClaimFeatures struct {
EnabledFeatures []string `json:"enabledFeatures,omitempty"`
ExternallyManagedFeatures []string `json:"externallyManagedFeatures,omitempty"`
DisabledFeatures []string `json:"disabledFeatures,omitempty"`
}
48 changes: 48 additions & 0 deletions vendor/kmodules.xyz/client-go/api/v1/zz_generated.deepcopy.go

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

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

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

5 changes: 3 additions & 2 deletions vendor/kmodules.xyz/resource-metadata/apis/shared/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ type DeploymentParameters struct {
}

type ResourceLocator struct {
Ref metav1.GroupKind `json:"ref"`
Query ResourceQuery `json:"query"`
Ref metav1.GroupKind `json:"ref"`
Query ResourceQuery `json:"query"`
Impersonate bool `json:"impersonate,omitempty"`
}

// +kubebuilder:validation:Enum=REST;GraphQL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ type FeatureSpec struct {
// FeatureBlock specifies the ui block name of this feature.
// +optional
FeatureBlock string `json:"featureBlock,omitempty"`
// FeatureExclusionGroup specifies the name of the exclusion group for features
// Only one feature in a feature exclusion group can be installed
// +optional
FeatureExclusionGroup string `json:"featureExclusionGroup,omitempty"`
// Required specifies whether this feature is mandatory or not for enabling the respecting FeatureSet.
// +optional
Recommended bool `json:"recommended,omitempty"`
Expand Down
Loading

0 comments on commit afae993

Please sign in to comment.