Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 5 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ linters-settings:
alias: apierrors
- pkg: github.com/operator-framework/api/pkg/operators/v1alpha1
alias: operatorsv1alpha1
- pkg: github.com/openshift/api/platform/v1alpha1
alias: platformv1alpha1
- pkg: github.com/openshift/platform-operators/api/v1alpha1
alias: platformtypes
revive:
rules:
- name: dot-imports
Expand All @@ -42,7 +46,7 @@ linters-settings:
- github.com/onsi/gomega
- github.com/onsi/ginkgo
goimports:
local-prefixes: github.com/openshift/platform-operators
local-prefixes: github.com/openshift/platform-operators,github.com/openshift/api/platform/v1alpha1

output:
format: tab
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM registry.ci.openshift.org/ocp/4.12:base
COPY manifests /manifests
# LABEL io.openshift.release.operator=true

COPY --from=builder /build/bin/manager /bin
COPY --from=builder /build/bin/manager /
USER 1001

LABEL io.k8s.display-name="OpenShift Platform Operator Manager" \
Expand Down
26 changes: 7 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
SHELL := /bin/bash

ROOT_DIR := $(patsubst %/,%,$(dir $(realpath $(lastword $(MAKEFILE_LIST)))))

# Image URL to use all building/pushing image targets
IMG ?= controller:latest
Expand Down Expand Up @@ -48,7 +51,6 @@ help: ## Display this help.

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) crd:crdVersions=v1 output:crd:artifacts:config=config/crd/bases paths=./api/...
$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=./api/...
$(CONTROLLER_GEN) rbac:roleName=manager-role paths=./... output:rbac:artifacts:config=config/rbac

Expand All @@ -74,6 +76,9 @@ manifests: generate kustomize
@# Cleanup the existing manifests so no removed ones linger post generation
rm manifests/* || true

@# Move the vendored PlatformOperator CRD from o/api to the manifests folder
cp $(ROOT_DIR)/vendor/github.com/openshift/api/platform/v1alpha1/platformoperators.crd.yaml manifests/0000_50_cluster-platform-operator-manager_00-platformoperator.crd.yaml

@# Move all of the rukpak manifests into the manifests folder
$(MV_TMP_DIR)/apiextensions.k8s.io_v1_customresourcedefinition_bundledeployments.core.rukpak.io.yaml manifests/0000_50_cluster-platform-operator-manager_00-rukpak-bundledeployments.crd.yaml
$(MV_TMP_DIR)/apiextensions.k8s.io_v1_customresourcedefinition_bundles.core.rukpak.io.yaml manifests/0000_50_cluster-platform-operator-manager_00-rukpak-bundles.crd.yaml
Expand All @@ -89,7 +94,6 @@ manifests: generate kustomize

@# Move all of the platform operators manifests into the manifests folder
$(MV_TMP_DIR)/v1_namespace_openshift-platform-operators.yaml manifests/0000_50_cluster-platform-operator-manager_00-namespace.yaml
$(MV_TMP_DIR)/apiextensions.k8s.io_v1_customresourcedefinition_platformoperators.platform.openshift.io.yaml manifests/0000_50_cluster-platform-operator-manager_00-platformoperator.crd.yaml
$(MV_TMP_DIR)/v1_serviceaccount_platform-operators-controller-manager.yaml manifests/0000_50_cluster-platform-operator-manager_01-serviceaccount.yaml
$(MV_TMP_DIR)/v1_service_platform-operators-controller-manager-metrics-service.yaml manifests/0000_50_cluster-platform-operator-manager_02-metricsservice.yaml
$(MV_TMP_DIR)/apps_v1_deployment_platform-operators-controller-manager.yaml manifests/0000_50_cluster-platform-operator-manager_06-deployment.yaml
Expand Down Expand Up @@ -152,27 +156,11 @@ kind-load: build-container kind
kind-cluster: kind
$(KIND) get clusters | grep $(KIND_CLUSTER_NAME) || $(KIND) create cluster --name $(KIND_CLUSTER_NAME)

.PHONY: install
install: generate kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -

.PHONY: uninstall
uninstall: generate kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -

.PHONY: run
run: build-container install
run: build-container
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -

.PHONY: deploy
deploy: manifests ## Deploy controller to the K8s cluster specified in ~/.kube/config.
$(KUBECTL) apply -f manifests

.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/default | $($(KUBECTL)) delete --ignore-not-found=$(ignore-not-found) -f -

##@ Build Dependencies

## Location to install dependencies to
Expand Down
36 changes: 0 additions & 36 deletions api/v1alpha1/groupversion_info.go

This file was deleted.

69 changes: 0 additions & 69 deletions api/v1alpha1/platformoperator_types.go

This file was deleted.

25 changes: 25 additions & 0 deletions api/v1alpha1/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Copyright 2022.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

var (
TypeApplied = "Applied"

ReasonSourceFailed = "SourceFailed"
ReasonApplyFailed = "ApplyFailed"
ReasonApplySuccessful = "ApplySuccessful"
)
4 changes: 2 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

platformv1alpha1 "github.com/openshift/platform-operators/api/v1alpha1"
platformv1alpha1 "github.com/openshift/api/platform/v1alpha1"
"github.com/openshift/platform-operators/controllers"
"github.com/openshift/platform-operators/internal/applier"
"github.com/openshift/platform-operators/internal/sourcer"
Expand All @@ -49,7 +49,7 @@ func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(operatorsv1alpha1.AddToScheme(scheme))
utilruntime.Must(rukpakv1alpha1.AddToScheme(scheme))
utilruntime.Must(platformv1alpha1.AddToScheme(scheme))
utilruntime.Must(platformv1alpha1.Install(scheme))
//+kubebuilder:scaffold:scheme
}

Expand Down
125 changes: 0 additions & 125 deletions config/crd/bases/platform.openshift.io_platformoperators.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions config/crd/kustomization.yaml

This file was deleted.

Loading