Skip to content

Commit

Permalink
operator [N] [CI] kubensync (0.2.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
eryalito authored Feb 6, 2024
1 parent 19bac29 commit 49a4850
Show file tree
Hide file tree
Showing 8 changed files with 527 additions and 0 deletions.
20 changes: 20 additions & 0 deletions operators/kubensync/0.2.0/bundle.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM scratch

# Core bundle labels.
LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=kubensync
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.28.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3

# Labels for testing.
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/

# Copy files to locations specified by labels.
COPY bundle/manifests /manifests/
COPY bundle/metadata /metadata/
COPY bundle/tests/scorecard /tests/scorecard/
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: managedresources.automation.kubensync.com
spec:
group: automation.kubensync.com
names:
kind: ManagedResource
listKind: ManagedResourceList
plural: managedresources
singular: managedresource
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: ManagedResource is the Schema for the managedresources API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ManagedResourceSpec defines the desired state of ManagedResource
properties:
avoidResourceUpdate:
description: AvoidResourceUpdate defines if the created resources
should be updated if they already exists. Default value is false.
type: boolean
namespaceSelector:
description: ManagedResourceSpecNamespaceSelector defines the selector
used to specify which namespaces are affected
properties:
regex:
description: Regex that the namespace name must match to be selected
type: string
type: object
template:
description: ManagedResourceSpecTemplate defines the resources to
be created when a namespace matches the selector
properties:
data:
description: Data defines a set of refences to secrets or configmaps
items:
description: Describes extra data that will be loaded into the
go template as inputs. They all will be inside `.Data` parent
and all Secret/ConfigMap keys will be loaded. The format inside
the template would look as follows `.Data.${Name}.${Key}`.
properties:
name:
description: Name of the key where the contents will be
created.
type: string
ref:
description: Defines the reference to the resource that
should be imported.
properties:
name:
description: Name of the resource.
type: string
namespace:
description: Namespace of the resource
type: string
type: object
type:
description: Defines the kind of resource the ref is pointing
to. Could be `Secret` or `ConfigMap`.
type: string
type: object
type: array
literal:
description: Literal defines a go template to be renderized for
each namespace matching the selector
type: string
type: object
type: object
status:
description: ManagedResourceStatus defines the observed state of ManagedResource
properties:
createdResources:
items:
properties:
apiVersion:
type: string
kind:
type: string
name:
type: string
namespace:
type: string
triggerNamespace:
type: string
uid:
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: null
storedVersions: null
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: kubensync
app.kubernetes.io/instance: controller-manager-metrics-service
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: service
app.kubernetes.io/part-of: kubensync
control-plane: controller-manager
name: kubensync-controller-manager-metrics-service
spec:
ports:
- name: https
port: 8443
protocol: TCP
targetPort: https
selector:
control-plane: controller-manager
status:
loadBalancer: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: kube-rbac-proxy
app.kubernetes.io/created-by: kubensync
app.kubernetes.io/instance: metrics-reader
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: clusterrole
app.kubernetes.io/part-of: kubensync
name: kubensync-metrics-reader
rules:
- nonResourceURLs:
- /metrics
verbs:
- get

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions operators/kubensync/0.2.0/metadata/annotations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
annotations:
# Core bundle annotations.
operators.operatorframework.io.bundle.mediatype.v1: registry+v1
operators.operatorframework.io.bundle.manifests.v1: manifests/
operators.operatorframework.io.bundle.metadata.v1: metadata/
operators.operatorframework.io.bundle.package.v1: kubensync
operators.operatorframework.io.bundle.channels.v1: alpha
operators.operatorframework.io.metrics.builder: operator-sdk-v1.28.0
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3

# Annotations for testing.
operators.operatorframework.io.test.mediatype.v1: scorecard+v1
operators.operatorframework.io.test.config.v1: tests/scorecard/
70 changes: 70 additions & 0 deletions operators/kubensync/0.2.0/tests/scorecard/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
apiVersion: scorecard.operatorframework.io/v1alpha3
kind: Configuration
metadata:
name: config
stages:
- parallel: true
tests:
- entrypoint:
- scorecard-test
- basic-check-spec
image: quay.io/operator-framework/scorecard-test:v1.28.0
labels:
suite: basic
test: basic-check-spec-test
storage:
spec:
mountPath: {}
- entrypoint:
- scorecard-test
- olm-bundle-validation
image: quay.io/operator-framework/scorecard-test:v1.28.0
labels:
suite: olm
test: olm-bundle-validation-test
storage:
spec:
mountPath: {}
- entrypoint:
- scorecard-test
- olm-crds-have-validation
image: quay.io/operator-framework/scorecard-test:v1.28.0
labels:
suite: olm
test: olm-crds-have-validation-test
storage:
spec:
mountPath: {}
- entrypoint:
- scorecard-test
- olm-crds-have-resources
image: quay.io/operator-framework/scorecard-test:v1.28.0
labels:
suite: olm
test: olm-crds-have-resources-test
storage:
spec:
mountPath: {}
- entrypoint:
- scorecard-test
- olm-spec-descriptors
image: quay.io/operator-framework/scorecard-test:v1.28.0
labels:
suite: olm
test: olm-spec-descriptors-test
storage:
spec:
mountPath: {}
- entrypoint:
- scorecard-test
- olm-status-descriptors
image: quay.io/operator-framework/scorecard-test:v1.28.0
labels:
suite: olm
test: olm-status-descriptors-test
storage:
spec:
mountPath: {}
storage:
spec:
mountPath: {}
5 changes: 5 additions & 0 deletions operators/kubensync/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Use `replaces-mode` or `semver-mode`. Once you switch to `semver-mode`, there is no easy way back.
updateGraph: semver-mode

reviewers:
- eryalito

0 comments on commit 49a4850

Please sign in to comment.