Skip to content

Commit

Permalink
Use IntHash as status.observedGeneration (#1231)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Sep 3, 2018
1 parent bf939eb commit 0de886e
Show file tree
Hide file tree
Showing 43 changed files with 3,268 additions and 2,509 deletions.
8 changes: 2 additions & 6 deletions api/crds/certificate.yaml
Expand Up @@ -437,12 +437,8 @@ spec:
- certURL
- certStableURL
observedGeneration:
description: observedGeneration is the most recent generation observed
for this resource. It corresponds to the resource's generation, which
is updated on mutation by the API Server.
format: int64
type: integer
observedGenerationHash:
description: IntHash represents as int64 Generation and string Hash.
It is json serialized into <int64>$<hash_string>.
type: string
version: v1beta1
versions:
Expand Down
8 changes: 2 additions & 6 deletions api/crds/ingress.yaml
Expand Up @@ -1436,12 +1436,8 @@ spec:
type: string
type: array
observedGeneration:
description: observedGeneration is the most recent generation observed
for this resource. It corresponds to the resource's generation, which
is updated on mutation by the API Server.
format: int64
type: integer
observedGenerationHash:
description: IntHash represents as int64 Generation and string Hash.
It is json serialized into <int64>$<hash_string>.
type: string
version: v1beta1
versions:
Expand Down
16 changes: 6 additions & 10 deletions api/openapi-spec/swagger.json
Expand Up @@ -1900,6 +1900,10 @@
}
},
"definitions": {
"com.github.appscode.go.encoding.json.types.IntHash": {
"description": "IntHash represents as int64 Generation and string Hash. It is json serialized into \u003cint64\u003e$\u003chash_string\u003e.",
"type": "string"
},
"com.github.appscode.voyager.apis.voyager.v1beta1.AuthOption": {
"properties": {
"basic": {
Expand Down Expand Up @@ -2079,11 +2083,7 @@
},
"observedGeneration": {
"description": "observedGeneration is the most recent generation observed for this resource. It corresponds to the resource's generation, which is updated on mutation by the API Server.",
"type": "integer",
"format": "int64"
},
"observedGenerationHash": {
"type": "string"
"$ref": "#/definitions/com.github.appscode.go.encoding.json.types.IntHash"
}
}
},
Expand Down Expand Up @@ -2449,11 +2449,7 @@
},
"observedGeneration": {
"description": "observedGeneration is the most recent generation observed for this resource. It corresponds to the resource's generation, which is updated on mutation by the API Server.",
"type": "integer",
"format": "int64"
},
"observedGenerationHash": {
"type": "string"
"$ref": "#/definitions/com.github.appscode.go.encoding.json.types.IntHash"
}
}
},
Expand Down
6 changes: 2 additions & 4 deletions apis/voyager/v1beta1/certificate.go
@@ -1,6 +1,7 @@
package v1beta1

import (
"github.com/appscode/go/encoding/json/types"
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -80,10 +81,7 @@ type CertificateStatus struct {
// observedGeneration is the most recent generation observed for this resource. It corresponds to the
// resource's generation, which is updated on mutation by the API Server.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`

// +optional
ObservedGenerationHash string `json:"observedGenerationHash,omitempty"`
ObservedGeneration *types.IntHash `json:"observedGeneration,omitempty"`

CreationTime *metav1.Time `json:"creationTime,omitempty"`
Conditions []CertificateCondition `json:"conditions,omitempty"`
Expand Down
6 changes: 2 additions & 4 deletions apis/voyager/v1beta1/ingress.go
@@ -1,6 +1,7 @@
package v1beta1

import (
"github.com/appscode/go/encoding/json/types"
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
Expand Down Expand Up @@ -163,10 +164,7 @@ type IngressStatus struct {
// observedGeneration is the most recent generation observed for this resource. It corresponds to the
// resource's generation, which is updated on mutation by the API Server.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`

// +optional
ObservedGenerationHash string `json:"observedGenerationHash,omitempty"`
ObservedGeneration *types.IntHash `json:"observedGeneration,omitempty"`

// LoadBalancer contains the current status of the load-balancer.
LoadBalancer core.LoadBalancerStatus `json:"loadBalancer,omitempty"`
Expand Down
36 changes: 18 additions & 18 deletions apis/voyager/v1beta1/openapi_generated.go

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

16 changes: 16 additions & 0 deletions apis/voyager/v1beta1/zz_generated.deepcopy.go

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

14 changes: 11 additions & 3 deletions docs/reference/voyager_run.md
Expand Up @@ -36,6 +36,10 @@ voyager run [flags]
--audit-log-maxsize int The maximum size in megabytes of the audit log file before it gets rotated.
--audit-log-mode string Strategy for sending audit events. Blocking indicates sending events should block server responses. Batch causes the backend to buffer and write events asynchronously. Known modes are batch,blocking. (default "blocking")
--audit-log-path string If set, all requests coming to the apiserver will be logged to this file. '-' means standard out.
--audit-log-truncate-enabled Whether event and batch truncating is enabled.
--audit-log-truncate-max-batch-size int Maximum size of the batch sent to the underlying backend. Actual serialized size can be several hundreds of bytes greater. If a batch exceeds this limit, it is split into several batches of smaller size. (default 10485760)
--audit-log-truncate-max-event-size int Maximum size of the audit event sent to the underlying backend. If the size of an event is greater than this number, first request and response are removed, andif this doesn't reduce the size enough, event is discarded. (default 102400)
--audit-log-version string API group and version used for serializing audit events written to log. (default "audit.k8s.io/v1beta1")
--audit-policy-file string Path to the file that defines the audit policy configuration. Requires the 'AdvancedAuditing' feature gate. With AdvancedAuditing, a profile is required to enable auditing.
--audit-webhook-batch-buffer-size int The size of the buffer to store events before batching and writing. Only used in batch mode. (default 10000)
--audit-webhook-batch-max-size int The maximum size of a batch. Only used in batch mode. (default 400)
Expand All @@ -46,6 +50,10 @@ voyager run [flags]
--audit-webhook-config-file string Path to a kubeconfig formatted file that defines the audit webhook configuration. Requires the 'AdvancedAuditing' feature gate.
--audit-webhook-initial-backoff duration The amount of time to wait before retrying the first failed request. (default 10s)
--audit-webhook-mode string Strategy for sending audit events. Blocking indicates sending events should block server responses. Batch causes the backend to buffer and write events asynchronously. Known modes are batch,blocking. (default "batch")
--audit-webhook-truncate-enabled Whether event and batch truncating is enabled.
--audit-webhook-truncate-max-batch-size int Maximum size of the batch sent to the underlying backend. Actual serialized size can be several hundreds of bytes greater. If a batch exceeds this limit, it is split into several batches of smaller size. (default 10485760)
--audit-webhook-truncate-max-event-size int Maximum size of the audit event sent to the underlying backend. If the size of an event is greater than this number, first request and response are removed, andif this doesn't reduce the size enough, event is discarded. (default 102400)
--audit-webhook-version string API group and version used for serializing audit events written to webhook. (default "audit.k8s.io/v1beta1")
--authentication-kubeconfig string kubeconfig file pointing at the 'core' kubernetes server with enough rights to create tokenaccessreviews.authentication.k8s.io.
--authentication-skip-lookup If false, the authentication-kubeconfig will be used to lookup missing authentication configuration from the cluster.
--authentication-token-webhook-cache-ttl duration The duration to cache responses from the webhook token authenticator. (default 10s)
Expand Down Expand Up @@ -78,16 +86,16 @@ voyager run [flags]
--qps float The maximum QPS to the master from this client (default 1e+06)
--rbac Enable RBAC for operator & offshoot Kubernetes objects
--requestheader-allowed-names strings List of client certificate common names to allow to provide usernames in headers specified by --requestheader-username-headers. If empty, any client certificate validated by the authorities in --requestheader-client-ca-file is allowed.
--requestheader-client-ca-file string Root certificate bundle to use to verify client certificates on incoming requests before trusting usernames in headers specified by --requestheader-username-headers
--requestheader-client-ca-file string Root certificate bundle to use to verify client certificates on incoming requests before trusting usernames in headers specified by --requestheader-username-headers. WARNING: generally do not depend on authorization being already done for incoming requests.
--requestheader-extra-headers-prefix strings List of request header prefixes to inspect. X-Remote-Extra- is suggested. (default [x-remote-extra-])
--requestheader-group-headers strings List of request headers to inspect for groups. X-Remote-Group is suggested. (default [x-remote-group])
--requestheader-username-headers strings List of request headers to inspect for usernames. X-Remote-User is common. (default [x-remote-user])
--restrict-to-operator-namespace If true, voyager operator will only handle Kubernetes objects in its own namespace.
--resync-period duration If non-zero, will re-list this often. Otherwise, re-list will be delayed aslong as possible (until the upstream source closes the watch or times out. (default 10m0s)
--secure-port int The port on which to serve HTTPS with authentication and authorization. If 0, don't serve HTTPS at all. (default 443)
--tls-cert-file string File containing the default x509 Certificate for HTTPS. (CA cert, if any, concatenated after server cert). If HTTPS serving is enabled, and --tls-cert-file and --tls-private-key-file are not provided, a self-signed certificate and key are generated for the public address and saved to the directory specified by --cert-dir.
--tls-cipher-suites strings Comma-separated list of cipher suites for the server. Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants). If omitted, the default Go cipher suites will be used
--tls-min-version string Minimum TLS version supported. Value must match version names from https://golang.org/pkg/crypto/tls/#pkg-constants.
--tls-cipher-suites strings Comma-separated list of cipher suites for the server. If omitted, the default Go cipher suites will be use. Possible values: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_RC4_128_SHA,TLS_RSA_WITH_3DES_EDE_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_RC4_128_SHA
--tls-min-version string Minimum TLS version supported. Possible values: VersionTLS10, VersionTLS11, VersionTLS12
--tls-private-key-file string File containing the default x509 private key matching --tls-cert-file.
--tls-sni-cert-key namedCertKey A pair of x509 certificate and private key file paths, optionally suffixed with a list of domain patterns which are fully qualified domain names, possibly with prefixed wildcard segments. If no domain patterns are provided, the names of the certificate are extracted. Non-wildcard matches trump over wildcard matches, explicit domain patterns trump over extracted names. For multiple key/certificate pairs, use the --tls-sni-cert-key multiple times. Examples: "example.crt,example.key" or "foo.crt,foo.key:*.foo.com,foo.com". (default [])
--validate-haproxy-config If true, validates generated haproxy.cfg before sending to HAProxy pods. (default true)
Expand Down

0 comments on commit 0de886e

Please sign in to comment.