Skip to content

Commit

Permalink
refactor(crd) Change resource group to goharbor.io
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Péronnet <pierre.peronnet@ovhcloud.com>
  • Loading branch information
holyhope committed Mar 6, 2020
1 parent 9f94c00 commit 5c5100a
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 67 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package v1alpha1 contains API Schema definitions for the containerregistry v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=containerregistry.ovhcloud.com
// +groupName=goharbor.io
package v1alpha1

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

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "containerregistry.ovhcloud.com", Version: "v1alpha1"}
GroupVersion = schema.GroupVersion{Group: "goharbor.io", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/harbor_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func (r *Harbor) SetupWebhookWithManager(mgr ctrl.Manager) error {
Complete()
}

// +kubebuilder:webhook:path=/mutate-containerregistry-ovhcloud-com-v1alpha1-harbor,mutating=true,failurePolicy=fail,groups=containerregistry.ovhcloud.com,resources=harbors,verbs=create;update,versions=v1alpha1,name=mharbor.kb.io
// +kubebuilder:webhook:path=/mutate-goharbor-v1alpha1-harbor,mutating=true,failurePolicy=fail,groups=goharbor.io,resources=harbors,verbs=create;update,versions=v1alpha1,name=mharbor.kb.io

var _ webhook.Defaulter = &Harbor{}

Expand Down
10 changes: 5 additions & 5 deletions api/v1alpha1/metadata.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package v1alpha1

const (
HarborClassAnnotation = "containerregistry.ovhcloud.com/harbor-class"
HarborClassAnnotation = "goharbor.io/harbor-class"
)

const (
WarningLabel = "containerregistry.ovhcloud.com/warning"
OperatorNameLabel = "containerregistry.ovhcloud.com/name"
OperatorVersionLabel = "containerregistry.ovhcloud.com/version"
ComponentNameLabel = "containerregistry.ovhcloud.com/component"
WarningLabel = "goharbor.io/warning"
OperatorNameLabel = "goharbor.io/name"
OperatorVersionLabel = "goharbor.io/version"
ComponentNameLabel = "goharbor.io/component"
)
2 changes: 1 addition & 1 deletion config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
resources:
- bases/containerregistry.ovhcloud.com_harbors.yaml
- bases/goharbor.io_harbors.yaml
# +kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/patches/cainjection_in_harbors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: harbors.containerregistry.ovhcloud.com
name: harbors.goharbor.io
2 changes: 1 addition & 1 deletion config/crd/patches/webhook_in_harbors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: harbors.containerregistry.ovhcloud.com
name: harbors.goharbor.io
spec:
# https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#pruning-versus-preserving-unknown-fields
preserveUnknownFields: false
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/harbor_editor_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: harbor-editor-role
rules:
- apiGroups:
- containerregistry.ovhcloud.com
- goharbor.io
resources:
- harbors
verbs:
Expand All @@ -17,7 +17,7 @@ rules:
- update
- watch
- apiGroups:
- containerregistry.ovhcloud.com
- goharbor.io
resources:
- harbors/status
verbs:
Expand Down
4 changes: 2 additions & 2 deletions config/rbac/harbor_viewer_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ metadata:
name: harbor-viewer-role
rules:
- apiGroups:
- containerregistry.ovhcloud.com
- goharbor.io
resources:
- harbors
verbs:
- get
- list
- watch
- apiGroups:
- containerregistry.ovhcloud.com
- goharbor.io
resources:
- harbors/status
verbs:
Expand Down
50 changes: 0 additions & 50 deletions config/samples/containerregistry_v1alpha1_harbor.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions controllers/harbor/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"github.com/goharbor/harbor-operator/pkg/factories/logger"
)

// +kubebuilder:rbac:groups=containerregistry.ovhcloud.com,resources=harbors,verbs=get;list;watch
// +kubebuilder:rbac:groups=containerregistry.ovhcloud.com,resources=harbors/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=goharbor.io,resources=harbors,verbs=get;list;watch
// +kubebuilder:rbac:groups=goharbor.io,resources=harbors/status,verbs=get;update;patch

func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
ctx := context.TODO()
Expand Down

0 comments on commit 5c5100a

Please sign in to comment.