Skip to content

Commit

Permalink
Use health checker types from kmodules (#675)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>

Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha authored Aug 25, 2022
1 parent 9973037 commit eb922b1
Show file tree
Hide file tree
Showing 68 changed files with 2,020 additions and 1,159 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ require (
k8s.io/component-base v0.24.3
k8s.io/klog/v2 v2.70.1
k8s.io/kubectl v0.24.3
kmodules.xyz/client-go v0.24.5
kmodules.xyz/client-go v0.24.6
kmodules.xyz/custom-resources v0.24.1
kmodules.xyz/monitoring-agent-api v0.24.0
kubedb.dev/apimachinery v0.28.0
kubedb.dev/apimachinery v0.28.4-0.20220825144447-722a1bc1c19e
stash.appscode.dev/apimachinery v0.22.0
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1168,8 +1168,8 @@ k8s.io/metrics v0.24.3/go.mod h1:p1M0lhMySWfhISkSd3HEj8xIgrVnJTK3PPhFq2rA3To=
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc=
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
kmodules.xyz/client-go v0.24.5 h1:vZcVfRv3o+E+t0reUwk5pxg9fe1v61/FGDh8sWi1RDk=
kmodules.xyz/client-go v0.24.5/go.mod h1:wTV6xDTJT8PYnHg33tg1ofVWvIXAboQGH+OKUCJwja0=
kmodules.xyz/client-go v0.24.6 h1:nHew75PfDc5TK56HMoMbS48kCvJtYcLeeNUCTbHJ4Mc=
kmodules.xyz/client-go v0.24.6/go.mod h1:wTV6xDTJT8PYnHg33tg1ofVWvIXAboQGH+OKUCJwja0=
kmodules.xyz/custom-resources v0.24.1 h1:b9IIZ6sJaCkWmMFELrA+gFc4NCizLH2bItAEifLYrRY=
kmodules.xyz/custom-resources v0.24.1/go.mod h1:S6+TonEzosMPXbTA0gkh8djnw+mhLtwCN41a3PNUtsY=
kmodules.xyz/monitoring-agent-api v0.24.0 h1:CPFvzDppUKckMBLwaMnZbpYCuP7+NhcS4t7dWNTIgQo=
Expand All @@ -1180,8 +1180,8 @@ kmodules.xyz/offshoot-api v0.24.2 h1:QCJEqv++x+FXe7fiTZ/zptJo83qZA4cTUO7YhMlIDvQ
kmodules.xyz/offshoot-api v0.24.2/go.mod h1:fYu0051hoJXXs70OjmIE+Q5smOgmzvYFhRJXCiFShaY=
kmodules.xyz/prober v0.24.0 h1:lh3fDBjYD9bOuFW5Usmf9mFYSNn7r0t65xeN4w2EMgw=
kmodules.xyz/prober v0.24.0/go.mod h1:leon0MFb7OWi/snhosqkNqbwYaED4VEmj7xaLxk851k=
kubedb.dev/apimachinery v0.28.0 h1:MEO6qdN8YGQ9VmY9ir7JpU6eyJUqcjQy8ofhrMQIf5M=
kubedb.dev/apimachinery v0.28.0/go.mod h1:XFyYbBJucmbwtfju+JrukS3aH70YygpuPXeb3gvQLio=
kubedb.dev/apimachinery v0.28.4-0.20220825144447-722a1bc1c19e h1:taWcv9At7lwHSPVMmo9ACY1/O80BATMOs8qO4j56gxo=
kubedb.dev/apimachinery v0.28.4-0.20220825144447-722a1bc1c19e/go.mod h1:5rmF0c7DpyThOUho8hvAuFwMvKE/2WsBySSNDVj35qA=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
Expand Down
2 changes: 1 addition & 1 deletion vendor/kmodules.xyz/client-go/api/v1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ type ClusterMetadata struct {
UID string `json:"uid" protobuf:"bytes,1,opt,name=uid"`
Name string `json:"name,omitempty" protobuf:"bytes,2,opt,name=name"`
DisplayName string `json:"displayName,omitempty" protobuf:"bytes,3,opt,name=displayName"`
Provider HostingProvider `json:"provider,omitempty" protobuf:"bytes,4,opt,name=provider"`
Provider HostingProvider `json:"provider,omitempty" protobuf:"bytes,4,opt,name=provider,casttype=HostingProvider"`
}
2 changes: 1 addition & 1 deletion vendor/kmodules.xyz/client-go/api/v1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type Condition struct {
Type string `json:"type" protobuf:"bytes,1,opt,name=type"`
// Status of the condition, one of True, False, Unknown.
// +required
Status core.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status"`
Status core.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"`
// If set, this represents the .metadata.generation that the condition was set based upon.
// For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date
// with respect to the current state of the instance.
Expand Down
599 changes: 506 additions & 93 deletions vendor/kmodules.xyz/client-go/api/v1/generated.pb.go

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions vendor/kmodules.xyz/client-go/api/v1/generated.proto

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

46 changes: 46 additions & 0 deletions vendor/kmodules.xyz/client-go/api/v1/healthchecker.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Copyright AppsCode Inc. and Contributors
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 v1

// ReadonlyHealthCheckSpec defines attributes of the health check using only read-only checks
type ReadonlyHealthCheckSpec struct {
// How often (in seconds) to perform the health check.
// Default to 10 seconds. Minimum value is 1.
// +optional
// +kubebuilder:default=10
PeriodSeconds *int32 `json:"periodSeconds,omitempty" protobuf:"varint,1,opt,name=periodSeconds"`
// Number of seconds after which the probe times out.
// Defaults to 10 second. Minimum value is 1.
// It should be less than the periodSeconds.
// +optional
// +kubebuilder:default=10
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty" protobuf:"varint,2,opt,name=timeoutSeconds"`
// Minimum consecutive failures for the health check to be considered failed after having succeeded.
// Defaults to 1. Minimum value is 1.
// +optional
// +kubebuilder:default=1
FailureThreshold *int32 `json:"failureThreshold,omitempty" protobuf:"varint,3,opt,name=failureThreshold"`
}

// HealthCheckSpec defines attributes of the health check
type HealthCheckSpec struct {
ReadonlyHealthCheckSpec `json:",inline" protobuf:"bytes,1,opt,name=readonlyHealthCheckSpec"`
// Whether to disable write check on database.
// Defaults to false.
// +optional
DisableWriteCheck bool `json:"disableWriteCheck,omitempty" protobuf:"varint,2,opt,name=disableWriteCheck"`
}
103 changes: 90 additions & 13 deletions vendor/kmodules.xyz/client-go/api/v1/openapi_generated.go

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

48 changes: 48 additions & 0 deletions vendor/kmodules.xyz/client-go/api/v1/zz_generated.deepcopy.go

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

Loading

0 comments on commit eb922b1

Please sign in to comment.