diff --git a/cmd/pro/provider/helper.go b/cmd/pro/provider/helper.go index c46a49b53..3ac99cb37 100644 --- a/cmd/pro/provider/helper.go +++ b/cmd/pro/provider/helper.go @@ -108,10 +108,6 @@ func DialWorkspace(baseClient client.Client, workspace *managementv1.DevPodWorks } host := restConfig.Host - if workspace.Annotations != nil && workspace.Annotations[storagev1.DevPodWorkspaceRunnerEndpointAnnotation] != "" { - host = workspace.Annotations[storagev1.DevPodWorkspaceRunnerEndpointAnnotation] - } - parsedURL, _ := url.Parse(host) if parsedURL != nil && parsedURL.Host != "" { host = parsedURL.Host diff --git a/go.mod b/go.mod index 7fcb3b73d..4e91aa210 100644 --- a/go.mod +++ b/go.mod @@ -20,8 +20,8 @@ require ( github.com/google/uuid v1.6.0 github.com/gorilla/websocket v1.5.1 github.com/joho/godotenv v1.5.1 - github.com/loft-sh/agentapi/v4 v4.0.0-alpha.1 - github.com/loft-sh/api/v4 v4.0.0-alpha.3 + github.com/loft-sh/agentapi/v4 v4.0.0-alpha.3 + github.com/loft-sh/api/v4 v4.0.0-alpha.3.0.20240522135459-9e20254f7d4d github.com/loft-sh/log v0.0.0-20240219160058-26d83ffb46ac github.com/loft-sh/programming-language-detection v0.0.5 github.com/loft-sh/ssh v0.0.4 diff --git a/go.sum b/go.sum index 9eab2b7b4..1b34abce9 100644 --- a/go.sum +++ b/go.sum @@ -818,8 +818,12 @@ github.com/loft-sh/admin-apis v0.0.0-20240203010124-3600c1c582a8 h1:nuY9Vgvabh2F github.com/loft-sh/admin-apis v0.0.0-20240203010124-3600c1c582a8/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U= github.com/loft-sh/agentapi/v4 v4.0.0-alpha.1 h1:LJiX7z2DQU1UHrMnkYWeLk9r9KMD2RX3733eoRAjJDo= github.com/loft-sh/agentapi/v4 v4.0.0-alpha.1/go.mod h1:6c1I63fh+Ku2wT7hZ1GrwfH9JZsyRb8MefocoKkojJI= +github.com/loft-sh/agentapi/v4 v4.0.0-alpha.3 h1:/OF23kjpecZHeRKSf3cflLuzB6Miv/UUslXXBQdqOQY= +github.com/loft-sh/agentapi/v4 v4.0.0-alpha.3/go.mod h1:6c1I63fh+Ku2wT7hZ1GrwfH9JZsyRb8MefocoKkojJI= github.com/loft-sh/api/v4 v4.0.0-alpha.3 h1:zZsKKzeezOv/MtuGg/PfsYQVpANDjW2MSdUXOfqhw9U= github.com/loft-sh/api/v4 v4.0.0-alpha.3/go.mod h1:hsFRiytpWwb9Wd/MnZrC/nCefHSCu/RoidgQipFXc2E= +github.com/loft-sh/api/v4 v4.0.0-alpha.3.0.20240522135459-9e20254f7d4d h1:bhispdYRuiZsi7AqOsMsePz7CopSmVrSApvYjDVeFyA= +github.com/loft-sh/api/v4 v4.0.0-alpha.3.0.20240522135459-9e20254f7d4d/go.mod h1:EQyRUQ9daLAyHgGNzTHlGMLZ9gyRjwEGQeYqb9IGSgo= github.com/loft-sh/apiserver v0.0.0-20240129130254-7b9a55ab1744 h1:1Yhs86ugpnEsex4kkFpyvCHNy42O5vtJjY7Loty9JkI= github.com/loft-sh/apiserver v0.0.0-20240129130254-7b9a55ab1744/go.mod h1:/QBF5drEoeQ0pggzT6q29+cyirRg5/MOJCq39ghku+8= github.com/loft-sh/jspolicy v0.2.2 h1:+7QqVumYm225mSJsGOjnbCGYzh9XyKYQab6FgLiHYJU= diff --git a/pkg/loft/client/client.go b/pkg/loft/client/client.go index e6eb81cce..fd8bebaf5 100644 --- a/pkg/loft/client/client.go +++ b/pkg/loft/client/client.go @@ -23,6 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/loft-sh/devpod/pkg/loft/kube" + "github.com/loft-sh/devpod/pkg/loft/project" "github.com/loft-sh/devpod/pkg/version" "github.com/loft-sh/log" "github.com/mitchellh/go-homedir" @@ -131,6 +132,13 @@ func (c *client) RefreshSelf(ctx context.Context) error { return fmt.Errorf("get self: %w", err) } + projectNamespacePrefix := project.DefaultProjectNamespacePrefix + if c.self.Status.ProjectNamespacePrefix != nil { + projectNamespacePrefix = *c.self.Status.ProjectNamespacePrefix + } + + project.SetProjectNamespacePrefix(projectNamespacePrefix) + return nil } diff --git a/pkg/loft/project/project.go b/pkg/loft/project/project.go index b256d1e51..0d2e53478 100644 --- a/pkg/loft/project/project.go +++ b/pkg/loft/project/project.go @@ -13,15 +13,11 @@ var prefixMux sync.RWMutex // SetProjectNamespacePrefix sets the global project namespace prefix // Defaulting should be handled when reading the config via ParseProjectNamespacePrefix -func SetProjectNamespacePrefix(newPrefix *string) { +func SetProjectNamespacePrefix(newPrefix string) { prefixMux.Lock() defer prefixMux.Unlock() - if newPrefix == nil { - return - } - - prefix = newPrefix + prefix = &newPrefix } func GetProjectNamespacePrefix() string { diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/clientset.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/clientset.go deleted file mode 100644 index 1cc4fbb1e..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/clientset.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package clientset - -import ( - "fmt" - "net/http" - - clusterv1 "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1" - storagev1 "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - ClusterV1() clusterv1.ClusterV1Interface - StorageV1() storagev1.StorageV1Interface -} - -// Clientset contains the clients for groups. -type Clientset struct { - *discovery.DiscoveryClient - clusterV1 *clusterv1.ClusterV1Client - storageV1 *storagev1.StorageV1Client -} - -// ClusterV1 retrieves the ClusterV1Client -func (c *Clientset) ClusterV1() clusterv1.ClusterV1Interface { - return c.clusterV1 -} - -// StorageV1 retrieves the StorageV1Client -func (c *Clientset) StorageV1() storagev1.StorageV1Interface { - return c.storageV1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfig will generate a rate-limiter in configShallowCopy. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - - if configShallowCopy.UserAgent == "" { - configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() - } - - // share the transport between all clients - httpClient, err := rest.HTTPClientFor(&configShallowCopy) - if err != nil { - return nil, err - } - - return NewForConfigAndClient(&configShallowCopy, httpClient) -} - -// NewForConfigAndClient creates a new Clientset for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. -func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") - } - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - - var cs Clientset - var err error - cs.clusterV1, err = clusterv1.NewForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } - cs.storageV1, err = storagev1.NewForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - cs, err := NewForConfig(c) - if err != nil { - panic(err) - } - return cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.clusterV1 = clusterv1.New(c) - cs.storageV1 = storagev1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/doc.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/doc.go deleted file mode 100644 index 2b617906e..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package clientset diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme/doc.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme/doc.go deleted file mode 100644 index 14db57a58..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme/register.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme/register.go deleted file mode 100644 index d4a39ada3..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme/register.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - clusterv1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1" - storagev1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - clusterv1.AddToScheme, - storagev1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/chartinfo.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/chartinfo.go deleted file mode 100644 index 3994280c4..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/chartinfo.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1" - scheme "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// ChartInfosGetter has a method to return a ChartInfoInterface. -// A group's client should implement this interface. -type ChartInfosGetter interface { - ChartInfos() ChartInfoInterface -} - -// ChartInfoInterface has methods to work with ChartInfo resources. -type ChartInfoInterface interface { - Create(ctx context.Context, chartInfo *v1.ChartInfo, opts metav1.CreateOptions) (*v1.ChartInfo, error) - Update(ctx context.Context, chartInfo *v1.ChartInfo, opts metav1.UpdateOptions) (*v1.ChartInfo, error) - UpdateStatus(ctx context.Context, chartInfo *v1.ChartInfo, opts metav1.UpdateOptions) (*v1.ChartInfo, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ChartInfo, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.ChartInfoList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ChartInfo, err error) - ChartInfoExpansion -} - -// chartInfos implements ChartInfoInterface -type chartInfos struct { - client rest.Interface -} - -// newChartInfos returns a ChartInfos -func newChartInfos(c *ClusterV1Client) *chartInfos { - return &chartInfos{ - client: c.RESTClient(), - } -} - -// Get takes name of the chartInfo, and returns the corresponding chartInfo object, and an error if there is any. -func (c *chartInfos) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ChartInfo, err error) { - result = &v1.ChartInfo{} - err = c.client.Get(). - Resource("chartinfos"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ChartInfos that match those selectors. -func (c *chartInfos) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ChartInfoList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ChartInfoList{} - err = c.client.Get(). - Resource("chartinfos"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested chartInfos. -func (c *chartInfos) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("chartinfos"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a chartInfo and creates it. Returns the server's representation of the chartInfo, and an error, if there is any. -func (c *chartInfos) Create(ctx context.Context, chartInfo *v1.ChartInfo, opts metav1.CreateOptions) (result *v1.ChartInfo, err error) { - result = &v1.ChartInfo{} - err = c.client.Post(). - Resource("chartinfos"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(chartInfo). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a chartInfo and updates it. Returns the server's representation of the chartInfo, and an error, if there is any. -func (c *chartInfos) Update(ctx context.Context, chartInfo *v1.ChartInfo, opts metav1.UpdateOptions) (result *v1.ChartInfo, err error) { - result = &v1.ChartInfo{} - err = c.client.Put(). - Resource("chartinfos"). - Name(chartInfo.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(chartInfo). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *chartInfos) UpdateStatus(ctx context.Context, chartInfo *v1.ChartInfo, opts metav1.UpdateOptions) (result *v1.ChartInfo, err error) { - result = &v1.ChartInfo{} - err = c.client.Put(). - Resource("chartinfos"). - Name(chartInfo.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(chartInfo). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the chartInfo and deletes it. Returns an error if one occurs. -func (c *chartInfos) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("chartinfos"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *chartInfos) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("chartinfos"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched chartInfo. -func (c *chartInfos) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ChartInfo, err error) { - result = &v1.ChartInfo{} - err = c.client.Patch(pt). - Resource("chartinfos"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/cluster_client.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/cluster_client.go deleted file mode 100644 index bf2f5cd20..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/cluster_client.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "net/http" - - v1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1" - "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme" - rest "k8s.io/client-go/rest" -) - -type ClusterV1Interface interface { - RESTClient() rest.Interface - ChartInfosGetter - ClusterQuotasGetter - FeaturesGetter - HelmReleasesGetter - LocalClusterAccessesGetter - SleepModeConfigsGetter - SpacesGetter - VirtualClustersGetter -} - -// ClusterV1Client is used to interact with features provided by the cluster.loft.sh group. -type ClusterV1Client struct { - restClient rest.Interface -} - -func (c *ClusterV1Client) ChartInfos() ChartInfoInterface { - return newChartInfos(c) -} - -func (c *ClusterV1Client) ClusterQuotas() ClusterQuotaInterface { - return newClusterQuotas(c) -} - -func (c *ClusterV1Client) Features() FeatureInterface { - return newFeatures(c) -} - -func (c *ClusterV1Client) HelmReleases(namespace string) HelmReleaseInterface { - return newHelmReleases(c, namespace) -} - -func (c *ClusterV1Client) LocalClusterAccesses() LocalClusterAccessInterface { - return newLocalClusterAccesses(c) -} - -func (c *ClusterV1Client) SleepModeConfigs(namespace string) SleepModeConfigInterface { - return newSleepModeConfigs(c, namespace) -} - -func (c *ClusterV1Client) Spaces() SpaceInterface { - return newSpaces(c) -} - -func (c *ClusterV1Client) VirtualClusters(namespace string) VirtualClusterInterface { - return newVirtualClusters(c, namespace) -} - -// NewForConfig creates a new ClusterV1Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*ClusterV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - httpClient, err := rest.HTTPClientFor(&config) - if err != nil { - return nil, err - } - return NewForConfigAndClient(&config, httpClient) -} - -// NewForConfigAndClient creates a new ClusterV1Client for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ClusterV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientForConfigAndClient(&config, h) - if err != nil { - return nil, err - } - return &ClusterV1Client{client}, nil -} - -// NewForConfigOrDie creates a new ClusterV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ClusterV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new ClusterV1Client for the given RESTClient. -func New(c rest.Interface) *ClusterV1Client { - return &ClusterV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *ClusterV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/clusterquota.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/clusterquota.go deleted file mode 100644 index cbbbb7484..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/clusterquota.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1" - scheme "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// ClusterQuotasGetter has a method to return a ClusterQuotaInterface. -// A group's client should implement this interface. -type ClusterQuotasGetter interface { - ClusterQuotas() ClusterQuotaInterface -} - -// ClusterQuotaInterface has methods to work with ClusterQuota resources. -type ClusterQuotaInterface interface { - Create(ctx context.Context, clusterQuota *v1.ClusterQuota, opts metav1.CreateOptions) (*v1.ClusterQuota, error) - Update(ctx context.Context, clusterQuota *v1.ClusterQuota, opts metav1.UpdateOptions) (*v1.ClusterQuota, error) - UpdateStatus(ctx context.Context, clusterQuota *v1.ClusterQuota, opts metav1.UpdateOptions) (*v1.ClusterQuota, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterQuota, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterQuotaList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterQuota, err error) - ClusterQuotaExpansion -} - -// clusterQuotas implements ClusterQuotaInterface -type clusterQuotas struct { - client rest.Interface -} - -// newClusterQuotas returns a ClusterQuotas -func newClusterQuotas(c *ClusterV1Client) *clusterQuotas { - return &clusterQuotas{ - client: c.RESTClient(), - } -} - -// Get takes name of the clusterQuota, and returns the corresponding clusterQuota object, and an error if there is any. -func (c *clusterQuotas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterQuota, err error) { - result = &v1.ClusterQuota{} - err = c.client.Get(). - Resource("clusterquotas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterQuotas that match those selectors. -func (c *clusterQuotas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterQuotaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ClusterQuotaList{} - err = c.client.Get(). - Resource("clusterquotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterQuotas. -func (c *clusterQuotas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("clusterquotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterQuota and creates it. Returns the server's representation of the clusterQuota, and an error, if there is any. -func (c *clusterQuotas) Create(ctx context.Context, clusterQuota *v1.ClusterQuota, opts metav1.CreateOptions) (result *v1.ClusterQuota, err error) { - result = &v1.ClusterQuota{} - err = c.client.Post(). - Resource("clusterquotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterQuota). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterQuota and updates it. Returns the server's representation of the clusterQuota, and an error, if there is any. -func (c *clusterQuotas) Update(ctx context.Context, clusterQuota *v1.ClusterQuota, opts metav1.UpdateOptions) (result *v1.ClusterQuota, err error) { - result = &v1.ClusterQuota{} - err = c.client.Put(). - Resource("clusterquotas"). - Name(clusterQuota.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterQuota). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *clusterQuotas) UpdateStatus(ctx context.Context, clusterQuota *v1.ClusterQuota, opts metav1.UpdateOptions) (result *v1.ClusterQuota, err error) { - result = &v1.ClusterQuota{} - err = c.client.Put(). - Resource("clusterquotas"). - Name(clusterQuota.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterQuota). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterQuota and deletes it. Returns an error if one occurs. -func (c *clusterQuotas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusterquotas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterQuotas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("clusterquotas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterQuota. -func (c *clusterQuotas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterQuota, err error) { - result = &v1.ClusterQuota{} - err = c.client.Patch(pt). - Resource("clusterquotas"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/doc.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/doc.go deleted file mode 100644 index 225e6b2be..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1 diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/feature.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/feature.go deleted file mode 100644 index a35cd26ad..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/feature.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1" - scheme "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// FeaturesGetter has a method to return a FeatureInterface. -// A group's client should implement this interface. -type FeaturesGetter interface { - Features() FeatureInterface -} - -// FeatureInterface has methods to work with Feature resources. -type FeatureInterface interface { - Create(ctx context.Context, feature *v1.Feature, opts metav1.CreateOptions) (*v1.Feature, error) - Update(ctx context.Context, feature *v1.Feature, opts metav1.UpdateOptions) (*v1.Feature, error) - UpdateStatus(ctx context.Context, feature *v1.Feature, opts metav1.UpdateOptions) (*v1.Feature, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Feature, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.FeatureList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Feature, err error) - FeatureExpansion -} - -// features implements FeatureInterface -type features struct { - client rest.Interface -} - -// newFeatures returns a Features -func newFeatures(c *ClusterV1Client) *features { - return &features{ - client: c.RESTClient(), - } -} - -// Get takes name of the feature, and returns the corresponding feature object, and an error if there is any. -func (c *features) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Feature, err error) { - result = &v1.Feature{} - err = c.client.Get(). - Resource("features"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Features that match those selectors. -func (c *features) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FeatureList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.FeatureList{} - err = c.client.Get(). - Resource("features"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested features. -func (c *features) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("features"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a feature and creates it. Returns the server's representation of the feature, and an error, if there is any. -func (c *features) Create(ctx context.Context, feature *v1.Feature, opts metav1.CreateOptions) (result *v1.Feature, err error) { - result = &v1.Feature{} - err = c.client.Post(). - Resource("features"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(feature). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a feature and updates it. Returns the server's representation of the feature, and an error, if there is any. -func (c *features) Update(ctx context.Context, feature *v1.Feature, opts metav1.UpdateOptions) (result *v1.Feature, err error) { - result = &v1.Feature{} - err = c.client.Put(). - Resource("features"). - Name(feature.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(feature). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *features) UpdateStatus(ctx context.Context, feature *v1.Feature, opts metav1.UpdateOptions) (result *v1.Feature, err error) { - result = &v1.Feature{} - err = c.client.Put(). - Resource("features"). - Name(feature.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(feature). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the feature and deletes it. Returns an error if one occurs. -func (c *features) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("features"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *features) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("features"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched feature. -func (c *features) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Feature, err error) { - result = &v1.Feature{} - err = c.client.Patch(pt). - Resource("features"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/generated_expansion.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/generated_expansion.go deleted file mode 100644 index 89664f171..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/generated_expansion.go +++ /dev/null @@ -1,19 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -type ChartInfoExpansion interface{} - -type ClusterQuotaExpansion interface{} - -type FeatureExpansion interface{} - -type HelmReleaseExpansion interface{} - -type LocalClusterAccessExpansion interface{} - -type SleepModeConfigExpansion interface{} - -type SpaceExpansion interface{} - -type VirtualClusterExpansion interface{} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/helmrelease.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/helmrelease.go deleted file mode 100644 index 7bae37a58..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/helmrelease.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1" - scheme "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// HelmReleasesGetter has a method to return a HelmReleaseInterface. -// A group's client should implement this interface. -type HelmReleasesGetter interface { - HelmReleases(namespace string) HelmReleaseInterface -} - -// HelmReleaseInterface has methods to work with HelmRelease resources. -type HelmReleaseInterface interface { - Create(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.CreateOptions) (*v1.HelmRelease, error) - Update(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.UpdateOptions) (*v1.HelmRelease, error) - UpdateStatus(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.UpdateOptions) (*v1.HelmRelease, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.HelmRelease, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.HelmReleaseList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HelmRelease, err error) - HelmReleaseExpansion -} - -// helmReleases implements HelmReleaseInterface -type helmReleases struct { - client rest.Interface - ns string -} - -// newHelmReleases returns a HelmReleases -func newHelmReleases(c *ClusterV1Client, namespace string) *helmReleases { - return &helmReleases{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the helmRelease, and returns the corresponding helmRelease object, and an error if there is any. -func (c *helmReleases) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HelmRelease, err error) { - result = &v1.HelmRelease{} - err = c.client.Get(). - Namespace(c.ns). - Resource("helmreleases"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of HelmReleases that match those selectors. -func (c *helmReleases) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HelmReleaseList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.HelmReleaseList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("helmreleases"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested helmReleases. -func (c *helmReleases) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("helmreleases"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a helmRelease and creates it. Returns the server's representation of the helmRelease, and an error, if there is any. -func (c *helmReleases) Create(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.CreateOptions) (result *v1.HelmRelease, err error) { - result = &v1.HelmRelease{} - err = c.client.Post(). - Namespace(c.ns). - Resource("helmreleases"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(helmRelease). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a helmRelease and updates it. Returns the server's representation of the helmRelease, and an error, if there is any. -func (c *helmReleases) Update(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.UpdateOptions) (result *v1.HelmRelease, err error) { - result = &v1.HelmRelease{} - err = c.client.Put(). - Namespace(c.ns). - Resource("helmreleases"). - Name(helmRelease.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(helmRelease). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *helmReleases) UpdateStatus(ctx context.Context, helmRelease *v1.HelmRelease, opts metav1.UpdateOptions) (result *v1.HelmRelease, err error) { - result = &v1.HelmRelease{} - err = c.client.Put(). - Namespace(c.ns). - Resource("helmreleases"). - Name(helmRelease.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(helmRelease). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the helmRelease and deletes it. Returns an error if one occurs. -func (c *helmReleases) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("helmreleases"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *helmReleases) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("helmreleases"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched helmRelease. -func (c *helmReleases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HelmRelease, err error) { - result = &v1.HelmRelease{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("helmreleases"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/localclusteraccess.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/localclusteraccess.go deleted file mode 100644 index 482dd60d9..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/localclusteraccess.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1" - scheme "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// LocalClusterAccessesGetter has a method to return a LocalClusterAccessInterface. -// A group's client should implement this interface. -type LocalClusterAccessesGetter interface { - LocalClusterAccesses() LocalClusterAccessInterface -} - -// LocalClusterAccessInterface has methods to work with LocalClusterAccess resources. -type LocalClusterAccessInterface interface { - Create(ctx context.Context, localClusterAccess *v1.LocalClusterAccess, opts metav1.CreateOptions) (*v1.LocalClusterAccess, error) - Update(ctx context.Context, localClusterAccess *v1.LocalClusterAccess, opts metav1.UpdateOptions) (*v1.LocalClusterAccess, error) - UpdateStatus(ctx context.Context, localClusterAccess *v1.LocalClusterAccess, opts metav1.UpdateOptions) (*v1.LocalClusterAccess, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.LocalClusterAccess, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.LocalClusterAccessList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LocalClusterAccess, err error) - LocalClusterAccessExpansion -} - -// localClusterAccesses implements LocalClusterAccessInterface -type localClusterAccesses struct { - client rest.Interface -} - -// newLocalClusterAccesses returns a LocalClusterAccesses -func newLocalClusterAccesses(c *ClusterV1Client) *localClusterAccesses { - return &localClusterAccesses{ - client: c.RESTClient(), - } -} - -// Get takes name of the localClusterAccess, and returns the corresponding localClusterAccess object, and an error if there is any. -func (c *localClusterAccesses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LocalClusterAccess, err error) { - result = &v1.LocalClusterAccess{} - err = c.client.Get(). - Resource("localclusteraccesses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of LocalClusterAccesses that match those selectors. -func (c *localClusterAccesses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LocalClusterAccessList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.LocalClusterAccessList{} - err = c.client.Get(). - Resource("localclusteraccesses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested localClusterAccesses. -func (c *localClusterAccesses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("localclusteraccesses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a localClusterAccess and creates it. Returns the server's representation of the localClusterAccess, and an error, if there is any. -func (c *localClusterAccesses) Create(ctx context.Context, localClusterAccess *v1.LocalClusterAccess, opts metav1.CreateOptions) (result *v1.LocalClusterAccess, err error) { - result = &v1.LocalClusterAccess{} - err = c.client.Post(). - Resource("localclusteraccesses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(localClusterAccess). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a localClusterAccess and updates it. Returns the server's representation of the localClusterAccess, and an error, if there is any. -func (c *localClusterAccesses) Update(ctx context.Context, localClusterAccess *v1.LocalClusterAccess, opts metav1.UpdateOptions) (result *v1.LocalClusterAccess, err error) { - result = &v1.LocalClusterAccess{} - err = c.client.Put(). - Resource("localclusteraccesses"). - Name(localClusterAccess.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(localClusterAccess). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *localClusterAccesses) UpdateStatus(ctx context.Context, localClusterAccess *v1.LocalClusterAccess, opts metav1.UpdateOptions) (result *v1.LocalClusterAccess, err error) { - result = &v1.LocalClusterAccess{} - err = c.client.Put(). - Resource("localclusteraccesses"). - Name(localClusterAccess.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(localClusterAccess). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the localClusterAccess and deletes it. Returns an error if one occurs. -func (c *localClusterAccesses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("localclusteraccesses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *localClusterAccesses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("localclusteraccesses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched localClusterAccess. -func (c *localClusterAccesses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LocalClusterAccess, err error) { - result = &v1.LocalClusterAccess{} - err = c.client.Patch(pt). - Resource("localclusteraccesses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/sleepmodeconfig.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/sleepmodeconfig.go deleted file mode 100644 index 9f25b95c4..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/sleepmodeconfig.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1" - scheme "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// SleepModeConfigsGetter has a method to return a SleepModeConfigInterface. -// A group's client should implement this interface. -type SleepModeConfigsGetter interface { - SleepModeConfigs(namespace string) SleepModeConfigInterface -} - -// SleepModeConfigInterface has methods to work with SleepModeConfig resources. -type SleepModeConfigInterface interface { - Create(ctx context.Context, sleepModeConfig *v1.SleepModeConfig, opts metav1.CreateOptions) (*v1.SleepModeConfig, error) - Update(ctx context.Context, sleepModeConfig *v1.SleepModeConfig, opts metav1.UpdateOptions) (*v1.SleepModeConfig, error) - UpdateStatus(ctx context.Context, sleepModeConfig *v1.SleepModeConfig, opts metav1.UpdateOptions) (*v1.SleepModeConfig, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SleepModeConfig, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.SleepModeConfigList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SleepModeConfig, err error) - SleepModeConfigExpansion -} - -// sleepModeConfigs implements SleepModeConfigInterface -type sleepModeConfigs struct { - client rest.Interface - ns string -} - -// newSleepModeConfigs returns a SleepModeConfigs -func newSleepModeConfigs(c *ClusterV1Client, namespace string) *sleepModeConfigs { - return &sleepModeConfigs{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the sleepModeConfig, and returns the corresponding sleepModeConfig object, and an error if there is any. -func (c *sleepModeConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SleepModeConfig, err error) { - result = &v1.SleepModeConfig{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sleepmodeconfigs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of SleepModeConfigs that match those selectors. -func (c *sleepModeConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SleepModeConfigList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SleepModeConfigList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("sleepmodeconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested sleepModeConfigs. -func (c *sleepModeConfigs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("sleepmodeconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a sleepModeConfig and creates it. Returns the server's representation of the sleepModeConfig, and an error, if there is any. -func (c *sleepModeConfigs) Create(ctx context.Context, sleepModeConfig *v1.SleepModeConfig, opts metav1.CreateOptions) (result *v1.SleepModeConfig, err error) { - result = &v1.SleepModeConfig{} - err = c.client.Post(). - Namespace(c.ns). - Resource("sleepmodeconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(sleepModeConfig). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a sleepModeConfig and updates it. Returns the server's representation of the sleepModeConfig, and an error, if there is any. -func (c *sleepModeConfigs) Update(ctx context.Context, sleepModeConfig *v1.SleepModeConfig, opts metav1.UpdateOptions) (result *v1.SleepModeConfig, err error) { - result = &v1.SleepModeConfig{} - err = c.client.Put(). - Namespace(c.ns). - Resource("sleepmodeconfigs"). - Name(sleepModeConfig.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(sleepModeConfig). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *sleepModeConfigs) UpdateStatus(ctx context.Context, sleepModeConfig *v1.SleepModeConfig, opts metav1.UpdateOptions) (result *v1.SleepModeConfig, err error) { - result = &v1.SleepModeConfig{} - err = c.client.Put(). - Namespace(c.ns). - Resource("sleepmodeconfigs"). - Name(sleepModeConfig.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(sleepModeConfig). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the sleepModeConfig and deletes it. Returns an error if one occurs. -func (c *sleepModeConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("sleepmodeconfigs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *sleepModeConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("sleepmodeconfigs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched sleepModeConfig. -func (c *sleepModeConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SleepModeConfig, err error) { - result = &v1.SleepModeConfig{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("sleepmodeconfigs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/space.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/space.go deleted file mode 100644 index fc1821df2..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/space.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1" - scheme "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// SpacesGetter has a method to return a SpaceInterface. -// A group's client should implement this interface. -type SpacesGetter interface { - Spaces() SpaceInterface -} - -// SpaceInterface has methods to work with Space resources. -type SpaceInterface interface { - Create(ctx context.Context, space *v1.Space, opts metav1.CreateOptions) (*v1.Space, error) - Update(ctx context.Context, space *v1.Space, opts metav1.UpdateOptions) (*v1.Space, error) - UpdateStatus(ctx context.Context, space *v1.Space, opts metav1.UpdateOptions) (*v1.Space, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Space, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.SpaceList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Space, err error) - SpaceExpansion -} - -// spaces implements SpaceInterface -type spaces struct { - client rest.Interface -} - -// newSpaces returns a Spaces -func newSpaces(c *ClusterV1Client) *spaces { - return &spaces{ - client: c.RESTClient(), - } -} - -// Get takes name of the space, and returns the corresponding space object, and an error if there is any. -func (c *spaces) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Space, err error) { - result = &v1.Space{} - err = c.client.Get(). - Resource("spaces"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Spaces that match those selectors. -func (c *spaces) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SpaceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SpaceList{} - err = c.client.Get(). - Resource("spaces"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested spaces. -func (c *spaces) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("spaces"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a space and creates it. Returns the server's representation of the space, and an error, if there is any. -func (c *spaces) Create(ctx context.Context, space *v1.Space, opts metav1.CreateOptions) (result *v1.Space, err error) { - result = &v1.Space{} - err = c.client.Post(). - Resource("spaces"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(space). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a space and updates it. Returns the server's representation of the space, and an error, if there is any. -func (c *spaces) Update(ctx context.Context, space *v1.Space, opts metav1.UpdateOptions) (result *v1.Space, err error) { - result = &v1.Space{} - err = c.client.Put(). - Resource("spaces"). - Name(space.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(space). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *spaces) UpdateStatus(ctx context.Context, space *v1.Space, opts metav1.UpdateOptions) (result *v1.Space, err error) { - result = &v1.Space{} - err = c.client.Put(). - Resource("spaces"). - Name(space.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(space). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the space and deletes it. Returns an error if one occurs. -func (c *spaces) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("spaces"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *spaces) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("spaces"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched space. -func (c *spaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Space, err error) { - result = &v1.Space{} - err = c.client.Patch(pt). - Resource("spaces"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/virtualcluster.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/virtualcluster.go deleted file mode 100644 index d3c00bf2c..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1/virtualcluster.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1" - scheme "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// VirtualClustersGetter has a method to return a VirtualClusterInterface. -// A group's client should implement this interface. -type VirtualClustersGetter interface { - VirtualClusters(namespace string) VirtualClusterInterface -} - -// VirtualClusterInterface has methods to work with VirtualCluster resources. -type VirtualClusterInterface interface { - Create(ctx context.Context, virtualCluster *v1.VirtualCluster, opts metav1.CreateOptions) (*v1.VirtualCluster, error) - Update(ctx context.Context, virtualCluster *v1.VirtualCluster, opts metav1.UpdateOptions) (*v1.VirtualCluster, error) - UpdateStatus(ctx context.Context, virtualCluster *v1.VirtualCluster, opts metav1.UpdateOptions) (*v1.VirtualCluster, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.VirtualCluster, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.VirtualClusterList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualCluster, err error) - VirtualClusterExpansion -} - -// virtualClusters implements VirtualClusterInterface -type virtualClusters struct { - client rest.Interface - ns string -} - -// newVirtualClusters returns a VirtualClusters -func newVirtualClusters(c *ClusterV1Client, namespace string) *virtualClusters { - return &virtualClusters{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the virtualCluster, and returns the corresponding virtualCluster object, and an error if there is any. -func (c *virtualClusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualCluster, err error) { - result = &v1.VirtualCluster{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualclusters"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VirtualClusters that match those selectors. -func (c *virtualClusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualClusterList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.VirtualClusterList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested virtualClusters. -func (c *virtualClusters) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("virtualclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a virtualCluster and creates it. Returns the server's representation of the virtualCluster, and an error, if there is any. -func (c *virtualClusters) Create(ctx context.Context, virtualCluster *v1.VirtualCluster, opts metav1.CreateOptions) (result *v1.VirtualCluster, err error) { - result = &v1.VirtualCluster{} - err = c.client.Post(). - Namespace(c.ns). - Resource("virtualclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualCluster). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a virtualCluster and updates it. Returns the server's representation of the virtualCluster, and an error, if there is any. -func (c *virtualClusters) Update(ctx context.Context, virtualCluster *v1.VirtualCluster, opts metav1.UpdateOptions) (result *v1.VirtualCluster, err error) { - result = &v1.VirtualCluster{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualclusters"). - Name(virtualCluster.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualCluster). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *virtualClusters) UpdateStatus(ctx context.Context, virtualCluster *v1.VirtualCluster, opts metav1.UpdateOptions) (result *v1.VirtualCluster, err error) { - result = &v1.VirtualCluster{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualclusters"). - Name(virtualCluster.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualCluster). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the virtualCluster and deletes it. Returns an error if one occurs. -func (c *virtualClusters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualclusters"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *virtualClusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualclusters"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched virtualCluster. -func (c *virtualClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualCluster, err error) { - result = &v1.VirtualCluster{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("virtualclusters"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/clusterquota.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/clusterquota.go deleted file mode 100644 index 648dc26e2..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/clusterquota.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1" - scheme "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// ClusterQuotasGetter has a method to return a ClusterQuotaInterface. -// A group's client should implement this interface. -type ClusterQuotasGetter interface { - ClusterQuotas() ClusterQuotaInterface -} - -// ClusterQuotaInterface has methods to work with ClusterQuota resources. -type ClusterQuotaInterface interface { - Create(ctx context.Context, clusterQuota *v1.ClusterQuota, opts metav1.CreateOptions) (*v1.ClusterQuota, error) - Update(ctx context.Context, clusterQuota *v1.ClusterQuota, opts metav1.UpdateOptions) (*v1.ClusterQuota, error) - UpdateStatus(ctx context.Context, clusterQuota *v1.ClusterQuota, opts metav1.UpdateOptions) (*v1.ClusterQuota, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterQuota, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterQuotaList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterQuota, err error) - ClusterQuotaExpansion -} - -// clusterQuotas implements ClusterQuotaInterface -type clusterQuotas struct { - client rest.Interface -} - -// newClusterQuotas returns a ClusterQuotas -func newClusterQuotas(c *StorageV1Client) *clusterQuotas { - return &clusterQuotas{ - client: c.RESTClient(), - } -} - -// Get takes name of the clusterQuota, and returns the corresponding clusterQuota object, and an error if there is any. -func (c *clusterQuotas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterQuota, err error) { - result = &v1.ClusterQuota{} - err = c.client.Get(). - Resource("clusterquotas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterQuotas that match those selectors. -func (c *clusterQuotas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterQuotaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ClusterQuotaList{} - err = c.client.Get(). - Resource("clusterquotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterQuotas. -func (c *clusterQuotas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("clusterquotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterQuota and creates it. Returns the server's representation of the clusterQuota, and an error, if there is any. -func (c *clusterQuotas) Create(ctx context.Context, clusterQuota *v1.ClusterQuota, opts metav1.CreateOptions) (result *v1.ClusterQuota, err error) { - result = &v1.ClusterQuota{} - err = c.client.Post(). - Resource("clusterquotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterQuota). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterQuota and updates it. Returns the server's representation of the clusterQuota, and an error, if there is any. -func (c *clusterQuotas) Update(ctx context.Context, clusterQuota *v1.ClusterQuota, opts metav1.UpdateOptions) (result *v1.ClusterQuota, err error) { - result = &v1.ClusterQuota{} - err = c.client.Put(). - Resource("clusterquotas"). - Name(clusterQuota.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterQuota). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *clusterQuotas) UpdateStatus(ctx context.Context, clusterQuota *v1.ClusterQuota, opts metav1.UpdateOptions) (result *v1.ClusterQuota, err error) { - result = &v1.ClusterQuota{} - err = c.client.Put(). - Resource("clusterquotas"). - Name(clusterQuota.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterQuota). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterQuota and deletes it. Returns an error if one occurs. -func (c *clusterQuotas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusterquotas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterQuotas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("clusterquotas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterQuota. -func (c *clusterQuotas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterQuota, err error) { - result = &v1.ClusterQuota{} - err = c.client.Patch(pt). - Resource("clusterquotas"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/doc.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/doc.go deleted file mode 100644 index 225e6b2be..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1 diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/generated_expansion.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/generated_expansion.go deleted file mode 100644 index 87f72b708..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/generated_expansion.go +++ /dev/null @@ -1,13 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -type ClusterQuotaExpansion interface{} - -type LocalClusterAccessExpansion interface{} - -type LocalTeamExpansion interface{} - -type LocalUserExpansion interface{} - -type VirtualClusterExpansion interface{} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/localclusteraccess.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/localclusteraccess.go deleted file mode 100644 index f8a2caf3f..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/localclusteraccess.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1" - scheme "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// LocalClusterAccessesGetter has a method to return a LocalClusterAccessInterface. -// A group's client should implement this interface. -type LocalClusterAccessesGetter interface { - LocalClusterAccesses() LocalClusterAccessInterface -} - -// LocalClusterAccessInterface has methods to work with LocalClusterAccess resources. -type LocalClusterAccessInterface interface { - Create(ctx context.Context, localClusterAccess *v1.LocalClusterAccess, opts metav1.CreateOptions) (*v1.LocalClusterAccess, error) - Update(ctx context.Context, localClusterAccess *v1.LocalClusterAccess, opts metav1.UpdateOptions) (*v1.LocalClusterAccess, error) - UpdateStatus(ctx context.Context, localClusterAccess *v1.LocalClusterAccess, opts metav1.UpdateOptions) (*v1.LocalClusterAccess, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.LocalClusterAccess, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.LocalClusterAccessList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LocalClusterAccess, err error) - LocalClusterAccessExpansion -} - -// localClusterAccesses implements LocalClusterAccessInterface -type localClusterAccesses struct { - client rest.Interface -} - -// newLocalClusterAccesses returns a LocalClusterAccesses -func newLocalClusterAccesses(c *StorageV1Client) *localClusterAccesses { - return &localClusterAccesses{ - client: c.RESTClient(), - } -} - -// Get takes name of the localClusterAccess, and returns the corresponding localClusterAccess object, and an error if there is any. -func (c *localClusterAccesses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LocalClusterAccess, err error) { - result = &v1.LocalClusterAccess{} - err = c.client.Get(). - Resource("localclusteraccesses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of LocalClusterAccesses that match those selectors. -func (c *localClusterAccesses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LocalClusterAccessList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.LocalClusterAccessList{} - err = c.client.Get(). - Resource("localclusteraccesses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested localClusterAccesses. -func (c *localClusterAccesses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("localclusteraccesses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a localClusterAccess and creates it. Returns the server's representation of the localClusterAccess, and an error, if there is any. -func (c *localClusterAccesses) Create(ctx context.Context, localClusterAccess *v1.LocalClusterAccess, opts metav1.CreateOptions) (result *v1.LocalClusterAccess, err error) { - result = &v1.LocalClusterAccess{} - err = c.client.Post(). - Resource("localclusteraccesses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(localClusterAccess). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a localClusterAccess and updates it. Returns the server's representation of the localClusterAccess, and an error, if there is any. -func (c *localClusterAccesses) Update(ctx context.Context, localClusterAccess *v1.LocalClusterAccess, opts metav1.UpdateOptions) (result *v1.LocalClusterAccess, err error) { - result = &v1.LocalClusterAccess{} - err = c.client.Put(). - Resource("localclusteraccesses"). - Name(localClusterAccess.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(localClusterAccess). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *localClusterAccesses) UpdateStatus(ctx context.Context, localClusterAccess *v1.LocalClusterAccess, opts metav1.UpdateOptions) (result *v1.LocalClusterAccess, err error) { - result = &v1.LocalClusterAccess{} - err = c.client.Put(). - Resource("localclusteraccesses"). - Name(localClusterAccess.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(localClusterAccess). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the localClusterAccess and deletes it. Returns an error if one occurs. -func (c *localClusterAccesses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("localclusteraccesses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *localClusterAccesses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("localclusteraccesses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched localClusterAccess. -func (c *localClusterAccesses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LocalClusterAccess, err error) { - result = &v1.LocalClusterAccess{} - err = c.client.Patch(pt). - Resource("localclusteraccesses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/localteam.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/localteam.go deleted file mode 100644 index ffec050d6..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/localteam.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1" - scheme "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// LocalTeamsGetter has a method to return a LocalTeamInterface. -// A group's client should implement this interface. -type LocalTeamsGetter interface { - LocalTeams() LocalTeamInterface -} - -// LocalTeamInterface has methods to work with LocalTeam resources. -type LocalTeamInterface interface { - Create(ctx context.Context, localTeam *v1.LocalTeam, opts metav1.CreateOptions) (*v1.LocalTeam, error) - Update(ctx context.Context, localTeam *v1.LocalTeam, opts metav1.UpdateOptions) (*v1.LocalTeam, error) - UpdateStatus(ctx context.Context, localTeam *v1.LocalTeam, opts metav1.UpdateOptions) (*v1.LocalTeam, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.LocalTeam, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.LocalTeamList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LocalTeam, err error) - LocalTeamExpansion -} - -// localTeams implements LocalTeamInterface -type localTeams struct { - client rest.Interface -} - -// newLocalTeams returns a LocalTeams -func newLocalTeams(c *StorageV1Client) *localTeams { - return &localTeams{ - client: c.RESTClient(), - } -} - -// Get takes name of the localTeam, and returns the corresponding localTeam object, and an error if there is any. -func (c *localTeams) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LocalTeam, err error) { - result = &v1.LocalTeam{} - err = c.client.Get(). - Resource("localteams"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of LocalTeams that match those selectors. -func (c *localTeams) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LocalTeamList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.LocalTeamList{} - err = c.client.Get(). - Resource("localteams"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested localTeams. -func (c *localTeams) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("localteams"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a localTeam and creates it. Returns the server's representation of the localTeam, and an error, if there is any. -func (c *localTeams) Create(ctx context.Context, localTeam *v1.LocalTeam, opts metav1.CreateOptions) (result *v1.LocalTeam, err error) { - result = &v1.LocalTeam{} - err = c.client.Post(). - Resource("localteams"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(localTeam). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a localTeam and updates it. Returns the server's representation of the localTeam, and an error, if there is any. -func (c *localTeams) Update(ctx context.Context, localTeam *v1.LocalTeam, opts metav1.UpdateOptions) (result *v1.LocalTeam, err error) { - result = &v1.LocalTeam{} - err = c.client.Put(). - Resource("localteams"). - Name(localTeam.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(localTeam). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *localTeams) UpdateStatus(ctx context.Context, localTeam *v1.LocalTeam, opts metav1.UpdateOptions) (result *v1.LocalTeam, err error) { - result = &v1.LocalTeam{} - err = c.client.Put(). - Resource("localteams"). - Name(localTeam.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(localTeam). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the localTeam and deletes it. Returns an error if one occurs. -func (c *localTeams) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("localteams"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *localTeams) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("localteams"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched localTeam. -func (c *localTeams) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LocalTeam, err error) { - result = &v1.LocalTeam{} - err = c.client.Patch(pt). - Resource("localteams"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/localuser.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/localuser.go deleted file mode 100644 index a73fc4b26..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/localuser.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1" - scheme "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// LocalUsersGetter has a method to return a LocalUserInterface. -// A group's client should implement this interface. -type LocalUsersGetter interface { - LocalUsers() LocalUserInterface -} - -// LocalUserInterface has methods to work with LocalUser resources. -type LocalUserInterface interface { - Create(ctx context.Context, localUser *v1.LocalUser, opts metav1.CreateOptions) (*v1.LocalUser, error) - Update(ctx context.Context, localUser *v1.LocalUser, opts metav1.UpdateOptions) (*v1.LocalUser, error) - UpdateStatus(ctx context.Context, localUser *v1.LocalUser, opts metav1.UpdateOptions) (*v1.LocalUser, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.LocalUser, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.LocalUserList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LocalUser, err error) - LocalUserExpansion -} - -// localUsers implements LocalUserInterface -type localUsers struct { - client rest.Interface -} - -// newLocalUsers returns a LocalUsers -func newLocalUsers(c *StorageV1Client) *localUsers { - return &localUsers{ - client: c.RESTClient(), - } -} - -// Get takes name of the localUser, and returns the corresponding localUser object, and an error if there is any. -func (c *localUsers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LocalUser, err error) { - result = &v1.LocalUser{} - err = c.client.Get(). - Resource("localusers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of LocalUsers that match those selectors. -func (c *localUsers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LocalUserList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.LocalUserList{} - err = c.client.Get(). - Resource("localusers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested localUsers. -func (c *localUsers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("localusers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a localUser and creates it. Returns the server's representation of the localUser, and an error, if there is any. -func (c *localUsers) Create(ctx context.Context, localUser *v1.LocalUser, opts metav1.CreateOptions) (result *v1.LocalUser, err error) { - result = &v1.LocalUser{} - err = c.client.Post(). - Resource("localusers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(localUser). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a localUser and updates it. Returns the server's representation of the localUser, and an error, if there is any. -func (c *localUsers) Update(ctx context.Context, localUser *v1.LocalUser, opts metav1.UpdateOptions) (result *v1.LocalUser, err error) { - result = &v1.LocalUser{} - err = c.client.Put(). - Resource("localusers"). - Name(localUser.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(localUser). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *localUsers) UpdateStatus(ctx context.Context, localUser *v1.LocalUser, opts metav1.UpdateOptions) (result *v1.LocalUser, err error) { - result = &v1.LocalUser{} - err = c.client.Put(). - Resource("localusers"). - Name(localUser.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(localUser). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the localUser and deletes it. Returns an error if one occurs. -func (c *localUsers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("localusers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *localUsers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("localusers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched localUser. -func (c *localUsers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LocalUser, err error) { - result = &v1.LocalUser{} - err = c.client.Patch(pt). - Resource("localusers"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/storage_client.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/storage_client.go deleted file mode 100644 index d1774b00b..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/storage_client.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "net/http" - - v1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1" - "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme" - rest "k8s.io/client-go/rest" -) - -type StorageV1Interface interface { - RESTClient() rest.Interface - ClusterQuotasGetter - LocalClusterAccessesGetter - LocalTeamsGetter - LocalUsersGetter - VirtualClustersGetter -} - -// StorageV1Client is used to interact with features provided by the storage.loft.sh group. -type StorageV1Client struct { - restClient rest.Interface -} - -func (c *StorageV1Client) ClusterQuotas() ClusterQuotaInterface { - return newClusterQuotas(c) -} - -func (c *StorageV1Client) LocalClusterAccesses() LocalClusterAccessInterface { - return newLocalClusterAccesses(c) -} - -func (c *StorageV1Client) LocalTeams() LocalTeamInterface { - return newLocalTeams(c) -} - -func (c *StorageV1Client) LocalUsers() LocalUserInterface { - return newLocalUsers(c) -} - -func (c *StorageV1Client) VirtualClusters(namespace string) VirtualClusterInterface { - return newVirtualClusters(c, namespace) -} - -// NewForConfig creates a new StorageV1Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*StorageV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - httpClient, err := rest.HTTPClientFor(&config) - if err != nil { - return nil, err - } - return NewForConfigAndClient(&config, httpClient) -} - -// NewForConfigAndClient creates a new StorageV1Client for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*StorageV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientForConfigAndClient(&config, h) - if err != nil { - return nil, err - } - return &StorageV1Client{client}, nil -} - -// NewForConfigOrDie creates a new StorageV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *StorageV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new StorageV1Client for the given RESTClient. -func New(c rest.Interface) *StorageV1Client { - return &StorageV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *StorageV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/virtualcluster.go b/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/virtualcluster.go deleted file mode 100644 index 27a4b1f85..000000000 --- a/vendor/github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1/virtualcluster.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1" - scheme "github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// VirtualClustersGetter has a method to return a VirtualClusterInterface. -// A group's client should implement this interface. -type VirtualClustersGetter interface { - VirtualClusters(namespace string) VirtualClusterInterface -} - -// VirtualClusterInterface has methods to work with VirtualCluster resources. -type VirtualClusterInterface interface { - Create(ctx context.Context, virtualCluster *v1.VirtualCluster, opts metav1.CreateOptions) (*v1.VirtualCluster, error) - Update(ctx context.Context, virtualCluster *v1.VirtualCluster, opts metav1.UpdateOptions) (*v1.VirtualCluster, error) - UpdateStatus(ctx context.Context, virtualCluster *v1.VirtualCluster, opts metav1.UpdateOptions) (*v1.VirtualCluster, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.VirtualCluster, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.VirtualClusterList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualCluster, err error) - VirtualClusterExpansion -} - -// virtualClusters implements VirtualClusterInterface -type virtualClusters struct { - client rest.Interface - ns string -} - -// newVirtualClusters returns a VirtualClusters -func newVirtualClusters(c *StorageV1Client, namespace string) *virtualClusters { - return &virtualClusters{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the virtualCluster, and returns the corresponding virtualCluster object, and an error if there is any. -func (c *virtualClusters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualCluster, err error) { - result = &v1.VirtualCluster{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualclusters"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VirtualClusters that match those selectors. -func (c *virtualClusters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualClusterList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.VirtualClusterList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested virtualClusters. -func (c *virtualClusters) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("virtualclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a virtualCluster and creates it. Returns the server's representation of the virtualCluster, and an error, if there is any. -func (c *virtualClusters) Create(ctx context.Context, virtualCluster *v1.VirtualCluster, opts metav1.CreateOptions) (result *v1.VirtualCluster, err error) { - result = &v1.VirtualCluster{} - err = c.client.Post(). - Namespace(c.ns). - Resource("virtualclusters"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualCluster). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a virtualCluster and updates it. Returns the server's representation of the virtualCluster, and an error, if there is any. -func (c *virtualClusters) Update(ctx context.Context, virtualCluster *v1.VirtualCluster, opts metav1.UpdateOptions) (result *v1.VirtualCluster, err error) { - result = &v1.VirtualCluster{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualclusters"). - Name(virtualCluster.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualCluster). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *virtualClusters) UpdateStatus(ctx context.Context, virtualCluster *v1.VirtualCluster, opts metav1.UpdateOptions) (result *v1.VirtualCluster, err error) { - result = &v1.VirtualCluster{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualclusters"). - Name(virtualCluster.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualCluster). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the virtualCluster and deletes it. Returns an error if one occurs. -func (c *virtualClusters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualclusters"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *virtualClusters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualclusters"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched virtualCluster. -func (c *virtualClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualCluster, err error) { - result = &v1.VirtualCluster{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("virtualclusters"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/cluster_agentconfig_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/cluster_agentconfig_types.go index efd3b733f..05ad1f118 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/cluster_agentconfig_types.go +++ b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/cluster_agentconfig_types.go @@ -37,6 +37,10 @@ type ClusterAgentConfigCommon struct { // +optional LoftHost string `json:"loftHost,omitempty"` + // ProjectNamespacePrefix holds the prefix for loft project namespaces + // +optional + ProjectNamespacePrefix string `json:"projectNamespacePrefix,omitempty"` + // LoftInstanceID defines the instance id from the loft instance // +optional LoftInstanceID string `json:"loftInstanceID,omitempty"` @@ -45,23 +49,6 @@ type ClusterAgentConfigCommon struct { AnalyticsSpec AgentAnalyticsSpec `json:"analyticsSpec"` } -// AgentLoftAccess holds the config how the agent can reach loft -type AgentLoftAccess struct { - // Cluster is the name of the cluster the agent is running in - // +optional - Cluster string `json:"cluster,omitempty"` - - // LoftAPIHost defines the host for the loft api. If empty, Loft will - // create an ssh tunnel to the agent pod. - // +optional - LoftAPIHost string `json:"loftAPIHost,omitempty"` - - // LoftAPIKey defines the api key the agent should use to connect to the - // loft api server. - // +optional - LoftAPIKey string `json:"loftAPIKey,omitempty"` -} - type AgentAuditConfig struct { // If audit is enabled and incoming api requests will be logged based on the supplied policy. // +optional diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/config_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/config_types.go index 6ec920a6d..06c140c3b 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/config_types.go +++ b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/config_types.go @@ -51,6 +51,10 @@ type ConfigStatus struct { // +optional LoftHost string `json:"loftHost,omitempty"` + // ProjectNamespacePrefix holds the prefix for loft project namespaces. Omitted defaults to "p-" + // +optional + ProjectNamespacePrefix *string `json:"projectNamespacePrefix,omitempty"` + // DevPodSubDomain holds a subdomain in the following form *.workspace.my-domain.com // +optional DevPodSubDomain string `json:"devPodSubDomain,omitempty"` diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/self_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/self_types.go index b31d684b8..352d48212 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/self_types.go +++ b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/self_types.go @@ -62,11 +62,15 @@ type SelfStatus struct { // ChatAuthToken is the token used to authenticate with the in-product chat widget in the UI // +optional - ChatAuthToken string `json:"chatAuthToken"` + ChatAuthToken string `json:"chatAuthToken,omitempty"` // InstanceID is the loft instance id // +optional - InstanceID string `json:"instanceID"` + InstanceID string `json:"instanceID,omitempty"` + + // ProjectNamespacePrefix is the prefix used to name project namespaces after defaulting has been applied + // +optional + ProjectNamespacePrefix *string `json:"projectNamespacePrefix,omitempty"` } type UserInfo struct { diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.conversion.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.conversion.go index 2f526d1e9..afd090d9b 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.conversion.go +++ b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.conversion.go @@ -4148,6 +4148,7 @@ func autoConvert_v1_ClusterAgentConfigCommon_To_management_ClusterAgentConfigCom out.DefaultImageRegistry = in.DefaultImageRegistry out.TokenCaCert = *(*[]byte)(unsafe.Pointer(&in.TokenCaCert)) out.LoftHost = in.LoftHost + out.ProjectNamespacePrefix = in.ProjectNamespacePrefix out.LoftInstanceID = in.LoftInstanceID if err := Convert_v1_AgentAnalyticsSpec_To_management_AgentAnalyticsSpec(&in.AnalyticsSpec, &out.AnalyticsSpec, s); err != nil { return err @@ -4166,6 +4167,7 @@ func autoConvert_management_ClusterAgentConfigCommon_To_v1_ClusterAgentConfigCom out.DefaultImageRegistry = in.DefaultImageRegistry out.TokenCaCert = *(*[]byte)(unsafe.Pointer(&in.TokenCaCert)) out.LoftHost = in.LoftHost + out.ProjectNamespacePrefix = in.ProjectNamespacePrefix out.LoftInstanceID = in.LoftInstanceID if err := Convert_management_AgentAnalyticsSpec_To_v1_AgentAnalyticsSpec(&in.AnalyticsSpec, &out.AnalyticsSpec, s); err != nil { return err @@ -4848,6 +4850,7 @@ func autoConvert_v1_ConfigStatus_To_management_ConfigStatus(in *ConfigStatus, ou out.Apps = (*management.Apps)(unsafe.Pointer(in.Apps)) out.Audit = (*management.Audit)(unsafe.Pointer(in.Audit)) out.LoftHost = in.LoftHost + out.ProjectNamespacePrefix = (*string)(unsafe.Pointer(in.ProjectNamespacePrefix)) out.DevPodSubDomain = in.DevPodSubDomain out.UISettings = (*uiv1.UISettingsConfig)(unsafe.Pointer(in.UISettings)) out.VaultIntegration = (*storagev1.VaultIntegrationSpec)(unsafe.Pointer(in.VaultIntegration)) @@ -4867,6 +4870,7 @@ func autoConvert_management_ConfigStatus_To_v1_ConfigStatus(in *management.Confi out.Apps = (*Apps)(unsafe.Pointer(in.Apps)) out.Audit = (*Audit)(unsafe.Pointer(in.Audit)) out.LoftHost = in.LoftHost + out.ProjectNamespacePrefix = (*string)(unsafe.Pointer(in.ProjectNamespacePrefix)) out.DevPodSubDomain = in.DevPodSubDomain out.UISettings = (*uiv1.UISettingsConfig)(unsafe.Pointer(in.UISettings)) out.VaultIntegration = (*storagev1.VaultIntegrationSpec)(unsafe.Pointer(in.VaultIntegration)) @@ -7934,6 +7938,7 @@ func autoConvert_v1_SelfStatus_To_management_SelfStatus(in *SelfStatus, out *man out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) out.ChatAuthToken = in.ChatAuthToken out.InstanceID = in.InstanceID + out.ProjectNamespacePrefix = (*string)(unsafe.Pointer(in.ProjectNamespacePrefix)) return nil } @@ -7953,6 +7958,7 @@ func autoConvert_management_SelfStatus_To_v1_SelfStatus(in *management.SelfStatu out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) out.ChatAuthToken = in.ChatAuthToken out.InstanceID = in.InstanceID + out.ProjectNamespacePrefix = (*string)(unsafe.Pointer(in.ProjectNamespacePrefix)) return nil } diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.deepcopy.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.deepcopy.go index 95cfdf4f4..b8b0c55b7 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.deepcopy.go @@ -153,22 +153,6 @@ func (in *AgentAuditEventStatus) DeepCopy() *AgentAuditEventStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AgentLoftAccess) DeepCopyInto(out *AgentLoftAccess) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentLoftAccess. -func (in *AgentLoftAccess) DeepCopy() *AgentLoftAccess { - if in == nil { - return nil - } - out := new(AgentLoftAccess) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Announcement) DeepCopyInto(out *Announcement) { *out = *in @@ -2160,6 +2144,11 @@ func (in *ConfigStatus) DeepCopyInto(out *ConfigStatus) { *out = new(Audit) (*in).DeepCopyInto(*out) } + if in.ProjectNamespacePrefix != nil { + in, out := &in.ProjectNamespacePrefix, &out.ProjectNamespacePrefix + *out = new(string) + **out = **in + } if in.UISettings != nil { in, out := &in.UISettings, &out.UISettings *out = new(uiv1.UISettingsConfig) @@ -5396,6 +5385,11 @@ func (in *SelfStatus) DeepCopyInto(out *SelfStatus) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.ProjectNamespacePrefix != nil { + in, out := &in.ProjectNamespacePrefix, &out.ProjectNamespacePrefix + *out = new(string) + **out = **in + } return } diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.api.register.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.api.register.go index 0be6ed2fd..7ebbc29db 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.api.register.go +++ b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.api.register.go @@ -1648,13 +1648,14 @@ type ClusterAgentConfig struct { } type ClusterAgentConfigCommon struct { - Cluster string `json:"cluster,omitempty"` - Audit *AgentAuditConfig `json:"audit,omitempty"` - DefaultImageRegistry string `json:"defaultImageRegistry,omitempty"` - TokenCaCert []byte `json:"tokenCaCert,omitempty"` - LoftHost string `json:"loftHost,omitempty"` - LoftInstanceID string `json:"loftInstanceID,omitempty"` - AnalyticsSpec AgentAnalyticsSpec `json:"analyticsSpec"` + Cluster string `json:"cluster,omitempty"` + Audit *AgentAuditConfig `json:"audit,omitempty"` + DefaultImageRegistry string `json:"defaultImageRegistry,omitempty"` + TokenCaCert []byte `json:"tokenCaCert,omitempty"` + LoftHost string `json:"loftHost,omitempty"` + ProjectNamespacePrefix string `json:"projectNamespacePrefix,omitempty"` + LoftInstanceID string `json:"loftInstanceID,omitempty"` + AnalyticsSpec AgentAnalyticsSpec `json:"analyticsSpec"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -1785,14 +1786,15 @@ type ConfigSpec struct { } type ConfigStatus struct { - Authentication Authentication `json:"auth,omitempty"` - OIDC *OIDC `json:"oidc,omitempty"` - Apps *Apps `json:"apps,omitempty"` - Audit *Audit `json:"audit,omitempty"` - LoftHost string `json:"loftHost,omitempty"` - DevPodSubDomain string `json:"devPodSubDomain,omitempty"` - UISettings *uiv1.UISettingsConfig `json:"uiSettings,omitempty"` - VaultIntegration *storagev1.VaultIntegrationSpec `json:"vault,omitempty"` + Authentication Authentication `json:"auth,omitempty"` + OIDC *OIDC `json:"oidc,omitempty"` + Apps *Apps `json:"apps,omitempty"` + Audit *Audit `json:"audit,omitempty"` + LoftHost string `json:"loftHost,omitempty"` + ProjectNamespacePrefix *string `json:"projectNamespacePrefix,omitempty"` + DevPodSubDomain string `json:"devPodSubDomain,omitempty"` + UISettings *uiv1.UISettingsConfig `json:"uiSettings,omitempty"` + VaultIntegration *storagev1.VaultIntegrationSpec `json:"vault,omitempty"` } type Connector struct { @@ -2035,7 +2037,7 @@ type KioskStatus struct { } // +genclient -// +genclient:nonNamespaced +// +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type License struct { @@ -2403,16 +2405,17 @@ type SelfSpec struct { } type SelfStatus struct { - User *UserInfo `json:"user,omitempty"` - Team *clusterv1.EntityInfo `json:"team,omitempty"` - AccessKey string `json:"accessKey,omitempty"` - AccessKeyScope *storagev1.AccessKeyScope `json:"accessKeyScope,omitempty"` - AccessKeyType storagev1.AccessKeyType `json:"accessKeyType,omitempty"` - Subject string `json:"subject,omitempty"` - UID string `json:"uid,omitempty"` - Groups []string `json:"groups,omitempty"` - ChatAuthToken string `json:"chatAuthToken"` - InstanceID string `json:"instanceID"` + User *UserInfo `json:"user,omitempty"` + Team *clusterv1.EntityInfo `json:"team,omitempty"` + AccessKey string `json:"accessKey,omitempty"` + AccessKeyScope *storagev1.AccessKeyScope `json:"accessKeyScope,omitempty"` + AccessKeyType storagev1.AccessKeyType `json:"accessKeyType,omitempty"` + Subject string `json:"subject,omitempty"` + UID string `json:"uid,omitempty"` + Groups []string `json:"groups,omitempty"` + ChatAuthToken string `json:"chatAuthToken,omitempty"` + InstanceID string `json:"instanceID,omitempty"` + ProjectNamespacePrefix *string `json:"projectNamespacePrefix,omitempty"` } // +genclient diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.deepcopy.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.deepcopy.go index 0a49767c0..8952e072a 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.deepcopy.go +++ b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.deepcopy.go @@ -2119,6 +2119,11 @@ func (in *ConfigStatus) DeepCopyInto(out *ConfigStatus) { *out = new(Audit) (*in).DeepCopyInto(*out) } + if in.ProjectNamespacePrefix != nil { + in, out := &in.ProjectNamespacePrefix, &out.ProjectNamespacePrefix + *out = new(string) + **out = **in + } if in.UISettings != nil { in, out := &in.UISettings, &out.UISettings *out = new(uiv1.UISettingsConfig) @@ -5339,6 +5344,11 @@ func (in *SelfStatus) DeepCopyInto(out *SelfStatus) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.ProjectNamespacePrefix != nil { + in, out := &in.ProjectNamespacePrefix, &out.ProjectNamespacePrefix + *out = new(string) + **out = **in + } return } diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/accesskey_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/accesskey_types.go index 19da8fd98..0d029e67d 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/accesskey_types.go +++ b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/accesskey_types.go @@ -153,10 +153,17 @@ func (a AccessKeyScope) ContainsRole(val AccessKeyScopeRoleName) bool { return true } - // (ThomasK33): As the vcluster role implicitly allows network peering - // add a dedicated role check here - if entry.Role == AccessKeyScopeRoleVCluster && val == AccessKeyScopeRoleNetworkPeer { - return true + // (ThomasK33): Add implicit network peer permissions + if val == AccessKeyScopeRoleNetworkPeer { + switch entry.Role { + case AccessKeyScopeRoleVCluster, AccessKeyScopeRoleAgent, AccessKeyScopeRoleRunner: + return true + // (ThomasK33): Adding this so that the exhaustive linter is happy + case AccessKeyScopeRoleNetworkPeer: + return true + case AccessKeyScopeRoleLoftCLI: + return false + } } } @@ -174,9 +181,11 @@ type AccessKeyScopeRole struct { type AccessKeyScopeRoleName string const ( + AccessKeyScopeRoleAgent AccessKeyScopeRoleName = "agent" AccessKeyScopeRoleVCluster AccessKeyScopeRoleName = "vcluster" AccessKeyScopeRoleNetworkPeer AccessKeyScopeRoleName = "network-peer" AccessKeyScopeRoleLoftCLI AccessKeyScopeRoleName = "loft-cli" + AccessKeyScopeRoleRunner AccessKeyScopeRoleName = "runner" ) type AccessKeyScopeCluster struct { diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspaceinstance_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspaceinstance_types.go index e1744a884..b7b19e4b4 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspaceinstance_types.go +++ b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspaceinstance_types.go @@ -23,8 +23,8 @@ var ( // DevPodWorkspaceSourceAnnotation holds the workspace source of the devpod workspace DevPodWorkspaceSourceAnnotation = "loft.sh/workspace-source" - // DevPodWorkspaceRunnerEndpointAnnotation holds the workspace runner endpoint of the devpod workspace - DevPodWorkspaceRunnerEndpointAnnotation = "loft.sh/runner-endpoint" + // DevPodWorkspaceRunnerNetworkPeerAnnotation holds the workspace runner network peer name of the devpod workspace + DevPodWorkspaceRunnerNetworkPeerAnnotation = "loft.sh/runner-network-peer-name" ) var ( diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspacetemplate_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspacetemplate_types.go index b983160c1..32247c719 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspacetemplate_types.go +++ b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspacetemplate_types.go @@ -100,8 +100,23 @@ type DevPodWorkspaceTemplateDefinition struct { // UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this workspace // +optional UseProjectGitCredentials bool `json:"useProjectGitCredentials,omitempty"` + + // GitCloneStrategy specifies how git based workspace are being cloned. Can be "" (full, default), treeless, blobless or shallow + // +optional + GitCloneStrategy GitCloneStrategy `json:"gitCloneStrategy,omitempty"` } +// +enum +type GitCloneStrategy string + +// WARN: Need to match https://github.com/loft-sh/devpod/pkg/git/clone.go +const ( + FullCloneStrategy GitCloneStrategy = "" + BloblessCloneStrategy GitCloneStrategy = "blobless" + TreelessCloneStrategy GitCloneStrategy = "treeless" + ShallowCloneStrategy GitCloneStrategy = "shallow" +) + type DevPodWorkspaceProvider struct { // Name is the name of the provider. This can also be an url. Name string `json:"name"` diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/runner_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/runner_types.go index cc7f7f26a..625f6f8ee 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/runner_types.go +++ b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/runner_types.go @@ -6,11 +6,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -var ( - RunnerConditions = []agentstoragev1.ConditionType{ - RunnerDeployed, - } -) +var RunnerConditions = []agentstoragev1.ConditionType{ + RunnerDeployed, +} const ( RunnerDeployed agentstoragev1.ConditionType = "Deployed" @@ -63,9 +61,9 @@ type RunnerSpec struct { // +optional Description string `json:"description,omitempty"` - // Endpoint is the hostname used to connect directly to the runner + // NetworkPeerName is the network peer name used to connect directly to the runner // +optional - Endpoint string `json:"endpoint,omitempty"` + NetworkPeerName string `json:"networkPeerName,omitempty"` // If ClusterRef is defined, Loft will schedule the runner on the given // cluster. diff --git a/vendor/modules.txt b/vendor/modules.txt index e2a2d7ad2..c3d5e6694 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -370,16 +370,12 @@ github.com/liggitt/tabwriter # github.com/loft-sh/admin-apis v0.0.0-20240203010124-3600c1c582a8 ## explicit; go 1.21.1 github.com/loft-sh/admin-apis/pkg/licenseapi -# github.com/loft-sh/agentapi/v4 v4.0.0-alpha.1 +# github.com/loft-sh/agentapi/v4 v4.0.0-alpha.3 ## explicit; go 1.22.2 github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1 github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1 -github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset -github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/scheme -github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/cluster/v1 -github.com/loft-sh/agentapi/v4/pkg/client/loft/clientset_generated/clientset/typed/storage/v1 -# github.com/loft-sh/api/v4 v4.0.0-alpha.3 +# github.com/loft-sh/api/v4 v4.0.0-alpha.3.0.20240522135459-9e20254f7d4d ## explicit; go 1.22.2 github.com/loft-sh/api/v4/pkg/apis/audit/v1 github.com/loft-sh/api/v4/pkg/apis/management