/jx-api

Primary LanguageGoApache License 2.0Apache-2.0

jx-api

Documentation Go Report Card Releases LICENSE Slack Status

Provides an API for JX, can be used with Jenkins X Kube Client to create a programatic interface

Here's an example which also uses Jenkins X logging

import (
    "github.com/jenkins-x/jx-kube-client/v3/pkg/kubeclient"
    "github.com/jenkins-x/jx-logging/v3/pkg/log"
    "github.com/jenkins-x/jx-api/v4/pkg/client/clientset/versioned"
)

func main() {
    f := kubeclient.NewFactory()
    cfg, err := f.CreateKubeConfig()
    if err != nil {
        log.Logger().Fatalf("failed to get kubernetes config: %v", err)
    }


    jxClient, err := versioned.NewForConfig(cfg)
    if err != nil {
        log.Logger().Fatalf("error building jx client: %v", err)
    }
}

See the other modules available