Skip to content
Open
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
69 changes: 69 additions & 0 deletions api/bindings/v1alpha1/boundendpoint_conditions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package v1alpha1

// BoundEndpointConditionType is a type of condition for a BoundEndpoint.
type BoundEndpointConditionType string

// BoundEndpointConditionReadyReason is a reason for the Ready condition on a BoundEndpoint.
type BoundEndpointConditionReadyReason string

// BoundEndpointConditionServicesCreatedReason is a reason for the ServicesCreated condition on a BoundEndpoint.
type BoundEndpointConditionServicesCreatedReason string

// BoundEndpointConditionConnectivityVerifiedReason is a reason for the ConnectivityVerified condition on a BoundEndpoint.
type BoundEndpointConditionConnectivityVerifiedReason string

const (
// BoundEndpointConditionReady indicates whether the BoundEndpoint is fully ready
// and all required Kubernetes services have been created and connectivity has been verified.
// This condition will be True when both ServicesCreated and ConnectivityVerified are True.
BoundEndpointConditionReady BoundEndpointConditionType = "Ready"

// BoundEndpointConditionServicesCreated indicates whether all required Kubernetes
// services for the BoundEndpoint have been successfully created.
// This condition will be True when service creation completes successfully,
// and False if service creation fails.
BoundEndpointConditionServicesCreated BoundEndpointConditionType = "ServicesCreated"

// BoundEndpointConditionConnectivityVerified indicates whether connectivity
// to the bound endpoint has been successfully verified.
// This condition will be True when connectivity checks pass,
// and False if connectivity verification fails.
BoundEndpointConditionConnectivityVerified BoundEndpointConditionType = "ConnectivityVerified"
)

// Reasons for Ready condition
const (
// BoundEndpointReasonReady is used when the BoundEndpoint is fully ready,
// with all services created and connectivity verified.
BoundEndpointReasonReady BoundEndpointConditionReadyReason = "BoundEndpointReady"

// BoundEndpointReasonServicesNotCreated is used when the Ready condition is False
// because required Kubernetes services have not been created yet.
BoundEndpointReasonServicesNotCreated BoundEndpointConditionReadyReason = "ServicesNotCreated"

// BoundEndpointReasonConnectivityNotVerified is used when the Ready condition is False
// because connectivity to the bound endpoint has not been verified yet.
BoundEndpointReasonConnectivityNotVerified BoundEndpointConditionReadyReason = "ConnectivityNotVerified"
)

// Reasons for ServicesCreated condition
const (
// BoundEndpointReasonServicesCreated is used when all required Kubernetes services
// have been successfully created for the BoundEndpoint.
BoundEndpointReasonServicesCreated BoundEndpointConditionServicesCreatedReason = "ServicesCreated"

// BoundEndpointReasonServiceCreationFailed is used when the controller fails to create
// one or more required Kubernetes services for the BoundEndpoint.
BoundEndpointReasonServiceCreationFailed BoundEndpointConditionServicesCreatedReason = "ServiceCreationFailed"
)

// Reasons for ConnectivityVerified condition
const (
// BoundEndpointReasonConnectivityVerified is used when connectivity to the
// BoundEndpoint has been successfully verified.
BoundEndpointReasonConnectivityVerified BoundEndpointConditionConnectivityVerifiedReason = "ConnectivityVerified"

// BoundEndpointReasonConnectivityFailed is used when connectivity verification
// to the BoundEndpoint fails.
BoundEndpointReasonConnectivityFailed BoundEndpointConditionConnectivityVerifiedReason = "ConnectivityFailed"
)
133 changes: 133 additions & 0 deletions api/ingress/v1alpha1/domain_conditions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
package v1alpha1

// DomainConditionType is a type of condition for a Domain.
type DomainConditionType string

// DomainConditionReadyReason is a reason for the Ready condition on a Domain.
type DomainConditionReadyReason string

// DomainConditionCreatedReason is a reason for the DomainCreated condition on a Domain.
type DomainConditionCreatedReason string

// DomainConditionCertificateReadyReason is a reason for the CertificateReady condition on a Domain.
type DomainConditionCertificateReadyReason string

// DomainConditionDNSConfiguredReason is a reason for the DNSConfigured condition on a Domain.
type DomainConditionDNSConfiguredReason string

// DomainConditionProgressingReason is a reason for the Progressing condition on a Domain.
type DomainConditionProgressingReason string

const (
// DomainConditionReady indicates whether the Domain is fully ready for use,
// with certificate provisioning and DNS configuration complete.
// For ngrok-managed domains, this will be True immediately upon creation.
// For custom domains, this will be True when both certificate and DNS are ready.
DomainConditionReady DomainConditionType = "Ready"

// DomainConditionCreated indicates whether the domain has been successfully
// created or registered via the ngrok API.
// This condition will be True when domain creation succeeds,
// and False if domain creation fails or the domain specification is invalid.
DomainConditionCreated DomainConditionType = "DomainCreated"

// DomainConditionCertificateReady indicates whether the TLS certificate for
// the domain has been successfully provisioned.
// For ngrok-managed domains, this is always True.
// For custom domains, this tracks the certificate provisioning process.
DomainConditionCertificateReady DomainConditionType = "CertificateReady"

// DomainConditionDNSConfigured indicates whether DNS configuration for the
// domain is complete and correctly pointing to ngrok.
// For ngrok-managed domains, this is always True.
// For custom domains, this tracks DNS setup status.
DomainConditionDNSConfigured DomainConditionType = "DNSConfigured"

// DomainConditionProgressing indicates whether the domain is currently being
// provisioned, with setup steps in progress.
// This condition will be True during active provisioning operations.
DomainConditionProgressing DomainConditionType = "Progressing"
)

// Reasons for Ready condition
const (
// DomainReasonActive is used when the Domain is fully active and ready for use,
// with all provisioning steps complete.
DomainReasonActive DomainConditionReadyReason = "DomainActive"

// DomainReasonInvalid is used when the Domain specification is invalid
// (e.g., invalid domain name format).
DomainReasonInvalid DomainConditionReadyReason = "DomainInvalid"

// DomainReasonCreationFailed is used when the Domain creation failed via the ngrok API.
DomainReasonCreationFailed DomainConditionReadyReason = "DomainCreationFailed"

// DomainReasonProvisioningError is used when there is an error during the
// domain provisioning process (certificate or DNS).
DomainReasonProvisioningError DomainConditionReadyReason = "ProvisioningError"
)

// Reasons for DomainCreated condition
const (
// DomainCreatedReasonCreated is used when the domain has been successfully created
// or registered via the ngrok API.
DomainCreatedReasonCreated DomainConditionCreatedReason = "DomainCreated"

// DomainCreatedReasonCreationFailed is used when the domain creation failed via the ngrok API.
DomainCreatedReasonCreationFailed DomainConditionCreatedReason = "DomainCreationFailed"

// DomainCreatedReasonInvalid is used when the Domain specification is invalid.
DomainCreatedReasonInvalid DomainConditionCreatedReason = "DomainInvalid"
)

// Reasons for CertificateReady condition
const (
// DomainCertificateReadyReasonReady is used when the TLS certificate has been
// successfully provisioned for the domain.
DomainCertificateReadyReasonReady DomainConditionCertificateReadyReason = "CertificateReady"

// DomainCertificateReadyReasonNgrokManaged is used when the domain is ngrok-managed and
// certificate management is handled automatically by ngrok.
DomainCertificateReadyReasonNgrokManaged DomainConditionCertificateReadyReason = "NgrokManaged"

// DomainCertificateReadyReasonProvisioningError is used when there is an error provisioning
// the TLS certificate for the domain.
DomainCertificateReadyReasonProvisioningError DomainConditionCertificateReadyReason = "ProvisioningError"

// DomainCertificateReadyReasonCreationFailed is used when certificate provisioning cannot proceed
// because the domain creation failed.
DomainCertificateReadyReasonCreationFailed DomainConditionCertificateReadyReason = "DomainCreationFailed"

// DomainCertificateReadyReasonInvalid is used when certificate provisioning cannot proceed
// because the domain specification is invalid.
DomainCertificateReadyReasonInvalid DomainConditionCertificateReadyReason = "DomainInvalid"
)

// Reasons for DNSConfigured condition
const (
// DomainDNSConfiguredReasonConfigured is used when DNS is properly configured for the domain.
DomainDNSConfiguredReasonConfigured DomainConditionDNSConfiguredReason = "DomainCreated"

// DomainDNSConfiguredReasonNgrokManaged is used when the domain is ngrok-managed and
// DNS is automatically configured by ngrok.
DomainDNSConfiguredReasonNgrokManaged DomainConditionDNSConfiguredReason = "NgrokManaged"

// DomainDNSConfiguredReasonProvisioningError is used when there is an error with DNS
// configuration for the domain.
DomainDNSConfiguredReasonProvisioningError DomainConditionDNSConfiguredReason = "ProvisioningError"

// DomainDNSConfiguredReasonCreationFailed is used when DNS configuration cannot proceed
// because the domain creation failed.
DomainDNSConfiguredReasonCreationFailed DomainConditionDNSConfiguredReason = "DomainCreationFailed"

// DomainDNSConfiguredReasonInvalid is used when DNS configuration cannot proceed
// because the domain specification is invalid.
DomainDNSConfiguredReasonInvalid DomainConditionDNSConfiguredReason = "DomainInvalid"
)

// Reasons for Progressing condition
const (
// DomainReasonProvisioning is used when the domain is actively being provisioned,
// with certificate or DNS setup in progress.
DomainReasonProvisioning DomainConditionProgressingReason = "Provisioning"
)
77 changes: 77 additions & 0 deletions api/ingress/v1alpha1/ippolicy_conditions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package v1alpha1

// IPPolicyConditionType is a type of condition for an IPPolicy.
type IPPolicyConditionType string

// IPPolicyConditionReadyReason is a reason for the Ready condition on an IPPolicy.
type IPPolicyConditionReadyReason string

// IPPolicyConditionCreatedReason is a reason for the IPPolicyCreated condition on an IPPolicy.
type IPPolicyConditionCreatedReason string

// IPPolicyConditionRulesConfiguredReason is a reason for the RulesConfigured condition on an IPPolicy.
type IPPolicyConditionRulesConfiguredReason string

const (
// IPPolicyConditionReady indicates whether the IPPolicy is fully ready and active,
// with the policy created and all rules properly configured.
// This condition will be True when both IPPolicyCreated and RulesConfigured are True.
IPPolicyConditionReady IPPolicyConditionType = "Ready"

// IPPolicyConditionCreated indicates whether the IP policy has been successfully
// created via the ngrok API.
// This condition will be True when policy creation succeeds,
// and False if policy creation fails.
IPPolicyConditionCreated IPPolicyConditionType = "IPPolicyCreated"

// IPPolicyConditionRulesConfigured indicates whether all IP policy rules have
// been successfully configured and applied.
// This condition will be True when rule configuration succeeds,
// and False if there are errors in the rule configuration (e.g., invalid CIDR).
IPPolicyConditionRulesConfigured IPPolicyConditionType = "RulesConfigured"
)

// Reasons for Ready condition
const (
// IPPolicyReasonActive is used when the IPPolicy is fully active and ready,
// with the policy created and all rules configured.
IPPolicyReasonActive IPPolicyConditionReadyReason = "IPPolicyActive"

// IPPolicyReasonRulesConfigurationError is used when the Ready condition is False
// because there are errors in the IP policy rules configuration.
IPPolicyReasonRulesConfigurationError IPPolicyConditionReadyReason = "IPPolicyRulesConfigurationError"

// IPPolicyReasonCreationFailed is used when the Ready condition is False
// because the IP policy could not be created.
IPPolicyReasonCreationFailed IPPolicyConditionReadyReason = "IPPolicyCreationFailed"

// IPPolicyReasonInvalidCIDR is used when the Ready condition is False
// because one or more IP policy rules contain an invalid CIDR block specification.
IPPolicyReasonInvalidCIDR IPPolicyConditionReadyReason = "IPPolicyInvalidCIDR"
)

// Reasons for IPPolicyCreated condition
const (
// IPPolicyCreatedReasonCreated is used when the IP policy has been successfully
// created via the ngrok API.
IPPolicyCreatedReasonCreated IPPolicyConditionCreatedReason = "IPPolicyCreated"

// IPPolicyCreatedReasonCreationFailed is used when the controller fails to create
// the IP policy via the ngrok API.
IPPolicyCreatedReasonCreationFailed IPPolicyConditionCreatedReason = "IPPolicyCreationFailed"
)

// Reasons for RulesConfigured condition
const (
// IPPolicyRulesConfiguredReasonConfigured is used when all IP policy rules have been
// successfully configured and applied.
IPPolicyRulesConfiguredReasonConfigured IPPolicyConditionRulesConfiguredReason = "IPPolicyRulesConfigured"

// IPPolicyRulesConfiguredReasonConfigurationError is used when there are errors
// configuring the IP policy rules.
IPPolicyRulesConfiguredReasonConfigurationError IPPolicyConditionRulesConfiguredReason = "IPPolicyRulesConfigurationError"

// IPPolicyRulesConfiguredReasonInvalidCIDR is used when one or more IP policy rules contain
// an invalid CIDR block specification.
IPPolicyRulesConfiguredReasonInvalidCIDR IPPolicyConditionRulesConfiguredReason = "IPPolicyInvalidCIDR"
)
84 changes: 84 additions & 0 deletions api/ngrok/v1alpha1/agentendpoint_conditions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package v1alpha1

// AgentEndpointConditionType is a type of condition for an AgentEndpoint.
type AgentEndpointConditionType string

// AgentEndpointConditionReadyReason is a reason for the Ready condition on an AgentEndpoint.
type AgentEndpointConditionReadyReason string

// AgentEndpointConditionEndpointCreatedReason is a reason for the EndpointCreated condition on an AgentEndpoint.
type AgentEndpointConditionEndpointCreatedReason string

// AgentEndpointConditionTrafficPolicyReason is a reason for the TrafficPolicyApplied condition on an AgentEndpoint.
type AgentEndpointConditionTrafficPolicyReason string

const (
// AgentEndpointConditionReady indicates whether the AgentEndpoint is fully ready
// and active, with the endpoint created and any traffic policies applied.
// This condition will be True when the endpoint is active and healthy.
AgentEndpointConditionReady AgentEndpointConditionType = "Ready"

// AgentEndpointConditionEndpointCreated indicates whether the ngrok endpoint
// has been successfully created via the ngrok API.
// This condition will be True when endpoint creation succeeds,
// and False if endpoint creation fails.
AgentEndpointConditionEndpointCreated AgentEndpointConditionType = "EndpointCreated"

// AgentEndpointConditionTrafficPolicy indicates whether any configured traffic
// policies have been successfully applied to the endpoint.
// This condition will be True when traffic policy application succeeds,
// and False if there are errors applying the policy.
AgentEndpointConditionTrafficPolicy AgentEndpointConditionType = "TrafficPolicyApplied"
)

// Reasons for Ready condition
const (
// AgentEndpointReasonActive is used when the AgentEndpoint is fully active
// and ready to serve traffic.
AgentEndpointReasonActive AgentEndpointConditionReadyReason = "EndpointActive"

// AgentEndpointReasonReconciling is used when the AgentEndpoint is currently
// being reconciled and is not yet ready.
AgentEndpointReasonReconciling AgentEndpointConditionReadyReason = "Reconciling"

// AgentEndpointReasonPending is used when the AgentEndpoint creation is pending,
// waiting for dependencies or preconditions to be met.
AgentEndpointReasonPending AgentEndpointConditionReadyReason = "Pending"

// AgentEndpointReasonUnknown is used when the AgentEndpoint status cannot be determined.
AgentEndpointReasonUnknown AgentEndpointConditionReadyReason = "Unknown"

// AgentEndpointReasonDomainNotReady is used when the AgentEndpoint is not ready
// because a referenced Domain resource is not yet ready.
AgentEndpointReasonDomainNotReady AgentEndpointConditionReadyReason = "DomainNotReady"
)

// Reasons for EndpointCreated condition
const (
// AgentEndpointReasonEndpointCreated is used when the ngrok endpoint has been
// successfully created via the ngrok API.
AgentEndpointReasonEndpointCreated AgentEndpointConditionEndpointCreatedReason = "EndpointCreated"

// AgentEndpointReasonNgrokAPIError is used when there is an error communicating
// with the ngrok API to create the endpoint.
AgentEndpointReasonNgrokAPIError AgentEndpointConditionEndpointCreatedReason = "NgrokAPIError"

// AgentEndpointReasonConfigError is used when the AgentEndpoint configuration
// is invalid or incomplete.
AgentEndpointReasonConfigError AgentEndpointConditionEndpointCreatedReason = "ConfigurationError"

// AgentEndpointReasonUpstreamError is used when there is an error with the
// upstream service configuration or connectivity.
AgentEndpointReasonUpstreamError AgentEndpointConditionEndpointCreatedReason = "UpstreamError"
)

// Reasons for TrafficPolicyApplied condition
const (
// AgentEndpointReasonTrafficPolicyApplied is used when configured traffic policies
// have been successfully applied to the endpoint.
AgentEndpointReasonTrafficPolicyApplied AgentEndpointConditionTrafficPolicyReason = "TrafficPolicyApplied"

// AgentEndpointReasonTrafficPolicyError is used when there is an error applying
// traffic policies to the endpoint.
AgentEndpointReasonTrafficPolicyError AgentEndpointConditionTrafficPolicyReason = "TrafficPolicyError"
)
Loading
Loading