Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor servicecatalog provisioned product resource #3

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apis/servicecatalog/generator-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ resources:
from:
operation: DescribeProvisionedProduct
path: ProvisionedProductDetail.ProvisioningArtifactId
LastProvisioningParameters:
is_read_only: true
custom_field:
Copy link
Author

@teeverr teeverr Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it's not necessary to expose all params as is, for comparison is enough to know the length of array.
But idk how to generate custom field with type int in the status.

"type: int" works only if "is_read_only" is false

list_of: ProvisioningParameter
LaunchRoleArn:
is_read_only: true
from:
Expand Down
11 changes: 11 additions & 0 deletions apis/servicecatalog/v1alpha1/zz_generated.deepcopy.go

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

2 changes: 2 additions & 0 deletions apis/servicecatalog/v1alpha1/zz_provisioned_product.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,15 @@ spec:
description: The identifier of the provisioning artifact. For
example, pa-4abcdjnxjj6ne.
type: string
lastProvisioningParameters:
items:
properties:
key:
type: string
value:
type: string
type: object
type: array
lastProvisioningRecordID:
description: "The record identifier of the last request performed
on this provisioned product of the following types: \n * ProvisionedProduct
Expand Down
14 changes: 0 additions & 14 deletions pkg/clients/servicecatalog/servicecatalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

cfsdkv2 "github.com/aws/aws-sdk-go-v2/service/cloudformation"
cfsdkv2types "github.com/aws/aws-sdk-go-v2/service/cloudformation/types"
"github.com/aws/aws-sdk-go/aws/request"
svcsdk "github.com/aws/aws-sdk-go/service/servicecatalog"
svcsdkapi "github.com/aws/aws-sdk-go/service/servicecatalog/servicecatalogiface"
)
Expand All @@ -38,8 +37,6 @@ type Client interface {
GetProvisionedProductOutputs(*svcsdk.GetProvisionedProductOutputsInput) (*svcsdk.GetProvisionedProductOutputsOutput, error)
DescribeRecord(*svcsdk.DescribeRecordInput) (*svcsdk.DescribeRecordOutput, error)
DescribeProduct(*svcsdk.DescribeProductInput) (*svcsdk.DescribeProductOutput, error)
DescribeProvisioningArtifact(*svcsdk.DescribeProvisioningArtifactInput) (*svcsdk.DescribeProvisioningArtifactOutput, error)
UpdateProvisionedProductWithContext(context.Context, *svcsdk.UpdateProvisionedProductInput, ...request.Option) (*svcsdk.UpdateProvisionedProductOutput, error)
}

// CustomServiceCatalogClient is the implementation of a Client
Expand Down Expand Up @@ -79,17 +76,6 @@ func (c *CustomServiceCatalogClient) DescribeRecord(describeRecordInput *svcsdk.
return describeRecordOutput, err
}

// DescribeProvisioningArtifact is wrapped (*ServiceCatalog) DescribeProvisioningArtifact from github.com/aws/aws-sdk-go/service/servicecatalog
func (c *CustomServiceCatalogClient) DescribeProvisioningArtifact(input *svcsdk.DescribeProvisioningArtifactInput) (*svcsdk.DescribeProvisioningArtifactOutput, error) {
output, err := c.Client.DescribeProvisioningArtifact(input)
return output, err
}

// UpdateProvisionedProductWithContext is wrapped (*ServiceCatalog) UpdateProvisionedProductWithContext from github.com/aws/aws-sdk-go/service/servicecatalog
func (c *CustomServiceCatalogClient) UpdateProvisionedProductWithContext(ctx context.Context, in *svcsdk.UpdateProvisionedProductInput, opts ...request.Option) (*svcsdk.UpdateProvisionedProductOutput, error) {
return c.Client.UpdateProvisionedProductWithContext(ctx, in, opts...)
}

// DescribeProduct is wrapped (*ServiceCatalog) DescribeProduct from github.com/aws/aws-sdk-go/service/servicecatalog
func (c *CustomServiceCatalogClient) DescribeProduct(input *svcsdk.DescribeProductInput) (*svcsdk.DescribeProductOutput, error) {
return c.Client.DescribeProduct(input)
Expand Down
194 changes: 0 additions & 194 deletions pkg/controller/servicecatalog/provisionedproduct/lifecycle.go

This file was deleted.

Loading
Loading