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

Allow empty backend #274

Merged
merged 11 commits into from
Dec 7, 2023
Merged

Conversation

muralov
Copy link
Contributor

@muralov muralov commented Nov 30, 2023

Description
Allow empty backend and set warning state without doing anything

Changes proposed in this pull request:

  • Allow empty backend by removing backend defaulting
    • Set warning state and do nothing
  • Set warning state if Event Mesh secret is missing
  • Set warning state if NATS module is missing
  • Forbid deleting backend config

Related issue(s)
#266

@muralov muralov requested review from a team as code owners November 30, 2023 08:12
@muralov muralov requested a review from marcobebway November 30, 2023 08:12
@kyma-bot kyma-bot added area/documentation Issues or PRs related to documentation cla: yes Indicates the PR's author has signed the CLA. labels Nov 30, 2023
@muralov muralov added area/eventing Issues or PRs related to eventing kind/feature Categorizes issue or PR as related to a new feature. labels Nov 30, 2023
@kyma-bot kyma-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 30, 2023
@muralov muralov added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 30, 2023
@muralov muralov force-pushed the allow-empty-backend branch from ab6908e to 443bf68 Compare November 30, 2023 08:29
@kyma-bot kyma-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 30, 2023
| **backend** | object | Backend defines the active backend used by Eventing. |
| **backend.​config** | object | Config defines configuration for eventing backend. |
| **backend.​config.​domain** | string | Domain defines the cluster public domain used to configure the EventMesh Subscriptions and their corresponding ApiRules. |
| **backend.​config.​eventMeshSecret** | string | EventMeshSecret defines the namespaced name of K8s Secret containing EventMesh credentials. The format of name is "namespace/name". |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this sentence. What is a "namespaced name"?

| **backend.​config** | object | Config defines configuration for eventing backend. |
| **backend.​config.​domain** | string | Domain defines the cluster public domain used to configure the EventMesh Subscriptions and their corresponding ApiRules. |
| **backend.​config.​eventMeshSecret** | string | EventMeshSecret defines the namespaced name of K8s Secret containing EventMesh credentials. The format of name is "namespace/name". |
| **backend.​config.​eventTypePrefix** | string | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no description for this one?

| **publisher.​replicas.​max** | integer | Max defines maximum number of replicas. |
| **publisher.​replicas.​min** | integer | Min defines minimum number of replicas. |
| **publisher.​resources** | object | Resources defines resources for eventing-publisher-proxy. |
| **publisher.​resources.​claims** | \[\]object | Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't rendered correctly when the sentences are in different lines:
image

The table is auto-generated, so you might have to adjust the formatting somewhere else instead of here. But here's how it should look like eventually:

Suggested change
| **publisher.​resources.​claims** | \[\]object | Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.
| **publisher.​resources.​claims** | \[\]object | Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers. |

| Parameter | Type | Description |
| ---- | ----------- | ---- |
| **activeBackend** (required) | string | |
| **conditions** | \[\]object | Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, with the content spread across three lines, this table cell isn't rendered correctly:

image

| **conditions** | \[\]object | Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example,
type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
// other fields } |
| **conditions.​lastTransitionTime** (required) | string | lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"This should be when"

Maybe a word is missing here? Not sure what this means.

// other fields } |
| **conditions.​lastTransitionTime** (required) | string | lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. |
| **conditions.​message** (required) | string | message is a human readable message indicating details about the transition. This may be an empty string. |
| **conditions.​observedGeneration** | integer | observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| **conditions.​observedGeneration** | integer | observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. |
| **conditions.​observedGeneration** | integer | observedGeneration represents the .metadata.generation that the condition was set based upon. For example, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. |

Fix it in the source file, not here :)

@muralov muralov changed the title Allow empty backend WIP: Allow empty backend Dec 4, 2023
@kyma-bot kyma-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 4, 2023
@muralov muralov force-pushed the allow-empty-backend branch 5 times, most recently from 0faf097 to 8417d28 Compare December 6, 2023 05:38
Make state warning and BackendAvailable condition false for empty backend config
@muralov muralov force-pushed the allow-empty-backend branch from 8417d28 to fb10b89 Compare December 6, 2023 05:41
 * Set Warning state if EventMes secret missing
 * Fix failing tests
@muralov muralov force-pushed the allow-empty-backend branch from fb10b89 to 32cce57 Compare December 6, 2023 05:47
@muralov muralov removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 6, 2023
It is not allowed to delete existing backend config, but evneting CR can be created with empty backend config.
@muralov muralov changed the title WIP: Allow empty backend Allow empty backend Dec 6, 2023
@kyma-bot kyma-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 6, 2023
Create integration tests for backend config deletion validation
@muralov muralov linked an issue Dec 6, 2023 that may be closed by this pull request
6 tasks
Auto generation of doc is breaking the documentation
@muralov muralov force-pushed the allow-empty-backend branch from 52caff4 to 3f26c86 Compare December 7, 2023 06:07
@muralov
Copy link
Contributor Author

muralov commented Dec 7, 2023

@NHingerl I've applied my only change to the .md file and reverted the auto-generated parts as it breaks the doc.

.golangci.yaml Outdated Show resolved Hide resolved
NHingerl
NHingerl previously approved these changes Dec 7, 2023
@kyma-bot kyma-bot added the lgtm Looks good to me! label Dec 7, 2023
@kyma-bot kyma-bot removed the lgtm Looks good to me! label Dec 7, 2023
@kyma-bot kyma-bot added the lgtm Looks good to me! label Dec 7, 2023
@kyma-bot kyma-bot merged commit e4b79e4 into kyma-project:main Dec 7, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Issues or PRs related to documentation area/eventing Issues or PRs related to eventing cla: yes Indicates the PR's author has signed the CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm Looks good to me! size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow empty backend-spec on eventing-cr
4 participants