Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
JsonnetFmt
  • Loading branch information
Duologic committed Apr 17, 2020
commit 98581ba5ea0728546ba64cfc71388cfc0152c851
62 changes: 31 additions & 31 deletions ksonnet-lib/k.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -17,71 +17,71 @@ local fn = {
self.mapContainers(function(c) if std.objectHas(c, 'name') && inNameSet(c.name) then f(c) else c),
};

k8s + {
apps:: k8s.apps + {
v1:: k8s.apps.v1 + {
daemonSet:: k8s.apps.v1.daemonSet + {
k8s {
apps:: k8s.apps {
v1:: k8s.apps.v1 {
daemonSet:: k8s.apps.v1.daemonSet {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
deployment:: k8s.apps.v1.deployment + {
deployment:: k8s.apps.v1.deployment {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
replicaSet:: k8s.apps.v1.replicaSet + {
replicaSet:: k8s.apps.v1.replicaSet {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
statefulSet:: k8s.apps.v1.statefulSet + {
statefulSet:: k8s.apps.v1.statefulSet {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
},
v1beta1:: k8s.apps.v1beta1 + {
deployment:: k8s.apps.v1beta1.deployment + {
v1beta1:: k8s.apps.v1beta1 {
deployment:: k8s.apps.v1beta1.deployment {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
statefulSet:: k8s.apps.v1beta1.statefulSet + {
statefulSet:: k8s.apps.v1beta1.statefulSet {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
},
v1beta2:: k8s.apps.v1beta2 + {
daemonSet:: k8s.apps.v1beta2.daemonSet + {
v1beta2:: k8s.apps.v1beta2 {
daemonSet:: k8s.apps.v1beta2.daemonSet {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
deployment:: k8s.apps.v1beta2.deployment + {
deployment:: k8s.apps.v1beta2.deployment {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
replicaSet:: k8s.apps.v1beta2.replicaSet + {
replicaSet:: k8s.apps.v1beta2.replicaSet {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
statefulSet:: k8s.apps.v1beta2.statefulSet + {
statefulSet:: k8s.apps.v1beta2.statefulSet {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
},
},
batch:: k8s.batch + {
v1:: k8s.batch.v1 + {
job:: k8s.batch.v1.job + {
batch:: k8s.batch {
v1:: k8s.batch.v1 {
job:: k8s.batch.v1.job {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
},
v1beta1:: k8s.batch.v1beta1 + {
cronJob:: k8s.batch.v1beta1.cronJob + {
v1beta1:: k8s.batch.v1beta1 {
cronJob:: k8s.batch.v1beta1.cronJob {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
},
},
core:: k8s.core + {
v1:: k8s.core.v1 + {
core:: k8s.core {
v1:: k8s.core.v1 {
list:: {
new(items):: {
apiVersion: 'v1',
Expand All @@ -90,34 +90,34 @@ k8s + {
} + self.items(items),
items(items):: if std.type(items) == 'array' then { items+: items } else { items+: [items] },
},
pod:: k8s.core.v1.pod + {
pod:: k8s.core.v1.pod {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
podTemplate:: k8s.core.v1.podTemplate + {
podTemplate:: k8s.core.v1.podTemplate {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
replicationController:: k8s.core.v1.replicationController + {
replicationController:: k8s.core.v1.replicationController {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
},
},
extensions:: k8s.extensions + {
v1beta1:: k8s.extensions.v1beta1 + {
daemonSet:: k8s.extensions.v1beta1.daemonSet + {
extensions:: k8s.extensions {
v1beta1:: k8s.extensions.v1beta1 {
daemonSet:: k8s.extensions.v1beta1.daemonSet {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
deployment:: k8s.extensions.v1beta1.deployment + {
deployment:: k8s.extensions.v1beta1.deployment {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
replicaSet:: k8s.extensions.v1beta1.replicaSet + {
replicaSet:: k8s.extensions.v1beta1.replicaSet {
mapContainers(f):: fn.mapContainers(f),
mapContainersWithName(names, f):: fn.mapContainersWithName(names, f),
},
},
},
}
}
16 changes: 8 additions & 8 deletions ksonnet-lib/k8s.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -14363,8 +14363,8 @@
// JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/).
jsonSchemaProps:: {
new():: {},
withDollarRef(dollarRef):: self + { "$ref": dollarRef },
withDollarSchema(dollarSchema):: self + { "$schema": dollarSchema },
withDollarRef(dollarRef):: self + { '$ref': dollarRef },
withDollarSchema(dollarSchema):: self + { '$schema': dollarSchema },
withAllOf(allOf):: self + if std.type(allOf) == 'array' then { allOf: allOf } else { allOf: [allOf] },
withAllOfMixin(allOf):: self + if std.type(allOf) == 'array' then { allOf+: allOf } else { allOf+: [allOf] },
allOfType:: hidden.apiextensions.v1beta1.jsonSchemaProps,
Expand Down Expand Up @@ -18597,7 +18597,7 @@
// Authenticated indicates that the token was associated with a known user.
withAuthenticated(authenticated):: self + { authenticated: authenticated },
// Error indicates that the token couldn't be checked
withErrorParam(errorParam):: self + { "error": errorParam },
withErrorParam(errorParam):: self + { 'error': errorParam },
mixin:: {
// User is the UserInfo associated with the provided token.
user:: {
Expand Down Expand Up @@ -18660,7 +18660,7 @@
// Authenticated indicates that the token was associated with a known user.
withAuthenticated(authenticated):: self + { authenticated: authenticated },
// Error indicates that the token couldn't be checked
withErrorParam(errorParam):: self + { "error": errorParam },
withErrorParam(errorParam):: self + { 'error': errorParam },
mixin:: {
// User is the UserInfo associated with the provided token.
user:: {
Expand Down Expand Up @@ -22225,7 +22225,7 @@
componentCondition:: {
new():: {},
// Condition error code for a component. For example, a health check error code.
withErrorParam(errorParam):: self + { "error": errorParam },
withErrorParam(errorParam):: self + { 'error': errorParam },
// Message about the condition for a component. For example, information about a health check.
withMessage(message):: self + { message: message },
// Status of the condition for a component. Valid values for "Healthy": "True", "False", or "Unknown".
Expand Down Expand Up @@ -23940,7 +23940,7 @@
nodeConfigStatus:: {
new():: {},
// Error describes any problems reconciling the Spec.ConfigSource to the Active config. Errors may occur, for example, attempting to checkpoint Spec.ConfigSource to the local Assigned record, attempting to checkpoint the payload associated with Spec.ConfigSource, attempting to load or validate the Assigned config, etc. Errors may occur at different points while syncing config. Earlier errors (e.g. download or checkpointing errors) will not result in a rollback to LastKnownGood, and may resolve across Kubelet retries. Later errors (e.g. loading or validating a checkpointed config) will result in a rollback to LastKnownGood. In the latter case, it is usually possible to resolve the error by fixing the config assigned in Spec.ConfigSource. You can find additional information for debugging by searching the error message in the Kubelet log. Error is a human-readable description of the error state; machines can check whether or not Error is empty, but should not rely on the stability of the Error text across Kubelet versions.
withErrorParam(errorParam):: self + { "error": errorParam },
withErrorParam(errorParam):: self + { 'error': errorParam },
mixin:: {
// Active reports the checkpointed config the node is actively using. Active will represent either the current version of the Assigned config, or the current LastKnownGood config, depending on whether attempting to use the Assigned config results in an error.
active:: {
Expand Down Expand Up @@ -24200,7 +24200,7 @@
},
assignedType:: hidden.core.v1.nodeConfigSource,
// Error describes any problems reconciling the Spec.ConfigSource to the Active config. Errors may occur, for example, attempting to checkpoint Spec.ConfigSource to the local Assigned record, attempting to checkpoint the payload associated with Spec.ConfigSource, attempting to load or validate the Assigned config, etc. Errors may occur at different points while syncing config. Earlier errors (e.g. download or checkpointing errors) will not result in a rollback to LastKnownGood, and may resolve across Kubelet retries. Later errors (e.g. loading or validating a checkpointed config) will result in a rollback to LastKnownGood. In the latter case, it is usually possible to resolve the error by fixing the config assigned in Spec.ConfigSource. You can find additional information for debugging by searching the error message in the Kubelet log. Error is a human-readable description of the error state; machines can check whether or not Error is empty, but should not rely on the stability of the Error text across Kubelet versions.
withErrorParam(errorParam):: self + __configMixin({ "error": errorParam }),
withErrorParam(errorParam):: self + __configMixin({ 'error': errorParam }),
// LastKnownGood reports the checkpointed config the node will fall back to when it encounters an error attempting to use the Assigned config. The Assigned config becomes the LastKnownGood config when the node determines that the Assigned config is stable and correct. This is currently implemented as a 10-minute soak period starting when the local record of Assigned config is updated. If the Assigned config is Active at the end of this period, it becomes the LastKnownGood. Note that if Spec.ConfigSource is reset to nil (use local defaults), the LastKnownGood is also immediately reset to nil, because the local default config is always assumed good. You should not make assumptions about the node's method of determining config stability and correctness, as this may change or become configurable in the future.
lastKnownGood:: {
local __lastKnownGoodMixin(lastKnownGood) = __configMixin({ lastKnownGood+: lastKnownGood }),
Expand Down Expand Up @@ -30581,4 +30581,4 @@
},
},
},
}
}