diff --git a/clients/rancher/generated/management/v3/zz_generated_app_condition.go b/clients/rancher/generated/management/v3/zz_generated_app_condition.go deleted file mode 100644 index 9d633aee..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_app_condition.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - AppConditionType = "appCondition" - AppConditionFieldLastTransitionTime = "lastTransitionTime" - AppConditionFieldLastUpdateTime = "lastUpdateTime" - AppConditionFieldMessage = "message" - AppConditionFieldReason = "reason" - AppConditionFieldStatus = "status" - AppConditionFieldType = "type" -) - -type AppCondition struct { - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_catalog.go b/clients/rancher/generated/management/v3/zz_generated_catalog.go deleted file mode 100644 index 4d323382..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_catalog.go +++ /dev/null @@ -1,164 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - CatalogType = "catalog" - CatalogFieldAnnotations = "annotations" - CatalogFieldBranch = "branch" - CatalogFieldCatalogSecrets = "catalogSecrets" - CatalogFieldCommit = "commit" - CatalogFieldConditions = "conditions" - CatalogFieldCreated = "created" - CatalogFieldCreatorID = "creatorId" - CatalogFieldCredentialSecret = "credentialSecret" - CatalogFieldDescription = "description" - CatalogFieldHelmVersion = "helmVersion" - CatalogFieldKind = "kind" - CatalogFieldLabels = "labels" - CatalogFieldLastRefreshTimestamp = "lastRefreshTimestamp" - CatalogFieldName = "name" - CatalogFieldOwnerReferences = "ownerReferences" - CatalogFieldPassword = "password" - CatalogFieldRemoved = "removed" - CatalogFieldState = "state" - CatalogFieldTransitioning = "transitioning" - CatalogFieldTransitioningMessage = "transitioningMessage" - CatalogFieldURL = "url" - CatalogFieldUUID = "uuid" - CatalogFieldUsername = "username" -) - -type Catalog struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Branch string `json:"branch,omitempty" yaml:"branch,omitempty"` - CatalogSecrets *CatalogSecrets `json:"catalogSecrets,omitempty" yaml:"catalogSecrets,omitempty"` - Commit string `json:"commit,omitempty" yaml:"commit,omitempty"` - Conditions []CatalogCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - CredentialSecret string `json:"credentialSecret,omitempty" yaml:"credentialSecret,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - HelmVersion string `json:"helmVersion,omitempty" yaml:"helmVersion,omitempty"` - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - LastRefreshTimestamp string `json:"lastRefreshTimestamp,omitempty" yaml:"lastRefreshTimestamp,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} - -type CatalogCollection struct { - types.Collection - Data []Catalog `json:"data,omitempty"` - client *CatalogClient -} - -type CatalogClient struct { - apiClient *Client -} - -type CatalogOperations interface { - List(opts *types.ListOpts) (*CatalogCollection, error) - ListAll(opts *types.ListOpts) (*CatalogCollection, error) - Create(opts *Catalog) (*Catalog, error) - Update(existing *Catalog, updates interface{}) (*Catalog, error) - Replace(existing *Catalog) (*Catalog, error) - ByID(id string) (*Catalog, error) - Delete(container *Catalog) error - - ActionRefresh(resource *Catalog) (*CatalogRefresh, error) - - CollectionActionRefresh(resource *CatalogCollection) (*CatalogRefresh, error) -} - -func newCatalogClient(apiClient *Client) *CatalogClient { - return &CatalogClient{ - apiClient: apiClient, - } -} - -func (c *CatalogClient) Create(container *Catalog) (*Catalog, error) { - resp := &Catalog{} - err := c.apiClient.Ops.DoCreate(CatalogType, container, resp) - return resp, err -} - -func (c *CatalogClient) Update(existing *Catalog, updates interface{}) (*Catalog, error) { - resp := &Catalog{} - err := c.apiClient.Ops.DoUpdate(CatalogType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *CatalogClient) Replace(obj *Catalog) (*Catalog, error) { - resp := &Catalog{} - err := c.apiClient.Ops.DoReplace(CatalogType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *CatalogClient) List(opts *types.ListOpts) (*CatalogCollection, error) { - resp := &CatalogCollection{} - err := c.apiClient.Ops.DoList(CatalogType, opts, resp) - resp.client = c - return resp, err -} - -func (c *CatalogClient) ListAll(opts *types.ListOpts) (*CatalogCollection, error) { - resp := &CatalogCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *CatalogCollection) Next() (*CatalogCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &CatalogCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *CatalogClient) ByID(id string) (*Catalog, error) { - resp := &Catalog{} - err := c.apiClient.Ops.DoByID(CatalogType, id, resp) - return resp, err -} - -func (c *CatalogClient) Delete(container *Catalog) error { - return c.apiClient.Ops.DoResourceDelete(CatalogType, &container.Resource) -} - -func (c *CatalogClient) ActionRefresh(resource *Catalog) (*CatalogRefresh, error) { - resp := &CatalogRefresh{} - err := c.apiClient.Ops.DoAction(CatalogType, "refresh", &resource.Resource, nil, resp) - return resp, err -} - -func (c *CatalogClient) CollectionActionRefresh(resource *CatalogCollection) (*CatalogRefresh, error) { - resp := &CatalogRefresh{} - err := c.apiClient.Ops.DoCollectionAction(CatalogType, "refresh", &resource.Collection, nil, resp) - return resp, err -} diff --git a/clients/rancher/generated/management/v3/zz_generated_catalog_condition.go b/clients/rancher/generated/management/v3/zz_generated_catalog_condition.go deleted file mode 100644 index 0aba7f4e..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_catalog_condition.go +++ /dev/null @@ -1,20 +0,0 @@ -package client - -const ( - CatalogConditionType = "catalogCondition" - CatalogConditionFieldLastTransitionTime = "lastTransitionTime" - CatalogConditionFieldLastUpdateTime = "lastUpdateTime" - CatalogConditionFieldMessage = "message" - CatalogConditionFieldReason = "reason" - CatalogConditionFieldStatus = "status" - CatalogConditionFieldType = "type" -) - -type CatalogCondition struct { - LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` - LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` - Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_catalog_refresh.go b/clients/rancher/generated/management/v3/zz_generated_catalog_refresh.go deleted file mode 100644 index b2f825f7..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_catalog_refresh.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - CatalogRefreshType = "catalogRefresh" - CatalogRefreshFieldCatalogs = "catalogs" -) - -type CatalogRefresh struct { - Catalogs []string `json:"catalogs,omitempty" yaml:"catalogs,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_catalog_secrets.go b/clients/rancher/generated/management/v3/zz_generated_catalog_secrets.go deleted file mode 100644 index d89c146f..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_catalog_secrets.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - CatalogSecretsType = "catalogSecrets" - CatalogSecretsFieldCredentialSecret = "credentialSecret" -) - -type CatalogSecrets struct { - CredentialSecret string `json:"credentialSecret,omitempty" yaml:"credentialSecret,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_catalog_spec.go b/clients/rancher/generated/management/v3/zz_generated_catalog_spec.go deleted file mode 100644 index 0eb5c87d..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_catalog_spec.go +++ /dev/null @@ -1,24 +0,0 @@ -package client - -const ( - CatalogSpecType = "catalogSpec" - CatalogSpecFieldBranch = "branch" - CatalogSpecFieldCatalogKind = "catalogKind" - CatalogSpecFieldCatalogSecrets = "catalogSecrets" - CatalogSpecFieldDescription = "description" - CatalogSpecFieldHelmVersion = "helmVersion" - CatalogSpecFieldPassword = "password" - CatalogSpecFieldURL = "url" - CatalogSpecFieldUsername = "username" -) - -type CatalogSpec struct { - Branch string `json:"branch,omitempty" yaml:"branch,omitempty"` - CatalogKind string `json:"catalogKind,omitempty" yaml:"catalogKind,omitempty"` - CatalogSecrets *CatalogSecrets `json:"catalogSecrets,omitempty" yaml:"catalogSecrets,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - HelmVersion string `json:"helmVersion,omitempty" yaml:"helmVersion,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_catalog_status.go b/clients/rancher/generated/management/v3/zz_generated_catalog_status.go deleted file mode 100644 index 624f1434..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_catalog_status.go +++ /dev/null @@ -1,18 +0,0 @@ -package client - -const ( - CatalogStatusType = "catalogStatus" - CatalogStatusFieldCommit = "commit" - CatalogStatusFieldConditions = "conditions" - CatalogStatusFieldCredentialSecret = "credentialSecret" - CatalogStatusFieldHelmVersionCommits = "helmVersionCommits" - CatalogStatusFieldLastRefreshTimestamp = "lastRefreshTimestamp" -) - -type CatalogStatus struct { - Commit string `json:"commit,omitempty" yaml:"commit,omitempty"` - Conditions []CatalogCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - CredentialSecret string `json:"credentialSecret,omitempty" yaml:"credentialSecret,omitempty"` - HelmVersionCommits map[string]VersionCommits `json:"helmVersionCommits,omitempty" yaml:"helmVersionCommits,omitempty"` - LastRefreshTimestamp string `json:"lastRefreshTimestamp,omitempty" yaml:"lastRefreshTimestamp,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_catalog_template.go b/clients/rancher/generated/management/v3/zz_generated_catalog_template.go deleted file mode 100644 index bc609f8a..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_catalog_template.go +++ /dev/null @@ -1,166 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - CatalogTemplateType = "catalogTemplate" - CatalogTemplateFieldAnnotations = "annotations" - CatalogTemplateFieldCatalogID = "catalogId" - CatalogTemplateFieldCategories = "categories" - CatalogTemplateFieldCategory = "category" - CatalogTemplateFieldClusterCatalogID = "clusterCatalogId" - CatalogTemplateFieldClusterID = "clusterId" - CatalogTemplateFieldCreated = "created" - CatalogTemplateFieldCreatorID = "creatorId" - CatalogTemplateFieldDefaultTemplateVersionID = "defaultTemplateVersionId" - CatalogTemplateFieldDefaultVersion = "defaultVersion" - CatalogTemplateFieldDescription = "description" - CatalogTemplateFieldFolderName = "folderName" - CatalogTemplateFieldIcon = "icon" - CatalogTemplateFieldIconFilename = "iconFilename" - CatalogTemplateFieldLabels = "labels" - CatalogTemplateFieldMaintainer = "maintainer" - CatalogTemplateFieldName = "name" - CatalogTemplateFieldOwnerReferences = "ownerReferences" - CatalogTemplateFieldPath = "path" - CatalogTemplateFieldProjectCatalogID = "projectCatalogId" - CatalogTemplateFieldProjectID = "projectId" - CatalogTemplateFieldProjectURL = "projectURL" - CatalogTemplateFieldReadme = "readme" - CatalogTemplateFieldRemoved = "removed" - CatalogTemplateFieldState = "state" - CatalogTemplateFieldStatus = "status" - CatalogTemplateFieldTransitioning = "transitioning" - CatalogTemplateFieldTransitioningMessage = "transitioningMessage" - CatalogTemplateFieldUUID = "uuid" - CatalogTemplateFieldUpgradeFrom = "upgradeFrom" - CatalogTemplateFieldVersionLinks = "versionLinks" - CatalogTemplateFieldVersions = "versions" -) - -type CatalogTemplate struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - CatalogID string `json:"catalogId,omitempty" yaml:"catalogId,omitempty"` - Categories []string `json:"categories,omitempty" yaml:"categories,omitempty"` - Category string `json:"category,omitempty" yaml:"category,omitempty"` - ClusterCatalogID string `json:"clusterCatalogId,omitempty" yaml:"clusterCatalogId,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - DefaultTemplateVersionID string `json:"defaultTemplateVersionId,omitempty" yaml:"defaultTemplateVersionId,omitempty"` - DefaultVersion string `json:"defaultVersion,omitempty" yaml:"defaultVersion,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - FolderName string `json:"folderName,omitempty" yaml:"folderName,omitempty"` - Icon string `json:"icon,omitempty" yaml:"icon,omitempty"` - IconFilename string `json:"iconFilename,omitempty" yaml:"iconFilename,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Maintainer string `json:"maintainer,omitempty" yaml:"maintainer,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - ProjectCatalogID string `json:"projectCatalogId,omitempty" yaml:"projectCatalogId,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - ProjectURL string `json:"projectURL,omitempty" yaml:"projectURL,omitempty"` - Readme string `json:"readme,omitempty" yaml:"readme,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *TemplateStatus `json:"status,omitempty" yaml:"status,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UpgradeFrom string `json:"upgradeFrom,omitempty" yaml:"upgradeFrom,omitempty"` - VersionLinks map[string]string `json:"versionLinks,omitempty" yaml:"versionLinks,omitempty"` - Versions []TemplateVersionSpec `json:"versions,omitempty" yaml:"versions,omitempty"` -} - -type CatalogTemplateCollection struct { - types.Collection - Data []CatalogTemplate `json:"data,omitempty"` - client *CatalogTemplateClient -} - -type CatalogTemplateClient struct { - apiClient *Client -} - -type CatalogTemplateOperations interface { - List(opts *types.ListOpts) (*CatalogTemplateCollection, error) - ListAll(opts *types.ListOpts) (*CatalogTemplateCollection, error) - Create(opts *CatalogTemplate) (*CatalogTemplate, error) - Update(existing *CatalogTemplate, updates interface{}) (*CatalogTemplate, error) - Replace(existing *CatalogTemplate) (*CatalogTemplate, error) - ByID(id string) (*CatalogTemplate, error) - Delete(container *CatalogTemplate) error -} - -func newCatalogTemplateClient(apiClient *Client) *CatalogTemplateClient { - return &CatalogTemplateClient{ - apiClient: apiClient, - } -} - -func (c *CatalogTemplateClient) Create(container *CatalogTemplate) (*CatalogTemplate, error) { - resp := &CatalogTemplate{} - err := c.apiClient.Ops.DoCreate(CatalogTemplateType, container, resp) - return resp, err -} - -func (c *CatalogTemplateClient) Update(existing *CatalogTemplate, updates interface{}) (*CatalogTemplate, error) { - resp := &CatalogTemplate{} - err := c.apiClient.Ops.DoUpdate(CatalogTemplateType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *CatalogTemplateClient) Replace(obj *CatalogTemplate) (*CatalogTemplate, error) { - resp := &CatalogTemplate{} - err := c.apiClient.Ops.DoReplace(CatalogTemplateType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *CatalogTemplateClient) List(opts *types.ListOpts) (*CatalogTemplateCollection, error) { - resp := &CatalogTemplateCollection{} - err := c.apiClient.Ops.DoList(CatalogTemplateType, opts, resp) - resp.client = c - return resp, err -} - -func (c *CatalogTemplateClient) ListAll(opts *types.ListOpts) (*CatalogTemplateCollection, error) { - resp := &CatalogTemplateCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *CatalogTemplateCollection) Next() (*CatalogTemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &CatalogTemplateCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *CatalogTemplateClient) ByID(id string) (*CatalogTemplate, error) { - resp := &CatalogTemplate{} - err := c.apiClient.Ops.DoByID(CatalogTemplateType, id, resp) - return resp, err -} - -func (c *CatalogTemplateClient) Delete(container *CatalogTemplate) error { - return c.apiClient.Ops.DoResourceDelete(CatalogTemplateType, &container.Resource) -} diff --git a/clients/rancher/generated/management/v3/zz_generated_catalog_template_version.go b/clients/rancher/generated/management/v3/zz_generated_catalog_template_version.go deleted file mode 100644 index 520ed186..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_catalog_template_version.go +++ /dev/null @@ -1,158 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - CatalogTemplateVersionType = "catalogTemplateVersion" - CatalogTemplateVersionFieldAnnotations = "annotations" - CatalogTemplateVersionFieldAppReadme = "appReadme" - CatalogTemplateVersionFieldCreated = "created" - CatalogTemplateVersionFieldCreatorID = "creatorId" - CatalogTemplateVersionFieldDigest = "digest" - CatalogTemplateVersionFieldExternalID = "externalId" - CatalogTemplateVersionFieldFiles = "files" - CatalogTemplateVersionFieldKubeVersion = "kubeVersion" - CatalogTemplateVersionFieldLabels = "labels" - CatalogTemplateVersionFieldName = "name" - CatalogTemplateVersionFieldOwnerReferences = "ownerReferences" - CatalogTemplateVersionFieldQuestions = "questions" - CatalogTemplateVersionFieldRancherMaxVersion = "rancherMaxVersion" - CatalogTemplateVersionFieldRancherMinVersion = "rancherMinVersion" - CatalogTemplateVersionFieldRancherVersion = "rancherVersion" - CatalogTemplateVersionFieldReadme = "readme" - CatalogTemplateVersionFieldRemoved = "removed" - CatalogTemplateVersionFieldRequiredNamespace = "requiredNamespace" - CatalogTemplateVersionFieldState = "state" - CatalogTemplateVersionFieldStatus = "status" - CatalogTemplateVersionFieldTransitioning = "transitioning" - CatalogTemplateVersionFieldTransitioningMessage = "transitioningMessage" - CatalogTemplateVersionFieldUUID = "uuid" - CatalogTemplateVersionFieldUpgradeVersionLinks = "upgradeVersionLinks" - CatalogTemplateVersionFieldVersion = "version" - CatalogTemplateVersionFieldVersionDir = "versionDir" - CatalogTemplateVersionFieldVersionName = "versionName" - CatalogTemplateVersionFieldVersionURLs = "versionUrls" -) - -type CatalogTemplateVersion struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - AppReadme string `json:"appReadme,omitempty" yaml:"appReadme,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Digest string `json:"digest,omitempty" yaml:"digest,omitempty"` - ExternalID string `json:"externalId,omitempty" yaml:"externalId,omitempty"` - Files map[string]string `json:"files,omitempty" yaml:"files,omitempty"` - KubeVersion string `json:"kubeVersion,omitempty" yaml:"kubeVersion,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Questions []Question `json:"questions,omitempty" yaml:"questions,omitempty"` - RancherMaxVersion string `json:"rancherMaxVersion,omitempty" yaml:"rancherMaxVersion,omitempty"` - RancherMinVersion string `json:"rancherMinVersion,omitempty" yaml:"rancherMinVersion,omitempty"` - RancherVersion string `json:"rancherVersion,omitempty" yaml:"rancherVersion,omitempty"` - Readme string `json:"readme,omitempty" yaml:"readme,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RequiredNamespace string `json:"requiredNamespace,omitempty" yaml:"requiredNamespace,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *TemplateVersionStatus `json:"status,omitempty" yaml:"status,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UpgradeVersionLinks map[string]string `json:"upgradeVersionLinks,omitempty" yaml:"upgradeVersionLinks,omitempty"` - Version string `json:"version,omitempty" yaml:"version,omitempty"` - VersionDir string `json:"versionDir,omitempty" yaml:"versionDir,omitempty"` - VersionName string `json:"versionName,omitempty" yaml:"versionName,omitempty"` - VersionURLs []string `json:"versionUrls,omitempty" yaml:"versionUrls,omitempty"` -} - -type CatalogTemplateVersionCollection struct { - types.Collection - Data []CatalogTemplateVersion `json:"data,omitempty"` - client *CatalogTemplateVersionClient -} - -type CatalogTemplateVersionClient struct { - apiClient *Client -} - -type CatalogTemplateVersionOperations interface { - List(opts *types.ListOpts) (*CatalogTemplateVersionCollection, error) - ListAll(opts *types.ListOpts) (*CatalogTemplateVersionCollection, error) - Create(opts *CatalogTemplateVersion) (*CatalogTemplateVersion, error) - Update(existing *CatalogTemplateVersion, updates interface{}) (*CatalogTemplateVersion, error) - Replace(existing *CatalogTemplateVersion) (*CatalogTemplateVersion, error) - ByID(id string) (*CatalogTemplateVersion, error) - Delete(container *CatalogTemplateVersion) error -} - -func newCatalogTemplateVersionClient(apiClient *Client) *CatalogTemplateVersionClient { - return &CatalogTemplateVersionClient{ - apiClient: apiClient, - } -} - -func (c *CatalogTemplateVersionClient) Create(container *CatalogTemplateVersion) (*CatalogTemplateVersion, error) { - resp := &CatalogTemplateVersion{} - err := c.apiClient.Ops.DoCreate(CatalogTemplateVersionType, container, resp) - return resp, err -} - -func (c *CatalogTemplateVersionClient) Update(existing *CatalogTemplateVersion, updates interface{}) (*CatalogTemplateVersion, error) { - resp := &CatalogTemplateVersion{} - err := c.apiClient.Ops.DoUpdate(CatalogTemplateVersionType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *CatalogTemplateVersionClient) Replace(obj *CatalogTemplateVersion) (*CatalogTemplateVersion, error) { - resp := &CatalogTemplateVersion{} - err := c.apiClient.Ops.DoReplace(CatalogTemplateVersionType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *CatalogTemplateVersionClient) List(opts *types.ListOpts) (*CatalogTemplateVersionCollection, error) { - resp := &CatalogTemplateVersionCollection{} - err := c.apiClient.Ops.DoList(CatalogTemplateVersionType, opts, resp) - resp.client = c - return resp, err -} - -func (c *CatalogTemplateVersionClient) ListAll(opts *types.ListOpts) (*CatalogTemplateVersionCollection, error) { - resp := &CatalogTemplateVersionCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *CatalogTemplateVersionCollection) Next() (*CatalogTemplateVersionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &CatalogTemplateVersionCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *CatalogTemplateVersionClient) ByID(id string) (*CatalogTemplateVersion, error) { - resp := &CatalogTemplateVersion{} - err := c.apiClient.Ops.DoByID(CatalogTemplateVersionType, id, resp) - return resp, err -} - -func (c *CatalogTemplateVersionClient) Delete(container *CatalogTemplateVersion) error { - return c.apiClient.Ops.DoResourceDelete(CatalogTemplateVersionType, &container.Resource) -} diff --git a/clients/rancher/generated/management/v3/zz_generated_client.go b/clients/rancher/generated/management/v3/zz_generated_client.go index 40b1b74d..9360d9fd 100644 --- a/clients/rancher/generated/management/v3/zz_generated_client.go +++ b/clients/rancher/generated/management/v3/zz_generated_client.go @@ -20,12 +20,6 @@ type Client struct { ProjectRoleTemplateBinding ProjectRoleTemplateBindingOperations Cluster ClusterOperations ClusterRegistrationToken ClusterRegistrationTokenOperations - Catalog CatalogOperations - Template TemplateOperations - CatalogTemplate CatalogTemplateOperations - CatalogTemplateVersion CatalogTemplateVersionOperations - TemplateVersion TemplateVersionOperations - TemplateContent TemplateContentOperations Group GroupOperations GroupMember GroupMemberOperations SamlToken SamlTokenOperations @@ -40,10 +34,6 @@ type Client struct { Setting SettingOperations Feature FeatureOperations ComposeConfig ComposeConfigOperations - ProjectCatalog ProjectCatalogOperations - ClusterCatalog ClusterCatalogOperations - MultiClusterApp MultiClusterAppOperations - MultiClusterAppRevision MultiClusterAppRevisionOperations KontainerDriver KontainerDriverOperations EtcdBackup EtcdBackupOperations CloudCredential CloudCredentialOperations @@ -80,12 +70,6 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) { client.ProjectRoleTemplateBinding = newProjectRoleTemplateBindingClient(client) client.Cluster = newClusterClient(client) client.ClusterRegistrationToken = newClusterRegistrationTokenClient(client) - client.Catalog = newCatalogClient(client) - client.Template = newTemplateClient(client) - client.CatalogTemplate = newCatalogTemplateClient(client) - client.CatalogTemplateVersion = newCatalogTemplateVersionClient(client) - client.TemplateVersion = newTemplateVersionClient(client) - client.TemplateContent = newTemplateContentClient(client) client.Group = newGroupClient(client) client.GroupMember = newGroupMemberClient(client) client.SamlToken = newSamlTokenClient(client) @@ -100,10 +84,6 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) { client.Setting = newSettingClient(client) client.Feature = newFeatureClient(client) client.ComposeConfig = newComposeConfigClient(client) - client.ProjectCatalog = newProjectCatalogClient(client) - client.ClusterCatalog = newClusterCatalogClient(client) - client.MultiClusterApp = newMultiClusterAppClient(client) - client.MultiClusterAppRevision = newMultiClusterAppRevisionClient(client) client.KontainerDriver = newKontainerDriverClient(client) client.EtcdBackup = newEtcdBackupClient(client) client.CloudCredential = newCloudCredentialClient(client) diff --git a/clients/rancher/generated/management/v3/zz_generated_cluster_catalog.go b/clients/rancher/generated/management/v3/zz_generated_cluster_catalog.go deleted file mode 100644 index d555f2bf..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_cluster_catalog.go +++ /dev/null @@ -1,168 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ClusterCatalogType = "clusterCatalog" - ClusterCatalogFieldAnnotations = "annotations" - ClusterCatalogFieldBranch = "branch" - ClusterCatalogFieldCatalogSecrets = "catalogSecrets" - ClusterCatalogFieldClusterID = "clusterId" - ClusterCatalogFieldCommit = "commit" - ClusterCatalogFieldConditions = "conditions" - ClusterCatalogFieldCreated = "created" - ClusterCatalogFieldCreatorID = "creatorId" - ClusterCatalogFieldCredentialSecret = "credentialSecret" - ClusterCatalogFieldDescription = "description" - ClusterCatalogFieldHelmVersion = "helmVersion" - ClusterCatalogFieldKind = "kind" - ClusterCatalogFieldLabels = "labels" - ClusterCatalogFieldLastRefreshTimestamp = "lastRefreshTimestamp" - ClusterCatalogFieldName = "name" - ClusterCatalogFieldNamespaceId = "namespaceId" - ClusterCatalogFieldOwnerReferences = "ownerReferences" - ClusterCatalogFieldPassword = "password" - ClusterCatalogFieldRemoved = "removed" - ClusterCatalogFieldState = "state" - ClusterCatalogFieldTransitioning = "transitioning" - ClusterCatalogFieldTransitioningMessage = "transitioningMessage" - ClusterCatalogFieldURL = "url" - ClusterCatalogFieldUUID = "uuid" - ClusterCatalogFieldUsername = "username" -) - -type ClusterCatalog struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Branch string `json:"branch,omitempty" yaml:"branch,omitempty"` - CatalogSecrets *CatalogSecrets `json:"catalogSecrets,omitempty" yaml:"catalogSecrets,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Commit string `json:"commit,omitempty" yaml:"commit,omitempty"` - Conditions []CatalogCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - CredentialSecret string `json:"credentialSecret,omitempty" yaml:"credentialSecret,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - HelmVersion string `json:"helmVersion,omitempty" yaml:"helmVersion,omitempty"` - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - LastRefreshTimestamp string `json:"lastRefreshTimestamp,omitempty" yaml:"lastRefreshTimestamp,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} - -type ClusterCatalogCollection struct { - types.Collection - Data []ClusterCatalog `json:"data,omitempty"` - client *ClusterCatalogClient -} - -type ClusterCatalogClient struct { - apiClient *Client -} - -type ClusterCatalogOperations interface { - List(opts *types.ListOpts) (*ClusterCatalogCollection, error) - ListAll(opts *types.ListOpts) (*ClusterCatalogCollection, error) - Create(opts *ClusterCatalog) (*ClusterCatalog, error) - Update(existing *ClusterCatalog, updates interface{}) (*ClusterCatalog, error) - Replace(existing *ClusterCatalog) (*ClusterCatalog, error) - ByID(id string) (*ClusterCatalog, error) - Delete(container *ClusterCatalog) error - - ActionRefresh(resource *ClusterCatalog) (*CatalogRefresh, error) - - CollectionActionRefresh(resource *ClusterCatalogCollection) (*CatalogRefresh, error) -} - -func newClusterCatalogClient(apiClient *Client) *ClusterCatalogClient { - return &ClusterCatalogClient{ - apiClient: apiClient, - } -} - -func (c *ClusterCatalogClient) Create(container *ClusterCatalog) (*ClusterCatalog, error) { - resp := &ClusterCatalog{} - err := c.apiClient.Ops.DoCreate(ClusterCatalogType, container, resp) - return resp, err -} - -func (c *ClusterCatalogClient) Update(existing *ClusterCatalog, updates interface{}) (*ClusterCatalog, error) { - resp := &ClusterCatalog{} - err := c.apiClient.Ops.DoUpdate(ClusterCatalogType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ClusterCatalogClient) Replace(obj *ClusterCatalog) (*ClusterCatalog, error) { - resp := &ClusterCatalog{} - err := c.apiClient.Ops.DoReplace(ClusterCatalogType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ClusterCatalogClient) List(opts *types.ListOpts) (*ClusterCatalogCollection, error) { - resp := &ClusterCatalogCollection{} - err := c.apiClient.Ops.DoList(ClusterCatalogType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ClusterCatalogClient) ListAll(opts *types.ListOpts) (*ClusterCatalogCollection, error) { - resp := &ClusterCatalogCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ClusterCatalogCollection) Next() (*ClusterCatalogCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ClusterCatalogCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ClusterCatalogClient) ByID(id string) (*ClusterCatalog, error) { - resp := &ClusterCatalog{} - err := c.apiClient.Ops.DoByID(ClusterCatalogType, id, resp) - return resp, err -} - -func (c *ClusterCatalogClient) Delete(container *ClusterCatalog) error { - return c.apiClient.Ops.DoResourceDelete(ClusterCatalogType, &container.Resource) -} - -func (c *ClusterCatalogClient) ActionRefresh(resource *ClusterCatalog) (*CatalogRefresh, error) { - resp := &CatalogRefresh{} - err := c.apiClient.Ops.DoAction(ClusterCatalogType, "refresh", &resource.Resource, nil, resp) - return resp, err -} - -func (c *ClusterCatalogClient) CollectionActionRefresh(resource *ClusterCatalogCollection) (*CatalogRefresh, error) { - resp := &CatalogRefresh{} - err := c.apiClient.Ops.DoCollectionAction(ClusterCatalogType, "refresh", &resource.Collection, nil, resp) - return resp, err -} diff --git a/clients/rancher/generated/management/v3/zz_generated_member.go b/clients/rancher/generated/management/v3/zz_generated_member.go index 620e4607..41c443b4 100644 --- a/clients/rancher/generated/management/v3/zz_generated_member.go +++ b/clients/rancher/generated/management/v3/zz_generated_member.go @@ -3,12 +3,16 @@ package client const ( MemberType = "member" MemberFieldAccessType = "accessType" + MemberFieldDisplayName = "displayName" MemberFieldGroupPrincipalID = "groupPrincipalId" + MemberFieldUserID = "userId" MemberFieldUserPrincipalID = "userPrincipalId" ) type Member struct { AccessType string `json:"accessType,omitempty" yaml:"accessType,omitempty"` + DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` GroupPrincipalID string `json:"groupPrincipalId,omitempty" yaml:"groupPrincipalId,omitempty"` + UserID string `json:"userId,omitempty" yaml:"userId,omitempty"` UserPrincipalID string `json:"userPrincipalId,omitempty" yaml:"userPrincipalId,omitempty"` } diff --git a/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app.go b/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app.go deleted file mode 100644 index 228b842b..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app.go +++ /dev/null @@ -1,165 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - MultiClusterAppType = "multiClusterApp" - MultiClusterAppFieldAnnotations = "annotations" - MultiClusterAppFieldAnswers = "answers" - MultiClusterAppFieldCreated = "created" - MultiClusterAppFieldCreatorID = "creatorId" - MultiClusterAppFieldLabels = "labels" - MultiClusterAppFieldMembers = "members" - MultiClusterAppFieldName = "name" - MultiClusterAppFieldOwnerReferences = "ownerReferences" - MultiClusterAppFieldRemoved = "removed" - MultiClusterAppFieldRevisionHistoryLimit = "revisionHistoryLimit" - MultiClusterAppFieldRoles = "roles" - MultiClusterAppFieldState = "state" - MultiClusterAppFieldStatus = "status" - MultiClusterAppFieldTargets = "targets" - MultiClusterAppFieldTemplateVersionID = "templateVersionId" - MultiClusterAppFieldTimeout = "timeout" - MultiClusterAppFieldTransitioning = "transitioning" - MultiClusterAppFieldTransitioningMessage = "transitioningMessage" - MultiClusterAppFieldUUID = "uuid" - MultiClusterAppFieldUpgradeStrategy = "upgradeStrategy" - MultiClusterAppFieldWait = "wait" -) - -type MultiClusterApp struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Answers []Answer `json:"answers,omitempty" yaml:"answers,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Members []Member `json:"members,omitempty" yaml:"members,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RevisionHistoryLimit int64 `json:"revisionHistoryLimit,omitempty" yaml:"revisionHistoryLimit,omitempty"` - Roles []string `json:"roles,omitempty" yaml:"roles,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *MultiClusterAppStatus `json:"status,omitempty" yaml:"status,omitempty"` - Targets []Target `json:"targets,omitempty" yaml:"targets,omitempty"` - TemplateVersionID string `json:"templateVersionId,omitempty" yaml:"templateVersionId,omitempty"` - Timeout int64 `json:"timeout,omitempty" yaml:"timeout,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UpgradeStrategy *UpgradeStrategy `json:"upgradeStrategy,omitempty" yaml:"upgradeStrategy,omitempty"` - Wait bool `json:"wait,omitempty" yaml:"wait,omitempty"` -} - -type MultiClusterAppCollection struct { - types.Collection - Data []MultiClusterApp `json:"data,omitempty"` - client *MultiClusterAppClient -} - -type MultiClusterAppClient struct { - apiClient *Client -} - -type MultiClusterAppOperations interface { - List(opts *types.ListOpts) (*MultiClusterAppCollection, error) - ListAll(opts *types.ListOpts) (*MultiClusterAppCollection, error) - Create(opts *MultiClusterApp) (*MultiClusterApp, error) - Update(existing *MultiClusterApp, updates interface{}) (*MultiClusterApp, error) - Replace(existing *MultiClusterApp) (*MultiClusterApp, error) - ByID(id string) (*MultiClusterApp, error) - Delete(container *MultiClusterApp) error - - ActionAddProjects(resource *MultiClusterApp, input *UpdateMultiClusterAppTargetsInput) error - - ActionRemoveProjects(resource *MultiClusterApp, input *UpdateMultiClusterAppTargetsInput) error - - ActionRollback(resource *MultiClusterApp, input *MultiClusterAppRollbackInput) error -} - -func newMultiClusterAppClient(apiClient *Client) *MultiClusterAppClient { - return &MultiClusterAppClient{ - apiClient: apiClient, - } -} - -func (c *MultiClusterAppClient) Create(container *MultiClusterApp) (*MultiClusterApp, error) { - resp := &MultiClusterApp{} - err := c.apiClient.Ops.DoCreate(MultiClusterAppType, container, resp) - return resp, err -} - -func (c *MultiClusterAppClient) Update(existing *MultiClusterApp, updates interface{}) (*MultiClusterApp, error) { - resp := &MultiClusterApp{} - err := c.apiClient.Ops.DoUpdate(MultiClusterAppType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *MultiClusterAppClient) Replace(obj *MultiClusterApp) (*MultiClusterApp, error) { - resp := &MultiClusterApp{} - err := c.apiClient.Ops.DoReplace(MultiClusterAppType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *MultiClusterAppClient) List(opts *types.ListOpts) (*MultiClusterAppCollection, error) { - resp := &MultiClusterAppCollection{} - err := c.apiClient.Ops.DoList(MultiClusterAppType, opts, resp) - resp.client = c - return resp, err -} - -func (c *MultiClusterAppClient) ListAll(opts *types.ListOpts) (*MultiClusterAppCollection, error) { - resp := &MultiClusterAppCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *MultiClusterAppCollection) Next() (*MultiClusterAppCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &MultiClusterAppCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *MultiClusterAppClient) ByID(id string) (*MultiClusterApp, error) { - resp := &MultiClusterApp{} - err := c.apiClient.Ops.DoByID(MultiClusterAppType, id, resp) - return resp, err -} - -func (c *MultiClusterAppClient) Delete(container *MultiClusterApp) error { - return c.apiClient.Ops.DoResourceDelete(MultiClusterAppType, &container.Resource) -} - -func (c *MultiClusterAppClient) ActionAddProjects(resource *MultiClusterApp, input *UpdateMultiClusterAppTargetsInput) error { - err := c.apiClient.Ops.DoAction(MultiClusterAppType, "addProjects", &resource.Resource, input, nil) - return err -} - -func (c *MultiClusterAppClient) ActionRemoveProjects(resource *MultiClusterApp, input *UpdateMultiClusterAppTargetsInput) error { - err := c.apiClient.Ops.DoAction(MultiClusterAppType, "removeProjects", &resource.Resource, input, nil) - return err -} - -func (c *MultiClusterAppClient) ActionRollback(resource *MultiClusterApp, input *MultiClusterAppRollbackInput) error { - err := c.apiClient.Ops.DoAction(MultiClusterAppType, "rollback", &resource.Resource, input, nil) - return err -} diff --git a/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_revision.go b/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_revision.go deleted file mode 100644 index a759036f..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_revision.go +++ /dev/null @@ -1,122 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - MultiClusterAppRevisionType = "multiClusterAppRevision" - MultiClusterAppRevisionFieldAnnotations = "annotations" - MultiClusterAppRevisionFieldAnswers = "answers" - MultiClusterAppRevisionFieldCreated = "created" - MultiClusterAppRevisionFieldCreatorID = "creatorId" - MultiClusterAppRevisionFieldLabels = "labels" - MultiClusterAppRevisionFieldName = "name" - MultiClusterAppRevisionFieldOwnerReferences = "ownerReferences" - MultiClusterAppRevisionFieldRemoved = "removed" - MultiClusterAppRevisionFieldTemplateVersionID = "templateVersionId" - MultiClusterAppRevisionFieldUUID = "uuid" -) - -type MultiClusterAppRevision struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Answers []Answer `json:"answers,omitempty" yaml:"answers,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - TemplateVersionID string `json:"templateVersionId,omitempty" yaml:"templateVersionId,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type MultiClusterAppRevisionCollection struct { - types.Collection - Data []MultiClusterAppRevision `json:"data,omitempty"` - client *MultiClusterAppRevisionClient -} - -type MultiClusterAppRevisionClient struct { - apiClient *Client -} - -type MultiClusterAppRevisionOperations interface { - List(opts *types.ListOpts) (*MultiClusterAppRevisionCollection, error) - ListAll(opts *types.ListOpts) (*MultiClusterAppRevisionCollection, error) - Create(opts *MultiClusterAppRevision) (*MultiClusterAppRevision, error) - Update(existing *MultiClusterAppRevision, updates interface{}) (*MultiClusterAppRevision, error) - Replace(existing *MultiClusterAppRevision) (*MultiClusterAppRevision, error) - ByID(id string) (*MultiClusterAppRevision, error) - Delete(container *MultiClusterAppRevision) error -} - -func newMultiClusterAppRevisionClient(apiClient *Client) *MultiClusterAppRevisionClient { - return &MultiClusterAppRevisionClient{ - apiClient: apiClient, - } -} - -func (c *MultiClusterAppRevisionClient) Create(container *MultiClusterAppRevision) (*MultiClusterAppRevision, error) { - resp := &MultiClusterAppRevision{} - err := c.apiClient.Ops.DoCreate(MultiClusterAppRevisionType, container, resp) - return resp, err -} - -func (c *MultiClusterAppRevisionClient) Update(existing *MultiClusterAppRevision, updates interface{}) (*MultiClusterAppRevision, error) { - resp := &MultiClusterAppRevision{} - err := c.apiClient.Ops.DoUpdate(MultiClusterAppRevisionType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *MultiClusterAppRevisionClient) Replace(obj *MultiClusterAppRevision) (*MultiClusterAppRevision, error) { - resp := &MultiClusterAppRevision{} - err := c.apiClient.Ops.DoReplace(MultiClusterAppRevisionType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *MultiClusterAppRevisionClient) List(opts *types.ListOpts) (*MultiClusterAppRevisionCollection, error) { - resp := &MultiClusterAppRevisionCollection{} - err := c.apiClient.Ops.DoList(MultiClusterAppRevisionType, opts, resp) - resp.client = c - return resp, err -} - -func (c *MultiClusterAppRevisionClient) ListAll(opts *types.ListOpts) (*MultiClusterAppRevisionCollection, error) { - resp := &MultiClusterAppRevisionCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *MultiClusterAppRevisionCollection) Next() (*MultiClusterAppRevisionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &MultiClusterAppRevisionCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *MultiClusterAppRevisionClient) ByID(id string) (*MultiClusterAppRevision, error) { - resp := &MultiClusterAppRevision{} - err := c.apiClient.Ops.DoByID(MultiClusterAppRevisionType, id, resp) - return resp, err -} - -func (c *MultiClusterAppRevisionClient) Delete(container *MultiClusterAppRevision) error { - return c.apiClient.Ops.DoResourceDelete(MultiClusterAppRevisionType, &container.Resource) -} diff --git a/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_rollback_input.go b/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_rollback_input.go deleted file mode 100644 index 90a033eb..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_rollback_input.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - MultiClusterAppRollbackInputType = "multiClusterAppRollbackInput" - MultiClusterAppRollbackInputFieldRevisionID = "revisionId" -) - -type MultiClusterAppRollbackInput struct { - RevisionID string `json:"revisionId,omitempty" yaml:"revisionId,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_spec.go b/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_spec.go deleted file mode 100644 index c9d0b380..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_spec.go +++ /dev/null @@ -1,26 +0,0 @@ -package client - -const ( - MultiClusterAppSpecType = "multiClusterAppSpec" - MultiClusterAppSpecFieldAnswers = "answers" - MultiClusterAppSpecFieldMembers = "members" - MultiClusterAppSpecFieldRevisionHistoryLimit = "revisionHistoryLimit" - MultiClusterAppSpecFieldRoles = "roles" - MultiClusterAppSpecFieldTargets = "targets" - MultiClusterAppSpecFieldTemplateVersionID = "templateVersionId" - MultiClusterAppSpecFieldTimeout = "timeout" - MultiClusterAppSpecFieldUpgradeStrategy = "upgradeStrategy" - MultiClusterAppSpecFieldWait = "wait" -) - -type MultiClusterAppSpec struct { - Answers []Answer `json:"answers,omitempty" yaml:"answers,omitempty"` - Members []Member `json:"members,omitempty" yaml:"members,omitempty"` - RevisionHistoryLimit int64 `json:"revisionHistoryLimit,omitempty" yaml:"revisionHistoryLimit,omitempty"` - Roles []string `json:"roles,omitempty" yaml:"roles,omitempty"` - Targets []Target `json:"targets,omitempty" yaml:"targets,omitempty"` - TemplateVersionID string `json:"templateVersionId,omitempty" yaml:"templateVersionId,omitempty"` - Timeout int64 `json:"timeout,omitempty" yaml:"timeout,omitempty"` - UpgradeStrategy *UpgradeStrategy `json:"upgradeStrategy,omitempty" yaml:"upgradeStrategy,omitempty"` - Wait bool `json:"wait,omitempty" yaml:"wait,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_status.go b/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_status.go deleted file mode 100644 index e84859c1..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_multi_cluster_app_status.go +++ /dev/null @@ -1,14 +0,0 @@ -package client - -const ( - MultiClusterAppStatusType = "multiClusterAppStatus" - MultiClusterAppStatusFieldConditions = "conditions" - MultiClusterAppStatusFieldHelmVersion = "helmVersion" - MultiClusterAppStatusFieldRevisionID = "revisionId" -) - -type MultiClusterAppStatus struct { - Conditions []AppCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - HelmVersion string `json:"helmVersion,omitempty" yaml:"helmVersion,omitempty"` - RevisionID string `json:"revisionId,omitempty" yaml:"revisionId,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_project_catalog.go b/clients/rancher/generated/management/v3/zz_generated_project_catalog.go deleted file mode 100644 index 2185abe0..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_project_catalog.go +++ /dev/null @@ -1,168 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ProjectCatalogType = "projectCatalog" - ProjectCatalogFieldAnnotations = "annotations" - ProjectCatalogFieldBranch = "branch" - ProjectCatalogFieldCatalogSecrets = "catalogSecrets" - ProjectCatalogFieldCommit = "commit" - ProjectCatalogFieldConditions = "conditions" - ProjectCatalogFieldCreated = "created" - ProjectCatalogFieldCreatorID = "creatorId" - ProjectCatalogFieldCredentialSecret = "credentialSecret" - ProjectCatalogFieldDescription = "description" - ProjectCatalogFieldHelmVersion = "helmVersion" - ProjectCatalogFieldKind = "kind" - ProjectCatalogFieldLabels = "labels" - ProjectCatalogFieldLastRefreshTimestamp = "lastRefreshTimestamp" - ProjectCatalogFieldName = "name" - ProjectCatalogFieldNamespaceId = "namespaceId" - ProjectCatalogFieldOwnerReferences = "ownerReferences" - ProjectCatalogFieldPassword = "password" - ProjectCatalogFieldProjectID = "projectId" - ProjectCatalogFieldRemoved = "removed" - ProjectCatalogFieldState = "state" - ProjectCatalogFieldTransitioning = "transitioning" - ProjectCatalogFieldTransitioningMessage = "transitioningMessage" - ProjectCatalogFieldURL = "url" - ProjectCatalogFieldUUID = "uuid" - ProjectCatalogFieldUsername = "username" -) - -type ProjectCatalog struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Branch string `json:"branch,omitempty" yaml:"branch,omitempty"` - CatalogSecrets *CatalogSecrets `json:"catalogSecrets,omitempty" yaml:"catalogSecrets,omitempty"` - Commit string `json:"commit,omitempty" yaml:"commit,omitempty"` - Conditions []CatalogCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - CredentialSecret string `json:"credentialSecret,omitempty" yaml:"credentialSecret,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - HelmVersion string `json:"helmVersion,omitempty" yaml:"helmVersion,omitempty"` - Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - LastRefreshTimestamp string `json:"lastRefreshTimestamp,omitempty" yaml:"lastRefreshTimestamp,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - URL string `json:"url,omitempty" yaml:"url,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` -} - -type ProjectCatalogCollection struct { - types.Collection - Data []ProjectCatalog `json:"data,omitempty"` - client *ProjectCatalogClient -} - -type ProjectCatalogClient struct { - apiClient *Client -} - -type ProjectCatalogOperations interface { - List(opts *types.ListOpts) (*ProjectCatalogCollection, error) - ListAll(opts *types.ListOpts) (*ProjectCatalogCollection, error) - Create(opts *ProjectCatalog) (*ProjectCatalog, error) - Update(existing *ProjectCatalog, updates interface{}) (*ProjectCatalog, error) - Replace(existing *ProjectCatalog) (*ProjectCatalog, error) - ByID(id string) (*ProjectCatalog, error) - Delete(container *ProjectCatalog) error - - ActionRefresh(resource *ProjectCatalog) (*CatalogRefresh, error) - - CollectionActionRefresh(resource *ProjectCatalogCollection) (*CatalogRefresh, error) -} - -func newProjectCatalogClient(apiClient *Client) *ProjectCatalogClient { - return &ProjectCatalogClient{ - apiClient: apiClient, - } -} - -func (c *ProjectCatalogClient) Create(container *ProjectCatalog) (*ProjectCatalog, error) { - resp := &ProjectCatalog{} - err := c.apiClient.Ops.DoCreate(ProjectCatalogType, container, resp) - return resp, err -} - -func (c *ProjectCatalogClient) Update(existing *ProjectCatalog, updates interface{}) (*ProjectCatalog, error) { - resp := &ProjectCatalog{} - err := c.apiClient.Ops.DoUpdate(ProjectCatalogType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ProjectCatalogClient) Replace(obj *ProjectCatalog) (*ProjectCatalog, error) { - resp := &ProjectCatalog{} - err := c.apiClient.Ops.DoReplace(ProjectCatalogType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ProjectCatalogClient) List(opts *types.ListOpts) (*ProjectCatalogCollection, error) { - resp := &ProjectCatalogCollection{} - err := c.apiClient.Ops.DoList(ProjectCatalogType, opts, resp) - resp.client = c - return resp, err -} - -func (c *ProjectCatalogClient) ListAll(opts *types.ListOpts) (*ProjectCatalogCollection, error) { - resp := &ProjectCatalogCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *ProjectCatalogCollection) Next() (*ProjectCatalogCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ProjectCatalogCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ProjectCatalogClient) ByID(id string) (*ProjectCatalog, error) { - resp := &ProjectCatalog{} - err := c.apiClient.Ops.DoByID(ProjectCatalogType, id, resp) - return resp, err -} - -func (c *ProjectCatalogClient) Delete(container *ProjectCatalog) error { - return c.apiClient.Ops.DoResourceDelete(ProjectCatalogType, &container.Resource) -} - -func (c *ProjectCatalogClient) ActionRefresh(resource *ProjectCatalog) (*CatalogRefresh, error) { - resp := &CatalogRefresh{} - err := c.apiClient.Ops.DoAction(ProjectCatalogType, "refresh", &resource.Resource, nil, resp) - return resp, err -} - -func (c *ProjectCatalogClient) CollectionActionRefresh(resource *ProjectCatalogCollection) (*CatalogRefresh, error) { - resp := &CatalogRefresh{} - err := c.apiClient.Ops.DoCollectionAction(ProjectCatalogType, "refresh", &resource.Collection, nil, resp) - return resp, err -} diff --git a/clients/rancher/generated/management/v3/zz_generated_rolling_update.go b/clients/rancher/generated/management/v3/zz_generated_rolling_update.go deleted file mode 100644 index 180f638b..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_rolling_update.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - RollingUpdateType = "rollingUpdate" - RollingUpdateFieldBatchSize = "batchSize" - RollingUpdateFieldInterval = "interval" -) - -type RollingUpdate struct { - BatchSize int64 `json:"batchSize,omitempty" yaml:"batchSize,omitempty"` - Interval int64 `json:"interval,omitempty" yaml:"interval,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_target.go b/clients/rancher/generated/management/v3/zz_generated_target.go deleted file mode 100644 index cd8d7282..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_target.go +++ /dev/null @@ -1,16 +0,0 @@ -package client - -const ( - TargetType = "target" - TargetFieldAppID = "appId" - TargetFieldHealthstate = "healthState" - TargetFieldProjectID = "projectId" - TargetFieldState = "state" -) - -type Target struct { - AppID string `json:"appId,omitempty" yaml:"appId,omitempty"` - Healthstate string `json:"healthState,omitempty" yaml:"healthState,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_template.go b/clients/rancher/generated/management/v3/zz_generated_template.go deleted file mode 100644 index 9b155630..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_template.go +++ /dev/null @@ -1,166 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - TemplateType = "template" - TemplateFieldAnnotations = "annotations" - TemplateFieldCatalogID = "catalogId" - TemplateFieldCategories = "categories" - TemplateFieldCategory = "category" - TemplateFieldClusterCatalogID = "clusterCatalogId" - TemplateFieldClusterID = "clusterId" - TemplateFieldCreated = "created" - TemplateFieldCreatorID = "creatorId" - TemplateFieldDefaultTemplateVersionID = "defaultTemplateVersionId" - TemplateFieldDefaultVersion = "defaultVersion" - TemplateFieldDescription = "description" - TemplateFieldFolderName = "folderName" - TemplateFieldIcon = "icon" - TemplateFieldIconFilename = "iconFilename" - TemplateFieldLabels = "labels" - TemplateFieldMaintainer = "maintainer" - TemplateFieldName = "name" - TemplateFieldOwnerReferences = "ownerReferences" - TemplateFieldPath = "path" - TemplateFieldProjectCatalogID = "projectCatalogId" - TemplateFieldProjectID = "projectId" - TemplateFieldProjectURL = "projectURL" - TemplateFieldReadme = "readme" - TemplateFieldRemoved = "removed" - TemplateFieldState = "state" - TemplateFieldStatus = "status" - TemplateFieldTransitioning = "transitioning" - TemplateFieldTransitioningMessage = "transitioningMessage" - TemplateFieldUUID = "uuid" - TemplateFieldUpgradeFrom = "upgradeFrom" - TemplateFieldVersionLinks = "versionLinks" - TemplateFieldVersions = "versions" -) - -type Template struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - CatalogID string `json:"catalogId,omitempty" yaml:"catalogId,omitempty"` - Categories []string `json:"categories,omitempty" yaml:"categories,omitempty"` - Category string `json:"category,omitempty" yaml:"category,omitempty"` - ClusterCatalogID string `json:"clusterCatalogId,omitempty" yaml:"clusterCatalogId,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - DefaultTemplateVersionID string `json:"defaultTemplateVersionId,omitempty" yaml:"defaultTemplateVersionId,omitempty"` - DefaultVersion string `json:"defaultVersion,omitempty" yaml:"defaultVersion,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - FolderName string `json:"folderName,omitempty" yaml:"folderName,omitempty"` - Icon string `json:"icon,omitempty" yaml:"icon,omitempty"` - IconFilename string `json:"iconFilename,omitempty" yaml:"iconFilename,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Maintainer string `json:"maintainer,omitempty" yaml:"maintainer,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - ProjectCatalogID string `json:"projectCatalogId,omitempty" yaml:"projectCatalogId,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - ProjectURL string `json:"projectURL,omitempty" yaml:"projectURL,omitempty"` - Readme string `json:"readme,omitempty" yaml:"readme,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *TemplateStatus `json:"status,omitempty" yaml:"status,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UpgradeFrom string `json:"upgradeFrom,omitempty" yaml:"upgradeFrom,omitempty"` - VersionLinks map[string]string `json:"versionLinks,omitempty" yaml:"versionLinks,omitempty"` - Versions []TemplateVersionSpec `json:"versions,omitempty" yaml:"versions,omitempty"` -} - -type TemplateCollection struct { - types.Collection - Data []Template `json:"data,omitempty"` - client *TemplateClient -} - -type TemplateClient struct { - apiClient *Client -} - -type TemplateOperations interface { - List(opts *types.ListOpts) (*TemplateCollection, error) - ListAll(opts *types.ListOpts) (*TemplateCollection, error) - Create(opts *Template) (*Template, error) - Update(existing *Template, updates interface{}) (*Template, error) - Replace(existing *Template) (*Template, error) - ByID(id string) (*Template, error) - Delete(container *Template) error -} - -func newTemplateClient(apiClient *Client) *TemplateClient { - return &TemplateClient{ - apiClient: apiClient, - } -} - -func (c *TemplateClient) Create(container *Template) (*Template, error) { - resp := &Template{} - err := c.apiClient.Ops.DoCreate(TemplateType, container, resp) - return resp, err -} - -func (c *TemplateClient) Update(existing *Template, updates interface{}) (*Template, error) { - resp := &Template{} - err := c.apiClient.Ops.DoUpdate(TemplateType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *TemplateClient) Replace(obj *Template) (*Template, error) { - resp := &Template{} - err := c.apiClient.Ops.DoReplace(TemplateType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *TemplateClient) List(opts *types.ListOpts) (*TemplateCollection, error) { - resp := &TemplateCollection{} - err := c.apiClient.Ops.DoList(TemplateType, opts, resp) - resp.client = c - return resp, err -} - -func (c *TemplateClient) ListAll(opts *types.ListOpts) (*TemplateCollection, error) { - resp := &TemplateCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *TemplateCollection) Next() (*TemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &TemplateCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *TemplateClient) ByID(id string) (*Template, error) { - resp := &Template{} - err := c.apiClient.Ops.DoByID(TemplateType, id, resp) - return resp, err -} - -func (c *TemplateClient) Delete(container *Template) error { - return c.apiClient.Ops.DoResourceDelete(TemplateType, &container.Resource) -} diff --git a/clients/rancher/generated/management/v3/zz_generated_template_content.go b/clients/rancher/generated/management/v3/zz_generated_template_content.go deleted file mode 100644 index 14061ba7..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_template_content.go +++ /dev/null @@ -1,120 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - TemplateContentType = "templateContent" - TemplateContentFieldAnnotations = "annotations" - TemplateContentFieldCreated = "created" - TemplateContentFieldCreatorID = "creatorId" - TemplateContentFieldData = "data" - TemplateContentFieldLabels = "labels" - TemplateContentFieldName = "name" - TemplateContentFieldOwnerReferences = "ownerReferences" - TemplateContentFieldRemoved = "removed" - TemplateContentFieldUUID = "uuid" -) - -type TemplateContent struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Data string `json:"data,omitempty" yaml:"data,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` -} - -type TemplateContentCollection struct { - types.Collection - Data []TemplateContent `json:"data,omitempty"` - client *TemplateContentClient -} - -type TemplateContentClient struct { - apiClient *Client -} - -type TemplateContentOperations interface { - List(opts *types.ListOpts) (*TemplateContentCollection, error) - ListAll(opts *types.ListOpts) (*TemplateContentCollection, error) - Create(opts *TemplateContent) (*TemplateContent, error) - Update(existing *TemplateContent, updates interface{}) (*TemplateContent, error) - Replace(existing *TemplateContent) (*TemplateContent, error) - ByID(id string) (*TemplateContent, error) - Delete(container *TemplateContent) error -} - -func newTemplateContentClient(apiClient *Client) *TemplateContentClient { - return &TemplateContentClient{ - apiClient: apiClient, - } -} - -func (c *TemplateContentClient) Create(container *TemplateContent) (*TemplateContent, error) { - resp := &TemplateContent{} - err := c.apiClient.Ops.DoCreate(TemplateContentType, container, resp) - return resp, err -} - -func (c *TemplateContentClient) Update(existing *TemplateContent, updates interface{}) (*TemplateContent, error) { - resp := &TemplateContent{} - err := c.apiClient.Ops.DoUpdate(TemplateContentType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *TemplateContentClient) Replace(obj *TemplateContent) (*TemplateContent, error) { - resp := &TemplateContent{} - err := c.apiClient.Ops.DoReplace(TemplateContentType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *TemplateContentClient) List(opts *types.ListOpts) (*TemplateContentCollection, error) { - resp := &TemplateContentCollection{} - err := c.apiClient.Ops.DoList(TemplateContentType, opts, resp) - resp.client = c - return resp, err -} - -func (c *TemplateContentClient) ListAll(opts *types.ListOpts) (*TemplateContentCollection, error) { - resp := &TemplateContentCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *TemplateContentCollection) Next() (*TemplateContentCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &TemplateContentCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *TemplateContentClient) ByID(id string) (*TemplateContent, error) { - resp := &TemplateContent{} - err := c.apiClient.Ops.DoByID(TemplateContentType, id, resp) - return resp, err -} - -func (c *TemplateContentClient) Delete(container *TemplateContent) error { - return c.apiClient.Ops.DoResourceDelete(TemplateContentType, &container.Resource) -} diff --git a/clients/rancher/generated/management/v3/zz_generated_template_spec.go b/clients/rancher/generated/management/v3/zz_generated_template_spec.go deleted file mode 100644 index dbce148a..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_template_spec.go +++ /dev/null @@ -1,48 +0,0 @@ -package client - -const ( - TemplateSpecType = "templateSpec" - TemplateSpecFieldCatalogID = "catalogId" - TemplateSpecFieldCategories = "categories" - TemplateSpecFieldCategory = "category" - TemplateSpecFieldClusterCatalogID = "clusterCatalogId" - TemplateSpecFieldClusterID = "clusterId" - TemplateSpecFieldDefaultTemplateVersionID = "defaultTemplateVersionId" - TemplateSpecFieldDefaultVersion = "defaultVersion" - TemplateSpecFieldDescription = "description" - TemplateSpecFieldDisplayName = "displayName" - TemplateSpecFieldFolderName = "folderName" - TemplateSpecFieldIcon = "icon" - TemplateSpecFieldIconFilename = "iconFilename" - TemplateSpecFieldMaintainer = "maintainer" - TemplateSpecFieldPath = "path" - TemplateSpecFieldProjectCatalogID = "projectCatalogId" - TemplateSpecFieldProjectID = "projectId" - TemplateSpecFieldProjectURL = "projectURL" - TemplateSpecFieldReadme = "readme" - TemplateSpecFieldUpgradeFrom = "upgradeFrom" - TemplateSpecFieldVersions = "versions" -) - -type TemplateSpec struct { - CatalogID string `json:"catalogId,omitempty" yaml:"catalogId,omitempty"` - Categories []string `json:"categories,omitempty" yaml:"categories,omitempty"` - Category string `json:"category,omitempty" yaml:"category,omitempty"` - ClusterCatalogID string `json:"clusterCatalogId,omitempty" yaml:"clusterCatalogId,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - DefaultTemplateVersionID string `json:"defaultTemplateVersionId,omitempty" yaml:"defaultTemplateVersionId,omitempty"` - DefaultVersion string `json:"defaultVersion,omitempty" yaml:"defaultVersion,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - FolderName string `json:"folderName,omitempty" yaml:"folderName,omitempty"` - Icon string `json:"icon,omitempty" yaml:"icon,omitempty"` - IconFilename string `json:"iconFilename,omitempty" yaml:"iconFilename,omitempty"` - Maintainer string `json:"maintainer,omitempty" yaml:"maintainer,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - ProjectCatalogID string `json:"projectCatalogId,omitempty" yaml:"projectCatalogId,omitempty"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - ProjectURL string `json:"projectURL,omitempty" yaml:"projectURL,omitempty"` - Readme string `json:"readme,omitempty" yaml:"readme,omitempty"` - UpgradeFrom string `json:"upgradeFrom,omitempty" yaml:"upgradeFrom,omitempty"` - Versions []TemplateVersionSpec `json:"versions,omitempty" yaml:"versions,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_template_status.go b/clients/rancher/generated/management/v3/zz_generated_template_status.go deleted file mode 100644 index 573947c5..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_template_status.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - TemplateStatusType = "templateStatus" - TemplateStatusFieldHelmVersion = "helmVersion" -) - -type TemplateStatus struct { - HelmVersion string `json:"helmVersion,omitempty" yaml:"helmVersion,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_template_version.go b/clients/rancher/generated/management/v3/zz_generated_template_version.go deleted file mode 100644 index f981e2c8..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_template_version.go +++ /dev/null @@ -1,158 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - TemplateVersionType = "templateVersion" - TemplateVersionFieldAnnotations = "annotations" - TemplateVersionFieldAppReadme = "appReadme" - TemplateVersionFieldCreated = "created" - TemplateVersionFieldCreatorID = "creatorId" - TemplateVersionFieldDigest = "digest" - TemplateVersionFieldExternalID = "externalId" - TemplateVersionFieldFiles = "files" - TemplateVersionFieldKubeVersion = "kubeVersion" - TemplateVersionFieldLabels = "labels" - TemplateVersionFieldName = "name" - TemplateVersionFieldOwnerReferences = "ownerReferences" - TemplateVersionFieldQuestions = "questions" - TemplateVersionFieldRancherMaxVersion = "rancherMaxVersion" - TemplateVersionFieldRancherMinVersion = "rancherMinVersion" - TemplateVersionFieldRancherVersion = "rancherVersion" - TemplateVersionFieldReadme = "readme" - TemplateVersionFieldRemoved = "removed" - TemplateVersionFieldRequiredNamespace = "requiredNamespace" - TemplateVersionFieldState = "state" - TemplateVersionFieldStatus = "status" - TemplateVersionFieldTransitioning = "transitioning" - TemplateVersionFieldTransitioningMessage = "transitioningMessage" - TemplateVersionFieldUUID = "uuid" - TemplateVersionFieldUpgradeVersionLinks = "upgradeVersionLinks" - TemplateVersionFieldVersion = "version" - TemplateVersionFieldVersionDir = "versionDir" - TemplateVersionFieldVersionName = "versionName" - TemplateVersionFieldVersionURLs = "versionUrls" -) - -type TemplateVersion struct { - types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - AppReadme string `json:"appReadme,omitempty" yaml:"appReadme,omitempty"` - Created string `json:"created,omitempty" yaml:"created,omitempty"` - CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` - Digest string `json:"digest,omitempty" yaml:"digest,omitempty"` - ExternalID string `json:"externalId,omitempty" yaml:"externalId,omitempty"` - Files map[string]string `json:"files,omitempty" yaml:"files,omitempty"` - KubeVersion string `json:"kubeVersion,omitempty" yaml:"kubeVersion,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Questions []Question `json:"questions,omitempty" yaml:"questions,omitempty"` - RancherMaxVersion string `json:"rancherMaxVersion,omitempty" yaml:"rancherMaxVersion,omitempty"` - RancherMinVersion string `json:"rancherMinVersion,omitempty" yaml:"rancherMinVersion,omitempty"` - RancherVersion string `json:"rancherVersion,omitempty" yaml:"rancherVersion,omitempty"` - Readme string `json:"readme,omitempty" yaml:"readme,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - RequiredNamespace string `json:"requiredNamespace,omitempty" yaml:"requiredNamespace,omitempty"` - State string `json:"state,omitempty" yaml:"state,omitempty"` - Status *TemplateVersionStatus `json:"status,omitempty" yaml:"status,omitempty"` - Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` - TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UpgradeVersionLinks map[string]string `json:"upgradeVersionLinks,omitempty" yaml:"upgradeVersionLinks,omitempty"` - Version string `json:"version,omitempty" yaml:"version,omitempty"` - VersionDir string `json:"versionDir,omitempty" yaml:"versionDir,omitempty"` - VersionName string `json:"versionName,omitempty" yaml:"versionName,omitempty"` - VersionURLs []string `json:"versionUrls,omitempty" yaml:"versionUrls,omitempty"` -} - -type TemplateVersionCollection struct { - types.Collection - Data []TemplateVersion `json:"data,omitempty"` - client *TemplateVersionClient -} - -type TemplateVersionClient struct { - apiClient *Client -} - -type TemplateVersionOperations interface { - List(opts *types.ListOpts) (*TemplateVersionCollection, error) - ListAll(opts *types.ListOpts) (*TemplateVersionCollection, error) - Create(opts *TemplateVersion) (*TemplateVersion, error) - Update(existing *TemplateVersion, updates interface{}) (*TemplateVersion, error) - Replace(existing *TemplateVersion) (*TemplateVersion, error) - ByID(id string) (*TemplateVersion, error) - Delete(container *TemplateVersion) error -} - -func newTemplateVersionClient(apiClient *Client) *TemplateVersionClient { - return &TemplateVersionClient{ - apiClient: apiClient, - } -} - -func (c *TemplateVersionClient) Create(container *TemplateVersion) (*TemplateVersion, error) { - resp := &TemplateVersion{} - err := c.apiClient.Ops.DoCreate(TemplateVersionType, container, resp) - return resp, err -} - -func (c *TemplateVersionClient) Update(existing *TemplateVersion, updates interface{}) (*TemplateVersion, error) { - resp := &TemplateVersion{} - err := c.apiClient.Ops.DoUpdate(TemplateVersionType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *TemplateVersionClient) Replace(obj *TemplateVersion) (*TemplateVersion, error) { - resp := &TemplateVersion{} - err := c.apiClient.Ops.DoReplace(TemplateVersionType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *TemplateVersionClient) List(opts *types.ListOpts) (*TemplateVersionCollection, error) { - resp := &TemplateVersionCollection{} - err := c.apiClient.Ops.DoList(TemplateVersionType, opts, resp) - resp.client = c - return resp, err -} - -func (c *TemplateVersionClient) ListAll(opts *types.ListOpts) (*TemplateVersionCollection, error) { - resp := &TemplateVersionCollection{} - resp, err := c.List(opts) - if err != nil { - return resp, err - } - data := resp.Data - for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() { - data = append(data, next.Data...) - resp = next - resp.Data = data - } - if err != nil { - return resp, err - } - return resp, err -} - -func (cc *TemplateVersionCollection) Next() (*TemplateVersionCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &TemplateVersionCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *TemplateVersionClient) ByID(id string) (*TemplateVersion, error) { - resp := &TemplateVersion{} - err := c.apiClient.Ops.DoByID(TemplateVersionType, id, resp) - return resp, err -} - -func (c *TemplateVersionClient) Delete(container *TemplateVersion) error { - return c.apiClient.Ops.DoResourceDelete(TemplateVersionType, &container.Resource) -} diff --git a/clients/rancher/generated/management/v3/zz_generated_template_version_spec.go b/clients/rancher/generated/management/v3/zz_generated_template_version_spec.go deleted file mode 100644 index ba9dd9fe..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_template_version_spec.go +++ /dev/null @@ -1,40 +0,0 @@ -package client - -const ( - TemplateVersionSpecType = "templateVersionSpec" - TemplateVersionSpecFieldAppReadme = "appReadme" - TemplateVersionSpecFieldDigest = "digest" - TemplateVersionSpecFieldExternalID = "externalId" - TemplateVersionSpecFieldFiles = "files" - TemplateVersionSpecFieldKubeVersion = "kubeVersion" - TemplateVersionSpecFieldQuestions = "questions" - TemplateVersionSpecFieldRancherMaxVersion = "rancherMaxVersion" - TemplateVersionSpecFieldRancherMinVersion = "rancherMinVersion" - TemplateVersionSpecFieldRancherVersion = "rancherVersion" - TemplateVersionSpecFieldReadme = "readme" - TemplateVersionSpecFieldRequiredNamespace = "requiredNamespace" - TemplateVersionSpecFieldUpgradeVersionLinks = "upgradeVersionLinks" - TemplateVersionSpecFieldVersion = "version" - TemplateVersionSpecFieldVersionDir = "versionDir" - TemplateVersionSpecFieldVersionName = "versionName" - TemplateVersionSpecFieldVersionURLs = "versionUrls" -) - -type TemplateVersionSpec struct { - AppReadme string `json:"appReadme,omitempty" yaml:"appReadme,omitempty"` - Digest string `json:"digest,omitempty" yaml:"digest,omitempty"` - ExternalID string `json:"externalId,omitempty" yaml:"externalId,omitempty"` - Files map[string]string `json:"files,omitempty" yaml:"files,omitempty"` - KubeVersion string `json:"kubeVersion,omitempty" yaml:"kubeVersion,omitempty"` - Questions []Question `json:"questions,omitempty" yaml:"questions,omitempty"` - RancherMaxVersion string `json:"rancherMaxVersion,omitempty" yaml:"rancherMaxVersion,omitempty"` - RancherMinVersion string `json:"rancherMinVersion,omitempty" yaml:"rancherMinVersion,omitempty"` - RancherVersion string `json:"rancherVersion,omitempty" yaml:"rancherVersion,omitempty"` - Readme string `json:"readme,omitempty" yaml:"readme,omitempty"` - RequiredNamespace string `json:"requiredNamespace,omitempty" yaml:"requiredNamespace,omitempty"` - UpgradeVersionLinks map[string]string `json:"upgradeVersionLinks,omitempty" yaml:"upgradeVersionLinks,omitempty"` - Version string `json:"version,omitempty" yaml:"version,omitempty"` - VersionDir string `json:"versionDir,omitempty" yaml:"versionDir,omitempty"` - VersionName string `json:"versionName,omitempty" yaml:"versionName,omitempty"` - VersionURLs []string `json:"versionUrls,omitempty" yaml:"versionUrls,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_template_version_status.go b/clients/rancher/generated/management/v3/zz_generated_template_version_status.go deleted file mode 100644 index ea736ff6..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_template_version_status.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - TemplateVersionStatusType = "templateVersionStatus" - TemplateVersionStatusFieldHelmVersion = "helmVersion" -) - -type TemplateVersionStatus struct { - HelmVersion string `json:"helmVersion,omitempty" yaml:"helmVersion,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_update_multi_cluster_app_targets_input.go b/clients/rancher/generated/management/v3/zz_generated_update_multi_cluster_app_targets_input.go deleted file mode 100644 index 8ccaf6a1..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_update_multi_cluster_app_targets_input.go +++ /dev/null @@ -1,12 +0,0 @@ -package client - -const ( - UpdateMultiClusterAppTargetsInputType = "updateMultiClusterAppTargetsInput" - UpdateMultiClusterAppTargetsInputFieldAnswers = "answers" - UpdateMultiClusterAppTargetsInputFieldProjects = "projects" -) - -type UpdateMultiClusterAppTargetsInput struct { - Answers []Answer `json:"answers,omitempty" yaml:"answers,omitempty"` - Projects []string `json:"projects,omitempty" yaml:"projects,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_upgrade_strategy.go b/clients/rancher/generated/management/v3/zz_generated_upgrade_strategy.go deleted file mode 100644 index 1bd375c9..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_upgrade_strategy.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - UpgradeStrategyType = "upgradeStrategy" - UpgradeStrategyFieldRollingUpdate = "rollingUpdate" -) - -type UpgradeStrategy struct { - RollingUpdate *RollingUpdate `json:"rollingUpdate,omitempty" yaml:"rollingUpdate,omitempty"` -} diff --git a/clients/rancher/generated/management/v3/zz_generated_version_commits.go b/clients/rancher/generated/management/v3/zz_generated_version_commits.go deleted file mode 100644 index 493b1e1e..00000000 --- a/clients/rancher/generated/management/v3/zz_generated_version_commits.go +++ /dev/null @@ -1,10 +0,0 @@ -package client - -const ( - VersionCommitsType = "versionCommits" - VersionCommitsFieldValue = "Value" -) - -type VersionCommits struct { - Value map[string]string `json:"Value,omitempty" yaml:"Value,omitempty"` -} diff --git a/go.mod b/go.mod index 774fa578..65ccc644 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,8 @@ toolchain go1.22.7 replace ( github.com/docker/distribution => github.com/docker/distribution v2.8.2+incompatible // rancher-machine requires a replace is set + // Temporary. will be removed shortly + github.com/rancher/rancher/pkg/apis => github.com/rohitsakala/rancher/pkg/apis v0.0.0-20241126182546-542381f93109 k8s.io/api => k8s.io/api v0.31.1 k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.31.1 k8s.io/apimachinery => k8s.io/apimachinery v0.31.1 diff --git a/go.sum b/go.sum index ea277c8d..8f0c5a90 100644 --- a/go.sum +++ b/go.sum @@ -2361,8 +2361,6 @@ github.com/rancher/lasso v0.0.0-20240924233157-8f384efc8813 h1:V/LY8pUHZG9Kc+xED github.com/rancher/lasso v0.0.0-20240924233157-8f384efc8813/go.mod h1:IxgTBO55lziYhTEETyVKiT8/B5Rg92qYiRmcIIYoPgI= github.com/rancher/norman v0.0.0-20241001183610-78a520c160ab h1:ihK6See3y/JilqZlc0CG7NXPN+ue5nY9U7xUZUA8M7I= github.com/rancher/norman v0.0.0-20241001183610-78a520c160ab/go.mod h1:qX/OG/4wY27xSAcSdRilUBxBumV6Ey2CWpAeaKnBQDs= -github.com/rancher/rancher/pkg/apis v0.0.0-20241113133627-598640d1556c h1:wgRohofDe45lOK4nmA7AboPkl1AlTJgp97kQ/0nDsg8= -github.com/rancher/rancher/pkg/apis v0.0.0-20241113133627-598640d1556c/go.mod h1:VJQNArsPMiuWlvlnfGbD5gZtGvttnsEJSbrLsHfBtuA= github.com/rancher/rke v1.7.0-rc.5 h1:kBRwXTW8CYPXvCcPLISiwGTCvJ8K/+b35D5ES0IcduM= github.com/rancher/rke v1.7.0-rc.5/go.mod h1:+x++Mvl0A3jIzNLiu8nkraqZXiHg6VPWv0Xl4iQCg+A= github.com/rancher/system-upgrade-controller/pkg/apis v0.0.0-20210727200656-10b094e30007 h1:ru+mqGnxMmKeU0Q3XIDxkARvInDIqT1hH2amTcsjxI4= @@ -2382,6 +2380,8 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rohitsakala/rancher/pkg/apis v0.0.0-20241126182546-542381f93109 h1:94VisPo5yIpQoeqcrUwN0TsJKgRas9a8GDKjcuwODRg= +github.com/rohitsakala/rancher/pkg/apis v0.0.0-20241126182546-542381f93109/go.mod h1:VJQNArsPMiuWlvlnfGbD5gZtGvttnsEJSbrLsHfBtuA= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= diff --git a/pkg/codegen/main.go b/pkg/codegen/main.go index 5f6c42c4..be22a6bd 100644 --- a/pkg/codegen/main.go +++ b/pkg/codegen/main.go @@ -17,7 +17,6 @@ import ( fleet "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1" "github.com/rancher/norman/types" catalogv1 "github.com/rancher/rancher/pkg/apis/catalog.cattle.io/v1" - managementv3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" provisioningv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" "github.com/rancher/shepherd/pkg/codegen/generator" @@ -84,8 +83,6 @@ func main() { Types: []interface{}{ // All structs with an embedded ObjectMeta field will be picked up "./vendor/github.com/rancher/rancher/pkg/apis/management.cattle.io/v3", - managementv3.ProjectCatalog{}, - managementv3.ClusterCatalog{}, }, }, "catalog.cattle.io": { diff --git a/pkg/generated/controllers/management.cattle.io/v3/catalog.go b/pkg/generated/controllers/management.cattle.io/v3/catalog.go deleted file mode 100644 index 2411c18d..00000000 --- a/pkg/generated/controllers/management.cattle.io/v3/catalog.go +++ /dev/null @@ -1,208 +0,0 @@ -/* -Copyright 2024 Rancher Labs, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package v3 - -import ( - "context" - "sync" - "time" - - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/shepherd/pkg/wrangler/pkg/generic" - "github.com/rancher/wrangler/v3/pkg/apply" - "github.com/rancher/wrangler/v3/pkg/condition" - "github.com/rancher/wrangler/v3/pkg/kv" - "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// CatalogController interface for managing Catalog resources. -type CatalogController interface { - generic.NonNamespacedControllerInterface[*v3.Catalog, *v3.CatalogList] -} - -// CatalogClient interface for managing Catalog resources in Kubernetes. -type CatalogClient interface { - generic.NonNamespacedClientInterface[*v3.Catalog, *v3.CatalogList] -} - -// CatalogCache interface for retrieving Catalog resources in memory. -type CatalogCache interface { - generic.NonNamespacedCacheInterface[*v3.Catalog] -} - -// CatalogStatusHandler is executed for every added or modified Catalog. Should return the new status to be updated -type CatalogStatusHandler func(obj *v3.Catalog, status v3.CatalogStatus) (v3.CatalogStatus, error) - -// CatalogGeneratingHandler is the top-level handler that is executed for every Catalog event. It extends CatalogStatusHandler by a returning a slice of child objects to be passed to apply.Apply -type CatalogGeneratingHandler func(obj *v3.Catalog, status v3.CatalogStatus) ([]runtime.Object, v3.CatalogStatus, error) - -// RegisterCatalogStatusHandler configures a CatalogController to execute a CatalogStatusHandler for every events observed. -// If a non-empty condition is provided, it will be updated in the status conditions for every handler execution -func RegisterCatalogStatusHandler(ctx context.Context, controller CatalogController, condition condition.Cond, name string, handler CatalogStatusHandler) { - statusHandler := &catalogStatusHandler{ - client: controller, - condition: condition, - handler: handler, - } - controller.AddGenericHandler(ctx, name, generic.FromObjectHandlerToHandler(statusHandler.sync)) -} - -// RegisterCatalogGeneratingHandler configures a CatalogController to execute a CatalogGeneratingHandler for every events observed, passing the returned objects to the provided apply.Apply. -// If a non-empty condition is provided, it will be updated in the status conditions for every handler execution -func RegisterCatalogGeneratingHandler(ctx context.Context, controller CatalogController, apply apply.Apply, - condition condition.Cond, name string, handler CatalogGeneratingHandler, opts *generic.GeneratingHandlerOptions) { - statusHandler := &catalogGeneratingHandler{ - CatalogGeneratingHandler: handler, - apply: apply, - name: name, - gvk: controller.GroupVersionKind(), - } - if opts != nil { - statusHandler.opts = *opts - } - controller.OnChange(ctx, name, statusHandler.Remove) - RegisterCatalogStatusHandler(ctx, controller, condition, name, statusHandler.Handle) -} - -type catalogStatusHandler struct { - client CatalogClient - condition condition.Cond - handler CatalogStatusHandler -} - -// sync is executed on every resource addition or modification. Executes the configured handlers and sends the updated status to the Kubernetes API -func (a *catalogStatusHandler) sync(key string, obj *v3.Catalog) (*v3.Catalog, error) { - if obj == nil { - return obj, nil - } - - origStatus := obj.Status.DeepCopy() - obj = obj.DeepCopy() - newStatus, err := a.handler(obj, obj.Status) - if err != nil { - // Revert to old status on error - newStatus = *origStatus.DeepCopy() - } - - if a.condition != "" { - if errors.IsConflict(err) { - a.condition.SetError(&newStatus, "", nil) - } else { - a.condition.SetError(&newStatus, "", err) - } - } - if !equality.Semantic.DeepEqual(origStatus, &newStatus) { - if a.condition != "" { - // Since status has changed, update the lastUpdatedTime - a.condition.LastUpdated(&newStatus, time.Now().UTC().Format(time.RFC3339)) - } - - var newErr error - obj.Status = newStatus - newObj, newErr := a.client.UpdateStatus(obj) - if err == nil { - err = newErr - } - if newErr == nil { - obj = newObj - } - } - return obj, err -} - -type catalogGeneratingHandler struct { - CatalogGeneratingHandler - apply apply.Apply - opts generic.GeneratingHandlerOptions - gvk schema.GroupVersionKind - name string - seen sync.Map -} - -// Remove handles the observed deletion of a resource, cascade deleting every associated resource previously applied -func (a *catalogGeneratingHandler) Remove(key string, obj *v3.Catalog) (*v3.Catalog, error) { - if obj != nil { - return obj, nil - } - - obj = &v3.Catalog{} - obj.Namespace, obj.Name = kv.RSplit(key, "/") - obj.SetGroupVersionKind(a.gvk) - - if a.opts.UniqueApplyForResourceVersion { - a.seen.Delete(key) - } - - return nil, generic.ConfigureApplyForObject(a.apply, obj, &a.opts). - WithOwner(obj). - WithSetID(a.name). - ApplyObjects() -} - -// Handle executes the configured CatalogGeneratingHandler and pass the resulting objects to apply.Apply, finally returning the new status of the resource -func (a *catalogGeneratingHandler) Handle(obj *v3.Catalog, status v3.CatalogStatus) (v3.CatalogStatus, error) { - if !obj.DeletionTimestamp.IsZero() { - return status, nil - } - - objs, newStatus, err := a.CatalogGeneratingHandler(obj, status) - if err != nil { - return newStatus, err - } - if !a.isNewResourceVersion(obj) { - return newStatus, nil - } - - err = generic.ConfigureApplyForObject(a.apply, obj, &a.opts). - WithOwner(obj). - WithSetID(a.name). - ApplyObjects(objs...) - if err != nil { - return newStatus, err - } - a.storeResourceVersion(obj) - return newStatus, nil -} - -// isNewResourceVersion detects if a specific resource version was already successfully processed. -// Only used if UniqueApplyForResourceVersion is set in generic.GeneratingHandlerOptions -func (a *catalogGeneratingHandler) isNewResourceVersion(obj *v3.Catalog) bool { - if !a.opts.UniqueApplyForResourceVersion { - return true - } - - // Apply once per resource version - key := obj.Namespace + "/" + obj.Name - previous, ok := a.seen.Load(key) - return !ok || previous != obj.ResourceVersion -} - -// storeResourceVersion keeps track of the latest resource version of an object for which Apply was executed -// Only used if UniqueApplyForResourceVersion is set in generic.GeneratingHandlerOptions -func (a *catalogGeneratingHandler) storeResourceVersion(obj *v3.Catalog) { - if !a.opts.UniqueApplyForResourceVersion { - return - } - - key := obj.Namespace + "/" + obj.Name - a.seen.Store(key, obj.ResourceVersion) -} diff --git a/pkg/generated/controllers/management.cattle.io/v3/catalogtemplate.go b/pkg/generated/controllers/management.cattle.io/v3/catalogtemplate.go deleted file mode 100644 index 242badad..00000000 --- a/pkg/generated/controllers/management.cattle.io/v3/catalogtemplate.go +++ /dev/null @@ -1,208 +0,0 @@ -/* -Copyright 2024 Rancher Labs, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package v3 - -import ( - "context" - "sync" - "time" - - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/shepherd/pkg/wrangler/pkg/generic" - "github.com/rancher/wrangler/v3/pkg/apply" - "github.com/rancher/wrangler/v3/pkg/condition" - "github.com/rancher/wrangler/v3/pkg/kv" - "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// CatalogTemplateController interface for managing CatalogTemplate resources. -type CatalogTemplateController interface { - generic.ControllerInterface[*v3.CatalogTemplate, *v3.CatalogTemplateList] -} - -// CatalogTemplateClient interface for managing CatalogTemplate resources in Kubernetes. -type CatalogTemplateClient interface { - generic.ClientInterface[*v3.CatalogTemplate, *v3.CatalogTemplateList] -} - -// CatalogTemplateCache interface for retrieving CatalogTemplate resources in memory. -type CatalogTemplateCache interface { - generic.CacheInterface[*v3.CatalogTemplate] -} - -// CatalogTemplateStatusHandler is executed for every added or modified CatalogTemplate. Should return the new status to be updated -type CatalogTemplateStatusHandler func(obj *v3.CatalogTemplate, status v3.TemplateStatus) (v3.TemplateStatus, error) - -// CatalogTemplateGeneratingHandler is the top-level handler that is executed for every CatalogTemplate event. It extends CatalogTemplateStatusHandler by a returning a slice of child objects to be passed to apply.Apply -type CatalogTemplateGeneratingHandler func(obj *v3.CatalogTemplate, status v3.TemplateStatus) ([]runtime.Object, v3.TemplateStatus, error) - -// RegisterCatalogTemplateStatusHandler configures a CatalogTemplateController to execute a CatalogTemplateStatusHandler for every events observed. -// If a non-empty condition is provided, it will be updated in the status conditions for every handler execution -func RegisterCatalogTemplateStatusHandler(ctx context.Context, controller CatalogTemplateController, condition condition.Cond, name string, handler CatalogTemplateStatusHandler) { - statusHandler := &catalogTemplateStatusHandler{ - client: controller, - condition: condition, - handler: handler, - } - controller.AddGenericHandler(ctx, name, generic.FromObjectHandlerToHandler(statusHandler.sync)) -} - -// RegisterCatalogTemplateGeneratingHandler configures a CatalogTemplateController to execute a CatalogTemplateGeneratingHandler for every events observed, passing the returned objects to the provided apply.Apply. -// If a non-empty condition is provided, it will be updated in the status conditions for every handler execution -func RegisterCatalogTemplateGeneratingHandler(ctx context.Context, controller CatalogTemplateController, apply apply.Apply, - condition condition.Cond, name string, handler CatalogTemplateGeneratingHandler, opts *generic.GeneratingHandlerOptions) { - statusHandler := &catalogTemplateGeneratingHandler{ - CatalogTemplateGeneratingHandler: handler, - apply: apply, - name: name, - gvk: controller.GroupVersionKind(), - } - if opts != nil { - statusHandler.opts = *opts - } - controller.OnChange(ctx, name, statusHandler.Remove) - RegisterCatalogTemplateStatusHandler(ctx, controller, condition, name, statusHandler.Handle) -} - -type catalogTemplateStatusHandler struct { - client CatalogTemplateClient - condition condition.Cond - handler CatalogTemplateStatusHandler -} - -// sync is executed on every resource addition or modification. Executes the configured handlers and sends the updated status to the Kubernetes API -func (a *catalogTemplateStatusHandler) sync(key string, obj *v3.CatalogTemplate) (*v3.CatalogTemplate, error) { - if obj == nil { - return obj, nil - } - - origStatus := obj.Status.DeepCopy() - obj = obj.DeepCopy() - newStatus, err := a.handler(obj, obj.Status) - if err != nil { - // Revert to old status on error - newStatus = *origStatus.DeepCopy() - } - - if a.condition != "" { - if errors.IsConflict(err) { - a.condition.SetError(&newStatus, "", nil) - } else { - a.condition.SetError(&newStatus, "", err) - } - } - if !equality.Semantic.DeepEqual(origStatus, &newStatus) { - if a.condition != "" { - // Since status has changed, update the lastUpdatedTime - a.condition.LastUpdated(&newStatus, time.Now().UTC().Format(time.RFC3339)) - } - - var newErr error - obj.Status = newStatus - newObj, newErr := a.client.UpdateStatus(obj) - if err == nil { - err = newErr - } - if newErr == nil { - obj = newObj - } - } - return obj, err -} - -type catalogTemplateGeneratingHandler struct { - CatalogTemplateGeneratingHandler - apply apply.Apply - opts generic.GeneratingHandlerOptions - gvk schema.GroupVersionKind - name string - seen sync.Map -} - -// Remove handles the observed deletion of a resource, cascade deleting every associated resource previously applied -func (a *catalogTemplateGeneratingHandler) Remove(key string, obj *v3.CatalogTemplate) (*v3.CatalogTemplate, error) { - if obj != nil { - return obj, nil - } - - obj = &v3.CatalogTemplate{} - obj.Namespace, obj.Name = kv.RSplit(key, "/") - obj.SetGroupVersionKind(a.gvk) - - if a.opts.UniqueApplyForResourceVersion { - a.seen.Delete(key) - } - - return nil, generic.ConfigureApplyForObject(a.apply, obj, &a.opts). - WithOwner(obj). - WithSetID(a.name). - ApplyObjects() -} - -// Handle executes the configured CatalogTemplateGeneratingHandler and pass the resulting objects to apply.Apply, finally returning the new status of the resource -func (a *catalogTemplateGeneratingHandler) Handle(obj *v3.CatalogTemplate, status v3.TemplateStatus) (v3.TemplateStatus, error) { - if !obj.DeletionTimestamp.IsZero() { - return status, nil - } - - objs, newStatus, err := a.CatalogTemplateGeneratingHandler(obj, status) - if err != nil { - return newStatus, err - } - if !a.isNewResourceVersion(obj) { - return newStatus, nil - } - - err = generic.ConfigureApplyForObject(a.apply, obj, &a.opts). - WithOwner(obj). - WithSetID(a.name). - ApplyObjects(objs...) - if err != nil { - return newStatus, err - } - a.storeResourceVersion(obj) - return newStatus, nil -} - -// isNewResourceVersion detects if a specific resource version was already successfully processed. -// Only used if UniqueApplyForResourceVersion is set in generic.GeneratingHandlerOptions -func (a *catalogTemplateGeneratingHandler) isNewResourceVersion(obj *v3.CatalogTemplate) bool { - if !a.opts.UniqueApplyForResourceVersion { - return true - } - - // Apply once per resource version - key := obj.Namespace + "/" + obj.Name - previous, ok := a.seen.Load(key) - return !ok || previous != obj.ResourceVersion -} - -// storeResourceVersion keeps track of the latest resource version of an object for which Apply was executed -// Only used if UniqueApplyForResourceVersion is set in generic.GeneratingHandlerOptions -func (a *catalogTemplateGeneratingHandler) storeResourceVersion(obj *v3.CatalogTemplate) { - if !a.opts.UniqueApplyForResourceVersion { - return - } - - key := obj.Namespace + "/" + obj.Name - a.seen.Store(key, obj.ResourceVersion) -} diff --git a/pkg/generated/controllers/management.cattle.io/v3/catalogtemplateversion.go b/pkg/generated/controllers/management.cattle.io/v3/catalogtemplateversion.go deleted file mode 100644 index 62f31d74..00000000 --- a/pkg/generated/controllers/management.cattle.io/v3/catalogtemplateversion.go +++ /dev/null @@ -1,208 +0,0 @@ -/* -Copyright 2024 Rancher Labs, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package v3 - -import ( - "context" - "sync" - "time" - - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/shepherd/pkg/wrangler/pkg/generic" - "github.com/rancher/wrangler/v3/pkg/apply" - "github.com/rancher/wrangler/v3/pkg/condition" - "github.com/rancher/wrangler/v3/pkg/kv" - "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// CatalogTemplateVersionController interface for managing CatalogTemplateVersion resources. -type CatalogTemplateVersionController interface { - generic.ControllerInterface[*v3.CatalogTemplateVersion, *v3.CatalogTemplateVersionList] -} - -// CatalogTemplateVersionClient interface for managing CatalogTemplateVersion resources in Kubernetes. -type CatalogTemplateVersionClient interface { - generic.ClientInterface[*v3.CatalogTemplateVersion, *v3.CatalogTemplateVersionList] -} - -// CatalogTemplateVersionCache interface for retrieving CatalogTemplateVersion resources in memory. -type CatalogTemplateVersionCache interface { - generic.CacheInterface[*v3.CatalogTemplateVersion] -} - -// CatalogTemplateVersionStatusHandler is executed for every added or modified CatalogTemplateVersion. Should return the new status to be updated -type CatalogTemplateVersionStatusHandler func(obj *v3.CatalogTemplateVersion, status v3.TemplateVersionStatus) (v3.TemplateVersionStatus, error) - -// CatalogTemplateVersionGeneratingHandler is the top-level handler that is executed for every CatalogTemplateVersion event. It extends CatalogTemplateVersionStatusHandler by a returning a slice of child objects to be passed to apply.Apply -type CatalogTemplateVersionGeneratingHandler func(obj *v3.CatalogTemplateVersion, status v3.TemplateVersionStatus) ([]runtime.Object, v3.TemplateVersionStatus, error) - -// RegisterCatalogTemplateVersionStatusHandler configures a CatalogTemplateVersionController to execute a CatalogTemplateVersionStatusHandler for every events observed. -// If a non-empty condition is provided, it will be updated in the status conditions for every handler execution -func RegisterCatalogTemplateVersionStatusHandler(ctx context.Context, controller CatalogTemplateVersionController, condition condition.Cond, name string, handler CatalogTemplateVersionStatusHandler) { - statusHandler := &catalogTemplateVersionStatusHandler{ - client: controller, - condition: condition, - handler: handler, - } - controller.AddGenericHandler(ctx, name, generic.FromObjectHandlerToHandler(statusHandler.sync)) -} - -// RegisterCatalogTemplateVersionGeneratingHandler configures a CatalogTemplateVersionController to execute a CatalogTemplateVersionGeneratingHandler for every events observed, passing the returned objects to the provided apply.Apply. -// If a non-empty condition is provided, it will be updated in the status conditions for every handler execution -func RegisterCatalogTemplateVersionGeneratingHandler(ctx context.Context, controller CatalogTemplateVersionController, apply apply.Apply, - condition condition.Cond, name string, handler CatalogTemplateVersionGeneratingHandler, opts *generic.GeneratingHandlerOptions) { - statusHandler := &catalogTemplateVersionGeneratingHandler{ - CatalogTemplateVersionGeneratingHandler: handler, - apply: apply, - name: name, - gvk: controller.GroupVersionKind(), - } - if opts != nil { - statusHandler.opts = *opts - } - controller.OnChange(ctx, name, statusHandler.Remove) - RegisterCatalogTemplateVersionStatusHandler(ctx, controller, condition, name, statusHandler.Handle) -} - -type catalogTemplateVersionStatusHandler struct { - client CatalogTemplateVersionClient - condition condition.Cond - handler CatalogTemplateVersionStatusHandler -} - -// sync is executed on every resource addition or modification. Executes the configured handlers and sends the updated status to the Kubernetes API -func (a *catalogTemplateVersionStatusHandler) sync(key string, obj *v3.CatalogTemplateVersion) (*v3.CatalogTemplateVersion, error) { - if obj == nil { - return obj, nil - } - - origStatus := obj.Status.DeepCopy() - obj = obj.DeepCopy() - newStatus, err := a.handler(obj, obj.Status) - if err != nil { - // Revert to old status on error - newStatus = *origStatus.DeepCopy() - } - - if a.condition != "" { - if errors.IsConflict(err) { - a.condition.SetError(&newStatus, "", nil) - } else { - a.condition.SetError(&newStatus, "", err) - } - } - if !equality.Semantic.DeepEqual(origStatus, &newStatus) { - if a.condition != "" { - // Since status has changed, update the lastUpdatedTime - a.condition.LastUpdated(&newStatus, time.Now().UTC().Format(time.RFC3339)) - } - - var newErr error - obj.Status = newStatus - newObj, newErr := a.client.UpdateStatus(obj) - if err == nil { - err = newErr - } - if newErr == nil { - obj = newObj - } - } - return obj, err -} - -type catalogTemplateVersionGeneratingHandler struct { - CatalogTemplateVersionGeneratingHandler - apply apply.Apply - opts generic.GeneratingHandlerOptions - gvk schema.GroupVersionKind - name string - seen sync.Map -} - -// Remove handles the observed deletion of a resource, cascade deleting every associated resource previously applied -func (a *catalogTemplateVersionGeneratingHandler) Remove(key string, obj *v3.CatalogTemplateVersion) (*v3.CatalogTemplateVersion, error) { - if obj != nil { - return obj, nil - } - - obj = &v3.CatalogTemplateVersion{} - obj.Namespace, obj.Name = kv.RSplit(key, "/") - obj.SetGroupVersionKind(a.gvk) - - if a.opts.UniqueApplyForResourceVersion { - a.seen.Delete(key) - } - - return nil, generic.ConfigureApplyForObject(a.apply, obj, &a.opts). - WithOwner(obj). - WithSetID(a.name). - ApplyObjects() -} - -// Handle executes the configured CatalogTemplateVersionGeneratingHandler and pass the resulting objects to apply.Apply, finally returning the new status of the resource -func (a *catalogTemplateVersionGeneratingHandler) Handle(obj *v3.CatalogTemplateVersion, status v3.TemplateVersionStatus) (v3.TemplateVersionStatus, error) { - if !obj.DeletionTimestamp.IsZero() { - return status, nil - } - - objs, newStatus, err := a.CatalogTemplateVersionGeneratingHandler(obj, status) - if err != nil { - return newStatus, err - } - if !a.isNewResourceVersion(obj) { - return newStatus, nil - } - - err = generic.ConfigureApplyForObject(a.apply, obj, &a.opts). - WithOwner(obj). - WithSetID(a.name). - ApplyObjects(objs...) - if err != nil { - return newStatus, err - } - a.storeResourceVersion(obj) - return newStatus, nil -} - -// isNewResourceVersion detects if a specific resource version was already successfully processed. -// Only used if UniqueApplyForResourceVersion is set in generic.GeneratingHandlerOptions -func (a *catalogTemplateVersionGeneratingHandler) isNewResourceVersion(obj *v3.CatalogTemplateVersion) bool { - if !a.opts.UniqueApplyForResourceVersion { - return true - } - - // Apply once per resource version - key := obj.Namespace + "/" + obj.Name - previous, ok := a.seen.Load(key) - return !ok || previous != obj.ResourceVersion -} - -// storeResourceVersion keeps track of the latest resource version of an object for which Apply was executed -// Only used if UniqueApplyForResourceVersion is set in generic.GeneratingHandlerOptions -func (a *catalogTemplateVersionGeneratingHandler) storeResourceVersion(obj *v3.CatalogTemplateVersion) { - if !a.opts.UniqueApplyForResourceVersion { - return - } - - key := obj.Namespace + "/" + obj.Name - a.seen.Store(key, obj.ResourceVersion) -} diff --git a/pkg/generated/controllers/management.cattle.io/v3/clustercatalog.go b/pkg/generated/controllers/management.cattle.io/v3/clustercatalog.go deleted file mode 100644 index 88a2734d..00000000 --- a/pkg/generated/controllers/management.cattle.io/v3/clustercatalog.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2024 Rancher Labs, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package v3 - -import ( - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/shepherd/pkg/wrangler/pkg/generic" -) - -// ClusterCatalogController interface for managing ClusterCatalog resources. -type ClusterCatalogController interface { - generic.ControllerInterface[*v3.ClusterCatalog, *v3.ClusterCatalogList] -} - -// ClusterCatalogClient interface for managing ClusterCatalog resources in Kubernetes. -type ClusterCatalogClient interface { - generic.ClientInterface[*v3.ClusterCatalog, *v3.ClusterCatalogList] -} - -// ClusterCatalogCache interface for retrieving ClusterCatalog resources in memory. -type ClusterCatalogCache interface { - generic.CacheInterface[*v3.ClusterCatalog] -} diff --git a/pkg/generated/controllers/management.cattle.io/v3/interface.go b/pkg/generated/controllers/management.cattle.io/v3/interface.go index 66ff8fc3..5c7e37b5 100644 --- a/pkg/generated/controllers/management.cattle.io/v3/interface.go +++ b/pkg/generated/controllers/management.cattle.io/v3/interface.go @@ -38,12 +38,8 @@ type Interface interface { AuthProvider() AuthProviderController AuthToken() AuthTokenController AzureADProvider() AzureADProviderController - Catalog() CatalogController - CatalogTemplate() CatalogTemplateController - CatalogTemplateVersion() CatalogTemplateVersionController CloudCredential() CloudCredentialController Cluster() ClusterController - ClusterCatalog() ClusterCatalogController ClusterProxyConfig() ClusterProxyConfigController ClusterRegistrationToken() ClusterRegistrationTokenController ClusterRoleTemplateBinding() ClusterRoleTemplateBindingController @@ -65,8 +61,6 @@ type Interface interface { KontainerDriver() KontainerDriverController LocalProvider() LocalProviderController ManagedChart() ManagedChartController - MultiClusterApp() MultiClusterAppController - MultiClusterAppRevision() MultiClusterAppRevisionController Node() NodeController NodeDriver() NodeDriverController NodePool() NodePoolController @@ -77,20 +71,13 @@ type Interface interface { Preference() PreferenceController Principal() PrincipalController Project() ProjectController - ProjectCatalog() ProjectCatalogController ProjectNetworkPolicy() ProjectNetworkPolicyController - ProjectRoleTemplateBinding() ProjectRoleTemplateBindingController - RancherUserNotification() RancherUserNotificationController - RkeAddon() RkeAddonController RkeK8sServiceOption() RkeK8sServiceOptionController RkeK8sSystemImage() RkeK8sSystemImageController RoleTemplate() RoleTemplateController SamlProvider() SamlProviderController SamlToken() SamlTokenController Setting() SettingController - Template() TemplateController - TemplateContent() TemplateContentController - TemplateVersion() TemplateVersionController Token() TokenController User() UserController UserAttribute() UserAttributeController @@ -132,18 +119,6 @@ func (v *version) AzureADProvider() AzureADProviderController { return generic.NewNonNamespacedController[*v3.AzureADProvider, *v3.AzureADProviderList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "AzureADProvider"}, "azureadproviders", v.controllerFactory, v.ts) } -func (v *version) Catalog() CatalogController { - return generic.NewNonNamespacedController[*v3.Catalog, *v3.CatalogList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Catalog"}, "catalogs", v.controllerFactory, v.ts) -} - -func (v *version) CatalogTemplate() CatalogTemplateController { - return generic.NewController[*v3.CatalogTemplate, *v3.CatalogTemplateList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "CatalogTemplate"}, "catalogtemplates", true, v.controllerFactory, v.ts) -} - -func (v *version) CatalogTemplateVersion() CatalogTemplateVersionController { - return generic.NewController[*v3.CatalogTemplateVersion, *v3.CatalogTemplateVersionList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "CatalogTemplateVersion"}, "catalogtemplateversions", true, v.controllerFactory, v.ts) -} - func (v *version) CloudCredential() CloudCredentialController { return generic.NewController[*v3.CloudCredential, *v3.CloudCredentialList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "CloudCredential"}, "cloudcredentials", true, v.controllerFactory, v.ts) } @@ -152,10 +127,6 @@ func (v *version) Cluster() ClusterController { return generic.NewNonNamespacedController[*v3.Cluster, *v3.ClusterList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Cluster"}, "clusters", v.controllerFactory, v.ts) } -func (v *version) ClusterCatalog() ClusterCatalogController { - return generic.NewController[*v3.ClusterCatalog, *v3.ClusterCatalogList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ClusterCatalog"}, "clustercatalogs", true, v.controllerFactory, v.ts) -} - func (v *version) ClusterProxyConfig() ClusterProxyConfigController { return generic.NewController[*v3.ClusterProxyConfig, *v3.ClusterProxyConfigList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ClusterProxyConfig"}, "clusterproxyconfigs", true, v.controllerFactory, v.ts) } @@ -240,14 +211,6 @@ func (v *version) ManagedChart() ManagedChartController { return generic.NewController[*v3.ManagedChart, *v3.ManagedChartList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ManagedChart"}, "managedcharts", true, v.controllerFactory, v.ts) } -func (v *version) MultiClusterApp() MultiClusterAppController { - return generic.NewController[*v3.MultiClusterApp, *v3.MultiClusterAppList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "MultiClusterApp"}, "multiclusterapps", true, v.controllerFactory, v.ts) -} - -func (v *version) MultiClusterAppRevision() MultiClusterAppRevisionController { - return generic.NewController[*v3.MultiClusterAppRevision, *v3.MultiClusterAppRevisionList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "MultiClusterAppRevision"}, "multiclusterapprevisions", true, v.controllerFactory, v.ts) -} - func (v *version) Node() NodeController { return generic.NewController[*v3.Node, *v3.NodeList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Node"}, "nodes", true, v.controllerFactory, v.ts) } @@ -288,10 +251,6 @@ func (v *version) Project() ProjectController { return generic.NewController[*v3.Project, *v3.ProjectList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Project"}, "projects", true, v.controllerFactory, v.ts) } -func (v *version) ProjectCatalog() ProjectCatalogController { - return generic.NewController[*v3.ProjectCatalog, *v3.ProjectCatalogList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ProjectCatalog"}, "projectcatalogs", true, v.controllerFactory, v.ts) -} - func (v *version) ProjectNetworkPolicy() ProjectNetworkPolicyController { return generic.NewController[*v3.ProjectNetworkPolicy, *v3.ProjectNetworkPolicyList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ProjectNetworkPolicy"}, "projectnetworkpolicies", true, v.controllerFactory, v.ts) } @@ -332,18 +291,6 @@ func (v *version) Setting() SettingController { return generic.NewNonNamespacedController[*v3.Setting, *v3.SettingList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Setting"}, "settings", v.controllerFactory, v.ts) } -func (v *version) Template() TemplateController { - return generic.NewNonNamespacedController[*v3.Template, *v3.TemplateList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Template"}, "templates", v.controllerFactory, v.ts) -} - -func (v *version) TemplateContent() TemplateContentController { - return generic.NewNonNamespacedController[*v3.TemplateContent, *v3.TemplateContentList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "TemplateContent"}, "templatecontents", v.controllerFactory, v.ts) -} - -func (v *version) TemplateVersion() TemplateVersionController { - return generic.NewNonNamespacedController[*v3.TemplateVersion, *v3.TemplateVersionList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "TemplateVersion"}, "templateversions", v.controllerFactory, v.ts) -} - func (v *version) Token() TokenController { return generic.NewNonNamespacedController[*v3.Token, *v3.TokenList](schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Token"}, "tokens", v.controllerFactory, v.ts) } diff --git a/pkg/generated/controllers/management.cattle.io/v3/multiclusterapp.go b/pkg/generated/controllers/management.cattle.io/v3/multiclusterapp.go deleted file mode 100644 index 5eea9a02..00000000 --- a/pkg/generated/controllers/management.cattle.io/v3/multiclusterapp.go +++ /dev/null @@ -1,208 +0,0 @@ -/* -Copyright 2024 Rancher Labs, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package v3 - -import ( - "context" - "sync" - "time" - - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/shepherd/pkg/wrangler/pkg/generic" - "github.com/rancher/wrangler/v3/pkg/apply" - "github.com/rancher/wrangler/v3/pkg/condition" - "github.com/rancher/wrangler/v3/pkg/kv" - "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// MultiClusterAppController interface for managing MultiClusterApp resources. -type MultiClusterAppController interface { - generic.ControllerInterface[*v3.MultiClusterApp, *v3.MultiClusterAppList] -} - -// MultiClusterAppClient interface for managing MultiClusterApp resources in Kubernetes. -type MultiClusterAppClient interface { - generic.ClientInterface[*v3.MultiClusterApp, *v3.MultiClusterAppList] -} - -// MultiClusterAppCache interface for retrieving MultiClusterApp resources in memory. -type MultiClusterAppCache interface { - generic.CacheInterface[*v3.MultiClusterApp] -} - -// MultiClusterAppStatusHandler is executed for every added or modified MultiClusterApp. Should return the new status to be updated -type MultiClusterAppStatusHandler func(obj *v3.MultiClusterApp, status v3.MultiClusterAppStatus) (v3.MultiClusterAppStatus, error) - -// MultiClusterAppGeneratingHandler is the top-level handler that is executed for every MultiClusterApp event. It extends MultiClusterAppStatusHandler by a returning a slice of child objects to be passed to apply.Apply -type MultiClusterAppGeneratingHandler func(obj *v3.MultiClusterApp, status v3.MultiClusterAppStatus) ([]runtime.Object, v3.MultiClusterAppStatus, error) - -// RegisterMultiClusterAppStatusHandler configures a MultiClusterAppController to execute a MultiClusterAppStatusHandler for every events observed. -// If a non-empty condition is provided, it will be updated in the status conditions for every handler execution -func RegisterMultiClusterAppStatusHandler(ctx context.Context, controller MultiClusterAppController, condition condition.Cond, name string, handler MultiClusterAppStatusHandler) { - statusHandler := &multiClusterAppStatusHandler{ - client: controller, - condition: condition, - handler: handler, - } - controller.AddGenericHandler(ctx, name, generic.FromObjectHandlerToHandler(statusHandler.sync)) -} - -// RegisterMultiClusterAppGeneratingHandler configures a MultiClusterAppController to execute a MultiClusterAppGeneratingHandler for every events observed, passing the returned objects to the provided apply.Apply. -// If a non-empty condition is provided, it will be updated in the status conditions for every handler execution -func RegisterMultiClusterAppGeneratingHandler(ctx context.Context, controller MultiClusterAppController, apply apply.Apply, - condition condition.Cond, name string, handler MultiClusterAppGeneratingHandler, opts *generic.GeneratingHandlerOptions) { - statusHandler := &multiClusterAppGeneratingHandler{ - MultiClusterAppGeneratingHandler: handler, - apply: apply, - name: name, - gvk: controller.GroupVersionKind(), - } - if opts != nil { - statusHandler.opts = *opts - } - controller.OnChange(ctx, name, statusHandler.Remove) - RegisterMultiClusterAppStatusHandler(ctx, controller, condition, name, statusHandler.Handle) -} - -type multiClusterAppStatusHandler struct { - client MultiClusterAppClient - condition condition.Cond - handler MultiClusterAppStatusHandler -} - -// sync is executed on every resource addition or modification. Executes the configured handlers and sends the updated status to the Kubernetes API -func (a *multiClusterAppStatusHandler) sync(key string, obj *v3.MultiClusterApp) (*v3.MultiClusterApp, error) { - if obj == nil { - return obj, nil - } - - origStatus := obj.Status.DeepCopy() - obj = obj.DeepCopy() - newStatus, err := a.handler(obj, obj.Status) - if err != nil { - // Revert to old status on error - newStatus = *origStatus.DeepCopy() - } - - if a.condition != "" { - if errors.IsConflict(err) { - a.condition.SetError(&newStatus, "", nil) - } else { - a.condition.SetError(&newStatus, "", err) - } - } - if !equality.Semantic.DeepEqual(origStatus, &newStatus) { - if a.condition != "" { - // Since status has changed, update the lastUpdatedTime - a.condition.LastUpdated(&newStatus, time.Now().UTC().Format(time.RFC3339)) - } - - var newErr error - obj.Status = newStatus - newObj, newErr := a.client.UpdateStatus(obj) - if err == nil { - err = newErr - } - if newErr == nil { - obj = newObj - } - } - return obj, err -} - -type multiClusterAppGeneratingHandler struct { - MultiClusterAppGeneratingHandler - apply apply.Apply - opts generic.GeneratingHandlerOptions - gvk schema.GroupVersionKind - name string - seen sync.Map -} - -// Remove handles the observed deletion of a resource, cascade deleting every associated resource previously applied -func (a *multiClusterAppGeneratingHandler) Remove(key string, obj *v3.MultiClusterApp) (*v3.MultiClusterApp, error) { - if obj != nil { - return obj, nil - } - - obj = &v3.MultiClusterApp{} - obj.Namespace, obj.Name = kv.RSplit(key, "/") - obj.SetGroupVersionKind(a.gvk) - - if a.opts.UniqueApplyForResourceVersion { - a.seen.Delete(key) - } - - return nil, generic.ConfigureApplyForObject(a.apply, obj, &a.opts). - WithOwner(obj). - WithSetID(a.name). - ApplyObjects() -} - -// Handle executes the configured MultiClusterAppGeneratingHandler and pass the resulting objects to apply.Apply, finally returning the new status of the resource -func (a *multiClusterAppGeneratingHandler) Handle(obj *v3.MultiClusterApp, status v3.MultiClusterAppStatus) (v3.MultiClusterAppStatus, error) { - if !obj.DeletionTimestamp.IsZero() { - return status, nil - } - - objs, newStatus, err := a.MultiClusterAppGeneratingHandler(obj, status) - if err != nil { - return newStatus, err - } - if !a.isNewResourceVersion(obj) { - return newStatus, nil - } - - err = generic.ConfigureApplyForObject(a.apply, obj, &a.opts). - WithOwner(obj). - WithSetID(a.name). - ApplyObjects(objs...) - if err != nil { - return newStatus, err - } - a.storeResourceVersion(obj) - return newStatus, nil -} - -// isNewResourceVersion detects if a specific resource version was already successfully processed. -// Only used if UniqueApplyForResourceVersion is set in generic.GeneratingHandlerOptions -func (a *multiClusterAppGeneratingHandler) isNewResourceVersion(obj *v3.MultiClusterApp) bool { - if !a.opts.UniqueApplyForResourceVersion { - return true - } - - // Apply once per resource version - key := obj.Namespace + "/" + obj.Name - previous, ok := a.seen.Load(key) - return !ok || previous != obj.ResourceVersion -} - -// storeResourceVersion keeps track of the latest resource version of an object for which Apply was executed -// Only used if UniqueApplyForResourceVersion is set in generic.GeneratingHandlerOptions -func (a *multiClusterAppGeneratingHandler) storeResourceVersion(obj *v3.MultiClusterApp) { - if !a.opts.UniqueApplyForResourceVersion { - return - } - - key := obj.Namespace + "/" + obj.Name - a.seen.Store(key, obj.ResourceVersion) -} diff --git a/pkg/generated/controllers/management.cattle.io/v3/multiclusterapprevision.go b/pkg/generated/controllers/management.cattle.io/v3/multiclusterapprevision.go deleted file mode 100644 index a92d4c3d..00000000 --- a/pkg/generated/controllers/management.cattle.io/v3/multiclusterapprevision.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2024 Rancher Labs, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package v3 - -import ( - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/shepherd/pkg/wrangler/pkg/generic" -) - -// MultiClusterAppRevisionController interface for managing MultiClusterAppRevision resources. -type MultiClusterAppRevisionController interface { - generic.ControllerInterface[*v3.MultiClusterAppRevision, *v3.MultiClusterAppRevisionList] -} - -// MultiClusterAppRevisionClient interface for managing MultiClusterAppRevision resources in Kubernetes. -type MultiClusterAppRevisionClient interface { - generic.ClientInterface[*v3.MultiClusterAppRevision, *v3.MultiClusterAppRevisionList] -} - -// MultiClusterAppRevisionCache interface for retrieving MultiClusterAppRevision resources in memory. -type MultiClusterAppRevisionCache interface { - generic.CacheInterface[*v3.MultiClusterAppRevision] -} diff --git a/pkg/generated/controllers/management.cattle.io/v3/projectcatalog.go b/pkg/generated/controllers/management.cattle.io/v3/projectcatalog.go deleted file mode 100644 index d681c0d0..00000000 --- a/pkg/generated/controllers/management.cattle.io/v3/projectcatalog.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2024 Rancher Labs, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package v3 - -import ( - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/shepherd/pkg/wrangler/pkg/generic" -) - -// ProjectCatalogController interface for managing ProjectCatalog resources. -type ProjectCatalogController interface { - generic.ControllerInterface[*v3.ProjectCatalog, *v3.ProjectCatalogList] -} - -// ProjectCatalogClient interface for managing ProjectCatalog resources in Kubernetes. -type ProjectCatalogClient interface { - generic.ClientInterface[*v3.ProjectCatalog, *v3.ProjectCatalogList] -} - -// ProjectCatalogCache interface for retrieving ProjectCatalog resources in memory. -type ProjectCatalogCache interface { - generic.CacheInterface[*v3.ProjectCatalog] -} diff --git a/pkg/generated/controllers/management.cattle.io/v3/template.go b/pkg/generated/controllers/management.cattle.io/v3/template.go deleted file mode 100644 index bdd7f42f..00000000 --- a/pkg/generated/controllers/management.cattle.io/v3/template.go +++ /dev/null @@ -1,208 +0,0 @@ -/* -Copyright 2024 Rancher Labs, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package v3 - -import ( - "context" - "sync" - "time" - - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/shepherd/pkg/wrangler/pkg/generic" - "github.com/rancher/wrangler/v3/pkg/apply" - "github.com/rancher/wrangler/v3/pkg/condition" - "github.com/rancher/wrangler/v3/pkg/kv" - "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// TemplateController interface for managing Template resources. -type TemplateController interface { - generic.NonNamespacedControllerInterface[*v3.Template, *v3.TemplateList] -} - -// TemplateClient interface for managing Template resources in Kubernetes. -type TemplateClient interface { - generic.NonNamespacedClientInterface[*v3.Template, *v3.TemplateList] -} - -// TemplateCache interface for retrieving Template resources in memory. -type TemplateCache interface { - generic.NonNamespacedCacheInterface[*v3.Template] -} - -// TemplateStatusHandler is executed for every added or modified Template. Should return the new status to be updated -type TemplateStatusHandler func(obj *v3.Template, status v3.TemplateStatus) (v3.TemplateStatus, error) - -// TemplateGeneratingHandler is the top-level handler that is executed for every Template event. It extends TemplateStatusHandler by a returning a slice of child objects to be passed to apply.Apply -type TemplateGeneratingHandler func(obj *v3.Template, status v3.TemplateStatus) ([]runtime.Object, v3.TemplateStatus, error) - -// RegisterTemplateStatusHandler configures a TemplateController to execute a TemplateStatusHandler for every events observed. -// If a non-empty condition is provided, it will be updated in the status conditions for every handler execution -func RegisterTemplateStatusHandler(ctx context.Context, controller TemplateController, condition condition.Cond, name string, handler TemplateStatusHandler) { - statusHandler := &templateStatusHandler{ - client: controller, - condition: condition, - handler: handler, - } - controller.AddGenericHandler(ctx, name, generic.FromObjectHandlerToHandler(statusHandler.sync)) -} - -// RegisterTemplateGeneratingHandler configures a TemplateController to execute a TemplateGeneratingHandler for every events observed, passing the returned objects to the provided apply.Apply. -// If a non-empty condition is provided, it will be updated in the status conditions for every handler execution -func RegisterTemplateGeneratingHandler(ctx context.Context, controller TemplateController, apply apply.Apply, - condition condition.Cond, name string, handler TemplateGeneratingHandler, opts *generic.GeneratingHandlerOptions) { - statusHandler := &templateGeneratingHandler{ - TemplateGeneratingHandler: handler, - apply: apply, - name: name, - gvk: controller.GroupVersionKind(), - } - if opts != nil { - statusHandler.opts = *opts - } - controller.OnChange(ctx, name, statusHandler.Remove) - RegisterTemplateStatusHandler(ctx, controller, condition, name, statusHandler.Handle) -} - -type templateStatusHandler struct { - client TemplateClient - condition condition.Cond - handler TemplateStatusHandler -} - -// sync is executed on every resource addition or modification. Executes the configured handlers and sends the updated status to the Kubernetes API -func (a *templateStatusHandler) sync(key string, obj *v3.Template) (*v3.Template, error) { - if obj == nil { - return obj, nil - } - - origStatus := obj.Status.DeepCopy() - obj = obj.DeepCopy() - newStatus, err := a.handler(obj, obj.Status) - if err != nil { - // Revert to old status on error - newStatus = *origStatus.DeepCopy() - } - - if a.condition != "" { - if errors.IsConflict(err) { - a.condition.SetError(&newStatus, "", nil) - } else { - a.condition.SetError(&newStatus, "", err) - } - } - if !equality.Semantic.DeepEqual(origStatus, &newStatus) { - if a.condition != "" { - // Since status has changed, update the lastUpdatedTime - a.condition.LastUpdated(&newStatus, time.Now().UTC().Format(time.RFC3339)) - } - - var newErr error - obj.Status = newStatus - newObj, newErr := a.client.UpdateStatus(obj) - if err == nil { - err = newErr - } - if newErr == nil { - obj = newObj - } - } - return obj, err -} - -type templateGeneratingHandler struct { - TemplateGeneratingHandler - apply apply.Apply - opts generic.GeneratingHandlerOptions - gvk schema.GroupVersionKind - name string - seen sync.Map -} - -// Remove handles the observed deletion of a resource, cascade deleting every associated resource previously applied -func (a *templateGeneratingHandler) Remove(key string, obj *v3.Template) (*v3.Template, error) { - if obj != nil { - return obj, nil - } - - obj = &v3.Template{} - obj.Namespace, obj.Name = kv.RSplit(key, "/") - obj.SetGroupVersionKind(a.gvk) - - if a.opts.UniqueApplyForResourceVersion { - a.seen.Delete(key) - } - - return nil, generic.ConfigureApplyForObject(a.apply, obj, &a.opts). - WithOwner(obj). - WithSetID(a.name). - ApplyObjects() -} - -// Handle executes the configured TemplateGeneratingHandler and pass the resulting objects to apply.Apply, finally returning the new status of the resource -func (a *templateGeneratingHandler) Handle(obj *v3.Template, status v3.TemplateStatus) (v3.TemplateStatus, error) { - if !obj.DeletionTimestamp.IsZero() { - return status, nil - } - - objs, newStatus, err := a.TemplateGeneratingHandler(obj, status) - if err != nil { - return newStatus, err - } - if !a.isNewResourceVersion(obj) { - return newStatus, nil - } - - err = generic.ConfigureApplyForObject(a.apply, obj, &a.opts). - WithOwner(obj). - WithSetID(a.name). - ApplyObjects(objs...) - if err != nil { - return newStatus, err - } - a.storeResourceVersion(obj) - return newStatus, nil -} - -// isNewResourceVersion detects if a specific resource version was already successfully processed. -// Only used if UniqueApplyForResourceVersion is set in generic.GeneratingHandlerOptions -func (a *templateGeneratingHandler) isNewResourceVersion(obj *v3.Template) bool { - if !a.opts.UniqueApplyForResourceVersion { - return true - } - - // Apply once per resource version - key := obj.Namespace + "/" + obj.Name - previous, ok := a.seen.Load(key) - return !ok || previous != obj.ResourceVersion -} - -// storeResourceVersion keeps track of the latest resource version of an object for which Apply was executed -// Only used if UniqueApplyForResourceVersion is set in generic.GeneratingHandlerOptions -func (a *templateGeneratingHandler) storeResourceVersion(obj *v3.Template) { - if !a.opts.UniqueApplyForResourceVersion { - return - } - - key := obj.Namespace + "/" + obj.Name - a.seen.Store(key, obj.ResourceVersion) -} diff --git a/pkg/generated/controllers/management.cattle.io/v3/templatecontent.go b/pkg/generated/controllers/management.cattle.io/v3/templatecontent.go deleted file mode 100644 index 507dfcad..00000000 --- a/pkg/generated/controllers/management.cattle.io/v3/templatecontent.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2024 Rancher Labs, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package v3 - -import ( - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/shepherd/pkg/wrangler/pkg/generic" -) - -// TemplateContentController interface for managing TemplateContent resources. -type TemplateContentController interface { - generic.NonNamespacedControllerInterface[*v3.TemplateContent, *v3.TemplateContentList] -} - -// TemplateContentClient interface for managing TemplateContent resources in Kubernetes. -type TemplateContentClient interface { - generic.NonNamespacedClientInterface[*v3.TemplateContent, *v3.TemplateContentList] -} - -// TemplateContentCache interface for retrieving TemplateContent resources in memory. -type TemplateContentCache interface { - generic.NonNamespacedCacheInterface[*v3.TemplateContent] -} diff --git a/pkg/generated/controllers/management.cattle.io/v3/templateversion.go b/pkg/generated/controllers/management.cattle.io/v3/templateversion.go deleted file mode 100644 index 62b708f1..00000000 --- a/pkg/generated/controllers/management.cattle.io/v3/templateversion.go +++ /dev/null @@ -1,208 +0,0 @@ -/* -Copyright 2024 Rancher Labs, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by main. DO NOT EDIT. - -package v3 - -import ( - "context" - "sync" - "time" - - v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" - "github.com/rancher/shepherd/pkg/wrangler/pkg/generic" - "github.com/rancher/wrangler/v3/pkg/apply" - "github.com/rancher/wrangler/v3/pkg/condition" - "github.com/rancher/wrangler/v3/pkg/kv" - "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// TemplateVersionController interface for managing TemplateVersion resources. -type TemplateVersionController interface { - generic.NonNamespacedControllerInterface[*v3.TemplateVersion, *v3.TemplateVersionList] -} - -// TemplateVersionClient interface for managing TemplateVersion resources in Kubernetes. -type TemplateVersionClient interface { - generic.NonNamespacedClientInterface[*v3.TemplateVersion, *v3.TemplateVersionList] -} - -// TemplateVersionCache interface for retrieving TemplateVersion resources in memory. -type TemplateVersionCache interface { - generic.NonNamespacedCacheInterface[*v3.TemplateVersion] -} - -// TemplateVersionStatusHandler is executed for every added or modified TemplateVersion. Should return the new status to be updated -type TemplateVersionStatusHandler func(obj *v3.TemplateVersion, status v3.TemplateVersionStatus) (v3.TemplateVersionStatus, error) - -// TemplateVersionGeneratingHandler is the top-level handler that is executed for every TemplateVersion event. It extends TemplateVersionStatusHandler by a returning a slice of child objects to be passed to apply.Apply -type TemplateVersionGeneratingHandler func(obj *v3.TemplateVersion, status v3.TemplateVersionStatus) ([]runtime.Object, v3.TemplateVersionStatus, error) - -// RegisterTemplateVersionStatusHandler configures a TemplateVersionController to execute a TemplateVersionStatusHandler for every events observed. -// If a non-empty condition is provided, it will be updated in the status conditions for every handler execution -func RegisterTemplateVersionStatusHandler(ctx context.Context, controller TemplateVersionController, condition condition.Cond, name string, handler TemplateVersionStatusHandler) { - statusHandler := &templateVersionStatusHandler{ - client: controller, - condition: condition, - handler: handler, - } - controller.AddGenericHandler(ctx, name, generic.FromObjectHandlerToHandler(statusHandler.sync)) -} - -// RegisterTemplateVersionGeneratingHandler configures a TemplateVersionController to execute a TemplateVersionGeneratingHandler for every events observed, passing the returned objects to the provided apply.Apply. -// If a non-empty condition is provided, it will be updated in the status conditions for every handler execution -func RegisterTemplateVersionGeneratingHandler(ctx context.Context, controller TemplateVersionController, apply apply.Apply, - condition condition.Cond, name string, handler TemplateVersionGeneratingHandler, opts *generic.GeneratingHandlerOptions) { - statusHandler := &templateVersionGeneratingHandler{ - TemplateVersionGeneratingHandler: handler, - apply: apply, - name: name, - gvk: controller.GroupVersionKind(), - } - if opts != nil { - statusHandler.opts = *opts - } - controller.OnChange(ctx, name, statusHandler.Remove) - RegisterTemplateVersionStatusHandler(ctx, controller, condition, name, statusHandler.Handle) -} - -type templateVersionStatusHandler struct { - client TemplateVersionClient - condition condition.Cond - handler TemplateVersionStatusHandler -} - -// sync is executed on every resource addition or modification. Executes the configured handlers and sends the updated status to the Kubernetes API -func (a *templateVersionStatusHandler) sync(key string, obj *v3.TemplateVersion) (*v3.TemplateVersion, error) { - if obj == nil { - return obj, nil - } - - origStatus := obj.Status.DeepCopy() - obj = obj.DeepCopy() - newStatus, err := a.handler(obj, obj.Status) - if err != nil { - // Revert to old status on error - newStatus = *origStatus.DeepCopy() - } - - if a.condition != "" { - if errors.IsConflict(err) { - a.condition.SetError(&newStatus, "", nil) - } else { - a.condition.SetError(&newStatus, "", err) - } - } - if !equality.Semantic.DeepEqual(origStatus, &newStatus) { - if a.condition != "" { - // Since status has changed, update the lastUpdatedTime - a.condition.LastUpdated(&newStatus, time.Now().UTC().Format(time.RFC3339)) - } - - var newErr error - obj.Status = newStatus - newObj, newErr := a.client.UpdateStatus(obj) - if err == nil { - err = newErr - } - if newErr == nil { - obj = newObj - } - } - return obj, err -} - -type templateVersionGeneratingHandler struct { - TemplateVersionGeneratingHandler - apply apply.Apply - opts generic.GeneratingHandlerOptions - gvk schema.GroupVersionKind - name string - seen sync.Map -} - -// Remove handles the observed deletion of a resource, cascade deleting every associated resource previously applied -func (a *templateVersionGeneratingHandler) Remove(key string, obj *v3.TemplateVersion) (*v3.TemplateVersion, error) { - if obj != nil { - return obj, nil - } - - obj = &v3.TemplateVersion{} - obj.Namespace, obj.Name = kv.RSplit(key, "/") - obj.SetGroupVersionKind(a.gvk) - - if a.opts.UniqueApplyForResourceVersion { - a.seen.Delete(key) - } - - return nil, generic.ConfigureApplyForObject(a.apply, obj, &a.opts). - WithOwner(obj). - WithSetID(a.name). - ApplyObjects() -} - -// Handle executes the configured TemplateVersionGeneratingHandler and pass the resulting objects to apply.Apply, finally returning the new status of the resource -func (a *templateVersionGeneratingHandler) Handle(obj *v3.TemplateVersion, status v3.TemplateVersionStatus) (v3.TemplateVersionStatus, error) { - if !obj.DeletionTimestamp.IsZero() { - return status, nil - } - - objs, newStatus, err := a.TemplateVersionGeneratingHandler(obj, status) - if err != nil { - return newStatus, err - } - if !a.isNewResourceVersion(obj) { - return newStatus, nil - } - - err = generic.ConfigureApplyForObject(a.apply, obj, &a.opts). - WithOwner(obj). - WithSetID(a.name). - ApplyObjects(objs...) - if err != nil { - return newStatus, err - } - a.storeResourceVersion(obj) - return newStatus, nil -} - -// isNewResourceVersion detects if a specific resource version was already successfully processed. -// Only used if UniqueApplyForResourceVersion is set in generic.GeneratingHandlerOptions -func (a *templateVersionGeneratingHandler) isNewResourceVersion(obj *v3.TemplateVersion) bool { - if !a.opts.UniqueApplyForResourceVersion { - return true - } - - // Apply once per resource version - key := obj.Namespace + "/" + obj.Name - previous, ok := a.seen.Load(key) - return !ok || previous != obj.ResourceVersion -} - -// storeResourceVersion keeps track of the latest resource version of an object for which Apply was executed -// Only used if UniqueApplyForResourceVersion is set in generic.GeneratingHandlerOptions -func (a *templateVersionGeneratingHandler) storeResourceVersion(obj *v3.TemplateVersion) { - if !a.opts.UniqueApplyForResourceVersion { - return - } - - key := obj.Namespace + "/" + obj.Name - a.seen.Store(key, obj.ResourceVersion) -} diff --git a/pkg/schemas/management.cattle.io/v3/schema.go b/pkg/schemas/management.cattle.io/v3/schema.go index 842b233e..412779aa 100644 --- a/pkg/schemas/management.cattle.io/v3/schema.go +++ b/pkg/schemas/management.cattle.io/v3/schema.go @@ -34,7 +34,6 @@ var ( Init(podSecurityAdmissionTypes). Init(authzTypes). Init(clusterTypes). - Init(catalogTypes). Init(authnTypes). Init(tokens). Init(schemaTypes). @@ -43,9 +42,6 @@ var ( Init(globalTypes). Init(rkeTypes). Init(composeType). - Init(projectCatalogTypes). - Init(clusterCatalogTypes). - Init(multiClusterAppTypes). Init(kontainerTypes). Init(etcdBackupTypes). Init(credTypes). @@ -128,43 +124,6 @@ func driverMetadataTypes(schemas *types.Schemas) *types.Schemas { MustImport(&Version, v3.RkeAddon{}) } -func catalogTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - AddMapperForType(&Version, v3.Catalog{}, - &m.Move{From: "catalogKind", To: "kind"}, - &m.Embed{Field: "status"}, - &m.Drop{Field: "helmVersionCommits"}, - ). - MustImport(&Version, v3.CatalogRefresh{}). - MustImportAndCustomize(&Version, v3.Catalog{}, func(schema *types.Schema) { - schema.ResourceActions = map[string]types.Action{ - "refresh": {Output: "catalogRefresh"}, - } - schema.CollectionActions = map[string]types.Action{ - "refresh": {Output: "catalogRefresh"}, - } - }). - AddMapperForType(&Version, v3.Template{}, - m.DisplayName{}, - ). - MustImport(&Version, v3.Template{}, struct { - VersionLinks map[string]string - }{}). - AddMapperForType(&Version, v3.CatalogTemplate{}, - m.DisplayName{}, - m.Drop{Field: "namespaceId"}, - ). - MustImport(&Version, v3.CatalogTemplate{}, struct { - VersionLinks map[string]string - }{}). - AddMapperForType(&Version, v3.CatalogTemplateVersion{}, - m.Drop{Field: "namespaceId"}, - ). - MustImport(&Version, v3.CatalogTemplateVersion{}). - MustImport(&Version, v3.TemplateVersion{}). - MustImport(&Version, v3.TemplateContent{}) -} - func nativeNodeTypes(schemas *types.Schemas) *types.Schemas { return schemas. TypeName("internalNodeStatus", v1.NodeStatus{}). @@ -744,66 +703,6 @@ func composeType(schemas *types.Schemas) *types.Schemas { return schemas.MustImport(&Version, v3.ComposeConfig{}) } -func projectCatalogTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - AddMapperForType(&Version, v3.ProjectCatalog{}, - &m.Move{From: "catalogKind", To: "kind"}, - &m.Embed{Field: "status"}, - &m.Drop{Field: "helmVersionCommits"}, - &mapper.NamespaceIDMapper{}). - MustImportAndCustomize(&Version, v3.ProjectCatalog{}, func(schema *types.Schema) { - schema.ResourceActions = map[string]types.Action{ - "refresh": {Output: "catalogRefresh"}, - } - schema.CollectionActions = map[string]types.Action{ - "refresh": {Output: "catalogRefresh"}, - } - }) -} - -func clusterCatalogTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - AddMapperForType(&Version, v3.ClusterCatalog{}, - &m.Move{From: "catalogKind", To: "kind"}, - &m.Embed{Field: "status"}, - &m.Drop{Field: "helmVersionCommits"}, - &mapper.NamespaceIDMapper{}). - MustImportAndCustomize(&Version, v3.ClusterCatalog{}, func(schema *types.Schema) { - schema.ResourceActions = map[string]types.Action{ - "refresh": {Output: "catalogRefresh"}, - } - schema.CollectionActions = map[string]types.Action{ - "refresh": {Output: "catalogRefresh"}, - } - }) -} - -func multiClusterAppTypes(schemas *types.Schemas) *types.Schemas { - return schemas. - AddMapperForType(&Version, v3.MultiClusterApp{}, m.Drop{Field: "namespaceId"}). - AddMapperForType(&Version, v3.MultiClusterAppRevision{}, m.Drop{Field: "namespaceId"}). - AddMapperForType(&Version, v3.Member{}, m.Drop{Field: "userName"}, m.Drop{Field: "displayName"}). - MustImport(&Version, v3.MultiClusterApp{}). - MustImport(&Version, v3.Target{}). - MustImport(&Version, v3.UpgradeStrategy{}). - MustImport(&Version, v3.MultiClusterAppRollbackInput{}). - MustImport(&Version, v3.MultiClusterAppRevision{}). - MustImport(&Version, v3.UpdateMultiClusterAppTargetsInput{}). - MustImportAndCustomize(&Version, v3.MultiClusterApp{}, func(schema *types.Schema) { - schema.ResourceActions = map[string]types.Action{ - "rollback": { - Input: "multiClusterAppRollbackInput", - }, - "addProjects": { - Input: "updateMultiClusterAppTargetsInput", - }, - "removeProjects": { - Input: "updateMultiClusterAppTargetsInput", - }, - } - }) -} - func kontainerTypes(schemas *types.Schemas) *types.Schemas { return schemas. AddMapperForType(&Version, v3.KontainerDriver{},