provider-jfrog-platform

module
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2026 License: Apache-2.0

README

Provider JFrog Platform

provider-jfrog-platform is a Crossplane provider that is built using Upjet code generation tools and exposes XRM-conformant managed resources for the JFrog Platform API.

The repo was created from the crossplane/upjet-provider-template@7311f9f template.

The provider is generated from Terraform provider jfrog/platform v2.2.7.

Getting Started

Install the provider by using the following command after changing the image tag to the latest release:

up ctp provider install hmlkao/provider-jfrog-platform:v0.6.2

Alternatively, you can use declarative installation:

cat <<EOF | kubectl apply -f -
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
  name: provider-jfrog-platform
spec:
  package: hmlkao/provider-jfrog-platform:v0.6.2
EOF

Notice that in this example, the Provider resource is referencing a ControllerConfig with debug enabled.

You can see the API reference here.

Supported resources

This is a list of all resources from Terraform provider v2.2.7.

The short group is platform, so the apiGroup is platform.jfrog.crossplane.io for cluster-scoped resources.

The short group is platform, so the apiGroup is platform.jfrog.m.crossplane.io for namespace-scoped resources.

Resource Supported Kind
platform_aws_iam_role AWSIAMRole
platform_crowd_settings CrowdSettings
platform_global_role GlobalRole
platform_group ✔ (Known Issues) Group
platform_group_members ❌ (Resource Import Not Implemented)
platform_http_sso_settings HTTPSSOSettings
platform_license ❌ (Resource Import Not Implemented)
platform_oidc_configuration OIDCConfiguration
platform_oidc_identity_mapping ✔ (Nested Schema) OIDCIdentityMapping
platform_permission ✔ (Nested Schema) Permission
platform_reverse_proxy ReverseProxy
platform_saml_settings SAMLSettings
platform_scim_group ✔ (Nested Schema) SCIMGroup
platform_scim_user ✔ (Nested Schema) (Known Issues) SCIMUser
platform_workers_service ✔ (Nested Schema) WorkersService

Adding new resource

  1. Add/Modify files related to the Terraform resource (check this reference commit), an example diff for human-modified files:

    $ git diff HEAD^^ HEAD^
    diff --git a/README.md b/README.md
    index 28e6ea5..e0cd4bf 100644
    --- a/README.md
    +++ b/README.md
    @@ -68,7 +68,7 @@ The short group is `platform`, so the `apiGroup` is `platform.artifactory.jfrog.
     | `platform_reverse_proxy`         | :heavy_check_mark:                                                                         | `ReverseProxy`      |
     | `platform_saml_settings`         | :heavy_check_mark:                                                                         | `SAMLSettings`      |
     | `platform_scim_group`            | :heavy_check_mark: ([Nested Schema](./KNOWN_ISSUES.md#nested-schema))                      | `SCIMGroup`         |
    -| `platform_scim_user`             | :x: ([Nested Schema](./KNOWN_ISSUES.md#nested-schema))                                     |                     |
    +| `platform_scim_user`             | :heavy_check_mark: ([Nested Schema](./KNOWN_ISSUES.md#nested-schema))                      | `SCIMUser`          |
     | `platform_workers_service`       | :x: ([Nested Schema](./KNOWN_ISSUES.md#nested-schema))                                     |                     |
    
    ## Adding new resource
    diff --git a/config/cluster/scim_user/config.go b/config/cluster/scim_user/config.go
    new file mode 100644
    index 0000000..1f9c52b
    --- /dev/null
    +++ b/config/cluster/scim_user/config.go
    @@ -0,0 +1,21 @@
    +package scimuser
    +
    +import (
    +        "errors"
    +
    +        "github.com/crossplane/upjet/v2/pkg/config"
    +)
    +
    +// Configure configures individual resources by adding custom ResourceConfigurators.
    +func Configure(p *config.Provider) {
    +        p.AddResourceConfigurator("platform_scim_user", func(r *config.Resource) {
    +                r.ShortGroup = "platform"
    +                r.Kind = "SCIMUser"
    +                r.ExternalName.GetExternalNameFn = func(tfstate map[string]any) (string, error) {
    +                        if username, ok := tfstate["username"].(string); ok && username != "" {
    +                                return username, nil
    +                        }
    +                        return "", errors.New("cannot find 'username' in tfstate")
    +                }
    +        })
    +}
    diff --git a/config/external_name.go b/config/external_name.go
    index b9570e9..8482aea 100644
    --- a/config/external_name.go
    +++ b/config/external_name.go
    @@ -19,6 +19,7 @@ var ExternalNameConfigs = map[string]config.ExternalName{
            "platform_reverse_proxy":      config.IdentifierFromProvider,
            "platform_saml_settings":      config.IdentifierFromProvider,
            "platform_scim_group":         config.IdentifierFromProvider,
    +       "platform_scim_user":          config.IdentifierFromProvider,
    }
    
    // ExternalNameConfigurations applies all external name configs listed in the
    diff --git a/config/namespaced/scim_user/config.go b/config/namespaced/scim_user/config.go
    new file mode 100644
    index 0000000..1f9c52b
    --- /dev/null
    +++ b/config/namespaced/scim_user/config.go
    @@ -0,0 +1,21 @@
    +package scimuser
    +
    +import (
    +        "errors"
    +
    +        "github.com/crossplane/upjet/v2/pkg/config"
    +)
    +
    +// Configure configures individual resources by adding custom ResourceConfigurators.
    +func Configure(p *config.Provider) {
    +        p.AddResourceConfigurator("platform_scim_user", func(r *config.Resource) {
    +                r.ShortGroup = "platform"
    +                r.Kind = "SCIMUser"
    +                r.ExternalName.GetExternalNameFn = func(tfstate map[string]any) (string, error) {
    +                        if username, ok := tfstate["username"].(string); ok && username != "" {
    +                                return username, nil
    +                        }
    +                        return "", errors.New("cannot find 'username' in tfstate")
    +                }
    +        })
    +}
    diff --git a/config/provider_cluster.go b/config/provider_cluster.go
    index b76f058..46bc337 100644
    --- a/config/provider_cluster.go
    +++ b/config/provider_cluster.go
    @@ -18,6 +18,7 @@ import (
            reverseproxy "github.com/hmlkao/provider-jfrog-platform/config/cluster/reverse_proxy"
            samlsettings "github.com/hmlkao/provider-jfrog-platform/config/cluster/saml_settings"
            scimgroup "github.com/hmlkao/provider-jfrog-platform/config/cluster/scim_group"
    +       scimuser "github.com/hmlkao/provider-jfrog-platform/config/cluster/scim_user"
    )
    
    // GetProvider returns provider configuration
    @@ -41,6 +42,7 @@ func GetProvider() *ujconfig.Provider {
                    reverseproxy.Configure,
                    samlsettings.Configure,
                    scimgroup.Configure,
    +               scimuser.Configure,
            } {
                    configure(pc)
            }
    diff --git a/config/provider_namespaced.go b/config/provider_namespaced.go
    index a48487e..cb75c9f 100644
    --- a/config/provider_namespaced.go
    +++ b/config/provider_namespaced.go
    @@ -18,6 +18,7 @@ import (
            reverseproxy "github.com/hmlkao/provider-jfrog-platform/config/namespaced/reverse_proxy"
            samlsettings "github.com/hmlkao/provider-jfrog-platform/config/namespaced/saml_settings"
            scimgroup "github.com/hmlkao/provider-jfrog-platform/config/namespaced/scim_group"
    +       scimuser "github.com/hmlkao/provider-jfrog-platform/config/namespaced/scim_user"
    )
    
    // GetProvider returns provider configuration
    @@ -41,6 +42,7 @@ func GetProviderNamespaced() *ujconfig.Provider {
                    reverseproxy.Configure,
                    samlsettings.Configure,
                    scimgroup.Configure,
    +               scimuser.Configure,
            } {
                    configure(pc)
            }
    diff --git a/examples/namespaced/scim_user/scim_user.yaml b/examples/namespaced/scim_user/scim_user.yaml
    new file mode 100644
    index 0000000..19fd3cc
    --- /dev/null
    +++ b/examples/namespaced/scim_user/scim_user.yaml
    @@ -0,0 +1,14 @@
    +apiVersion: platform.jfrog.m.crossplane.io/v1alpha1
    +kind: SCIMUser
    +metadata:
    +  name: my-scim-user
    +  namespace: example-namespace
    +spec:
    +  forProvider:
    +    username: test@tempurl.org
    +    emails:
    +    - primary: true
    +      value: test@tempurl.org
    +  providerConfigRef:
    +    kind: ProviderConfig
    +    name: default
    
  2. Generate the resource files

    make generate
    
  3. Verify that the changes are reviewable

    make reviewable test
    
  4. Create a PR with all files included

Build provider from scratch

Check BUILD_FROM_SCRATCH.md for notes on how provider-jfrog-artifactory was built using the crossplane/upjet tool step-by-step.

Developing

Run code-generation pipeline:

go run cmd/generator/main.go "$PWD"

Run against a Kubernetes cluster:

make run

Build, push, and install:

make all

Build binary:

make build

JFrog Platform icon

The package icon was pulled from JFrog Brand Guidelines.

The icon is stored in the extensions/icons/ folder according to the instructions Add documentation, icons, and other assets to your package.

Report a Bug

For filing bugs, suggesting improvements, or requesting new features, please open an issue.

Directories

Path Synopsis
apis
cluster
Package cluster contains Kubernetes API for the provider.
Package cluster contains Kubernetes API for the provider.
cluster/platform/v1alpha1
+kubebuilder:object:generate=true +groupName=platform.jfrog.crossplane.io +versionName=v1alpha1
+kubebuilder:object:generate=true +groupName=platform.jfrog.crossplane.io +versionName=v1alpha1
cluster/v1alpha1
Package v1alpha1 contains the core resources of the jfrog-platform jet provider.
Package v1alpha1 contains the core resources of the jfrog-platform jet provider.
cluster/v1beta1
Package v1beta1 contains the core resources of the jfrog-platform upjet provider.
Package v1beta1 contains the core resources of the jfrog-platform upjet provider.
namespaced
Package namespaced contains Kubernetes API for the provider.
Package namespaced contains Kubernetes API for the provider.
namespaced/platform/v1alpha1
+kubebuilder:object:generate=true +groupName=platform.jfrog.m.crossplane.io +versionName=v1alpha1
+kubebuilder:object:generate=true +groupName=platform.jfrog.m.crossplane.io +versionName=v1alpha1
namespaced/v1alpha1
Package v1alpha1 contains the core resources of the jfrog-platform jet provider.
Package v1alpha1 contains the core resources of the jfrog-platform jet provider.
namespaced/v1beta1
Package v1beta1 contains the core resources of the jfrog-platform upjet provider.
Package v1beta1 contains the core resources of the jfrog-platform upjet provider.
cmd
generator command
provider command
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL