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

Upgrade deps #181

Closed
wants to merge 3 commits into from
Closed
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
1 change: 1 addition & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
- name: Remove MySQL App Armour Configuration
run: |
set -x
sudo apt-get update
sudo apt-get remove mysql-server --purge
sudo apt-get install apparmor-profiles
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
Expand Down
44 changes: 3 additions & 41 deletions .github/workflows/image-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
types: [published, edited]

env:
dockerhub_namespace: kloeckneri
manufacturer: kloeckner-i
manufacturer: db-operator
product_name: db-operator
go_version: "1.17"
go_os: linux
Expand All @@ -15,6 +14,8 @@ env:
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
include:
Expand Down Expand Up @@ -49,12 +50,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Dockerhub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set action link variable
run: echo "LINK=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV

Expand All @@ -66,8 +61,6 @@ jobs:
file: Dockerfile-ci
platforms: ${{ env.go_os }}/${{ matrix.docker_arch }}
tags: |
${{ env.dockerhub_namespace }}/${{ env.product_name }}:latest-${{ matrix.go_arch }}
${{ env.dockerhub_namespace }}/${{ env.product_name }}:${{ github.event.release.tag_name }}-${{ matrix.go_arch }}
ghcr.io/${{ env.manufacturer }}/${{ env.product_name }}:latest-${{ matrix.go_arch }}
ghcr.io/${{ env.manufacturer }}/${{ env.product_name }}:${{ github.event.release.tag_name }}-${{ matrix.go_arch }}
labels: |
Expand Down Expand Up @@ -106,34 +99,3 @@ jobs:
run: |
docker manifest push ghcr.io/${{ env.manufacturer }}/${{ env.product_name }}:${{ github.event.release.tag_name }}
docker manifest push ghcr.io/${{ env.manufacturer }}/${{ env.product_name }}:latest

push_to_dockerhub:
runs-on: ubuntu-latest
needs: build
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Create a docker manifest for a versioned container
run: |
docker manifest create ${{ env.dockerhub_namespace }}/${{ env.product_name }}:${{ github.event.release.tag_name }} \
--amend ${{ env.dockerhub_namespace }}/${{ env.product_name }}:${{ github.event.release.tag_name }}-amd64 \
--amend ${{ env.dockerhub_namespace }}/${{ env.product_name }}:${{ github.event.release.tag_name }}-arm64

- name: Create a manifest for the latest container
run: |
docker manifest create ${{ env.dockerhub_namespace }}/${{ env.product_name }}:latest \
--amend ${{ env.dockerhub_namespace }}/${{ env.product_name }}:latest-amd64 \
--amend ${{ env.dockerhub_namespace }}/${{ env.product_name }}:latest-arm64

- name: Push the manifest
run: |
docker manifest push ${{ env.dockerhub_namespace }}/${{ env.product_name }}:${{ github.event.release.tag_name }}
docker manifest push ${{ env.dockerhub_namespace }}/${{ env.product_name }}:latest

1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ k3d_image: build ## rebuild the docker images and upload into your k3d cluster
## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
manifests: controller-gen ## generate custom resource definitions
$(CONTROLLER_GEN) crd rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) crd webhook paths="./..." output:crd:artifacts:config=charts/db-operator/crds

## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
generate: controller-gen ## generate supporting code for custom resource types
Expand Down
20 changes: 10 additions & 10 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: kci.rocks
domain: kinda.rocks
layout:
- go.kubebuilder.io/v3
projectName: db-operator
repo: github.com/kloeckner-i/db-operator
repo: github.com/db-operator/db-operator
resources:
- api:
crdVersion: v1
controller: true
domain: kci.rocks
domain: kinda.rocks
kind: DbInstance
path: github.com/kloeckner-i/db-operator/api/v1alpha1
path: github.com/db-operator/db-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: kci.rocks
domain: kinda.rocks
kind: Database
path: github.com/kloeckner-i/db-operator/api/v1alpha1
path: github.com/db-operator/db-operator/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: kci.rocks
domain: kinda.rocks
kind: Database
path: github.com/kloeckner-i/db-operator/api/v1beta1
path: github.com/db-operator/db-operator/api/v1beta1
version: v1beta1
webhooks:
conversion: true
Expand All @@ -37,9 +37,9 @@ resources:
webhookVersion: v1
- api:
crdVersion: v1
domain: kci.rocks
domain: kinda.rocks
kind: DbInstance
path: github.com/kloeckner-i/db-operator/api/v1beta1
path: github.com/db-operator/db-operator/api/v1beta1
version: v1beta1
webhooks:
conversion: true
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ DB Operator provides following features:
* [Upgrade guide](docs/upgradeguide.md) - breaking changes and guide for the upgrade

## Helm Chart is migrated!
The repository contains helm charts for db-operator is moved to https://github.com/kloeckner-i/charts
The repository contains helm charts for db-operator is moved to https://github.com/db-operator/charts
New chart after db-operator > 1.2.7, db-instances > 1.3.0 will be only available in new repository.

## CRD Versions are upgraded!
Expand All @@ -44,9 +44,9 @@ $ helm repo add kloeckneri https://kloeckner-i.github.io/charts/
$ helm install --name my-release kloeckneri/db-operator
```

To see more options of helm values, [see chart repo]([https://github.com/kloeckner-i/charts/tree/main/charts/db-operator])
To see more options of helm values, [see chart repo]([https://github.com/db-operator/charts/tree/main/charts/db-operator])

To see which version is working together check out our [version matrix](https://github.com/kloeckner-i/db-operator/wiki/Version-Matrix).
To see which version is working together check out our [version matrix](https://github.com/db-operator/db-operator/wiki/Version-Matrix).

## Development

Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/database_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1alpha1
import (
"errors"

"github.com/kloeckner-i/db-operator/api/v1beta1"
"github.com/db-operator/db-operator/api/v1beta1"
"sigs.k8s.io/controller-runtime/pkg/conversion"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/dbinstance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1alpha1
import (
"errors"

"github.com/kloeckner-i/db-operator/api/v1beta1"
"github.com/db-operator/db-operator/api/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/conversion"
)
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// Package v1alpha1 contains API Schema definitions for the v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=kci.rocks
// +groupName=kinda.rocks
package v1alpha1

import (
Expand All @@ -26,7 +26,7 @@ import (

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "kci.rocks", Version: "v1alpha1"}
GroupVersion = schema.GroupVersion{Group: "kinda.rocks", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand Down
2 changes: 2 additions & 0 deletions api/v1beta1/database_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ type Postgres struct {
DropPublicSchema bool `json:"dropPublicSchema,omitempty"`
// Specify schemas to be created. The user created by db-operator will have all access on them.
Schemas []string `json:"schemas,omitempty"`
// Let user create database from template
Template string `json:"template,omitempty"`
}

// DatabaseStatus defines the observed state of Database
Expand Down
4 changes: 2 additions & 2 deletions api/v1beta1/database_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (r *Database) SetupWebhookWithManager(mgr ctrl.Manager) error {

// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!

//+kubebuilder:webhook:path=/mutate-kci-rocks-v1beta1-database,mutating=true,failurePolicy=fail,sideEffects=None,groups=kci.rocks,resources=databases,verbs=create;update,versions=v1beta1,name=mdatabase.kb.io,admissionReviewVersions=v1
//+kubebuilder:webhook:path=/mutate-kci-rocks-v1beta1-database,mutating=true,failurePolicy=fail,sideEffects=None,groups=kinda.rocks,resources=databases,verbs=create;update,versions=v1beta1,name=mdatabase.kb.io,admissionReviewVersions=v1

var _ webhook.Defaulter = &Database{}

Expand All @@ -46,7 +46,7 @@ func (r *Database) Default() {
}

// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
//+kubebuilder:webhook:path=/validate-kci-rocks-v1beta1-database,mutating=false,failurePolicy=fail,sideEffects=None,groups=kci.rocks,resources=databases,verbs=create;update,versions=v1beta1,name=vdatabase.kb.io,admissionReviewVersions=v1
//+kubebuilder:webhook:path=/validate-kci-rocks-v1beta1-database,mutating=false,failurePolicy=fail,sideEffects=None,groups=kinda.rocks,resources=databases,verbs=create;update,versions=v1beta1,name=vdatabase.kb.io,admissionReviewVersions=v1

var _ webhook.Validator = &Database{}

Expand Down
4 changes: 2 additions & 2 deletions api/v1beta1/dbinstance_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (r *DbInstance) SetupWebhookWithManager(mgr ctrl.Manager) error {

// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!

//+kubebuilder:webhook:path=/mutate-kci-rocks-v1beta1-dbinstance,mutating=true,failurePolicy=fail,sideEffects=None,groups=kci.rocks,resources=dbinstances,verbs=create;update,versions=v1beta1,name=mdbinstance.kb.io,admissionReviewVersions=v1
//+kubebuilder:webhook:path=/mutate-kci-rocks-v1beta1-dbinstance,mutating=true,failurePolicy=fail,sideEffects=None,groups=kinda.rocks,resources=dbinstances,verbs=create;update,versions=v1beta1,name=mdbinstance.kb.io,admissionReviewVersions=v1

var _ webhook.Defaulter = &DbInstance{}

Expand All @@ -46,7 +46,7 @@ func (r *DbInstance) Default() {
}

// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
//+kubebuilder:webhook:path=/validate-kci-rocks-v1beta1-dbinstance,mutating=false,failurePolicy=fail,sideEffects=None,groups=kci.rocks,resources=dbinstances,verbs=create;update,versions=v1beta1,name=vdbinstance.kb.io,admissionReviewVersions=v1
//+kubebuilder:webhook:path=/validate-kci-rocks-v1beta1-dbinstance,mutating=false,failurePolicy=fail,sideEffects=None,groups=kinda.rocks,resources=dbinstances,verbs=create;update,versions=v1beta1,name=vdbinstance.kb.io,admissionReviewVersions=v1

var _ webhook.Validator = &DbInstance{}

Expand Down
4 changes: 2 additions & 2 deletions api/v1beta1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// Package v1beta1 contains API Schema definitions for the v1beta1 API group
// +kubebuilder:object:generate=true
// +groupName=kci.rocks
// +groupName=kinda.rocks
package v1beta1

import (
Expand All @@ -26,7 +26,7 @@ import (

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "kci.rocks", Version: "v1beta1"}
GroupVersion = schema.GroupVersion{Group: "kinda.rocks", Version: "v1beta1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand Down
7 changes: 5 additions & 2 deletions config/crd/bases/kci.rocks_databases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
name: databases.kci.rocks
name: databases.kinda.rocks
spec:
group: kci.rocks
group: kinda.rocks
names:
kind: Database
listKind: DatabaseList
Expand Down Expand Up @@ -395,6 +395,9 @@ spec:
items:
type: string
type: array
template:
description: Let user create database from template
type: string
type: object
secretName:
type: string
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/kci.rocks_dbinstances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.3
creationTimestamp: null
name: dbinstances.kci.rocks
name: dbinstances.kinda.rocks
spec:
group: kci.rocks
group: kinda.rocks
names:
kind: DbInstance
listKind: DbInstanceList
Expand Down
4 changes: 2 additions & 2 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
resources:
- bases/kci.rocks_dbinstances.yaml
- bases/kci.rocks_databases.yaml
- bases/kinda.rocks_dbinstances.yaml
- bases/kinda.rocks_databases.yaml
#+kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/patches/cainjection_in_databases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: databases.kci.rocks
name: databases.kinda.rocks
2 changes: 1 addition & 1 deletion config/crd/patches/cainjection_in_dbinstances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: dbinstances.kci.rocks
name: dbinstances.kinda.rocks
2 changes: 1 addition & 1 deletion config/crd/patches/webhook_in_databases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: databases.kci.rocks
name: databases.kinda.rocks
spec:
conversion:
strategy: Webhook
Expand Down
2 changes: 1 addition & 1 deletion config/crd/patches/webhook_in_dbinstances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: dbinstances.kci.rocks
name: dbinstances.kinda.rocks
spec:
conversion:
strategy: Webhook
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/dbinstance_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
name: dbinstance-editor-role
rules:
- apiGroups:
- kci.rocks
- kinda.rocks
resources:
- dbinstances
verbs:
Expand All @@ -24,7 +24,7 @@ rules:
- update
- watch
- apiGroups:
- kci.rocks
- kinda.rocks
resources:
- dbinstances/status
verbs:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/dbinstance_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ metadata:
name: dbinstance-viewer-role
rules:
- apiGroups:
- kci.rocks
- kinda.rocks
resources:
- dbinstances
verbs:
- get
- list
- watch
- apiGroups:
- kci.rocks
- kinda.rocks
resources:
- dbinstances/status
verbs:
Expand Down
Loading