Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AutocompleteGKEClusterNamesTask = inspectiontaskbase.NewCachedTask(googlecloudclustergke_contract.AutocompleteGKEClusterNamesTaskID, []taskid.UntypedTaskReference{ googlecloudclustergke_contract.ClusterListFetcherTaskID.Ref(), googlecloudcommon_contract.InputProjectIdTaskID.Ref(), }, func(ctx context.Context, prevValue inspectiontaskbase.CacheableTaskResult[*googlecloudk8scommon_contract.AutocompleteClusterNameList]) (inspectiontaskbase.CacheableTaskResult[*googlecloudk8scommon_contract.AutocompleteClusterNameList], error) { listFetcher := coretask.GetTaskResult(ctx, googlecloudclustergke_contract.ClusterListFetcherTaskID.Ref()) projectID := coretask.GetTaskResult(ctx, googlecloudcommon_contract.InputProjectIdTaskID.Ref()) if projectID != "" && projectID == prevValue.DependencyDigest { return prevValue, nil } if projectID != "" { clusters, err := listFetcher.GetClusterNames(ctx, projectID) if err != nil { slog.WarnContext(ctx, "Failed to read cluster names for project", "projectID", projectID, "error", err) return inspectiontaskbase.CacheableTaskResult[*googlecloudk8scommon_contract.AutocompleteClusterNameList]{ DependencyDigest: projectID, Value: &googlecloudk8scommon_contract.AutocompleteClusterNameList{ ClusterNames: []string{}, Error: fmt.Sprintf("Failed to list GKE cluster names: %v", err), }, }, nil } return inspectiontaskbase.CacheableTaskResult[*googlecloudk8scommon_contract.AutocompleteClusterNameList]{ DependencyDigest: projectID, Value: &googlecloudk8scommon_contract.AutocompleteClusterNameList{ ClusterNames: clusters, Error: "", }, }, nil } return inspectiontaskbase.CacheableTaskResult[*googlecloudk8scommon_contract.AutocompleteClusterNameList]{ DependencyDigest: projectID, Value: &googlecloudk8scommon_contract.AutocompleteClusterNameList{ ClusterNames: []string{}, Error: "Project ID is empty", }, }, nil }, inspectioncore_contract.InspectionTypeLabel(googlecloudclustergke_contract.InspectionTypeId))
AutocompleteGKEClusterNamesTask is a task that provides autocomplete suggestions for GKE cluster names.
View Source
var ClusterListFetcherTask = coretask.NewTask(googlecloudclustergke_contract.ClusterListFetcherTaskID, []taskid.UntypedTaskReference{ googlecloudcommon_contract.APIClientFactoryTaskID.Ref(), googlecloudcommon_contract.APIClientCallOptionsInjectorTaskID.Ref(), }, func(ctx context.Context) (googlecloudclustergke_contract.ClusterListFetcher, error) { return &googlecloudclustergke_contract.ClusterListFetcherImpl{}, nil })
ClusterListFetcherTask is a task to inject ClusterListFetcherImpl instance and enable tests to inject mock instance.
View Source
var GKEClusterNamePrefixTask = coretask.NewTask(googlecloudclustergke_contract.ClusterNamePrefixTaskIDForGKE, []taskid.UntypedTaskReference{}, func(ctx context.Context) (string, error) { return "", nil }, inspectioncore_contract.InspectionTypeLabel(googlecloudclustergke_contract.InspectionTypeId))
GKEClusterNamePrefixTask is a task that returns an empty string as the cluster name prefix for GKE. This task is necessary to satisfy the dependency of the log source profile, but GKE does not require a prefix.
Functions ¶
func Register ¶
func Register(registry coreinspection.InspectionTaskRegistry) error
Register registers all googlecloudclustergke inspection tasks to the registry.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.