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

Improve/GitHub workflows #24

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 6 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
- 'v*'

jobs:
docker:
name: docker
build-push-docker:
name: build-docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -33,6 +33,10 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-push-bundle:
name: build-push-bundle
runs-on: ubuntu-latest
steps:
- name: Install operator-sdk
run: |
curl -L https://github.com/operator-framework/operator-sdk/releases/download/v1.31.0/operator-sdk_linux_amd64 -o /usr/local/bin/operator-sdk
hoptical marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
7 changes: 0 additions & 7 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,3 @@ resources:
- secret.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: controller
newTag: latest
- name: ghcr.io/snapp-incubator/s3-operator
newName: s3-operator
newTag: latest
4 changes: 2 additions & 2 deletions deploy/charts/s3-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.4
version: 0.3.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.1.5"
appVersion: "v0.3.4"
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "s3-operator.fullname" . }}-clusterresourcequota-updater-binding
labels:
{{- include "s3-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: '{{ include "s3-operator.fullname" . }}-clusterresourcequota-updater'
subjects:
- kind: ServiceAccount
name: '{{ include "s3-operator.fullname" . }}-controller-manager'
namespace: '{{ .Release.Namespace }}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "s3-operator.fullname" . }}-clusterresourcequota-updater
labels:
{{- include "s3-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- quota.openshift.io
resources:
- clusterresourcequotas/status
verbs:
- update
- patch
26 changes: 26 additions & 0 deletions deploy/charts/s3-operator/templates/manager-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,32 @@ rules:
- patch
- update
- watch
- apiGroups:
- s3.snappcloud.io
resources:
- s3buckets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- s3.snappcloud.io
resources:
- s3buckets/finalizers
verbs:
- update
- apiGroups:
- s3.snappcloud.io
resources:
- s3buckets/status
verbs:
- get
- patch
- update
- apiGroups:
- s3.snappcloud.io
resources:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "s3-operator.fullname" . }}-resourcequota-status-updater-binding
labels:
{{- include "s3-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: '{{ include "s3-operator.fullname" . }}-resourcequota-status-updater'
subjects:
- kind: ServiceAccount
name: '{{ include "s3-operator.fullname" . }}-controller-manager'
namespace: '{{ .Release.Namespace }}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "s3-operator.fullname" . }}-resourcequota-status-updater
labels:
{{- include "s3-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- resourcequotas/status
verbs:
- update
- patch
93 changes: 93 additions & 0 deletions deploy/charts/s3-operator/templates/s3bucket-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: s3buckets.s3.snappcloud.io
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
labels:
{{- include "s3-operator.labels" . | nindent 4 }}
spec:
group: s3.snappcloud.io
names:
kind: S3Bucket
listKind: S3BucketList
plural: s3buckets
shortNames:
- s3b
singular: s3bucket
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.s3UserRef
name: S3USERREF
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: S3Bucket is the Schema for the s3buckets 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: S3BucketSpec defines the desired state of S3Bucket
properties:
s3DeletionPolicy:
default: delete
enum:
- delete
- retain
type: string
s3SubuserBinding:
items:
properties:
access:
default: read
description: access of the subuser which can be read or write
enum:
- read
- write
type: string
name:
description: name of the subuser
type: string
required:
- name
type: object
type: array
s3UserRef:
type: string
required:
- s3UserRef
type: object
status:
description: S3BucketStatus defines the observed state of S3Bucket
properties:
created:
default: false
type: boolean
policy:
type: string
reason:
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
1 change: 1 addition & 0 deletions deploy/charts/s3-operator/templates/s3user-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ spec:
properties:
maxBuckets:
description: max number of buckets the user can create
format: int64
type: integer
maxObjects:
anyOf:
Expand Down
14 changes: 14 additions & 0 deletions deploy/charts/s3-operator/templates/s3userclaim-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ spec:
kind: S3UserClaim
listKind: S3UserClaimList
plural: s3userclaims
shortNames:
- s3u
singular: s3userclaim
scope: Namespaced
versions:
Expand Down Expand Up @@ -64,6 +66,7 @@ spec:
properties:
maxBuckets:
description: max number of buckets the user can create
format: int64
type: integer
maxObjects:
anyOf:
Expand All @@ -84,6 +87,11 @@ spec:
type: string
s3UserClass:
type: string
subusers:
items:
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
type: array
required:
- adminSecret
- readonlySecret
Expand All @@ -96,6 +104,7 @@ spec:
properties:
maxBuckets:
description: max number of buckets the user can create
format: int64
type: integer
maxObjects:
anyOf:
Expand All @@ -114,6 +123,11 @@ spec:
type: object
s3UserName:
type: string
subusers:
items:
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
type: array
type: object
type: object
served: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ metadata:
labels:
{{- include "s3-operator.labels" . | nindent 4 }}
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: '{{ include "s3-operator.fullname" . }}-webhook-service'
namespace: '{{ .Release.Namespace }}'
path: /validate-s3-snappcloud-io-v1alpha1-s3bucket
failurePolicy: Fail
name: vs3bucket.kb.io
rules:
- apiGroups:
- s3.snappcloud.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- s3buckets
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
Expand All @@ -24,6 +44,7 @@ webhooks:
operations:
- CREATE
- UPDATE
- DELETE
resources:
- s3userclaims
sideEffects: None