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

v2 operator first pass #55

Draft
wants to merge 2 commits into
base: v2
Choose a base branch
from
Draft
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
36 changes: 25 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION := v1.8.2
VERSION := v2.0.0
BUNDLE_IMG ?= quay.io/skupper/skupper-operator-bundle:$(VERSION)
INDEX_IMG ?= quay.io/skupper/skupper-operator-index:$(VERSION)
OPM_URL := https://github.com/operator-framework/operator-registry/releases/latest/download/linux-amd64-opm
Expand All @@ -10,11 +10,13 @@ PLATFORMS ?= linux/amd64,linux/arm64
all: index-build

.PHONY: bundle-build ## Build the bundle image.
bundle-build: test
bundle-build: validate-bundle
@echo Building bundle image
$(CONTAINER_TOOL) buildx build --no-cache --platform ${PLATFORMS} --manifest skupper-operator-bundle -f bundle.Dockerfile -t $(BUNDLE_IMG) .
$ pushd ./bundle/$(subst v,,$(VERSION)) && \
$(CONTAINER_TOOL) buildx build --no-cache --platform ${PLATFORMS} --manifest skupper-operator-bundle -t $(BUNDLE_IMG) -f bundle.Dockerfile .
@echo Pushing $(BUNDLE_IMG)
$(CONTAINER_TOOL) manifest push --all skupper-operator-bundle $(BUNDLE_IMG)
$(CONTAINER_TOOL) manifest push --all skupper-operator-bundle $(BUNDLE_IMG) && \
cd ../../

.PHONY: opm-download
opm-download:
Expand All @@ -36,10 +38,22 @@ index-build: bundle-build opm-download
@echo Pushing $(INDEX_IMG)
$(CONTAINER_TOOL) manifest push --all skupper-operator-index $(INDEX_IMG)

.PHONY: test
test:
@rm -rf ./tmp || true
mkdir ./tmp
cp -r bundle/manifests/$(subst v,,$(VERSION)) ./tmp/manifests
cp -r bundle/metadata ./tmp
operator-sdk bundle validate ./tmp
.PHONY: index-build2 ## Build the index image.
index-build2: bundle-build opm-download
$(info Using OPM Tool: $(OPM))
@echo Adding unique $(VERSION) entry to catalog.yaml
@echo Adding bundle to the catalog
$(OPM) render $(BUNDLE_IMG) --output yaml >> $(CATALOG_YAML)
$(OPM) validate skupper-operator-index/
@echo Building index image
$(CONTAINER_TOOL) buildx build --no-cache --platform ${PLATFORMS} --manifest skupper-operator-index -f skupper-operator-index.Dockerfile -t $(INDEX_IMG) .
@echo Pushing $(INDEX_IMG)
$(CONTAINER_TOOL) manifest push --all skupper-operator-index $(INDEX_IMG)

.PHONY: validate-bundle
validate-bundle:
operator-sdk bundle validate ./bundle/$(subst v,,$(VERSION))

.PHONY: validate-index
validate-index:
$(OPM) validate skupper-operator-index/
7 changes: 4 additions & 3 deletions bundle.Dockerfile → bundle/2.0.0/bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ 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=skupper-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable-2
LABEL operators.operatorframework.io.bundle.channels.v1="stable-2,stable-2.0"
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/v3

# Copy files to locations specified by labels.
COPY bundle/manifests/1.8.2 /manifests/
COPY bundle/metadata /metadata/
COPY manifests /manifests/
COPY metadata /metadata/

Large diffs are not rendered by default.

112 changes: 112 additions & 0 deletions bundle/2.0.0/manifests/skupper_access_grant_crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: accessgrants.skupper.io
spec:
group: skupper.io
versions:
- name: v2alpha1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
redemptionsAllowed:
type: integer
expirationWindow:
type: string
format: duration
code:
type: string
issuer:
type: string
settings:
type: object
additionalProperties:
type: string
status:
type: object
properties:
url:
type: string
code:
type: string
ca:
type: string
redemptions:
type: integer
expirationTime:
type: string
format: date-time
status:
type: string
message:
type: string
conditions:
type: array
items:
type: object
properties:
lastTransitionTime:
format: date-time
type: string
message:
maxLength: 32768
type: string
observedGeneration:
format: int64
minimum: 0
type: integer
reason:
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
enum:
- "True"
- "False"
- Unknown
type: string
type:
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][- A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
subresources:
status: {}
additionalPrinterColumns:
- name: Redemptions Allowed
type: integer
description: The number of claims the grant is valid for
jsonPath: .spec.redemptionsAllowed
- name: Redemptions Made
type: integer
description: The number of times an access token originating from this grant has been redeemed
jsonPath: .status.redeemed
- name: Expiration
type: string
description: When the grant will expire
jsonPath: .status.expiration
- name: Status
type: string
description: The status of the grant
jsonPath: .status.status
- name: Message
type: string
description: Any human readable message relevant to the grant
jsonPath: .status.message
scope: Namespaced
names:
plural: accessgrants
singular: accessgrant
kind: AccessGrant
102 changes: 102 additions & 0 deletions bundle/2.0.0/manifests/skupper_access_token_crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: accesstokens.skupper.io
spec:
group: skupper.io
versions:
- name: v2alpha1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
url:
type: string
code:
type: string
ca:
type: string
linkCost:
type: integer
settings:
type: object
additionalProperties:
type: string
required:
- url
- code
- ca
status:
type: object
properties:
redeemed:
type: boolean
status:
type: string
message:
type: string
conditions:
type: array
items:
type: object
properties:
lastTransitionTime:
format: date-time
type: string
message:
maxLength: 32768
type: string
observedGeneration:
format: int64
minimum: 0
type: integer
reason:
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
enum:
- "True"
- "False"
- Unknown
type: string
type:
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][- A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
subresources:
status: {}
additionalPrinterColumns:
- name: URL
type: string
description: The URL the access token is redeemed at
jsonPath: .spec.url
- name: Redeemed
type: boolean
description: Whether the access token has already been redeemed
jsonPath: .status.redeemed
- name: Status
type: string
description: The status of the access token
jsonPath: .status.status
- name: Message
type: string
description: Any human readable message relevant to the token
jsonPath: .status.message
scope: Namespaced
names:
plural: accesstokens
singular: accesstoken
kind: AccessToken
97 changes: 97 additions & 0 deletions bundle/2.0.0/manifests/skupper_attached_connector_binding_crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: attachedconnectorbindings.skupper.io
spec:
group: skupper.io
versions:
- name: v2alpha1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
connectorNamespace:
type: string
routingKey:
type: string
exposePodsByName:
type: boolean
settings:
type: object
additionalProperties:
type: string
required:
- connectorNamespace
- routingKey
status:
type: object
properties:
status:
type: string
conditions:
type: array
items:
type: object
properties:
lastTransitionTime:
format: date-time
type: string
message:
maxLength: 32768
type: string
observedGeneration:
format: int64
minimum: 0
type: integer
reason:
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
enum:
- "True"
- "False"
- Unknown
type: string
type:
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][- A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
hasMatchingListener:
type: boolean
subresources:
status: {}
additionalPrinterColumns:
- name: Routing Key
type: string
description: An identifier that associates connectors with listeners.
jsonPath: .spec.routingKey
- name: Connector Namespace
type: string
description: The namespace where the associated AttachableConnector is located.
jsonPath: .spec.connectorNamespace
- name: Status
type: string
description: The status of the connector
jsonPath: .status.status
- name: Has Matching Listener
type: integer
description: Whether there is at least one listener in the network with a matching routing key.
jsonPath: .status.hasMatchingListener
scope: Namespaced
names:
plural: attachedconnectorbindings
singular: attachedconnectorbinding
kind: AttachedConnectorBinding
Loading