-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
…unts ServiceAccountRoleIDExtractor
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package common | ||
|
||
import ( | ||
"github.com/crossplane/crossplane-runtime/pkg/fieldpath" | ||
"github.com/crossplane/crossplane-runtime/pkg/reference" | ||
xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" | ||
) | ||
|
||
const ( | ||
// SelfPackagePath is the golang path for this package. | ||
SelfPackagePath = "github.com/crossplane-contrib/provider-keycloak/config/common" | ||
|
||
// PathServiceAccountRoleIDExtractor is the golang path to ARNExtractor function | ||
// in this package. | ||
PathServiceAccountRoleIDExtractor = SelfPackagePath + ".ServiceAccountRoleIDExtractor()" | ||
) | ||
|
||
func ServiceAccountRoleIDExtractor() reference.ExtractValueFn { | ||
Check failure on line 18 in config/common/common.go GitHub Actions / lint
Check failure on line 18 in config/common/common.go GitHub Actions / lint
|
||
return func(mg xpresource.Managed) string { | ||
paved, err := fieldpath.PaveObject(mg) | ||
if err != nil { | ||
// todo(hasan): should we log this error? | ||
return "" | ||
} | ||
r, err := paved.GetString("status.atProvider.serviceAccountUserId") | ||
if err != nil { | ||
// todo(hasan): should we log this error? | ||
return "" | ||
} | ||
return r | ||
} | ||
} |