Skip to content

Commit

Permalink
CRD versions fixed (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
EldarAliiev authored May 26, 2022
1 parent 77a0ce6 commit e832fdb
Show file tree
Hide file tree
Showing 21 changed files with 634 additions and 164 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2020 Coralogix Ltd.
Copyright 2022 Coralogix Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Current Operator version
VERSION ?= 0.0.1
VERSION ?= 1.0.1
# Default bundle image tag
BUNDLE_IMG ?= controller-bundle:$(VERSION)
# Options for 'bundle-build'
Expand All @@ -12,9 +12,9 @@ endif
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)

# Image URL to use all building/pushing image targets
IMG ?= controller:latest
IMG ?= "registry.connect.redhat.com/coralogix/coralogix-operator:1.0.0"
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"
CRD_OPTIONS ?= "crd"

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -83,7 +83,7 @@ ifeq (, $(shell which controller-gen))
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$CONTROLLER_GEN_TMP_DIR ;\
go mod init tmp ;\
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.3.0 ;\
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.0 ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
CONTROLLER_GEN=$(GOBIN)/controller-gen
Expand Down Expand Up @@ -119,7 +119,7 @@ bundle: manifests kustomize
packagemanifests: manifests kustomize
operator-sdk generate kustomize manifests -q
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
$(KUSTOMIZE) build config/manifests | operator-sdk generate packagemanifests -q --version $(VERSION) --default-channel --channel $(DEFAULT_CHANNEL)
$(KUSTOMIZE) build config/manifests | operator-sdk generate packagemanifests -q --version $(VERSION) --from-version $(FROM_VERSION) --default-channel --channel $(DEFAULT_CHANNEL)

# Build the bundle image.
.PHONY: bundle-build
Expand Down
10 changes: 8 additions & 2 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ layout: go.kubebuilder.io/v2
projectName: coralogix-operator
repo: github.com/coralogix/coralogix-operator
resources:
- group: loggers
-
# TODO(user): Uncomment the below line if this resource implements a controller, else delete it.
# controller: true
domain: coralogix.com
group: loggers
kind: CoralogixLogger
# TODO(user): Update the package path for your API if the below value is incorrect.
path: github.com/coralogix/coralogix-operator/api/v1
version: v1
version: 3-alpha
version: "3"
plugins:
go.sdk.operatorframework.io/v2-alpha: {}
11 changes: 7 additions & 4 deletions bundle.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +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=coralogix-operator
LABEL operators.operatorframework.io.bundle.channels.v1=stable
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.0.1
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-unknown
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v2
LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/

# 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,16 @@
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
control-plane: controller-manager
name: coralogix-operator-controller-manager-metrics-service
spec:
ports:
- name: https
port: 8443
targetPort: https
selector:
control-plane: controller-manager
status:
loadBalancer: {}
18 changes: 13 additions & 5 deletions bundle/manifests/coralogix-operator.clusterserviceversion.yaml

Large diffs are not rendered by default.

127 changes: 65 additions & 62 deletions bundle/manifests/loggers.coralogix.com_coralogixloggers.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.3.0
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
name: coralogixloggers.loggers.coralogix.com
spec:
Expand All @@ -13,71 +13,74 @@ spec:
plural: coralogixloggers
singular: coralogixlogger
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: Coralogix logging agent.
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: CoralogixLoggerSpec defines the desired state of CoralogixLogger
properties:
cluster_name:
description: Current cluster name
type: string
private_key:
description: Coralogix Private Key
format: password
maxLength: 36
minLength: 36
pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-z]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
type: string
required:
- cluster_name
- private_key
type: object
status:
description: CoralogixLoggerStatus defines the observed state of CoralogixLogger
properties:
clusterRole:
description: ClusterRole name
type: string
clusterRoleBinding:
description: ClusterRoleBinding name
type: string
daemonSet:
description: DaemonSet name
type: string
phase:
description: Phase
type: string
reason:
description: Reason
type: string
serviceAccount:
description: ServiceAccount name
type: string
state:
description: Current state of logging agent
type: string
type: object
type: object
version: v1
versions:
- name: v1
schema:
openAPIV3Schema:
description: Coralogix logging agent.
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: CoralogixLoggerSpec defines the desired state of CoralogixLogger
properties:
cluster_name:
description: Current cluster name
type: string
private_key:
description: Coralogix Private Key
format: password
maxLength: 36
minLength: 36
pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-z]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
type: string
required:
- cluster_name
- private_key
type: object
status:
description: CoralogixLoggerStatus defines the observed state of CoralogixLogger
properties:
clusterRole:
description: ClusterRole name
type: string
clusterRoleBinding:
description: ClusterRoleBinding name
type: string
daemonSet:
description: DaemonSet name
type: string
phase:
description: Phase
type: string
reason:
description: Reason
type: string
serviceAccount:
description: ServiceAccount name
type: string
state:
description: Current state of logging agent
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
conditions: null
storedVersions: null
12 changes: 7 additions & 5 deletions bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
annotations:
operators.operatorframework.io.bundle.channel.default.v1: stable
operators.operatorframework.io.bundle.channels.v1: stable
operators.operatorframework.io.bundle.manifests.v1: manifests/
# 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: coralogix-operator
operators.operatorframework.io.metrics.builder: operator-sdk-v1.0.1
operators.operatorframework.io.bundle.channels.v1: alpha
operators.operatorframework.io.metrics.builder: operator-sdk-unknown
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v2
operators.operatorframework.io.test.config.v1: tests/scorecard/

# Annotations for testing.
operators.operatorframework.io.test.mediatype.v1: scorecard+v1
operators.operatorframework.io.test.config.v1: tests/scorecard/
21 changes: 21 additions & 0 deletions bundle/tests/scorecard/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,59 @@ stages:
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.0.1
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.0.1
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.0.1
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.0.1
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.0.1
labels:
suite: olm
test: olm-status-descriptors-test
storage:
spec:
mountPath: {}
storage:
spec:
mountPath: {}
2 changes: 1 addition & 1 deletion config/crd/bases/_.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
Expand Down
Loading

0 comments on commit e832fdb

Please sign in to comment.