Documentation ¶
Index ¶
- Constants
- func APIStatusErrorToDiagnostics(s metav1.Status) []*tfprotov5.Diagnostic
- func FieldPathToTftypesPath(fieldPath string) (*tftypes.AttributePath, error)
- func GVKFromTftypesObject(in *tftypes.Value, m meta.RESTMapper) (schema.GroupVersionKind, error)
- func GVRFromUnstructured(o *unstructured.Unstructured, m meta.RESTMapper) (schema.GroupVersionResource, error)
- func GetObjectTypeFromSchema(schema *tfprotov5.Schema) tftypes.Type
- func GetProviderConfigSchema() *tfprotov5.Schema
- func GetProviderResourceSchema() map[string]*tfprotov5.Schema
- func GetResourceType(name string) (tftypes.Type, error)
- func GetTypeFromSchema(s *tfprotov5.Schema) tftypes.Type
- func IsResourceNamespaced(gvk schema.GroupVersionKind, m meta.RESTMapper) (bool, error)
- func RemoveServerSideFields(in map[string]interface{}) map[string]interface{}
- func Serve(ctx context.Context, logger hclog.Logger) error
- func ServeReattach(ctx context.Context, logger hclog.Logger) error
- func ServeTest(ctx context.Context, logger hclog.Logger) (tfexec.ReattachInfo, error)
- type FieldMatcher
- type FieldWaiter
- type NoopWaiter
- type RawProviderServer
- func (s *RawProviderServer) ApplyResourceChange(ctx context.Context, req *tfprotov5.ApplyResourceChangeRequest) (*tfprotov5.ApplyResourceChangeResponse, error)
- func (s *RawProviderServer) ConfigureProvider(ctx context.Context, req *tfprotov5.ConfigureProviderRequest) (*tfprotov5.ConfigureProviderResponse, error)
- func (s *RawProviderServer) GetProviderSchema(ctx context.Context, req *tfprotov5.GetProviderSchemaRequest) (*tfprotov5.GetProviderSchemaResponse, error)
- func (*RawProviderServer) ImportResourceState(ctx context.Context, req *tfprotov5.ImportResourceStateRequest) (*tfprotov5.ImportResourceStateResponse, error)
- func (s *RawProviderServer) PlanResourceChange(ctx context.Context, req *tfprotov5.PlanResourceChangeRequest) (*tfprotov5.PlanResourceChangeResponse, error)
- func (s *RawProviderServer) PrepareProviderConfig(ctx context.Context, req *tfprotov5.PrepareProviderConfigRequest) (*tfprotov5.PrepareProviderConfigResponse, error)
- func (s *RawProviderServer) ReadDataSource(ctx context.Context, req *tfprotov5.ReadDataSourceRequest) (*tfprotov5.ReadDataSourceResponse, error)
- func (s *RawProviderServer) ReadResource(ctx context.Context, req *tfprotov5.ReadResourceRequest) (*tfprotov5.ReadResourceResponse, error)
- func (s *RawProviderServer) StopProvider(ctx context.Context, req *tfprotov5.StopProviderRequest) (*tfprotov5.StopProviderResponse, error)
- func (ps *RawProviderServer) TFTypeFromOpenAPI(ctx context.Context, gvk schema.GroupVersionKind, status bool) (tftypes.Type, error)
- func (s *RawProviderServer) UpgradeResourceState(ctx context.Context, req *tfprotov5.UpgradeResourceStateRequest) (*tfprotov5.UpgradeResourceStateResponse, error)
- func (s *RawProviderServer) ValidateDataSourceConfig(ctx context.Context, req *tfprotov5.ValidateDataSourceConfigRequest) (*tfprotov5.ValidateDataSourceConfigResponse, error)
- func (s *RawProviderServer) ValidateResourceTypeConfig(ctx context.Context, req *tfprotov5.ValidateResourceTypeConfigRequest) (*tfprotov5.ValidateResourceTypeConfigResponse, error)
- type Waiter
Constants ¶
const (
OAPIFoundry string = "OPENAPIFOUNDRY"
)
keys into the global state storage
Variables ¶
This section is empty.
Functions ¶
func APIStatusErrorToDiagnostics ¶ added in v0.3.0
func APIStatusErrorToDiagnostics(s metav1.Status) []*tfprotov5.Diagnostic
APIStatusErrorToDiagnostics converts an Kubernetes API machinery StatusError into Terraform Diagnostics
func FieldPathToTftypesPath ¶ added in v0.3.0
func FieldPathToTftypesPath(fieldPath string) (*tftypes.AttributePath, error)
FieldPathToTftypesPath takes a string representation of a path to a field in dot/square bracket notation and returns a tftypes.AttributePath
func GVKFromTftypesObject ¶ added in v0.3.0
func GVKFromTftypesObject(in *tftypes.Value, m meta.RESTMapper) (schema.GroupVersionKind, error)
GVKFromTftypesObject extracts a canonical schema.GroupVersionKind out of the resource's metadata by checking it agaings the discovery API via a RESTMapper
func GVRFromUnstructured ¶ added in v0.3.0
func GVRFromUnstructured(o *unstructured.Unstructured, m meta.RESTMapper) (schema.GroupVersionResource, error)
GVRFromUnstructured extracts a canonical schema.GroupVersionResource out of the resource's metadata by checking it against the discovery API via a RESTMapper
func GetObjectTypeFromSchema ¶
GetObjectTypeFromSchema returns a tftypes.Type that can wholy represent the schema input
func GetProviderConfigSchema ¶
GetProviderConfigSchema contains the definitions of all configuration attributes
func GetProviderResourceSchema ¶
GetProviderResourceSchema contains the definitions of all supported resources
func GetResourceType ¶ added in v0.3.0
GetResourceType returns the tftypes.Type of a resource of type 'name'
func GetTypeFromSchema ¶ added in v0.3.0
GetTypeFromSchema returns the equivalent tftypes.Type representation of a given tfprotov5.Schema
func IsResourceNamespaced ¶
func IsResourceNamespaced(gvk schema.GroupVersionKind, m meta.RESTMapper) (bool, error)
IsResourceNamespaced determines if a resource is namespaced or cluster-level by querying the Kubernetes discovery API
func RemoveServerSideFields ¶ added in v0.4.0
RemoveServerSideFields removes certain fields which get added to the resource after creation which would cause a perpetual diff
func ServeReattach ¶ added in v0.3.0
ServeReattach is the entrypoint for manually starting the provider as a process in reattach mode for debugging.
Types ¶
type FieldMatcher ¶ added in v0.2.0
type FieldMatcher struct {
// contains filtered or unexported fields
}
FieldMatcher contains a tftypes.AttributePath to a field and a regexp to match on it
type FieldWaiter ¶ added in v0.2.0
type FieldWaiter struct {
// contains filtered or unexported fields
}
FieldWaiter will wait for a set of fields to be set, or have a particular value
type NoopWaiter ¶ added in v0.2.0
type NoopWaiter struct{}
NoopWaiter is a placeholder for when there is nothing to wait on
type RawProviderServer ¶
type RawProviderServer struct { OAPIFoundry openapi.Foundry // contains filtered or unexported fields }
RawProviderServer implements the ProviderServer interface as exported from ProtoBuf.
func (*RawProviderServer) ApplyResourceChange ¶
func (s *RawProviderServer) ApplyResourceChange(ctx context.Context, req *tfprotov5.ApplyResourceChangeRequest) (*tfprotov5.ApplyResourceChangeResponse, error)
ApplyResourceChange function
func (*RawProviderServer) ConfigureProvider ¶ added in v0.3.0
func (s *RawProviderServer) ConfigureProvider(ctx context.Context, req *tfprotov5.ConfigureProviderRequest) (*tfprotov5.ConfigureProviderResponse, error)
ConfigureProvider function
func (*RawProviderServer) GetProviderSchema ¶ added in v0.3.0
func (s *RawProviderServer) GetProviderSchema(ctx context.Context, req *tfprotov5.GetProviderSchemaRequest) (*tfprotov5.GetProviderSchemaResponse, error)
GetProviderSchema function
func (*RawProviderServer) ImportResourceState ¶
func (*RawProviderServer) ImportResourceState(ctx context.Context, req *tfprotov5.ImportResourceStateRequest) (*tfprotov5.ImportResourceStateResponse, error)
ImportResourceState function
func (*RawProviderServer) PlanResourceChange ¶
func (s *RawProviderServer) PlanResourceChange(ctx context.Context, req *tfprotov5.PlanResourceChangeRequest) (*tfprotov5.PlanResourceChangeResponse, error)
PlanResourceChange function
func (*RawProviderServer) PrepareProviderConfig ¶
func (s *RawProviderServer) PrepareProviderConfig(ctx context.Context, req *tfprotov5.PrepareProviderConfigRequest) (*tfprotov5.PrepareProviderConfigResponse, error)
PrepareProviderConfig function
func (*RawProviderServer) ReadDataSource ¶
func (s *RawProviderServer) ReadDataSource(ctx context.Context, req *tfprotov5.ReadDataSourceRequest) (*tfprotov5.ReadDataSourceResponse, error)
ReadDataSource function
func (*RawProviderServer) ReadResource ¶
func (s *RawProviderServer) ReadResource(ctx context.Context, req *tfprotov5.ReadResourceRequest) (*tfprotov5.ReadResourceResponse, error)
ReadResource function
func (*RawProviderServer) StopProvider ¶ added in v0.3.0
func (s *RawProviderServer) StopProvider(ctx context.Context, req *tfprotov5.StopProviderRequest) (*tfprotov5.StopProviderResponse, error)
StopProvider function
func (*RawProviderServer) TFTypeFromOpenAPI ¶ added in v0.3.0
func (ps *RawProviderServer) TFTypeFromOpenAPI(ctx context.Context, gvk schema.GroupVersionKind, status bool) (tftypes.Type, error)
TFTypeFromOpenAPI generates a tftypes.Type representation of a Kubernetes resource designated by the supplied GroupVersionKind resource id
func (*RawProviderServer) UpgradeResourceState ¶
func (s *RawProviderServer) UpgradeResourceState(ctx context.Context, req *tfprotov5.UpgradeResourceStateRequest) (*tfprotov5.UpgradeResourceStateResponse, error)
UpgradeResourceState isn't really useful in this provider, but we have to loop the state back through to keep Terraform happy.
func (*RawProviderServer) ValidateDataSourceConfig ¶
func (s *RawProviderServer) ValidateDataSourceConfig(ctx context.Context, req *tfprotov5.ValidateDataSourceConfigRequest) (*tfprotov5.ValidateDataSourceConfigResponse, error)
ValidateDataSourceConfig function
func (*RawProviderServer) ValidateResourceTypeConfig ¶
func (s *RawProviderServer) ValidateResourceTypeConfig(ctx context.Context, req *tfprotov5.ValidateResourceTypeConfigRequest) (*tfprotov5.ValidateResourceTypeConfigResponse, error)
ValidateResourceTypeConfig function
type Waiter ¶ added in v0.2.0
Waiter is a simple interface to implement a blocking wait operation
func NewResourceWaiter ¶ added in v0.2.0
func NewResourceWaiter(resource dynamic.ResourceInterface, resourceName string, resourceType tftypes.Type, waitForBlock tftypes.Value, hl hclog.Logger) (Waiter, error)
NewResourceWaiter constructs an appropriate Waiter using the supplied waitForBlock configuration