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 operator-sdk, controller-gen and kustomize with latest configs #1291

Merged
merged 1 commit into from
Dec 11, 2023
Merged
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
6 changes: 4 additions & 2 deletions cicd-scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

echo "install dependencies"

_OPERATOR_SDK_VERSION=v1.4.2
_OPERATOR_SDK_VERSION=v1.32.0

if ! [ -x "$(command -v operator-sdk)" ]; then
if [[ $OSTYPE == "linux-gnu" ]]; then
curl -L https://github.com/operator-framework/operator-sdk/releases/download/${_OPERATOR_SDK_VERSION}/operator-sdk_linux_amd64 -o operator-sdk
elif [[ $OSTYPE == "darwin"* ]]; then
elif [[ $OSTYPE == "darwin-amd64"* ]]; then
curl -L https://github.com/operator-framework/operator-sdk/releases/download/${_OPERATOR_SDK_VERSION}/operator-sdk_darwin_amd64 -o operator-sdk
elif [[ $OSTYPE == "darwin-arm64"* ]]; then
curl -L https://github.com/operator-framework/operator-sdk/releases/download/${_OPERATOR_SDK_VERSION}/operator-sdk_darwin_arm64 -o operator-sdk
fi
chmod +x operator-sdk
sudo mv operator-sdk /usr/local/bin/operator-sdk
Expand Down
4 changes: 3 additions & 1 deletion operators/endpointmetrics/config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ namespace: open-cluster-management-addon-observability
#commonLabels:
# someName: someValue

bases:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../crd
- ../rbac
- ../manager
5 changes: 3 additions & 2 deletions operators/multiclusterobservability/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,15 @@ generate: controller-gen
# Download controller-gen locally if necessary
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
controller-gen:
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1)
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.13.0)

# Download kustomize locally if necessary
KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize:
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected])
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected])

# go-get-tool will 'go get' any package $2 and install it to $1.
# TODO(saswatamcode): Not all tools are "go install"-able, if they have replace directives in their go.mod. Replace with something else.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
define go-get-tool
@[ -f $(1) ] || { \
Expand Down
22 changes: 18 additions & 4 deletions operators/multiclusterobservability/PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,30 @@ layout: go.kubebuilder.io/v3
projectName: multicluster-observability-operator
repo: github.com/stolostron/multicluster-observability-operator
resources:
- crdVersion: v1
- api:
crdVersion: v1
namespaced: true
controller: true
path: github.com/stolostron/multicluster-observability-operator/operators/multiclusterobservability/api/v1beta2
domain: open-cluster-management.io
group: observability
kind: MultiClusterObservability
version: v1beta2
webhookVersion: v1
- crdVersion: v1
webhooks:
conversion: true
defaulting: true
validation: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
controller: true
path: github.com/stolostron/multicluster-observability-operator/operators/multiclusterobservability/api/shared
domain: open-cluster-management.io
group: observability
kind: ObservabilityAddon
version: v1beta1
version: 3-alpha
version: "3"
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
11 changes: 7 additions & 4 deletions operators/multiclusterobservability/bundle.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
FROM scratch

USER 1001:1001

# Core bundle labels.
LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=multicluster-observability-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.4.2
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.32.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/

# Labels for testing.
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/

# Copy files to locations specified by labels.
COPY bundle/manifests /manifests/
COPY bundle/metadata /metadata/
COPY bundle/tests/scorecard /tests/scorecard/

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,23 @@ metadata:
}
]
capabilities: Basic Install
operators.operatorframework.io/builder: operator-sdk-v1.4.2
createdAt: "2023-12-11T07:57:04Z"
operators.operatorframework.io/builder: operator-sdk-v1.32.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
operators.operatorframework.io/internal-objects: '["observatoria.core.observatorium.io","observabilityaddons.observability.open-cluster-management.io"]'
name: multicluster-observability-operator.v0.1.0
namespace: placeholder
spec:
apiservicedefinitions: {}
customresourcedefinitions:
owned:
- description: MultiClusterObservability defines the configuration for the Observability installation on Hub and Managed Clusters all through this one custom resource.
- description: MultiClusterObservability defines the configuration for the Observability
installation on Hub and Managed Clusters all through this one custom resource.
displayName: MultiClusterObservability
kind: MultiClusterObservability
name: multiclusterobservabilities.observability.open-cluster-management.io
version: v1beta1
- description: MultiClusterObservability defines the configuration for the Observability installation on Hub and Managed Clusters all through this one custom resource.
- description: MultiClusterObservability defines the configuration for the Observability
installation on Hub and Managed Clusters all through this one custom resource.
displayName: MultiClusterObservability
kind: MultiClusterObservability
name: multiclusterobservabilities.observability.open-cluster-management.io
Expand All @@ -76,7 +78,8 @@ spec:
- kind: Observatorium
name: observatoria.core.observatorium.io
version: v1alpha1
description: The multicluster-observability-operator is a component of ACM observability feature. It is designed to install into Hub Cluster.
description: The multicluster-observability-operator is a component of ACM observability
feature. It is designed to install into Hub Cluster.
displayName: Multicluster Observability Operator
icon:
- base64data: ""
Expand Down Expand Up @@ -453,7 +456,9 @@ spec:
- watch
serviceAccountName: multicluster-observability-operator
deployments:
- name: multicluster-observability-operator
- label:
name: multicluster-observability-operator
name: multicluster-observability-operator
spec:
replicas: 1
selector:
Expand Down Expand Up @@ -521,7 +526,7 @@ spec:
resources:
limits:
cpu: 600m
memory: 2Gi
memory: 1Gi
requests:
cpu: 100m
memory: 128Mi
Expand Down Expand Up @@ -561,6 +566,18 @@ spec:
url: https://github.com/stolostron/multicluster-observability-operator
version: 0.1.0
webhookdefinitions:
- admissionReviewVersions:
- v1
- v1beta1
containerPort: 443
conversionCRDs:
- multiclusterobservabilities.observability.open-cluster-management.io
deploymentName: multicluster-observability-operator
generateName: cmulticlusterobservabilities.kb.io
sideEffects: None
targetPort: 9443
type: ConversionWebhook
webhookPath: /convert
- admissionReviewVersions:
- v1
- v1beta1
Expand Down
Loading