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

scaffolded OperatorConfig API #1027

Merged
merged 3 commits into from
Mar 28, 2024
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
22 changes: 18 additions & 4 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: ibm.com
layout: go.kubebuilder.io/v3
layout:
- go.kubebuilder.io/v3
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
projectName: operand-deployment-lifecycle-manager
repo: github.com/IBM/operand-deployment-lifecycle-manager
resources:
Expand Down Expand Up @@ -27,7 +35,13 @@ resources:
kind: OperandBindInfo
path: github.com/IBM/operand-deployment-lifecycle-manager/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: ibm.com
group: operator
kind: OperatorConfig
path: github.com/IBM/operand-deployment-lifecycle-manager/api/v1alpha1
version: v1alpha1
version: "3"
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
64 changes: 64 additions & 0 deletions api/v1alpha1/operatorconfig_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
//
// Copyright 2022 IBM Corporation
//
// 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

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// OperatorConfigSpec defines the desired state of OperatorConfig
type OperatorConfigSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// Foo is an example field of OperatorConfig. Edit operatorconfig_types.go to remove/update
Foo string `json:"foo,omitempty"`
}

// OperatorConfigStatus defines the observed state of OperatorConfig
type OperatorConfigStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// OperatorConfig is the Schema for the operatorconfigs API
type OperatorConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec OperatorConfigSpec `json:"spec,omitempty"`
Status OperatorConfigStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// OperatorConfigList contains a list of OperatorConfig
type OperatorConfigList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []OperatorConfig `json:"items"`
}

func init() {
SchemeBuilder.Register(&OperatorConfig{}, &OperatorConfigList{})
}
121 changes: 121 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=ibm-odlm
LABEL operators.operatorframework.io.bundle.channels.v1=v4.3
LABEL operators.operatorframework.io.bundle.channel.default.v1=v4.3
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.32.0
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.29.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ metadata:
categories: Developer Tools, Monitoring, Logging & Tracing, Security
certified: "false"
containerImage: icr.io/cpopen/odlm:latest
createdAt: "2024-03-13T21:38:26Z"
createdAt: "2024-03-20T18:18:08Z"
description: The Operand Deployment Lifecycle Manager provides a Kubernetes CRD-based API to manage the lifecycle of operands.
nss.operator.ibm.com/managed-operators: ibm-odlm
olm.skipRange: '>=1.2.0 <4.3.0'
operators.openshift.io/infrastructure-features: '["disconnected"]'
operators.operatorframework.io/builder: operator-sdk-v1.32.0
operators.operatorframework.io/builder: operator-sdk-v1.29.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/IBM/operand-deployment-lifecycle-manager
support: IBM
Expand Down Expand Up @@ -215,6 +215,9 @@ spec:
x-descriptors:
- urn:alm:descriptor:io.kubernetes.phase
version: v1alpha1
- kind: OperatorConfig
name: operatorconfigs.operator.ibm.com
version: v1alpha1
description: |-
# Introduction

Expand Down Expand Up @@ -562,22 +565,22 @@ spec:
install:
spec:
clusterPermissions:
- rules:
- apiGroups:
- operators.coreos.com
resources:
- catalogsources
verbs:
- get
- apiGroups:
- operator.ibm.com
resources:
- certmanagers
- auditloggings
verbs:
- get
- delete
serviceAccountName: operand-deployment-lifecycle-manager
- rules:
- apiGroups:
- operators.coreos.com
resources:
- catalogsources
verbs:
- get
- apiGroups:
- operator.ibm.com
resources:
- certmanagers
- auditloggings
verbs:
- get
- delete
serviceAccountName: operand-deployment-lifecycle-manager
deployments:
- label:
app.kubernetes.io/instance: operand-deployment-lifecycle-manager
Expand Down
59 changes: 59 additions & 0 deletions bundle/manifests/operator.ibm.com_operatorconfigs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
creationTimestamp: null
labels:
app.kubernetes.io/instance: operand-deployment-lifecycle-manager
app.kubernetes.io/managed-by: operand-deployment-lifecycle-manager
app.kubernetes.io/name: operand-deployment-lifecycle-manager
name: operatorconfigs.operator.ibm.com
spec:
group: operator.ibm.com
names:
kind: OperatorConfig
listKind: OperatorConfigList
plural: operatorconfigs
singular: operatorconfig
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: OperatorConfig is the Schema for the operatorconfigs API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: OperatorConfigSpec defines the desired state of OperatorConfig
properties:
foo:
description: Foo is an example field of OperatorConfig. Edit operatorconfig_types.go
to remove/update
type: string
type: object
status:
description: OperatorConfigStatus defines the observed state of OperatorConfig
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
2 changes: 1 addition & 1 deletion bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ annotations:
operators.operatorframework.io.bundle.package.v1: ibm-odlm
operators.operatorframework.io.bundle.channels.v1: v4.3
operators.operatorframework.io.bundle.channel.default.v1: v4.3
operators.operatorframework.io.metrics.builder: operator-sdk-v1.32.0
operators.operatorframework.io.metrics.builder: operator-sdk-v1.29.0
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3
# Annotations for testing.
Expand Down
Loading