// GetConfig gets the config.
GetConfig gets the config.
// GetConfig gets the config .
func GetConfig(ctx context.Context, c client.Client, mg resource.Managed) ([]byte, error) {
	pc := &v1beta1.ProviderConfig{}
	if err := c.Get(ctx, types.NamespacedName{Name: mg.GetProviderConfigReference().Name}, pc); err != nil {
		return nil, errors.Wrap(err, "cannot get referenced ProviderConfig")
	}
	t := resource.NewProviderConfigUsageTracker(c, &v1beta1.ProviderConfigUsage{})
	if err := t.Track(ctx, mg); err != nil {
		return nil, errors.Wrap(err, "cannot track ProviderConfig usage")
	}
	return resource.CommonCredentialExtractor(ctx, pc.Spec.Credentials.Source, c, pc.Spec.Credentials.CommonCredentialSelectors)
}
func GetConfig ( ctx context . Context , c client . Client , mg resource . Managed ) ( [ ] byte , error ) { pc := & v1beta1 . ProviderConfig { } if err := c . Get ( ctx , types . NamespacedName { Name : mg . GetProviderConfigReference ( ) . Name } , pc ) ; err != nil { return nil , errors . Wrap ( err , " " ) } t := resource . NewProviderConfigUsageTracker ( c , & v1beta1 . ProviderConfigUsage { } ) if err := t . Track ( ctx , mg ) ; err != nil { return nil , errors . Wrap ( err , " " ) } return resource . CommonCredentialExtractor ( ctx , pc . Spec . Credentials . Source , c , pc . Spec . Credentials . CommonCredentialSelectors ) }
GetConfig gets the config.
GetConfig gets the config .