 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- func BuildExternalOutputResources(outputResources []OutputResource) []map[string]any
- func IsGlobalScopedResource(resource ResourceScopePropertiesAdapter) bool
- func NewLocalID(prefix string, ids ...string) string
- func ScopesEqual(a ResourceScopePropertiesAdapter, b ResourceScopePropertiesAdapter) bool
- type ACIComputeProperties
- type BasicDaprResourceProperties
- type BasicResourceProperties
- type BasicResourcePropertiesAdapter
- type ComputedValueReference
- type DaprComponentAuth
- type DaprComponentMetadataValue
- type DaprComponentSecretRef
- type DeploymentDataModel
- type DeploymentOutput
- type EnvironmentCompute
- type EnvironmentComputeKind
- type IdentitySettingKind
- type IdentitySettings
- type KubernetesComputeProperties
- type OutputResource
- type RadiusResourceModel
- type RecipeStatus
- type Resource
- type ResourceScopePropertiesAdapter
- type ResourceStatus
- type SecretValueReference
Constants ¶
const ( LocalIDAzureCosmosAccount = "AzureCosmosAccount" LocalIDAzureCosmosDBMongo = "AzureCosmosDBMongo" LocalIDDaprStateStoreAzureStorage = "DaprStateStoreAzureStorage" LocalIDDaprSecretStoreAzureKeyVault = "DaprSecretStoreAzureKeyVault" LocalIDDaprPubSubBrokerKafka = "DaprPubSubBrokerKafka" LocalIDDeployment = "Deployment" LocalIDGateway = "Gateway" LocalIDHttpProxy = "HttpProxy" LocalIDKeyVault = "KeyVault" LocalIDSecret = "Secret" LocalIDConfigMap = "ConfigMap" LocalIDSecretProviderClass = "SecretProviderClass" LocalIDServiceAccount = "ServiceAccount" LocalIDKubernetesRole = "KubernetesRole" LocalIDKubernetesRoleBinding = "KubernetesRoleBinding" LocalIDService = "Service" LocalIDUserAssignedManagedIdentity = "UserAssignedManagedIdentity" LocalIDFederatedIdentity = "FederatedIdentity" LocalIDRoleAssignmentPrefix = "RoleAssignment" LocalIDAzureCGProfile = "AzureCGProfile" LocalIDAzureCGNGroups = "AzureCGNGroups" LocalIDAzureVirtualNetworkSubnet = "AzureVirtualNetworkSubnet" LocalIDAzureContainerLoadBalancer = "AzureContainerLoadBalancer" LocalIDAzurePublicIP = "AzurePublicIP" LocalIDAzureApplicationGateway = "AzureApplicationGateway" LocalIDAzureNetworkSecurityGroup = "AzureNetworkSecurityGroup" LocalIDHttpRoute = "HttpRoute" LocalIDAzureAppGWNetworkSecurityGroup = "AzureAppGWNetworkSecurityGroup" // Obsolete when we remove AppModelV1 LocalIDRoleAssignmentKVKeys = "RoleAssignment-KVKeys" )
Represents local IDs used for output resources
Variables ¶
This section is empty.
Functions ¶
func BuildExternalOutputResources ¶
func BuildExternalOutputResources(outputResources []OutputResource) []map[string]any
BuildExternalOutputResources builds a slice of maps containing the LocalID, Provider and Identity of each OutputResource.
func IsGlobalScopedResource ¶ added in v0.45.0
func IsGlobalScopedResource(resource ResourceScopePropertiesAdapter) bool
IsGlobalScopedResource checks if resource is global scoped.
func NewLocalID ¶
NewLocalID generates a unique string based on the input parameter ids using a stable hashing algorithm.
Most LocalIDs are a 1:1 mapping with Radius resource. This is a little tricky for role assignments because we need to key them on the resource ID of the target resource X the role being assigned. For example if the user switches their keyvault 'a' for a different instance 'b' we want to delete the original role assignments and create new ones.
func ScopesEqual ¶ added in v0.45.0
func ScopesEqual(a ResourceScopePropertiesAdapter, b ResourceScopePropertiesAdapter) bool
ScopesEqual compares two resources and returns true if their Application and Environment fields are equal (i.e. resource belongs to the same env and app).
Types ¶
type ACIComputeProperties ¶ added in v0.47.0
type ACIComputeProperties struct {
	ResourceGroup string `json:"resourceGroup"`
}
    type BasicDaprResourceProperties ¶
type BasicDaprResourceProperties struct {
	// ComponentName represents the name of the component.
	ComponentName string `json:"componentName,omitempty"`
}
    BasicDaprResourceProperties is the basic resource properties for dapr resources.
type BasicResourceProperties ¶
type BasicResourceProperties struct {
	// Environment represents the id of environment resource.
	Environment string `json:"environment,omitempty"`
	// Application represents the id of application resource.
	Application string `json:"application,omitempty"`
	// Status represents the resource status.
	Status ResourceStatus `json:"status,omitempty"`
}
    BasicResourceProperties is the basic resource model for Radius resources.
func (*BasicResourceProperties) ApplicationID ¶ added in v0.45.0
func (b *BasicResourceProperties) ApplicationID() string
ApplicationID implements BasicResourcePropertiesAdapter.
func (*BasicResourceProperties) EnvironmentID ¶ added in v0.45.0
func (b *BasicResourceProperties) EnvironmentID() string
EnvironmentID implements BasicResourcePropertiesAdapter.
func (*BasicResourceProperties) GetResourceStatus ¶ added in v0.45.0
func (b *BasicResourceProperties) GetResourceStatus() ResourceStatus
GetResourceStatus implements BasicResourcePropertiesAdapter.
func (*BasicResourceProperties) SetResourceStatus ¶ added in v0.45.0
func (b *BasicResourceProperties) SetResourceStatus(status ResourceStatus)
SetResourceStatus implements BasicResourcePropertiesAdapter.
type BasicResourcePropertiesAdapter ¶ added in v0.45.0
type BasicResourcePropertiesAdapter interface {
	ResourceScopePropertiesAdapter
	// GetResourceStatus returns the resource status.
	GetResourceStatus() ResourceStatus
	// SetResourceStatus sets the resource status.
	SetResourceStatus(status ResourceStatus)
}
    BasicResourcePropertiesAdapter is the interface that wraps the basic resource properties.
type ComputedValueReference ¶
type ComputedValueReference struct {
	// LocalID specifies the output resource to be used for lookup. Does not apply with `.Value`
	LocalID string
	// Value specifies a static value to copy to computed values.
	Value any
	// PropertyReference specifies a property key to look up in the resource's *persisted properties*.
	PropertyReference string
	// JSONPointer specifies a JSON Pointer that cn be used to look up the value in the resource's body.
	JSONPointer string
	// Transformer transforms datamodel resource with the computed values.
	Transformer func(v1.DataModelInterface, map[string]any) error
}
    ComputedValueReference represents a non-secret value that can accessed once the output resources have been deployed.
type DaprComponentAuth ¶ added in v0.38.0
type DaprComponentAuth struct {
	// SecretStore is the name of the secret store to fetch secrets from
	SecretStore string `json:"secretStore,omitempty"`
}
    DaprComponentAuth represents the auth configuration for a Dapr component
type DaprComponentMetadataValue ¶ added in v0.38.0
type DaprComponentMetadataValue struct {
	// Plain text value
	Value string `json:"value,omitempty"`
	// SecretKeyRef is a reference to a secret in a Dapr secret store
	SecretKeyRef *DaprComponentSecretRef `json:"secretKeyRef,omitempty"`
}
    DaprComponentMetadataValue is the value of a Dapr Metadata
type DaprComponentSecretRef ¶ added in v0.38.0
type DaprComponentSecretRef struct {
	// Name of the secret in the secret store
	Name string `json:"name,omitempty"`
	// Key of the secret in the secret store
	Key string `json:"key,omitempty"`
}
    DaprComponentSecretRef is a reference to a secret in a Dapr secret store
type DeploymentDataModel ¶
type DeploymentDataModel interface {
	v1.ResourceDataModel
	ApplyDeploymentOutput(deploymentOutput DeploymentOutput) error
	OutputResources() []OutputResource
}
    DeploymentDataModel is the interface that wraps existing data models and enables us to use in generic deployment backend controllers.
type DeploymentOutput ¶
type DeploymentOutput struct {
	DeployedOutputResources []OutputResource
	ComputedValues          map[string]any
	SecretValues            map[string]SecretValueReference
}
    DeploymentOutput is the output details of a deployment.
type EnvironmentCompute ¶
type EnvironmentCompute struct {
	Kind              EnvironmentComputeKind      `json:"kind"`
	KubernetesCompute KubernetesComputeProperties `json:"kubernetes,omitempty"`
	ACICompute        ACIComputeProperties        `json:"aci,omitempty"`
	// Environment-level identity that can be used by any resource in the environment.
	// Resources can specify its own identities and they will override the environment-level identity.
	Identity *IdentitySettings `json:"identity,omitempty"`
}
    EnvironmentCompute represents the compute resource of Environment.
type EnvironmentComputeKind ¶
type EnvironmentComputeKind string
EnvironmentComputeKind is the type of compute resource.
const ( // UnknownComputeKind represents kubernetes compute resource type. UnknownComputeKind EnvironmentComputeKind = "unknown" // KubernetesComputeKind represents kubernetes compute resource type. KubernetesComputeKind EnvironmentComputeKind = "kubernetes" // ACIComputeKind represents ACI compute resource type. ACIComputeKind EnvironmentComputeKind = "aci" )
type IdentitySettingKind ¶
type IdentitySettingKind string
IdentitySettingKind represents the kind of identity setting.
const ( // IdentityNone represents unknown identity. IdentityNone IdentitySettingKind = "None" // AzureIdentityWorkload represents Azure Workload identity. AzureIdentityWorkload IdentitySettingKind = "azure.com.workload" // UserAssigned represents Azure User Assigned Managed Identity. UserAssigned IdentitySettingKind = "userAssigned" // SystemAssigned represents Azure System Assigned Managed Identity. SystemAssigned IdentitySettingKind = "systemAssigned" // SystemAssignedUserAssigned represents Azure System Assigned and User Assigned Managed Identity. SystemAssignedUserAssigned IdentitySettingKind = "systemAssignedUserAssigned" )
type IdentitySettings ¶
type IdentitySettings struct {
	// Kind represents the type of authentication.
	Kind IdentitySettingKind `json:"kind"`
	// OIDCIssuer represents the name of OIDC issuer.
	OIDCIssuer string `json:"oidcIssuer,omitempty"`
	// Resource represents the resource id of managed identity.
	Resource string `json:"resource,omitempty"`
	// ManagedIdentity represents the list of user assigned managed identities.
	ManagedIdentity []string `json:"managedIdentity,omitempty"`
}
    IdentitySettings represents the identity info to access azure resource, such as Key vault.
func (*IdentitySettings) Validate ¶
func (is *IdentitySettings) Validate() error
Validate checks if the IdentitySettings struct is nil and if the Kind is AzureIdentityWorkload, checks if the OIDCIssuer is empty and if the Resource is not empty. It returns an error if any of these conditions are not met.
type KubernetesComputeProperties ¶
type KubernetesComputeProperties struct {
	// ResourceID represents the resource ID for kubernetes compute resource.
	ResourceID string `json:"resourceId,omitempty"`
	// Namespace represents Kubernetes namespace.
	Namespace string `json:"namespace"`
}
    KubernetesComputeProperties represents the kubernetes compute of the environment.
type OutputResource ¶
type OutputResource struct {
	// LocalID is a logical identifier scoped to the owning Radius resource. This is only needed or used
	// when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning
	// beyond being compared to determine dependency relationships.
	LocalID string `json:"localID"`
	// ID is the UCP resource ID of the underlying resource.
	ID resources.ID `json:"id"`
	// RadiusManaged determines whether Radius manages the lifecycle of the underlying resource.
	RadiusManaged *bool `json:"radiusManaged"`
	AdditionalProperties map[string]string `json:"additionalProperties,omitempty"`
	// CreateResource describes data that will be used to create a resource. This is never saved to the database.
	CreateResource *Resource `json:"-"`
}
    OutputResource represents the output of rendering a resource
func GetGCOutputResources ¶
func GetGCOutputResources(after []OutputResource, before []OutputResource) []OutputResource
GetGCOutputResources [GC stands for Garbage Collection] compares two slices of OutputResource and returns a slice of OutputResource that contains the elements that are in the "before" slice but not in the "after".
func NewKubernetesOutputResource ¶
func NewKubernetesOutputResource(localID string, obj runtime.Object, objectMeta metav1.ObjectMeta) OutputResource
NewKubernetesOutputResource creates an OutputResource object with the given resourceType, localID, obj and objectMeta.
func OrderOutputResources ¶
func OrderOutputResources(outputResources []OutputResource) ([]OutputResource, error)
OrderOutputResources orders the given OutputResources based on their dependencies (i.e. deployment order) and returns the ordered OutputResources or an error.
func (OutputResource) GetDependencies ¶
func (resource OutputResource) GetDependencies() ([]string, error)
GetDependencies returns a slice of strings containing the LocalIDs of the OutputResource's dependencies, or an error if any of the dependencies are missing a LocalID.
func (OutputResource) GetResourceType ¶
func (or OutputResource) GetResourceType() resourcemodel.ResourceType
GetResourceType returns the ResourceType of the OutputResource.
func (OutputResource) IsRadiusManaged ¶
func (resource OutputResource) IsRadiusManaged() bool
IsRadiusManaged checks if the RadiusManaged field of the OutputResource struct is set and returns its value.
func (OutputResource) Key ¶
func (resource OutputResource) Key() string
Key localID of the output resource is used as the key in DependencyItem for output resources.
type RadiusResourceModel ¶
type RadiusResourceModel interface {
	v1.ResourceDataModel
	ApplyDeploymentOutput(deploymentOutput DeploymentOutput) error
	OutputResources() []OutputResource
	ResourceMetadata() BasicResourcePropertiesAdapter
}
    RadiusResourceModel represents the interface of radius resource type. TODO: Replace DeploymentDataModel with RadiusResourceModel later when link rp leverages generic.
type RecipeStatus ¶ added in v0.27.0
type RecipeStatus struct {
	// TemplateKind specifies the kind of template used for the recipe.
	TemplateKind string `json:"templateKind,omitempty"`
	// TemplatePath specifies the path of the template used for the recipe.
	TemplatePath string `json:"templatePath,omitempty"`
	// TemplateVersion specifies the version of the template used for the recipe.
	TemplateVersion string `json:"templateVersion,omitempty"`
}
    RecipeStatus defines the status of the recipe
type Resource ¶
type Resource struct {
	// Data is the arbitrary data that will be passed to the handler.
	Data any
	// ResourceType is the type of resource that will be created. This is used for dispatching to the correct handler.
	ResourceType resourcemodel.ResourceType
	// Dependencies is the set of LocalIDs of the resources that are required to be deployed before this resource can be deployed.
	Dependencies []string
}
    Resource describes data that will be used to create a resource. This data is not saved to the database.
func (Resource) ExistDependency ¶
ExistDependency checks if the given id is in the Dependencies of the Resource and returns true if it is, false otherwise.
type ResourceScopePropertiesAdapter ¶ added in v0.45.0
type ResourceScopePropertiesAdapter interface {
	// ApplicationID returns the resource id of the application.
	ApplicationID() string
	// EnvironmentID returns the resource id of the environment.
	EnvironmentID() string
}
    ResourceScopePropertiesAdapter is the interface that wraps the resource scope properties (application and environment ids).
type ResourceStatus ¶
type ResourceStatus struct {
	// Compute represents a resource presented in the underlying platform.
	Compute *EnvironmentCompute `json:"compute,omitempty"`
	// OutputResources represents the output resources associated with the radius resource.
	OutputResources []OutputResource `json:"outputResources,omitempty"`
	Recipe          *RecipeStatus    `json:"recipe,omitempty"`
}
    ResourceStatus represents the output status of Radius resource.
func (ResourceStatus) DeepCopyRecipeStatus ¶ added in v0.45.0
func (original ResourceStatus) DeepCopyRecipeStatus() ResourceStatus
DeepCopyRecipeStatus creates a copy of ResourceStatus. It only deep-copies the Recipe field (if not nil). Other fields (Compute and OutputResources) will reference the same underlying data as the original.
type SecretValueReference ¶
type SecretValueReference struct {
	// Value is the secret value itself
	Value string
}
    SecretValueReference represents a secret value that can accessed on the output resources have been deployed.