MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / GetJobEnabledPluginNames

Method GetJobEnabledPluginNames

api/v1/cluster_funcs.go:116–135  ·  view source on GitHub ↗

GetJobEnabledPluginNames gets the name of the plugins that are available to the job container

()

Source from the content-addressed store, hash-verified

114
115// GetJobEnabledPluginNames gets the name of the plugins that are available to the job container
116func (cluster *Cluster) GetJobEnabledPluginNames() (result []string) {
117 var instance []string
118 for _, pluginStatus := range cluster.Status.PluginStatus {
119 if slices.Contains(pluginStatus.Capabilities,
120 identity.PluginCapability_Service_TYPE_INSTANCE_JOB_SIDECAR_INJECTION.String()) {
121 instance = append(instance, pluginStatus.Name)
122 }
123 }
124
125 enabled := GetPluginConfigurationEnabledPluginNames(cluster.Spec.Plugins)
126
127 var instanceEnabled []string
128 for _, pluginName := range instance {
129 if slices.Contains(enabled, pluginName) {
130 instanceEnabled = append(instanceEnabled, pluginName)
131 }
132 }
133
134 return instanceEnabled
135}
136
137// GetExternalClustersEnabledPluginNames gets the name of the plugins that are
138// involved in the reconciliation of this external cluster list. This

Callers 3

BootstrapMethod · 0.80

Calls 2

StringMethod · 0.45

Tested by

no test coverage detected