Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
  • Loading branch information
dhaiducek committed Mar 8, 2024
1 parent 780747f commit e07b6b4
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ e2e-debug: ## Collect debug logs from deployed clusters.
-KUBECONFIG=$(KIND_KUBECONFIG) kubectl -n open-cluster-management-agent-addon get deployments
-KUBECONFIG=$(KIND_KUBECONFIG) kubectl -n open-cluster-management-agent-addon get pods
-KUBECONFIG=$(KIND_KUBECONFIG) kubectl get manifestwork --all-namespaces -o yaml
-KUBECONFIG=$(KIND_KUBECONFIG) kubectl get crds --show-labels

@echo "* Local controller log:"
-cat build/_output/controller.log
Expand Down
6 changes: 3 additions & 3 deletions build/crd-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ replaceAnnotation='s/SEDTARGET: SEDTARGET/{{ if .Values.onMulticlusterHub }}"add
cat > pkg/addon/configpolicy/manifests/managedclusterchart/templates/policy.open-cluster-management.io_configurationpolicies_crd.yaml << EOF
# Copyright Contributors to the Open Cluster Management project
{{- if semverCompare "< 1.16.0" .Capabilities.KubeVersion.Version }}
{{- if default "v9.9.9" .Capabilities.KubeVersion.Version | trimPrefix "v" | semverCompare "< 1.16.0" }}
$(yq e "$addLocationLabel | $addTemplateLabel" .go/config-policy-crd-v1beta1.yaml)
{{ else }}
$(yq e "$addLocationLabel" .go/config-policy-crd-v1.yaml)
Expand All @@ -68,15 +68,15 @@ EOF
cat > pkg/addon/configpolicy/manifests/managedclusterchart/templates/policy.open-cluster-management.io_operatorpolicies_crd.yaml << EOF
# Copyright Contributors to the Open Cluster Management project
{{- if semverCompare "> 1.16.0" .Capabilities.KubeVersion.Version }}
{{- if default "v9.9.9" .Capabilities.KubeVersion.Version | trimPrefix "v" | semverCompare "> 1.16.0" }}
$(yq e "$addLocationLabel" .go/operator-policy-crd-v1.yaml)
{{- end }}
EOF

cat > pkg/addon/policyframework/manifests/managedclusterchart/templates/policy.open-cluster-management.io_policies_crd.yaml << EOF
# Copyright Contributors to the Open Cluster Management project
{{- if semverCompare "< 1.16.0" .Capabilities.KubeVersion.Version }}
{{- if default "v9.9.9" .Capabilities.KubeVersion.Version | trimPrefix "v" | semverCompare "< 1.16.0" }}
$(yq e "$addTempAnnotation | $addLocationLabel" .go/policy-crd-v1beta1.yaml | sed -E "$replaceAnnotation")
{{ else }}
$(yq e "$addTempAnnotation | $addLocationLabel" .go/policy-crd-v1.yaml | sed -E "$replaceAnnotation")
Expand Down
1 change: 1 addition & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ rules:
verbs:
- get
- list
- patch
- watch
- apiGroups:
- addon.open-cluster-management.io
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import (
//+kubebuilder:rbac:groups=certificates.k8s.io,resources=certificatesigningrequests;certificatesigningrequests/approval,verbs=get;list;watch;create;update
//+kubebuilder:rbac:groups=certificates.k8s.io,resources=signers,verbs=approve
//+kubebuilder:rbac:groups=cluster.open-cluster-management.io,resources=managedclusters,verbs=get;list;watch
//+kubebuilder:rbac:groups=addon.open-cluster-management.io,resources=clustermanagementaddons,verbs=get;list;watch
//+kubebuilder:rbac:groups=addon.open-cluster-management.io,resources=clustermanagementaddons,verbs=get;list;watch;patch

// RBAC below will need to be updated if/when new policy controllers are added.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ spec:
port: 8081
failureThreshold: 3
periodSeconds: 10
{{- if semverCompare "< 1.20.0" .Capabilities.KubeVersion.Version }}
{{- if default "v9.9.9" .Capabilities.KubeVersion.Version | trimPrefix "v" | semverCompare "< 1.20.0" }}
initialDelaySeconds: 300
{{- end }}
readinessProbe:
Expand All @@ -127,10 +127,10 @@ spec:
port: 8081
failureThreshold: 3
periodSeconds: 10
{{- if semverCompare "< 1.20.0" .Capabilities.KubeVersion.Version }}
{{- if default "v9.9.9" .Capabilities.KubeVersion.Version | trimPrefix "v" | semverCompare "< 1.20.0" }}
initialDelaySeconds: 300
{{- end }}
{{- if semverCompare ">= 1.20.0" .Capabilities.KubeVersion.Version }}
{{- if default "v9.9.9" .Capabilities.KubeVersion.Version | trimPrefix "v" | semverCompare ">= 1.20.0" }}
{{- /* startupProbe became stable in k8s 1.20 */}}
startupProbe:
httpGet:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Cluster Management project

{{- if semverCompare "< 1.16.0" .Capabilities.KubeVersion.Version }}
{{- if default "v9.9.9" .Capabilities.KubeVersion.Version | trimPrefix "v" | semverCompare "< 1.16.0" }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Cluster Management project

{{- if semverCompare "> 1.16.0" .Capabilities.KubeVersion.Version }}
{{- if default "v9.9.9" .Capabilities.KubeVersion.Version | trimPrefix "v" | semverCompare "> 1.16.0" }}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ spec:
port: 8080
failureThreshold: 3
periodSeconds: 10
{{- if semverCompare "< 1.20.0" .Capabilities.KubeVersion.Version }}
{{- if default "v9.9.9" .Capabilities.KubeVersion.Version | trimPrefix "v" | semverCompare "< 1.20.0" }}
initialDelaySeconds: 300
{{- end }}
readinessProbe:
Expand All @@ -127,7 +127,7 @@ spec:
port: 8080
failureThreshold: 3
periodSeconds: 10
{{- if semverCompare "< 1.20.0" .Capabilities.KubeVersion.Version }}
{{- if default "v9.9.9" .Capabilities.KubeVersion.Version | trimPrefix "v" | semverCompare "< 1.20.0" }}
initialDelaySeconds: 300
{{- end }}
{{- if semverCompare ">= 1.20.0" .Capabilities.KubeVersion.Version }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Cluster Management project

{{- if semverCompare "< 1.16.0" .Capabilities.KubeVersion.Version }}
{{- if default "v9.9.9" .Capabilities.KubeVersion.Version | trimPrefix "v" | semverCompare "< 1.16.0" }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
Expand All @@ -11,6 +11,7 @@ metadata:
name: policies.policy.open-cluster-management.io
labels:
addon.open-cluster-management.io/hosted-manifest-location: hosting
kubernetesversion: {{ .Capabilities.KubeVersion.Version }}
spec:
additionalPrinterColumns:
- JSONPath: .spec.remediationAction
Expand Down Expand Up @@ -265,6 +266,7 @@ metadata:
name: policies.policy.open-cluster-management.io
labels:
addon.open-cluster-management.io/hosted-manifest-location: hosting
kubernetesversion: {{ .Capabilities.KubeVersion.Version }}
spec:
group: policy.open-cluster-management.io
names:
Expand Down

0 comments on commit e07b6b4

Please sign in to comment.