Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
devfile
Browse files Browse the repository at this point in the history
  • Loading branch information
dacleyra committed Jun 11, 2020
2 parents a23b6f8 + b555e35 commit 5967f76
Show file tree
Hide file tree
Showing 21 changed files with 2,946 additions and 281 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:

# Install operator-sdk
env:
- RELEASE_VERSION=v0.16.0
- RELEASE_VERSION=v0.17.1

before_install:
- curl -OJL https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
Expand Down
25 changes: 18 additions & 7 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"os"
"runtime"
"strings"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
_ "k8s.io/client-go/plugin/pkg/client/auth"
Expand All @@ -15,7 +16,7 @@ import (
"github.com/kabanero-io/kabanero-operator/pkg/apis"
"github.com/kabanero-io/kabanero-operator/pkg/controller"

knsapis "github.com/knative/serving-operator/pkg/apis"
knsapis "knative.dev/serving/pkg/apis/serving/v1alpha1"
appsv1 "github.com/openshift/api/apps/v1"
consolev1 "github.com/openshift/api/console/v1"
operatorv1 "github.com/openshift/api/operator/v1"
Expand All @@ -29,9 +30,9 @@ import (
"github.com/operator-framework/operator-sdk/pkg/leader"
"github.com/operator-framework/operator-sdk/pkg/log/zap"
"github.com/operator-framework/operator-sdk/pkg/metrics"
"github.com/operator-framework/operator-sdk/pkg/restmapper"
sdkVersion "github.com/operator-framework/operator-sdk/version"
"github.com/spf13/pflag"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/manager"
logf "sigs.k8s.io/controller-runtime/pkg/log"
Expand Down Expand Up @@ -112,20 +113,30 @@ func main() {
}

ctx := context.TODO()

// Become the leader before proceeding
err = leader.Become(ctx, "kabanero-operator-lock")
if err != nil {
log.Error(err, "")
os.Exit(1)
}

// Create a new Cmd to provide shared dependencies and start components
mgr, err := manager.New(cfg, manager.Options{
// Set default manager options
options := manager.Options{
Namespace: namespace,
MapperProvider: restmapper.NewDynamicRESTMapper,
MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort),
})
}

// Add support for MultiNamespace set in WATCH_NAMESPACE (e.g ns1,ns2)
// Note that this is not intended to be used for excluding namespaces, this is better done via a Predicate
// Also note that you may face performance issues when using this with a high number of namespaces.
// More Info: https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/cache#MultiNamespacedCacheBuilder
if strings.Contains(namespace, ",") {
options.Namespace = ""
options.NewCache = cache.MultiNamespacedCacheBuilder(strings.Split(namespace, ","))
}

// Create a new manager to provide shared dependencies and start components
mgr, err := manager.New(cfg, options)
if err != nil {
log.Error(err, "")
os.Exit(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: TLS_HOST
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: TLS_PORT
value: "9443"
- name: TLS_CERTIFICATE
value: /etc/tls/secrets/openshift.io/kabanero.cli/certs/tls.crt
- name: TLS_PRIVATE_KEY
value: /etc/tls/secrets/openshift.io/kabanero.cli/certs/tls.key
ports:
- containerPort: 9443
protocol: TCP
Expand Down
8 changes: 8 additions & 0 deletions deploy/crds/kabanero.io_collections_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
type: object
status:
description: CollectionStatus defines the observed state of a collection
Expand Down Expand Up @@ -101,6 +102,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
digest:
type: string
name:
Expand All @@ -113,6 +115,7 @@ spec:
- url
type: object
type: array
x-kubernetes-list-type: set
activeVersion:
type: string
availableLocation:
Expand All @@ -129,6 +132,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
status:
type: string
statusMessage:
Expand All @@ -148,6 +152,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
location:
type: string
pipelines:
Expand Down Expand Up @@ -178,6 +183,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
digest:
type: string
name:
Expand All @@ -190,6 +196,7 @@ spec:
- url
type: object
type: array
x-kubernetes-list-type: set
status:
type: string
statusMessage:
Expand All @@ -198,6 +205,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
type: object
type: object
version: v1alpha1
Expand Down
19 changes: 19 additions & 0 deletions deploy/crds/kabanero.io_kabaneros_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
type: object
events:
properties:
Expand Down Expand Up @@ -163,6 +164,7 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
type: object
landing:
description: KabaneroLandingCustomizationSpec defines customization
Expand All @@ -177,6 +179,7 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
tekton:
description: TektonCustomizationSpec defines customization entries
for Tekton
Expand Down Expand Up @@ -253,6 +256,7 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
ready:
type: string
type: object
Expand All @@ -275,6 +279,7 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
ready:
type: string
type: object
Expand All @@ -296,6 +301,7 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
errorMessage:
type: string
ready:
Expand All @@ -304,6 +310,7 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
type: object
knativeEventing:
description: Knative eventing instance readiness status.
Expand Down Expand Up @@ -486,6 +493,7 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
type: object
gitops:
properties:
Expand Down Expand Up @@ -526,6 +534,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
type: object
governancePolicy:
description: GovernancePolicyConfig defines customization entries
Expand Down Expand Up @@ -623,6 +632,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
repositories:
items:
description: RepositoryConfig defines customization entries
Expand Down Expand Up @@ -693,15 +703,18 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
type: object
type: array
x-kubernetes-list-type: set
skipRegistryCertVerification:
type: boolean
type: object
targetNamespaces:
items:
type: string
type: array
x-kubernetes-list-type: set
triggers:
items:
description: TriggerSpec defines the sets of default triggers for
Expand Down Expand Up @@ -739,6 +752,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
version:
type: string
type: object
Expand Down Expand Up @@ -771,6 +785,7 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
message:
type: string
ready:
Expand Down Expand Up @@ -829,6 +844,7 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
message:
type: string
ready:
Expand Down Expand Up @@ -867,6 +883,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
digest:
type: string
gitRelease:
Expand Down Expand Up @@ -912,6 +929,7 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
message:
type: string
ready:
Expand All @@ -920,6 +938,7 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: set
type: object
landing:
description: Kabanero Landing page readiness status.
Expand Down
7 changes: 7 additions & 0 deletions deploy/crds/kabanero.io_stacks_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
metafile:
type: string
pipelines:
Expand Down Expand Up @@ -102,6 +103,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
skipCertVerification:
type: boolean
skipRegistryCertVerification:
Expand All @@ -110,6 +112,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
type: object
status:
description: StackStatus defines the observed state of a stack
Expand Down Expand Up @@ -143,6 +146,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
location:
type: string
pipelines:
Expand Down Expand Up @@ -173,6 +177,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
digest:
type: string
gitRelease:
Expand All @@ -197,6 +202,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
status:
type: string
statusMessage:
Expand All @@ -205,6 +211,7 @@ spec:
type: string
type: object
type: array
x-kubernetes-list-type: set
type: object
type: object
version: v1alpha2
Expand Down
Loading

0 comments on commit 5967f76

Please sign in to comment.