Documentation ¶
Index ¶
- Constants
- type AssetStream
- type AssetToUnstructuredResourceStream
- type ByteStream
- type FilteredAssetStream
- type HCLStream
- type IAMClient
- type IAMFormat
- type RecoverableByteStream
- type URLToUnstructuredResourceStream
- type UnstructuredResourceAndIAMPolicyStream
- type UnstructuredResourceFixupStream
- type UnstructuredStream
- type YAMLStream
Constants ¶
const ( IAMFormatPartialPolicy = "partialpolicy" IAMFormatPolicy = "policy" IAMFormatPolicyMember = "policymember" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssetStream ¶
func NewFilteredAssetStream ¶
func NewFilteredAssetStream(stream AssetStream, shouldInclude func(*asset.Asset) bool) AssetStream
Constructs a new asset stream with a filter function which determines if a given asset is included or not This is useful for filtering out asset types and resource types that we do not yet support
type AssetToUnstructuredResourceStream ¶
type AssetToUnstructuredResourceStream struct {
// contains filtered or unexported fields
}
func NewUnstructuredResourceStreamFromAssetStream ¶
func NewUnstructuredResourceStreamFromAssetStream(assetStream AssetStream, client gcpclient.Client, tfProvider *schema.Provider, serviceClient serviceclient.ServiceClient) (*AssetToUnstructuredResourceStream, error)
NewUnstructuredResourceStreamFromAssetStream returns an unstructured stream. The stream converts each asset in the 'assetStream' to a KCC resource and does a GET request to GCP finally returning the current value of the resource in KCC format as an unstructured
func (*AssetToUnstructuredResourceStream) Next ¶
func (s *AssetToUnstructuredResourceStream) Next(ctx context.Context) (*unstructured.Unstructured, error)
type ByteStream ¶
type ByteStream interface {
Next(ctx context.Context) ([]byte, *unstructured.Unstructured, error)
}
func NewByteStream ¶
func NewByteStream(resourceFormat outputsink.ResourceFormat, uStream UnstructuredStream, smLoader *servicemappingloader.ServiceMappingLoader, tfProvider *schema.Provider) (ByteStream, error)
type FilteredAssetStream ¶
type FilteredAssetStream struct {
// contains filtered or unexported fields
}
func (*FilteredAssetStream) Close ¶
func (f *FilteredAssetStream) Close() error
type HCLStream ¶
type HCLStream struct {
// contains filtered or unexported fields
}
func NewHCLStream ¶
func NewHCLStream(unstructuredStream UnstructuredStream, smLoader *servicemappingloader.ServiceMappingLoader, tfProvider *schema.Provider) *HCLStream
func (*HCLStream) Next ¶
func (h *HCLStream) Next(ctx context.Context) ([]byte, *unstructured.Unstructured, error)
type IAMClient ¶
type IAMClient interface { SupportsIAM(unstructured *unstructured.Unstructured) (bool, error) GetPolicy(ctx context.Context, unstructured *unstructured.Unstructured) (*v1beta1.IAMPolicy, error) }
type RecoverableByteStream ¶
type RecoverableByteStream struct {
// contains filtered or unexported fields
}
RecoverableByteStream stream wraps a ByteStream and can recover from panics on Next(). It should be used to wrap the top level stream so that it can catch panics from any nested stream.
func NewRecoverableByteStream ¶
func NewRecoverableByteStream(inputStream ByteStream) *RecoverableByteStream
func (*RecoverableByteStream) Next ¶
func (s *RecoverableByteStream) Next(ctx context.Context) (bytes []byte, unstructured *unstructured.Unstructured, err error)
type URLToUnstructuredResourceStream ¶
type URLToUnstructuredResourceStream struct {
// contains filtered or unexported fields
}
func NewUnstructuredResourceStreamFromURL ¶
func NewUnstructuredResourceStreamFromURL(url string, provider *schema.Provider, smLoader *servicemappingloader.ServiceMappingLoader, gcpClient gcpclient.Client) *URLToUnstructuredResourceStream
func (*URLToUnstructuredResourceStream) Next ¶
func (s *URLToUnstructuredResourceStream) Next(ctx context.Context) (*unstructured.Unstructured, error)
type UnstructuredResourceAndIAMPolicyStream ¶
type UnstructuredResourceAndIAMPolicyStream struct {
// contains filtered or unexported fields
}
func NewUnstructuredResourceAndIAMPolicyStream ¶
func NewUnstructuredResourceAndIAMPolicyStream(unstructuredStream UnstructuredStream, iamClient IAMClient, iamFormat IAMFormat, filterDeletedIAMMembers bool) *UnstructuredResourceAndIAMPolicyStream
func (*UnstructuredResourceAndIAMPolicyStream) Next ¶
func (s *UnstructuredResourceAndIAMPolicyStream) Next(ctx context.Context) (*unstructured.Unstructured, error)
This function returns the next unstructured as follows: 1. If there at least one value in the iam resources slice, reduce the size of the slice by one and return the value at the head of the slice 2. Else, get the next resource, if it supports iam policy fetch the iam policy, if the policy is non-empty save it into the iam resources slice, then return the resource
type UnstructuredResourceFixupStream ¶
type UnstructuredResourceFixupStream struct {
// contains filtered or unexported fields
}
UnstructuredResourceFixupStream will make any necessary edits to a resource to make sure it will work with K8s and KCC For example, ensuring the metadata.name is a K8s legal value (some GCP resource's allow values in 'name' with characters that are not allowed by K8s in metadata.name)
func NewUnstructuredResourceFixupStream ¶
func NewUnstructuredResourceFixupStream(unstructuredStream UnstructuredStream) *UnstructuredResourceFixupStream
func (*UnstructuredResourceFixupStream) Next ¶
func (s *UnstructuredResourceFixupStream) Next(ctx context.Context) (*unstructured.Unstructured, error)
type UnstructuredStream ¶
type UnstructuredStream interface {
Next(ctx context.Context) (*unstructured.Unstructured, error)
}
type YAMLStream ¶
type YAMLStream struct {
// contains filtered or unexported fields
}
func NewYAMLStream ¶
func NewYAMLStream(unstructuredStream UnstructuredStream) *YAMLStream
func (*YAMLStream) Next ¶
func (y *YAMLStream) Next(ctx context.Context) ([]byte, *unstructured.Unstructured, error)