Skip to content

Commit

Permalink
Merge pull request #82 from kube-logging/rename-output
Browse files Browse the repository at this point in the history
chore(api): rename OtelOutput type to Output
  • Loading branch information
kristofgyuracz authored Sep 2, 2024
2 parents 51a1749 + c52523d commit 499ee0a
Show file tree
Hide file tree
Showing 24 changed files with 107 additions and 111 deletions.
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ resources:
namespaced: true
domain: kube-logging.dev
group: telemetry
kind: OtelOutput
kind: Output
path: github.com/kube-logging/telemetry-controller/api/telemetry/v1alpha1
version: v1alpha1
version: "3"
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ import (
// 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.

// OtelOutputSpec defines the desired state of OtelOutput
type OtelOutputSpec struct {
// OutputSpec defines the desired state of Output
type OutputSpec 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 OtelOutput. Edit oteloutput_types.go to remove/update
OTLP *OTLP `json:"otlp,omitempty"`
Loki *Loki `json:"loki,omitempty"`
Fluentforward *Fluentforward `json:"fluentforward,omitempty"`
Expand Down Expand Up @@ -88,38 +87,36 @@ type TCPClientSettings struct {
SharedKey string `json:"shared_key,omitempty" yaml:"shared_key,omitempty"`
}

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

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:categories=telemetry-all

// OtelOutput is the Schema for the oteloutputs API
type OtelOutput struct {
// Output is the Schema for the outputs API
type Output struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec OtelOutputSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
Status OtelOutputStatus `json:"status,omitempty" `
Spec OutputSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
Status OutputStatus `json:"status,omitempty" `
}

// +kubebuilder:object:root=true

// OtelOutputList contains a list of OtelOutput
type OtelOutputList struct {
// OutputList contains a list of Output
type OutputList struct {
metav1.TypeMeta `json:",inline" yaml:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []OtelOutput `json:"items"`
Items []Output `json:"items"`
}

func init() {
SchemeBuilder.Register(&OtelOutput{}, &OtelOutputList{})
SchemeBuilder.Register(&Output{}, &OutputList{})
}

func (o *OtelOutput) NamespacedName() NamespacedName {
func (o *Output) NamespacedName() NamespacedName {
return NamespacedName{Namespace: o.Namespace, Name: o.Name}
}
38 changes: 19 additions & 19 deletions api/telemetry/v1alpha1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
name: oteloutputs.telemetry.kube-logging.dev
name: outputs.telemetry.kube-logging.dev
spec:
group: telemetry.kube-logging.dev
names:
categories:
- telemetry-all
kind: OtelOutput
listKind: OtelOutputList
plural: oteloutputs
singular: oteloutput
kind: Output
listKind: OutputList
plural: outputs
singular: output
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: OtelOutput is the Schema for the oteloutputs API
description: Output is the Schema for the outputs API
properties:
apiVersion:
description: |-
Expand All @@ -39,7 +39,7 @@ spec:
metadata:
type: object
spec:
description: OtelOutputSpec defines the desired state of OtelOutput
description: OutputSpec defines the desired state of Output
properties:
fluentforward:
properties:
Expand Down Expand Up @@ -409,8 +409,7 @@ spec:
type: integer
type: object
otlp:
description: Foo is an example field of OtelOutput. Edit oteloutput_types.go
to remove/update
description: 'OTLP grpc exporter config ref: https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/config.go'
properties:
auth:
description: Auth configuration for outgoing RPCs.
Expand Down Expand Up @@ -610,7 +609,7 @@ spec:
type: object
type: object
status:
description: OtelOutputStatus defines the observed state of OtelOutput
description: OutputStatus defines the observed state of Output
type: object
type: object
served: true
Expand Down
6 changes: 3 additions & 3 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resources:
- bases/telemetry.kube-logging.dev_collectors.yaml
- bases/telemetry.kube-logging.dev_subscriptions.yaml
- bases/telemetry.kube-logging.dev_tenants.yaml
- bases/telemetry.kube-logging.dev_oteloutputs.yaml
- bases/telemetry.kube-logging.dev_outputs.yaml
#+kubebuilder:scaffold:crdkustomizeresource

patches:
Expand All @@ -14,15 +14,15 @@ patches:
#- path: patches/webhook_in_collectors.yaml
#- path: patches/webhook_in_telemetry_subscriptions.yaml
#- path: patches/webhook_in_telemetry_tenants.yaml
#- path: patches/webhook_in_telemetry_oteloutputs.yaml
#- path: patches/webhook_in_telemetry_outputs.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch

# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
#- path: patches/cainjection_in_collectors.yaml
#- path: patches/cainjection_in_telemetry_subscriptions.yaml
#- path: patches/cainjection_in_telemetry_tenants.yaml
#- path: patches/cainjection_in_telemetry_oteloutputs.yaml
#- path: patches/cainjection_in_telemetry_outputs.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch

# [WEBHOOK] To enable webhook, uncomment the following section
Expand Down
8 changes: 4 additions & 4 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
resources:
- manager.yaml
- manager.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: ghcr.io/kube-logging/telemetry-controller
newTag: 0.0.8
- name: controller
newName: ghcr.io/kube-logging/telemetry-controller
newTag: 0.0.9
4 changes: 2 additions & 2 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ rules:
- telemetry.kube-logging.dev
resources:
- collectors
- oteloutputs
- outputs
- subscriptions
- tenants
verbs:
Expand All @@ -96,7 +96,7 @@ rules:
- telemetry.kube-logging.dev
resources:
- collectors/status
- oteloutputs/status
- outputs/status
- subscriptions/status
- tenants/status
verbs:
Expand Down
10 changes: 5 additions & 5 deletions config/rbac/telemetry_oteloutput_viewer_role.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# permissions for end users to view oteloutputs.
# permissions for end users to view outputs.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: oteloutput-viewer-role
app.kubernetes.io/instance: output-viewer-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: telemetry-controller
app.kubernetes.io/part-of: telemetry-controller
app.kubernetes.io/managed-by: kustomize
name: oteloutput-viewer-role
name: output-viewer-role
rules:
- apiGroups:
- telemetry.kube-logging.dev
resources:
- oteloutputs
- outputs
verbs:
- get
- list
- watch
- apiGroups:
- telemetry.kube-logging.dev
resources:
- oteloutputs/status
- outputs/status
verbs:
- get
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# permissions for end users to edit oteloutputs.
# permissions for end users to edit outputs.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: oteloutput-editor-role
app.kubernetes.io/instance: output-editor-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: telemetry-controller
app.kubernetes.io/part-of: telemetry-controller
app.kubernetes.io/managed-by: kustomize
name: oteloutput-editor-role
name: output-editor-role
rules:
- apiGroups:
- telemetry.kube-logging.dev
resources:
- oteloutputs
- outputs
verbs:
- create
- delete
Expand All @@ -26,6 +26,6 @@ rules:
- apiGroups:
- telemetry.kube-logging.dev
resources:
- oteloutputs/status
- outputs/status
verbs:
- get
2 changes: 1 addition & 1 deletion config/samples/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ resources:
- telemetry_v1alpha1_collector.yaml
- telemetry_v1alpha1_subscription.yaml
- telemetry_v1alpha1_tenant.yaml
- telemetry_v1alpha1_oteloutput.yaml
- telemetry_v1alpha1_output.yaml
#+kubebuilder:scaffold:manifestskustomizesamples
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: telemetry.kube-logging.dev/v1alpha1
kind: OtelOutput
kind: Output
metadata:
labels:
app.kubernetes.io/name: oteloutput
app.kubernetes.io/instance: oteloutput-sample
app.kubernetes.io/name: output
app.kubernetes.io/instance: output-sample
app.kubernetes.io/part-of: telemetry-controller
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: telemetry-controller
name: oteloutput-sample
name: output-sample
spec:
otlp:
endpoint: receiver.svc.cluster.local:4317
Expand Down
Loading

0 comments on commit 499ee0a

Please sign in to comment.