Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates Kube API for Ingress & CRDs #16

Merged
merged 9 commits into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions .ci/openshift_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@ set -u
# print each command before executing it
set -x

echo tests disabled
# # Make sure we're running the integration tests with the image built by OpenShift CI
# export IMG=${REGISTRY_OPERATOR}
# Make sure we're running the integration tests with the image built by OpenShift CI
export IMG=${REGISTRY_OPERATOR}

# # For some reason go on PROW force usage vendor folder
# # This workaround is here until we don't figure out cause
# go mod tidy
# go mod vendor
# For some reason go on PROW force usage vendor folder
# This workaround is here until we don't figure out cause
go mod tidy
go mod vendor

# # Make sure kustomize and controller-gen are installed before running the tests
# # ToDo: Remove later, should not be required.
# make kustomize
# make controller-gen
# Make sure kustomize and controller-gen are installed before running the tests
# ToDo: Remove later, should not be required.
make kustomize
make controller-gen

# make test-integration
make test-integration
12 changes: 9 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.12
go-version: ^1.17
-
name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand All @@ -44,7 +44,7 @@ jobs:
go mod tidy
if [[ ! -z $(git status -s) ]]
then
echo "Go mod state is not clean"
echo "Go mod state is not clean: $(git status -s)"
exit 1
fi
-
Expand All @@ -55,10 +55,16 @@ jobs:
git reset HEAD --hard

make fmt
if [[ ! -z $(git status -s) ]]
then
echo "not well formatted sources found during make fmt: $(git status -s)"
exit 1
fi

make fmt_license
if [[ ! -z $(git status -s) ]]
then
echo "not well formatted sources are found"
echo "not well formatted sources found during make fmt_license: $(git status -s)"
exit 1
fi
-
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.13 as builder
FROM golang:1.17 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ manifests: controller-gen
### fmt: Run go fmt against code
fmt:
ifneq ($(shell command -v goimports 2> /dev/null),)
find . -name '*.go' -exec goimports -w {} \;
find . -name '*.go' -not -name '*zz_generated*.go' -exec goimports -w {} \;
else
@echo "WARN: goimports is not installed -- formatting using go fmt instead."
@echo " Please install goimports to ensure file imports are consistent."
Expand Down Expand Up @@ -120,7 +120,7 @@ ifeq (, $(shell which controller-gen))
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$CONTROLLER_GEN_TMP_DIR ;\
go mod init tmp ;\
GOFLAGS="" go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.3.0 ;\
GOFLAGS="" go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.5.0 ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
CONTROLLER_GEN=$(GOBIN)/controller-gen
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The repository contains a Makefile; building and deploying can be configured via

|variable|purpose|default value|
|---|---|---|
| `IMG` | Image used for controller | `quay.io/devfile/registry-operator:next` |
| `IMG` | Image used for controller (run makefile, if `IMG` is updated) | `quay.io/devfile/registry-operator:next` |

Some of the rules supported by the makefile:

Expand All @@ -85,6 +85,7 @@ Some of the rules supported by the makefile:
| uninstall | remove the devfile registry operator and CRDs from the cluster |
| manifests | Generate manifests e.g. CRD, RBAC etc. |
| generate | Generate the API type definitions. Must be run after modifying the DevfileRegistry type. |
| bundle | Generate bundle manifests and metadata, then validate generated files. |
| test_integration | Run the integration tests for the operator. |

To see all rules supported by the makefile, run `make help`
Expand Down
21 changes: 21 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=registry-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.12.0+git
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.4.0+git
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v2

# Labels for testing.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: registry-operator-metrics-reader
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
Expand Down
7 changes: 4 additions & 3 deletions bundle/manifests/registry-operator.clusterserviceversion.yaml

Large diffs are not rendered by default.

171 changes: 101 additions & 70 deletions bundle/manifests/registry.devfile.io_devfileregistries.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
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.5.0
creationTimestamp: null
name: devfileregistries.registry.devfile.io
spec:
additionalPrinterColumns:
- JSONPath: .status.url
description: The URL for the Devfile Registry
name: URL
type: string
group: registry.devfile.io
names:
kind: DevfileRegistry
Expand All @@ -21,72 +16,108 @@ spec:
- dr
singular: devfileregistry
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
description: DevfileRegistry is the Schema for the devfileregistries 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: DevfileRegistrySpec defines the desired state of DevfileRegistry
properties:
devfileIndexImage:
description: Sets the container image containing devfile stacks to be deployed on the Devfile Registry
type: string
k8s:
description: DevfileRegistrySpecK8sOnly defines the desired state of the kubernetes-only fields of the DevfileRegistry
properties:
ingressDomain:
description: Ingress domain for a Kubernetes cluster. This MUST be explicitly specified on Kubernetes. There are no defaults
type: string
type: object
ociRegistryImage:
description: Overrides the container image used for the OCI registry. Recommended to leave blank and default to the image specified by the operator.
type: string
storage:
description: DevfileRegistrySpecStorage defines the desired state of the storage for the DevfileRegistry
properties:
enabled:
description: Instructs the operator to deploy the DevfileRegistry with persistent storage Enabled by default. Disabling is only recommended for development or test.
type: boolean
ociRegistryImage:
description: Configures the size of the devfile registry's persistent volume, if enabled. Defaults to 1Gi.
type: string
type: object
tls:
description: DevfileRegistrySpecTLS defines the desired state for TLS in the DevfileRegistry
properties:
enabled:
description: Instructs the operator to deploy the DevfileRegistry with TLS enabled. Enabled by default. Disabling is only recommended for development or test.
type: boolean
ociRegistryImage:
description: Name of an optional, pre-existing TLS secret to use for TLS termination on ingress/route resources.
type: string
type: object
type: object
status:
description: DevfileRegistryStatus defines the observed state of DevfileRegistry
properties:
url:
description: URL is the exposed URL for the Devfile Registry, and is set in the status after the registry has become available.
type: string
required:
- url
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: The URL for the Devfile Registry
jsonPath: .status.url
name: URL
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: DevfileRegistry is the Schema for the devfileregistries 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: DevfileRegistrySpec defines the desired state of DevfileRegistry
properties:
devfileIndexImage:
description: Sets the container image containing devfile stacks to
be deployed on the Devfile Registry
type: string
k8s:
description: DevfileRegistrySpecK8sOnly defines the desired state
of the kubernetes-only fields of the DevfileRegistry
properties:
ingressDomain:
description: Ingress domain for a Kubernetes cluster. This MUST
be explicitly specified on Kubernetes. There are no defaults
type: string
type: object
ociRegistryImage:
description: Overrides the container image used for the OCI registry.
Recommended to leave blank and default to the image specified by
the operator.
type: string
storage:
description: DevfileRegistrySpecStorage defines the desired state
of the storage for the DevfileRegistry
properties:
enabled:
description: Instructs the operator to deploy the DevfileRegistry
with persistent storage Enabled by default. Disabling is only
recommended for development or test.
type: boolean
ociRegistryImage:
description: Configures the size of the devfile registry's persistent
volume, if enabled. Defaults to 1Gi.
type: string
type: object
telemetry:
description: Telemetry defines the desired state for telemetry in
the DevfileRegistry
properties:
enabled:
description: Instructs the operator to deploy the DevfileRegistry
with telemetry enabled. Disabled by default. Enabling is recommended
for registry improvement.
type: boolean
registryName:
description: The registry name (can be any string) that is used
as identifier for devfile telemetry.
type: string
type: object
tls:
description: DevfileRegistrySpecTLS defines the desired state for
TLS in the DevfileRegistry
properties:
enabled:
description: Instructs the operator to deploy the DevfileRegistry
with TLS enabled. Enabled by default. Disabling is only recommended
for development or test.
type: boolean
ociRegistryImage:
description: Name of an optional, pre-existing TLS secret to use
for TLS termination on ingress/route resources.
type: string
type: object
type: object
status:
description: DevfileRegistryStatus defines the observed state of DevfileRegistry
properties:
url:
description: URL is the exposed URL for the Devfile Registry, and
is set in the status after the registry has become available.
type: string
required:
- url
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
Expand Down
2 changes: 1 addition & 1 deletion bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ annotations:
operators.operatorframework.io.bundle.metadata.v1: metadata/
operators.operatorframework.io.bundle.package.v1: registry-operator
operators.operatorframework.io.bundle.channels.v1: alpha
operators.operatorframework.io.metrics.builder: operator-sdk-v1.12.0+git
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.builder: operator-sdk-v1.4.0+git
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v2

# Annotations for testing.
Expand Down
Loading