Documentation
¶
Index ¶
- Variables
- func FetchNamespaceFromApplicationResource(application *v20231001preview.ApplicationResource) (string, error)
- func FetchNamespaceFromEnvironmentResource(environment *v20231001preview.EnvironmentResource) (string, error)
- func FetchNamespaceFromEnvironmentResourceV20250801(environment *v20250801preview.EnvironmentResource) string
- func FindNamespaceByEnvID(ctx context.Context, databaseClient database.Client, envID string) (namespace string, err error)
- type Metadata
Constants ¶
This section is empty.
Variables ¶
var ( ErrNonKubernetesEnvironment = errors.New("cannot get namespace because the current environment is not Kubernetes") ErrNoNamespaceInEnvironment = errors.New("no namespace found in the environment resource. Please configure providers.kubernetes.namespace in the environment resource") )
Functions ¶
func FetchNamespaceFromApplicationResource ¶
func FetchNamespaceFromApplicationResource(application *v20231001preview.ApplicationResource) (string, error)
FetchNamespaceFromApplicationResource finds the application-scope Kubernetes namespace from ApplicationResource. If no namespace is found, an error is returned.
func FetchNamespaceFromEnvironmentResource ¶
func FetchNamespaceFromEnvironmentResource(environment *v20231001preview.EnvironmentResource) (string, error)
FetchNamespaceFromEnvironmentResource finds the environment-scope Kubernetes namespace from EnvironmentResource. If no namespace is found, an error is returned.
func FetchNamespaceFromEnvironmentResourceV20250801 ¶ added in v0.53.0
func FetchNamespaceFromEnvironmentResourceV20250801(environment *v20250801preview.EnvironmentResource) string
FetchNamespaceFromEnvironmentResourceV20250801 finds the environment-scope Kubernetes namespace from v20250801preview EnvironmentResource. If no namespace is found, it returns "" instead of error. This is because, Radius might still be able to deploy resources if recipe handles the namespace.
func FindNamespaceByEnvID ¶
func FindNamespaceByEnvID(ctx context.Context, databaseClient database.Client, envID string) (namespace string, err error)
FindNamespaceByEnvID finds the environment-scope Kubernetes namespace. If the environment ID is invalid or the environment is not a Kubernetes environment, an error is returned.
Types ¶
type Metadata ¶
type Metadata struct {
EnvData map[string]string // EnvData contains labels/annotations defined as a KubernetesMetadataExtension at the Environment level.
AppData map[string]string // AppData contains labels/annotations defined as a KubernetesMetadataExtension at the Application level.
Input map[string]string // Input contains labels/annotations defined as a KubernetesMetadataExtension at the Current Resource level.
ObjectMetadata map[string]string // ObjectMetadata contains labels/annotations that are in the outputresource at the ObjectMeta level.
SpecData map[string]string // SpecData contains labels/annotations that are in the outputresource at the Spec level.
}
Metadata represents KubernetesMetadata data. It includes labels/annotations defined as KubernetesMetadataExtension at the Environment/Application/Current Resource(Container eg.) level and pre-existing labels/annotations that may be present in the outputresource.
func (*Metadata) Merge ¶
Merge merges environment, application maps with current values and returns updated metaMap and specMap More info: ObjectMeta: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata Spec: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status