Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #234 from bitsf/fix_version_yaml
Browse files Browse the repository at this point in the history
fix harbor version in yamls
  • Loading branch information
steven-zou authored Oct 16, 2020
2 parents b893399 + 33667a4 commit 03b909c
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 31 deletions.
51 changes: 32 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ jobs:
apiVersion: v1
kind: Namespace
metadata:
name: harbor
name: sample
---
# A secret of harbor admin password.
apiVersion: v1
kind: Secret
metadata:
name: admin-secret
namespace: harbor
namespace: sample
data:
password: SGFyYm9yMTIzNDU=
type: Opaque
Expand All @@ -159,18 +159,29 @@ jobs:
kind: Issuer
metadata:
name: selfsigned-issuer
namespace: harbor
namespace: sample
spec:
selfSigned:
crlDistributionPoints:
- "https://harbor.${IP}.xip.io"
- "https://notary-harbor.${IP}.xip.io"
selfSigned: {}
---
apiVersion: goharbor.io/v1
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: public-certificate
namespace: sample
spec:
secretName: public-certificate
dnsNames:
- harbor.${IP}.xip.io
- notary-harbor.${IP}.xip.io
issuerRef:
name: selfsigned-issuer
kind: Issuer
---
apiVersion: goharbor.io/v1alpha1
kind: HarborCluster
metadata:
name: sz-harbor-cluster
namespace: harbor
namespace: sample
spec:
redis:
kind: "inCluster"
Expand Down Expand Up @@ -201,10 +212,10 @@ jobs:
cpu: "500m"
memory: "500Mi"
publicURL: "https://harbor.${IP}.xip.io"
disableRedirect: true
replicas: 1
notary:
publicUrl: "https://notary-harbor.${IP}.xip.io"
disableRedirect: true
jobService:
workerCount: 10
replicas: 1
Expand All @@ -220,7 +231,7 @@ jobs:
options:
provider: minIO
spec:
replicas: 3
replicas: 2
volumesPerServer: 2
version: RELEASE.2020-08-13T02-39-50Z
volumeClaimTemplate:
Expand All @@ -238,29 +249,31 @@ jobs:
limits:
memory: 500Mi
cpu: 500m
version: 1.10.0
version: 1.10.4
EOF
free -h
# currently we don't have a good way to wait install done
for i in $(seq 1 6);do
sleep 30
echo $i
kubectl get all -n harbor
kubectl get all -n sample
done
if ! kubectl -n harbor wait --for=condition=Ready pod --all --timeout 600s ;then
if ! kubectl -n sample wait --for=condition=Ready pod --all --timeout 600s ;then
echo install harbor failed
kubectl get all -n harbor
kubectl get all -n sample
for n in $(kubectl get po -n harbor |grep -v Running|grep 'sz-harbor'|awk '{print $1}');do
for n in $(kubectl get po -n sample |grep -v Running|grep 'sz-harbor'|awk '{print $1}');do
echo describe $n
kubectl describe pod -n harbor $n
kubectl describe pod -n sample $n
done
exit 1
else
kubectl get all -n harbor
kubectl get all -n sample
fi
free -h
if ! kubectl -n harbor wait --for=condition=Available deployment/sz-harbor-cluster-harbor-core;then
if ! kubectl -n sample wait --for=condition=Available deployment/sz-harbor-cluster-harbor-core;then
echo harbor-core not ready
exit 1;
fi
Expand Down
4 changes: 2 additions & 2 deletions apis/goharbor.io/v1alpha1/harborcluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (r *HarborCluster) SetupWebhookWithManager(mgr ctrl.Manager) error {

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!

// +kubebuilder:webhook:path=/mutate-goharbor-io-v1-harborcluster,mutating=true,failurePolicy=fail,groups=goharbor.io,resources=harborclusters,verbs=create;update,versions=v1alpha1,name=mharborcluster.kb.io
// +kubebuilder:webhook:path=/mutate-goharbor-io-v1alpha1-harborcluster,mutating=true,failurePolicy=fail,groups=goharbor.io,resources=harborclusters,verbs=create;update,versions=v1alpha1,name=mharborcluster.kb.io

var _ webhook.Defaulter = &HarborCluster{}

Expand All @@ -47,7 +47,7 @@ func (r *HarborCluster) Default() {
}

// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
// +kubebuilder:webhook:verbs=create;update,path=/validate-goharbor-io-v1-harborcluster,mutating=false,failurePolicy=fail,groups=goharbor.io,resources=harborclusters,versions=v1alpha1,name=vharborcluster.kb.io
// +kubebuilder:webhook:verbs=create;update,path=/validate-goharbor-io-v1alpha1-harborcluster,mutating=false,failurePolicy=fail,groups=goharbor.io,resources=harborclusters,versions=v1alpha1,name=vharborcluster.kb.io

var _ webhook.Validator = &HarborCluster{}

Expand Down
2 changes: 1 addition & 1 deletion docs/installation_external.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ type: Opaque

# Using all external service.
---
apiVersion: goharbor.io/v1
apiVersion: goharbor.io/v1alpha1
kind: HarborCluster
metadata:
name: harborcluster-sample
Expand Down
4 changes: 2 additions & 2 deletions docs/installation_local.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Create an admin secret with the manifest like:
cat <<EOF | kubectl apply -f -
# A secret of harbor admin password.
# Password is encoded with base64.
apiVersion: v1
apiVersion: v1alpha1
kind: Secret
metadata:
name: admin-secret
Expand Down Expand Up @@ -247,7 +247,7 @@ and `notary.goharbor.io` as Notary public URL):

```shell script
cat <<EOF | kubectl apply -f -
apiVersion: goharbor.io/v1
apiVersion: goharbor.io/v1alpha1
kind: HarborCluster
metadata:
name: sz-harbor-cluster
Expand Down
13 changes: 7 additions & 6 deletions manifests/all-in-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,9 @@ spec:
type: array
type: object
type: object
version: v1
version: v1alpha1
versions:
- name: v1
- name: v1alpha1
served: true
storage: true
status:
Expand Down Expand Up @@ -2589,6 +2589,7 @@ rules:
resources:
- configmaps
- events
- ingresses
- pods
- secrets
- services
Expand Down Expand Up @@ -3599,14 +3600,14 @@ webhooks:
service:
name: harbor-cluster-operator-webhook-service
namespace: harbor-cluster-operator-system
path: /mutate-goharbor-io-v1-harborcluster
path: /mutate-goharbor-io-v1alpha1-harborcluster
failurePolicy: Fail
name: mharborcluster.kb.io
rules:
- apiGroups:
- goharbor.io
apiVersions:
- v1
- v1alpha1
operations:
- CREATE
- UPDATE
Expand Down Expand Up @@ -3657,14 +3658,14 @@ webhooks:
service:
name: harbor-cluster-operator-webhook-service
namespace: harbor-cluster-operator-system
path: /validate-goharbor-io-v1-harborcluster
path: /validate-goharbor-io-v1alpha1-harborcluster
failurePolicy: Fail
name: vharborcluster.kb.io
rules:
- apiGroups:
- goharbor.io
apiVersions:
- v1
- v1alpha1
operations:
- CREATE
- UPDATE
Expand Down
2 changes: 1 addition & 1 deletion samples/incluster/inCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
name: selfsigned-issuer
kind: Issuer
---
apiVersion: goharbor.io/v1
apiVersion: goharbor.io/v1alpha1
kind: HarborCluster
metadata:
name: sz-harbor-cluster
Expand Down

0 comments on commit 03b909c

Please sign in to comment.