{"modulePath":"github.com/2lambda123/openshift-origin","version":"v4.1.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package deploymentconfig\n\n## Types\n\n```go\ntype DeploymentConfigController struct {\n\t// contains filtered or unexported fields\n}\n```\nDeploymentConfigController is responsible for creating a new deployment when:\n\n 1. The config version is \u003e 0 and,\n 2. No deployment for the version exists.\n\nThe controller reconciles deployments with the replica count specified on the config. The active deployment (that is, the latest successful deployment) will always be scaled to the config replica count. All other deployments will be scaled to zero.\n\nIf a new version is observed for which no deployment exists, any running deployments will be cancelled. The controller will not attempt to scale running deployments.\n\n```go\nfunc NewDeploymentConfigController(\n\tdcInformer appsv1informer.DeploymentConfigInformer,\n\trcInformer kcoreinformers.ReplicationControllerInformer,\n\tappsClientset appsv1client.Interface,\n\tkubeClientset kclientset.Interface,\n) *DeploymentConfigController\n```\nNewDeploymentConfigController creates a new DeploymentConfigController.\n\n```go\nfunc (c *DeploymentConfigController) Handle(config *appsv1.DeploymentConfig) error\n```\nHandle implements the loop that processes deployment configs. Since this controller started using caches, the provided config MUST be deep-copied beforehand (see work() in factory.go).\n\n```go\nfunc (c *DeploymentConfigController) Run(workers int, stopCh \u003c-chan struct{})\n```\nRun begins watching and syncing.\n\n```go\ntype RCControlInterface interface {\n\tPatchReplicationController(namespace, name string, data []byte) error\n}\n```\nRSControlInterface is an interface that knows how to add or delete ReplicationControllers, as well as increment or decrement them. It is used by the DeploymentConfig controller to ease testing of actions that it takes.\n\n```go\ntype RCControllerRefManager struct {\n\tkcontroller.BaseControllerRefManager\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewRCControllerRefManager(\n\trcControl RCControlInterface,\n\tcontroller kmetav1.Object,\n\tselector klabels.Selector,\n\tcontrollerKind kschema.GroupVersionKind,\n\tcanAdopt func() error,\n) *RCControllerRefManager\n```\nNewRCControllerRefManager returns a RCControllerRefManager that exposes methods to manage the controllerRef of ReplicationControllers.\n\nThe CanAdopt() function can be used to perform a potentially expensive check (such as a live GET from the API server) prior to the first adoption. It will only be called (at most once) if an adoption is actually attempted. If CanAdopt() returns a non-nil error, all adoptions will fail.\n\nNOTE: Once CanAdopt() is called, it will not be called again by the same\n\n\tRCControllerRefManager instance. Create a new instance if it\n\tmakes sense to check CanAdopt() again (e.g. in a different sync pass).\n\n```go\nfunc (m *RCControllerRefManager) AdoptReplicationController(rs *v1.ReplicationController) error\n```\nAdoptReplicationController sends a patch to take control of the ReplicationController. It returns the error if the patching fails.\n\n```go\nfunc (m *RCControllerRefManager) ClaimReplicationController(rc *v1.ReplicationController) (bool, error)\n```\nClaimReplicationController tries to take ownership of a ReplicationController.\n\nIt will reconcile the following:\n\n  - Adopt the ReplicationController if it's an orphan.\n  - Release owned ReplicationController if the selector no longer matches.\n\nA non-nil error is returned if some form of reconciliation was attempted and failed. Usually, controllers should try again later in case reconciliation is still needed.\n\nIf the error is nil, either the reconciliation succeeded, or no reconciliation was necessary. The returned boolean indicates whether you now own the object.\n\n```go\nfunc (m *RCControllerRefManager) ClaimReplicationControllers(rcs []*v1.ReplicationController) ([]*v1.ReplicationController, error)\n```\nClaimReplicationControllers tries to take ownership of a list of ReplicationControllers.\n\nIt will reconcile the following:\n\n  - Adopt orphans if the selector matches.\n  - Release owned objects if the selector no longer matches.\n\nA non-nil error is returned if some form of reconciliation was attempted and failed. Usually, controllers should try again later in case reconciliation is still needed.\n\nIf the error is nil, either the reconciliation succeeded, or no reconciliation was necessary. The list of ReplicationControllers that you now own is returned.\n\n```go\nfunc (m *RCControllerRefManager) ReleaseReplicationController(rc *v1.ReplicationController) error\n```\nReleaseReplicationController sends a patch to free the ReplicationController from the control of the Deployment controller. It returns the error if the patching fails. 404 and 422 errors are ignored.\n\n```go\ntype RealRCControl struct {\n\tKubeClient kclientset.Interface\n\tRecorder   record.EventRecorder\n}\n```\nRealRCControl is the default implementation of RCControlInterface.\n\n```go\nfunc (r RealRCControl) PatchReplicationController(namespace, name string, data []byte) error\n```\nPatchReplicationController executes a strategic merge patch contained in 'data' on RC specified by 'namespace' and 'name'\n\n","path":"github.com/2lambda123/openshift-origin/pkg/apps/controller/deploymentconfig","name":"deploymentconfig","synopsis":"","isRedistributable":true}
