text:
title: UCP release notes
description: Release notes for Docker Universal Control Plane. Learn more about the
  changes introduced in the latest versions.
keywords: UCP, release notes
toc_min: 1
toc_max: 2
redirect_from:
  - /datacenter/ucp/2.2/guides/release-notes/
  - /datacenter/ucp/3.0/guides/release-notes/
---

Here you can learn about new features, bug fixes, breaking changes, and
known issues for the latest UCP version.
You can then use [the upgrade instructions](admin/install/upgrade.md) to
upgrade your installation to the latest release.

* [Version 3.0](#version-30)
* [Version 2.2](#version-22)

# Version 3.0

## 3.0.5 (2018-08-30)

**Bug fixes**

* Security
  * Fixed a critical security issue to prevent UCP from accepting certificates from
    the system pool when adding client CAs to the server that requires mutual authentication.

**Known Issue**

* When you are upgrading from UCP 3.0.3 or 3.0.4, you must manually pull
 `docker/ucp-agent:3.0.5` in the images section of the web UI before upgrading.
 Alternately, you can just `docker pull docker/ucp-agent:3.0.5` on every manager node.
 This issue is fixed in 3.0.5.  Any upgrade from 3.0.5 or above should work without
 manually pulling the images.

## 3.0.4 (2018-08-09)

**Bug fixes**

* Security
  * Fixed a critical security issue where the LDAP bind username and password
    were stored in clear text on UCP hosts. Please refer to [this KB article](https://success.docker.com/article/upgrading-to-ucp-2-2-12-ucp-3-0-4/) for proper implementation of this fix.

**Known Issue**

* You must manually pull `docker/ucp-agent:3.0.4` in the images section of the web UI before upgrading. Alternately, you can just pull `docker/ucp-agent:3.0.4` on every manager node.

## 3.0.3 (2018-07-26)

**New platforms**
* UCP now supports running Windows Server 1803 workers
   * Server 1803 ingress routing, VIP service discovery, and named pipe mounting are not supported in this release.
   * Offline bundles `ucp_images_win_1803_3.0.3.tar.gz` have been added.
* UCP 3.0.3 now supports IBM Z (s390x) as worker nodes on 3.0.x for SLES 12 SP 3. Interlock is currently not supported for 3.0.x on Z.

**Bug Fixes**
* Core
   * Optimize swarm service read api calls through UCP
   * Fixes an issue where some UCP Controller API calls may hang indefinitely.
   * Default Calico MTU set to 1480
   * Calico is upgraded to 3.0.8
   * Compose for Kubernetes logging improvements
   * Fixes an issue where backups would fail if UCP was not licensed.
   * Fixes an issue where DTR admins are missing the Full Control Grant against /Shared Collection even though they have logged in at least once to the UI.
   * Add support for bind mount volumes to kubernetes stacks and fixes sporadic errors in kubernetes stack validator that would incorrectly reject stacks.

## 3.0.2 (2018-06-21)

**New Features**
* UCP now supports running Windows Server 1709 workers
   * Server 1709 provides smaller Windows base image sizes, as detailed [here](https://docs.microsoft.com/en-us/windows-server/get-started/whats-new-in-windows-server-1709)
   * Server 1709 provides relaxed image compatibility requirements, as detailed [here](https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility)
   * Server 1709 ingress routing, VIP service discovery, and named pipe mounting are not supported in this release.
   * Offline bundle names are changed from `ucp_images_win_3.0.1.tar.gz` to `ucp_images_win_2016_3.0.2.tar.gz` and `ucp_images_win_1709_3.0.2.tar.gz` based on Windows Server versions.
* UCP now supports running RHEL 7.5.  Please refer to the [compatibility matrix](https://success.docker.com/article/compatibility-matrix).
* Added support for dynamic volume provisioning in Kubernetes for AWS EBS and
Azure Disk when installing UCP with the `--cloud-provider` option.

**Bug Fixes**
* Core
   * Fixed an issue for anonymous volumes in Compose for Kubernetes.
   * Fixed an issue where a fresh install would have an initial per-user session
   limit of unlimited rather than the expected limit of 10 minutes.
   * Added separate resource types for Kubernetes subresources (e.g. pod/log)
   so that users can get separate permissions for those resources, as with the
   built-in Kubernetes RBAC authorizer. If you had a custom role with
   (for instance) Pod Get permissions, you may need to create a new custom
   role with permissions for each new subresource.
   * To deploy Pods with Privileged options, users now require a grant with the
   role `Full Control` for all namespaces.
   * The `/api/ucp/config` endpoint now includes default node orchestrator.
   * Added `cni_mtu` and `cni_ipinip_mtu` settings to UCP config for controlling
   MTU sizes in Calico.
   * When a route is not found, interlock now returns a 503 (the expected
     behavior) instead of a 404.

* UI/UX
   * Fixed an issue that causes LDAP configuration UI to not work properly.

## 3.0.1 (2018-05-17)

**Bug Fixes**
* Core
  * Bumped Kubernetes version to 1.8.11.
  * Compose for Kubernetes now respects the specified port services are exposed on.
  This port must be in the `NodePort` range.
  * Kubernetes API server port is now configurable via `--kube-apiserver-port`
  flag at install or `cluster_config.kube_apiserver_port` in UCP config.
  * Fixed an issue where upgrade fails due to missing `ucp-kv` snapshots.
  * Fixed an issue where upgrade fails due to layer 7 routing issues.
  * `ucp-interlock-proxy` no longer tries to schedule components on Windows nodes.
  * Fixed an issue where a Kubernetes networking failure would not stop UCP from
  installing successfully.
  * Fixed an issue where encrypted overlay networks could not communicate on
  firewalled hosts.
  * Fixed an issue where Pod CIDR and Node IP values could conflict at install
  Installation no longer fails if an empty `PodCIDR` value is set in the UCP
  config at install time. Instead, it falls back to default CIDR.

*  UI/UX
  * Fixed an issue where UCP banners redirected to older UCP 2.2 documentation.

**Known issues**

* Encrypted overlay networks may not work after upgrade from 3.0.0.  Apply the following to
  all the nodes after the upgrade.
    ```
    iptables -t nat -D KUBE-MARK-DROP -j MARK --set-xmark 0x8000/0x8000
    iptables -t filter -D KUBE-FIREWALL -m comment --comment "kubernetes firewall for dropping marked packets" -m mark --mark 0x8000/0x8000 -j DROP
    ```
 * `ucp-kube-controller-manager` emits a large number of container logs.
 * Excessive delay is seen when sending `docker service ls` via UCP client
   bundle on a cluster that is running thousands of services.
 *  Inter-node networking may break on Kubernetes pods while the `calico-node`
  pods are being upgraded on each node. This may cause up to a few minutes of
  networking disruption for pods on each node during the upgrade process,
  depending on how quickly `calico-node` gets upgraded on those nodes.
  * `ucp-interlock-proxy` may fail to start when two or more services are
 configured with two or more backend hosts.  [You can use this workaround](https://success.docker.com/article/how-do-i-ensure-the-ucp-routing-mesh-ucp-interlock-proxy-continues-running-in-the-event-of-a-failed-update).

## Version 3.0.0 (2018-04-17)

The UCP system requirements were updated with 3.0.0. Make sure to
[check the system](https://docs.docker.com/ee/ucp/admin/install/system-requirements/)
requirements before upgrading.

### Orchestration

* UCP now supports Kubernetes as an orchestrator, in addition to the existing
Swarmkit and "classic" Swarm orchestrators. Kubernetes system components are
automatically deployed on all manager and Linux worker nodes managed by UCP.
[Learn more about Kubernetes support](https://docs.docker.com/ee/ucp/ucp-architecture/).
* Worker nodes running Linux on amd64 architectures can be configured to run
only Swarm workloads, only Kubernetes workloads, or mixed workloads. Manager
nodes are by default Mixed in order to support Swarm and Kubernetes system
components. However, it is not recommended to run Worker nodes as Mixed due to
potential resource contention issues.
* Users can deploy Kubernetes workloads through the web UI, and the CLI using
a UCP client bundle and `kubectl`.
[Learn more](https://docs.docker.com/ee/ucp/kubernetes/).
* Users can now use Compose to deploy Kubernetes workloads from the web UI.
[Lean more](https://docs.docker.com/ee/ucp/kubernetes/deploy-with-compose/).

### Networking

* UCP includes Calico as the default CNI plugin for networking of Kubernetes
applications. [Learn more](https://docs.projectcalico.org/v3.1/introduction/).
The following Calico features are supported:
   * L3 IP-IP Overlay Data Path.
   * BGP control plane.
   * Calico IPAM.
   * Management of Calico CNI plugin lifecycle.
   * Kubernetes Network Policy. This is experimental in 3.0.0.
* You can now use layer 7 routing in your Kubernetes workloads by using an
NGINX-based ingress controller.
[Learn more](https://docs.docker.com/ee/ucp/kubernetes/deploy-ingress-controller/).
* Layer 7 routing for Swarmkit applications has been upgraded to use
Interlock backend.
This adds increased performance, stability, and new features including SSL Termination,
Contextual Path-based Routing, Websocket Support, and Canary Application Instance
deployments. Existing Hostname Routing Mesh (HRM) labels (and newly added labels
with the old format) will automatically migrate to the new format. It is strongly
recommended to use the new format for new applications in order to take advantage
of the new features. [Learn more](https://docs.docker.com/ee/ucp/interlock/).

### Storage

* Support for NFS-based Kubernetes persistent volumes. Additional volume plugins
will be available in future releases.

### Security

* Role-based access control now supports Kubernetes resources.
[Lean more](https://docs.docker.com/ee/ucp/authorization/migrate-kubernetes-roles/).
  * In addition to users, teams, organizations, and grants you can now use
  Kubernetes Service Accounts as a subject type.
  [Learn more](https://docs.docker.com/ee/ucp/kubernetes/create-service-account/).
  * You can now create custom roles with Kubernetes API permissions. Default
  roles include Kubernetes API permissions based on their access type.
  As an example, View-Only contains Swarm and Kubernetes read-only API permissions.
  * In addition to collections, grants can now use Kubernetes Namespaces as
  a resource set type.
  * Admins can now link a Kubernetes namespace to a collection of nodes in order
  to isolate users and workloads between different nodes.
* Administrators can now enforce only running trusted images for both swarm and
  Kubernetes applications. [Learn more](https://docs.docker.com/ee/ucp/admin/configure/run-only-the-images-you-trust/)
* API support for registering multiple UCP clusters to a single DTR for the
  purposes of signed image enforcement. [Learn more](https://docs.docker.com/ee/ucp/admin/configure/integrate-with-multiple-registries/).
* The `Restricted Control` role includes the `User Impersonation` Kubernetes action,
  which can allow a user to escalate to admin privileges if the role is granted against
  `All Kubernetes Namespaces`. For this version, we recommend that administrators do not
  grant the `Restricted Control` role against Kubernetes namespaces, and use custom roles
  instead. This issue does not affect any other roles in the system, or any of the grants
  using `Restricted Control` against collections.
* For increased security UCP now requires clients to use TLS version 1.2.

### Known issues

* Platform support
  * Kubernetes is not yet supported for Windows based workloads. Use Swarmkit for
  Windows based workloads instead.
  * EE 2.0 is not yet supported in IBM Z platforms.
* Upgrade
  * After upgrading to 3.0, UCP uses the `191.168.0.0/16` CIDR to allocate IPs
  for Kubernetes Pods. This option is customizable when doing a fresh installation,
  but not during an upgrade. As a workaround to configure this option, before
  upgrading, [update the UCP configuration](admin/configure/ucp-configuration-file.md)
  to include `pod_cidr = "<ip>/<mask>"` under the `[cluster_config]` option.
* CLI
  * Both Docker and `kubectl` CLIs report that UCP is running Kubernetes 1.8.2,
  when in fact it is running 1.8.9.
* Networking
  * Swarm encrypted overlay networks might not work as expected because default
  Kubernetes firewall rules are interfering with them. [Learn more](https://success.docker.com/article/KB000717).
  * Calico networking for Kubernetes is not supported for Microsoft Azure. UCP
  leverages Azure networking and IPAM for control-plane and connectivity.
  [Learn how to deploy EE 2.0 on Azure](https://docs.docker.com/ee/ucp/admin/install/install-on-azure/).
  * Azure IPAM will fail if nodes in the cluster are connected to different subnets.
  As a workaround ensure network setup avoids multiple subnets. This will be
  rectified in an upcoming patch release.
  * UCP Calico control-plane supports full-mesh BGP peering only at release-time.
  Calico control-plane may cause high CPU on nodes in clusters above 100 nodes.
  A route reflector based partial-mesh BGP control-plane will reduce CPU
  consumption when scaling past 100 nodes.
  Route-reflector configurations will be included in a future release.
  * In some deployments the `kube-dns` component won't be able to resolve external
  domain names. [Deploy a ConfigMap to work around this](https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/#configure-stub-domain-and-upstream-dns-servers).
  * If you upgrade from UCP 2.x to UCP 3.x on Azure, Kubernetes networking doesn't work.
  The cluster upgrade completes, and Swarm workloads work, but Kubernetes networking
  will be down.
* Management
  * If upgrading UCP through the UI, UCP will not check to ensure the manager node
  has the minimum memory required of 4 GB. Upgrading through the CLI does check for
  this requirement.
  * Putting a node in `drain` mode currently removes only Swarm workloads, and not
  Kubernetes workloads. This will be fixed in a future release.
  * Kubernetes base image layer uses Ubuntu 16.04 which contains some known CVE
  vulnerabilities. These will be removed when the base image layer is updated.
  * Running `docker system prune -a` directly on individual worker nodes in the cluster
  will potentially delete UCP system images. This behavior will not occur if the
  prune command is run using a UCP client bundle.
  * Compose for Kubernetes only supports v3 or higher YAML files. Any older
  version YAML files will silently fail without errors.
  * Linking Kubernetes namespace to a collection of nodes in order to isolate
  Kubernetes workloads between different nodes is not working as expected.
  [You can use this workaround](https://success.docker.com/article/workaround-for-link-nodes-in-collection-ucp-300).
  * Running `kubectl get cs` might show some internal UCP components as
  unhealthy when that's not the case.
* Storage
  * UCP does not yet support dynamic volume provisioning (NFS volumes do not
    support this). This will change in future releases when more volume types
    are available.

### Deprecation notice

The following functionality has been deprecated with UCP 3.0.0 and will be
unavailable in the next UCP feature release.

* The web UI is going to stop supporting users to deploy stacks with basic
containers. You should update your Compose files to version 3, and deploy your
stack as a Swarm service or Kubernetes workload.
* The option to integrate with a remote Syslog system is going to be removed
from the UCP web UI. You can configure Docker Engine for this.
* The option to configure a rescheduling policy for basic containers is
deprecated. Deploy your applications as Swarm services or Kubernetes workloads.

# Version 2.2

## Version 2.2.13 (2018-08-30)

**Bug fixes**

* Security
  * Fixed a critical security issue to prevent UCP from accepting certificates from
    the system pool when adding client CAs to the server that requires mutual authentication.

## Version 2.2.12 (2018-08-09)

**Bug fixes**

* Security
  * Fixed a critical security issue where the LDAP bind username and password
    were stored in clear text on UCP hosts. Please refer to the following KB article
    https://success.docker.com/article/upgrading-to-ucp-2-2-12-ucp-3-0-4/
    for proper implementation of this fix.

## Version 2.2.11 (2018-07-26)

**New platforms**
* UCP 2.2.11 is supported running on RHEL 7.5 and Ubuntu 18.04.

**Bug fixes**

* Security
  * Fixed an issue that causes some security headers to not be added to all API responses.

* Core
  * Optimized swarm service read API calls through UCP.
  * Upgraded `RethinkDB` image to address potential security vulnerabilities.
  * Fixee an issue where removing a worker node from the cluster would cause an etcd member to be removed on a manager node.
  * Upgraded `etcd` version to 2.3.8.
  * Fixed an issue that causes classic Swarm to provide outdated data.
  * Fixed an issue that raises `ucp-kv` collection error with un-named volumes.

* UI
  * Fixed an issue that causes UI to not parse volume options correctly.
  * Fixed an issue that prevents the user from deploying stacks via UI.

## Version 2.2.10 (2018-05-17)

**Bug fixes**

* Security
  * Security headers are added for PCI compliance to all API responses.

* UI
  * Users can now set log driver name and options on both create and update
   service screens.
  * Fixed an issue that causes legacy collections on services to break UI. Now
   legacy collections are properly prepended with "/Shared/Legacy/".
  * Fixed an issue that causes service counts in status summary to be shown
   incorrectly.

* Authentication/Authorization
  * Private collections are now only created for those users which have
   previously logged in.
  * The logic which reconciles collection labels is now skipped if the
   node already has an access label.
  * Fixed an issue where LDAP syncs would always search against the last server
   in the list of additional domains if the search base DN matched any of those
   domains.

* Core
  * UCP can now be displayed in an iframe for pages hosted on the same domain.
  * Fixed an issue that prevents non-admin users to do `docker build` on UCP.
  * Fixed an issue where a node's status may be reported incorrectly in node
   listings.
  * UCP can now be installed on a system with more than 127 logical CPU cores.
  * Improved the performance of UCP's local and global health checks.

**Known Issue**

* Excessive delay is seen when sending `docker service ls` via UCP client
 bundle on a cluster that is running thousands of services.

## Version 2.2.9 (2018-04-17)

**Bug fixes**

* Security
  * Fixed an issue that allows users to incorrectly interact with local volumes.
  * Fixed an issue where setting minimum TLS version that causes `ucp-agent` to
   keep restarting on worker nodes.

* Core
  * Fixed an issue that causes container fail to start with `container ID not found`
   during high concurrent API calls to create and start containers.

## Version 2.2.7 (2018-03-26)

**Bug fixes**

* Fixed an issue where the minimum TLS version setting is not correctly handled,
  leading to non-default values causing `ucp-controller` and `ucp-agent` to keep
  restarting.

## Version 2.2.6 (2018-03-19)

**New features**

* Security
  * Default TLS connections to TLS 1.2, and allow users to configure the minimum
  TLS version used by the UCP controller.
* Support and troubleshoot
  * The support dump now includes the output of `dmesg`.
  * Added more information to the telemetry data: kernel version, graph driver, and
  logging driver.
  * The `dsinfo` image used for support dumps is now smaller.

**Bug fixes**

* Core
  * The HRM service is no longer deployed with constraints that might prevent
  the service from ever getting scheduled.
  * Fixed a problem causing the HRM service to be restarted multiple times.
  * The `ucp-agent` service is now deployed without adding extra collection labels.
  This doesn't change the behavior of the service.
  * Fixed problem causing a healthy `ucp-auth-store` component to be reported as
  unhealthy.
  * Fixed a race condition causing the labels for the UCP controller container
  to be reset.
  * Fixed an issue causing the `ucp-agent` service to be deployed with the wrong
  architecture on Windows nodes.
* RBAC
  * Role-based access control can now be enforced for third-party volume plugins,
  fixing a known issue from UCP 2.2.5.
  * Admins can now clean up volumes and networks that had inconsistent collection
  labels across different nodes in the cluster. Previously, they would have had
  to go onto each node and clean up those resources directly.
  * When upgrading from UCP 2.1, inactive user accounts are no longer migrated
  to the new RBAC model.
  * Fixed an issue preventing users from seeing a collection when they have
  permissions to deploy services on a child collection.
  * Grants are now deleted when deleting an organization whose teams have grants.
* UI
  * Fixed a problem in the Settings page that would cause Docker to stop when
  you made changes to UCP settings and a new manager node is promoted to leader.
  * Fixed bug causing the Grants list page not to render after deleting an
  organization mentioned used on a grant.
  * Fixed a problem that would intermittently cause settings not to be persisted.
  * Fixed an issue that prevented users from being able to change LDAP settings.

**Known issues**

* RethinkDB can only run with up to 127 CPU cores.
* When integrating with LDAP and using multiple domain servers, if the
default server configuration is not chosen, then the last server configuration
is always used, regardless of which one is actually the best match.

## Version 2.2.5 (16 January 2018)

**Bug fixes**

* Role-based access control is now enforced for volumes managed by
third-party volume plugins. This is a critical security fix for customers that
use third-party volume drivers and rely on Docker Universal Control Plane for
tenant isolation of workloads and data.
**Caution** is advised when applying this update because users or automated
workflows may have come to rely on lack of access control enforcement when
manipulating volumes created with 3rd party volume plugins.

**Known issues**

* UCP role-based access control is not compatible with all third-party volume
plugins. If you're using certain third-party volume plugins (such as Netapp)
and are planning on upgrading UCP, you can skip 2.2.5 and wait for the upcoming
2.2.6 release, which will provide an alternative way to turn on RBAC enforcement
for volumes.

## Version 2.2.4 (2 November 2017)

**News**

* Docker Universal Control Plane now supports running managers on IBM Z on RHEL, SLES and Ubuntu. Previously, only workers were supported on IBM Z.

**Bug fixes**

* Core
  * `ucp-etcd` system images are now hidden. Previously, these system images were erroneously displayed in the images list.
  * `disable_usageinfo` will now disable usage metrics. A regression caused this setting to not be respected.
  * UCP now outputs "Initializing..." log messages during setup so that administrators can establish that setup or install has begun.
  * Windows worker promotion is now blocked. Previously, Windows workers could be promoted using the CLI, which would fail.
  * Loading gzipped images with the Docker CLI is now supported. This would previously cause a panic.
  * Permissions are now checked when filtering nodes by container. Previously, permissions were not considered.
  * An LDAP sync is now triggered as soon as an LDAP user is lazy-provisioned. Previously, lazy-provisioned users would not immediately be added to teams and orgs.

* UI/UX
  * License page now shows all capabilities. Previously it was not clear if a license supported Docker image scanning or not.
  * Additional translations added for internationalization.
  * UI for adding users to teams simplified.
  * The grant list can now sorted and pagination in the grants view has been improved. The grants view previously had glitches on systems with many grants.
  * Fixed problem where UI would hang when pulling images.
  * "Max failure ratio" and "Failure action" re-introduced in service definitions. These settings were not available in UCP 2.2, but were available in previous UCP versions.
  * Collection labels are no longer applied to UCP system services. UCP previously auto-applied labels, which was confusing.

**Known issues**

 * Docker currently has limitations related to overlay networking and services using VIP-based endpoints. These limitations apply to use of the HTTP Routing Mesh (HRM). HRM users should familiarize themselves with these limitations. In particular, HRM may encounter virtual IP exhaustion (as evidenced by `failed to allocate network IP for task` Docker log messages). If this happens, and if the HRM service is restarted or rescheduled for any reason, HRM may fail to resume operation automatically. See the Docker EE 17.06-ee5 release notes for details.
 * The Swarm admin UI for UCP versions 2.2.0 and later contain a bug. If used with Docker Engine version 17.06.2-ee5 or earlier, attempting to update "Task History Limit", "Heartbeat Period" and "Node Certificate Expiry" settings using the UI will cause the cluster to crash on next restart. Using UCP 2.2.X and Docker Engine 17.06-ee6 and later, updating these settings will fail (but not cause the cluster to crash). Users are encouraged to update to Docker Engine version 17.06.2-ee6 and later, and to use the Docker CLI (instead of the UCP UI) to update these settings. Rotating join tokens works with any combination of Docker Engine and UCP versions. Docker Engine versions 17.03 and earlier (which use UCP version 2.1 and earlier) are not affected by this problem.

## Version 2.2.3 (13 September 2017)

**Bug fixes**

* Core
  * Node list will no longer show duplicated worker node entries.
  * Volume mount options are no longer dropped when creating volumes.
  * `docker stack deploy` with secrets specified in docker-compose file now works.
* UI/UX
  * Upgrade button is now greyed out and deacticated after initiating upgrade.
  * If an error is encountered while creating a service, the UI no longer freezes.
  * Upgrade notification fixed to have working link.
  * "Default Role For All Private Collections" can now be updated. Updating this
  role in the UI previously had no effect.
  * Added notification to UI to show that an upgrade is in progress.
  * Client bundle can now be downloaded with Safari browser.
  * Windows nodes are no longer displayed in the DTR install UI.
  * DTR settings state in UCP is now preserved when switching tabs. Previously,
  un-saved state was lost when switching tabs.
  * Fixed problem where first manager node may have IP address `0.0.0.0`,
  causing dashboard to not update.
  * UI for adding Windows nodes improved to include full join instructions.
  * Node Task UI fixed. Displaying tasks for a node previously did not work.
  * LDAP settings UI improved. Sync interval setting is now validated, a
  never-ending update spinner been fixed and it's UI action sequencing bugs have
  been fixed so that it's now possible to disable LDAP.
  * Uploading Docker images in the UI now has better error messages and improved
  validation.
  * Containers removed in UI are now force-removed. Previously removing
  containers would fail.
  * DTR install instructions `--ucp-url` parameter fixed to have valid value.
  * Deleting multiple users in succession fixed. Previously, an error would
  result when deleting more than one user at a time.
  * Added validation when adding DTR URL in UCP admin settings.
  * Left-nav now shows resource counts, addressing an UI regression from UCP 2.1.

**Known issues**

 * Upgrading heterogeneous swarms from CLI may fail because x86 images are used
 instead of the correct image for the worker architecture.
 * Agent container log is empty even though it's running correctly.
 * Rapid UI settings updates may cause unintended settings changes for logging
 settings and other admin settings.
 * Attempting to load an (unsupported) `tar.gz` image results in a poor error
 message.
 * Searching for images in the UCP images UI doesn't work.
 * Removing a stack may leave orphaned volumes.
 * Storage metrics are not available for Windows.
 * You can't create a bridge network from the web UI. As a workaround use
 `<node-name>/<network-name>`.

## version 2.2.2 (30 August 2017)

**Bug fixes**

* Core
  * Fixed an issue that caused timeouts during install, preventing UCP 2.2.1 from
  being released.
  * Fixed a number of issues in which access control labels and roles could not
  be upgraded to their new format, when upgrading UCP.
  [Learn more](https://success.docker.com/KBase/Auth_system_migration_errors).
  * Fixed an issue that caused an upgrade with multiple manager nodes to fail
  with RethinkDB startup errors.
  * Fixed an issue that caused upgrades to fail due to UCP being unable to
  remove and replace older UCP containers.
  * Fixed an issue in which upgrade timed out due to lack of available disk space.
  * Fixed an issue in which rescheduling of containers not belonging in services
  could fail due to a request for a duplicate IP address.
  * DTR containers are no longer omitted from `docker ps` commands.
* UI/UX
  * Fixed known issue from 2.2.0 where config changes (including LDAP/AD) take
  an extended period to update after making changes in the UI settings.
  * Fixed an issue where the `/apidocs` url redirected to the login page.
  * Fixed an issue in which the UI does not redirect to a bad URL immediately
  after an upgrade.
  * Config and API docs now show the correct LDAP sync cron schedule format.
* docker/ucp image
  * Support dump now contains information about access control migrations.
  * The `ucp-auth-store` and `ucp-auth-api` containers now report health checks.

**Known issues**

* When deploying compose files that use secrets, the secret definition must
include `external: true`, otherwise the deployment fails with the error
`unable to inspect secret`.

## Version 2.2.0 (16 August 2017)

**New features**

* The role-based access control system has been overhauled for additional
granularity and customization. Admins now define access control through Grants,
a 1:1:1 mapping of a Subject, a Role, and a Collection:
  * Subject: A user, team, or organization.
  * Role: A set of permissions. In addition to the existing predefined roles,
  admins can now create custom roles with their choice of permissions taken
  from the full Docker API.
  * Collection: A group of containers or container-based resources (e.g. volumes,
  networks, secrets, etc.). Collections have a hierarchical directory-like structure
  and replace the old access control labels from the previous system (though they
  still use labels in the CLI).
  * [Read the documentation](access-control/index.md#transition-from-ucp-21-access-control)
   for more information and examples of the new system and how your old access
   control settings are migrated during an upgrade.
* UCP now provides access control for nodes, where an admin can enforce
physical isolation between users on different nodes in the cluster. This means two
different teams can only view and deploy on the nodes to which they have access.
This is only available with an EE Advanced license.
* Enhancements to the user management system:
  * UCP now supports the user concept of organizations, which are groups of teams.
  * Users can now specify a default collection which automatically applies
  access control labels to all CLI deploy commands when no label is specified by
  the user.
* Support for UCP workers running Windows Server 2016, and the ability to deploy
Windows-based containerized applications on the cluster.
  * [Read the documentation](admin/configure/join-windows-worker-nodes/index.md)
  for instructions on how to join Windows nodes, and current limitations when
  deploying Windows applications.
* Support for UCP workers running on IBM Z systems with RHEL 7.3, Ubuntu 16.04,
and SLES 12.
* UCP now provides a public, stable API for cluster configuration and access control,
and the API is fully interactive within the UCP UI.
* Support for using services with macvlan networks and configuring network scope in UI.
* The UCP UI has been redesigned for ease-of-use and data management:
  * Redesigned dashboard with time-series historical graphs for usage metrics.
  * Compact layout to more easily view resource information at a glance.
  * Detail panels for resources no longer slide out and cover the main panel.
  * Filtering mechanism to display related items (e.g. resources in a collection or stack).

**Known issues**

* UI issues:
  * Cannot currently remove nodes using UCP UI. Workaround is to remove from CLI
  instead.
  * Search does not function correctly for images.
  * Cannot view label constraints from a collection's details pages. Workaround
  is to view by editing the collection.
  * Certain config changes to UCP make take several minutes to update after making
  changes in the UI. In particular this affects LDAP/AD configuration changes.
  * Turning `LDAP Enabled` from "Yes" to "No" disables the save button. Workaround
  is to do a page refresh which completes the configuration change.
  * Removing stacks from the UI may cause certain resources to not be deleted,
  including networks or volumes. Workaround is to delete the resources directly.
  * When you create a network and check 'Enable hostname based routing', the web
  UI doesn't apply the HRM labels to the network. As a workaround,
  [create the network using the CLI](https://docs.docker.com/datacenter/ucp/2.2/guides/user/services/use-domain-names-to-access-services/#service-labels).
  * The web UI does not currently persist changes to session timeout settings.
  As a workaround you can update the settings from the CLI, by [adapting these instructions for the
  session timeout](https://docs.docker.com/datacenter/ucp/2.2/guides/admin/configure/external-auth/enable-ldap-config-file/).
* docker/ucp
  * The `support` command does not currently produce a valid support dump. As a
  workaround you can download a support dumps from the web UI.
* Windows issues
  * Disk related metrics do not display for Windows worker nodes.
  * If upgrading from an existing deployment, ensure that HRM is using a non-encrypted
  network prior to attaching Windows services.

## Release notes for earlier versions

- [UCP 2.1 release notes](/datacenter/ucp/2.1/guides/release-notes/index.md)
- [UCP 2.0 release notes](/datacenter/ucp/2.0/guides/release-notes.md)
- [UCP 1.1 release notes](/datacenter/ucp/1.1/release_notes.md)


text:
.. _nupatipentry:

nupatipentry
===========================================

.. class:: nupatipentry.NUPATIPEntry(bambou.nurest_object.NUMetaRESTObject,):

PATIPEntry is auto-generated (southbound case, decentralized for containers) or through REST (for centralized case, user can choose a IP).

Attributes
----------

- ``pat_centralized``: This flag will determine whether we can expect anchor point or not.

- ``ip_address``: Its own IPAddress.

- ``ip_type``: IPv4 or IPv6 (only IPv4 supported in R1.0)

- ``last_updated_by``: ID of the user who last updated the object.

- ``last_updated_date``: Time stamp when this object was last updated.

- ``entity_scope``: Specify if scope of entity is Data center or Enterprise level

- ``creation_date``: Time stamp when this object was created.

- ``associated_domain_id``: The ID of the associated l3-domain.

- ``owner``: Identifies the user that has created this object.

- ``external_id``: External object ID. Used for integration with third party systems

- ``hypervisor_id``: The ID of the PatMapper entity to which this domain is associated to.

Parents
--------

- :ref:`nusharednetworkresource.NUSharedNetworkResource<nusharednetworkresource>`

- :ref:`nusubnet.NUSubnet<nusubnet>`

redpajama_set_name: RedPajamaGithub


text:
function [ac_trans] = synthesizeFixedTrajectories(sys, filePath, configAndProblemDomainName, stateTraject, inputTraject, options)
%
% synthesizeFixedTrajectories:
% Given an automaton, collection of regions and trajectories, this function
% synthesizes atomic controllers collecting time-varying LQR controllers
% and funnels for each controller.
%
% Inputs:
%   - sys: The DrakeSystem model containing the equations of motion of the
%   system.
%   - filePath: A string naming the file path where all the files
%   pertaining to the problem domain and configuration exist.  e.g.
%   '/path/to/reasyns/examples/box_pushing/'.
%   - configAndProblemDomainName: A string with the uniform name given to
%   all the files in the 'filePath' directory.  The required files are:
%      <configAndProblemDomainName>.m
%      <configAndProblemDomainName>.aut
%      <configAndProblemDomainName>.regions
%      <configAndProblemDomainName>.spec
%      configs/<configAndProblemDomainName>.config
%   - stateTraject: An p-by-q structure of Trajects containing a trajectory
%   of system state variables for predecessor mode p to the successor mode
%   q in terms of the state designations in the automaton structure `aut`.
%   - stateTraject: An p-by-q structure of Trajects containing a trajectory
%   of system inputs for predecessor mode p to the successor mode q in
%   terms of the state designations in the automaton structure `aut`.
%   - options: An options structure containing the options required to
%   build the atomic controllers and funnels.  See
%   "plane_with_trajectory.m" for details of this structure's contents.
%
% Output:
%   - ac_trans: A p-by-q structure of QuadraticACs containing the
%   trajectories, controllers and funnels for each controller.
%

warning off
format compact
close all

fileName = [filePath,'/',configAndProblemDomainName];
if ~isdir([filePath,'/reasyns_log']), mkdir([filePath,'/reasyns_log']); end
if ~isdir([filePath,'/reasyns_controllers']), mkdir([filePath,'/reasyns_controllers']); end

% Load the ordered set of regions.
[reg, regDefl, ~] = processRegFile(filePath, configAndProblemDomainName, options);
%processRegFile(filePath, configAndProblemDomainName, options, 1/40)
% without the calibration matrix -- instead provide a scalar defining the relationship between pixels to lab units

% Load the automaton.
aut = processAutFileFastSlow([filePath, '/', configAndProblemDomainName, '.aut'],reg);
trans = vertcat(aut.trans{:});

Ntrans = length(aut.trans);
Nmodes = max([aut.state{:}]);

aut.f = cell(1,Ntrans);  % enforce certain dynamics depending on the current transition (region activation)
[aut.f{:}] = deal(1);

options.maxFunnelsTrans(1:Nmodes) = 1;

% Set the clock (used for file naming).
clk = fix(clock);

% Prepare a log file.
if options.doLog
    fid = fopen([filePath,'/reasyns_log/reasyns_log_', date, '_', num2str(clk(4)), num2str(clk(5)), num2str(clk(6)), '.txt'], 'w');
end

% Make copies of files that we may be modifying later on.
resetAllInputFiles

% Choose SDP solver.
if checkDependency('mosek')
    options.solver = @spot_mosek;
    options.solver_name = 'mosek';
elseif checkDependency('sedumi')
    options.solver = @spot_sedumi;
    options.solver_name = 'sedumi';
else
    error('synthesizeFixedTrajectories: Please install either MOSEK or SeDuMi and try again.');
end

figure(1)
clf
plot(reg)
axis equal
hold on

figure(3)
clf
plot(reg)
hold on
plot(regDefl)
axis equal
% axis([min(regBnd{1}.v(:,1)) max(regBnd{1}.v(:,1)) min(regBnd{1}.v(:,2)) max(regBnd{1}.v(:,2))])

%%  Main

tic

%%
% NmodesReach = Nmodes;  % Commented out for now since we are only this
                         % function with a single trajectory.
NmodesReach = 4;

tic
toc
if options.doLog, fprintf(fid, '%f : Starting ....\n', toc); end
j = 0;
for statePre = 1:NmodesReach
    ac_inward{statePre} = [];  % N.B. ac_inward remains empty in this synthesis function.
    for itrans = find(trans(:,1) == statePre)'
        j = j+1;
        ac_trans{j} = [];
    end
end

%%
joinedStates = false*ones(Nmodes,1);  % keep a list of modes which need joining
patchedStates = false*ones(Nmodes,1);  % keep a list of modes which need joining

%%
for indexToGo = 1:NmodesReach

    patchedAndUnvistedStatesToPatch = find(~(patchedStates(1:indexToGo)));
    counter = 0;

    for statePre =  patchedAndUnvistedStatesToPatch'

        if options.doLog, fprintf(fid,'%f : Attempting to compute funnels for State %d.\n', toc, statePre); end
        % while reachIncomplete

        [indexTransVect, indexPostVect] = findTransitionsWithNonRepeatingRegions(aut, statePre);
        indexTransVect = indexTransVect';

        % remove any transitions, for whose region pairs, a funnel has already been created.
        newIndexTransVect = indexTransVect;
        for i = 1:length(ac_trans)
            if isempty(ac_trans{i}), continue, end
            preState = ac_trans{i}.pre;
            ac_trans{i}.post
            for postState = ac_trans{i}.post
                for indexTrans = indexTransVect'
                    if (aut.label{preState} ~= aut.label{aut.trans{indexTrans}(1)}), continue, end
                    if (aut.label{postState} ~= aut.label{aut.trans{indexTrans}(2)}), continue, end
                    newIndexTransVect = setdiff(newIndexTransVect, indexTrans);
                end
            end
        end

        errorMsg = [];
        if ~isempty(newIndexTransVect)
            for indexTrans = newIndexTransVect'
                statePost = trans(indexTrans,2);

                x0 = stateTraject{statePre, statePost};
                u0 = inputTraject{statePre, statePost};
                [ac_tmp, errorMsg] = computeFunnel(sys, x0, u0, reg, aut, ac_trans, statePre, statePost, options);

                indexSet = vertcat(aut.label{indexPostVect}) == vertcat(aut.label{vertcat(aut.state{:}) == statePre});
                statePostVect = vertcat(aut.state{indexSet});
                for i = 1:length(ac_tmp)
                    ac_tmp(i).setTransition(statePre, statePostVect);
                end
                ac_trans{indexTrans} = ac_tmp;
            end
        end

        if ~isempty(errorMsg)
            disp(['synthesizeFixedTrajectories: Transition funnel computation was unsuccessful for State ',num2str(statePre),'. Repeating.'])
            joinedStates(statePre) = false;
            patchedStates(statePre) = false;
            counter = counter+1;
        else
            disp(['synthesizeFixedTrajectories: Transition funnel computation was successful for State ',num2str(statePre),'.'])
            counter = 0;
            joinedStates(statePre) = false;
            patchedStates(statePre) = true;

            joinedStates(statePre) = false;  % If 'true' then we have just joined the funnel from the previous transition
            if false  % 'false' here means we always just assume the worst case and that no funnels are composed.
                % TODO: fix the following to flag the state as 'joined' only if it passes a check for composition
                for jpre = 1:length(ac_trans)
                    if isempty(ac_trans{jpre}), continue, end
                    if ~any(ac_trans{jpre}.post == statePre), continue, end
                    tmp = ac_trans{jpre}.ellipsoid;
                    ellToCompose = tmp(end);
                    for jpost = 1:length(ac_trans)
                        if isempty(ac_trans{jpost}), continue, end
                        if ~any(ac_trans{jpost}.pre == statePost), continue, end
                        if ~ac_trans{jpost}.funnelContainsEllipsoid(sys, ellToCompose), continue, end
                        joinedStates(statePre) = true;
                    end
                end
            end

        end

        disp(toc);

        if patchedStates(statePre) , continue, end

        iPreStateToPatch = [];
        if ~isempty([ac_trans{lastTrans}]) && counter > 10
            counter = 0;
            iPreStateToPatch = trans(lastTrans,1);
        end
        disp(['synthesizeFixedTrajectories: Failed to create a transition funnel for State ',num2str(statePre),'. '])
        toc
        if options.doLog, fprintf(fid,'%f : Failed to create a transition funnel for State  %d. Re-computing the transition funnel.\n', toc, statePre); end
        break
    end
end
toc

%%
toc
if options.doLog, fclose(fid); end

% Save the controller data to file.
log_string = [filePath,'/reasyns_controllers/reasyns_',date,'_',num2str(clk(4)),num2str(clk(5)),num2str(clk(6))];
saveReasynsProblemInstance(log_string, sys, aut, ac_inward, ac_trans)
%eval(['save(''',filePath,'/reasyns_controllers/reasyns_',date,'_',num2str(clk(4)),num2str(clk(5)),num2str(clk(6)),''');'])


text:
NETNS=$1
TARGET_IP=$2
ENVOY_PORT=10000

# remove iptables rule
iptables -t nat -D PREROUTING --src 0/0 --dst "$TARGET_IP" -p tcp --dport 80 -j REDIRECT --to-ports "$ENVOY_PORT"

# delete network namespace
ip netns delete "$NETNS"

# delete veth pair
ip link del "$NETNS-veth0" type veth peer name "$NETNS-veth1"


text:
$modulePath = Resolve-Path -Path "$PSScriptRoot\..\..\.." | Select-Object -ExpandProperty Path
$moduleName = Resolve-Path -Path "$PSScriptRoot\..\.." | Get-Item | Select-Object -ExpandProperty BaseName

Remove-Module -Name $moduleName -Force -ErrorAction SilentlyContinue
Import-Module -Name "$modulePath\$moduleName" -Force

Describe 'Get-FileExplorerNamespace' {

    Context 'Default' {

        Mock 'Get-ItemProperty' -ModuleName $moduleName -ParameterFilter { $Path -eq 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\*' } {
            [PSCustomObject] @{
                '(default)'   = 'OneDrive'
                'PSChildName' = '{018D5C66-4533-4307-9B53-224DE2ED1FE6}'
            }
            [PSCustomObject] @{
                '(default)'   = 'Dropbox'
                'PSChildName' = '{E31EA727-12ED-4702-820C-4B6445F28E1A}'
            }
        }

        Mock 'Get-ItemProperty' -ModuleName $moduleName -ParameterFilter { $Path -eq 'HKCU:\SOFTWARE\Classes\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\Instance\initPropertyBag' } {
            [PSCustomObject] @{
                'TargetKnownFolder' = '{a52bba46-e9e1-435f-b3d9-28daa648c0f6}'
                'TargetFolderPath'  = $null
            }
        }

        Mock 'Get-ItemProperty' -ModuleName $moduleName -ParameterFilter { $Path -eq 'HKCU:\SOFTWARE\Classes\CLSID\{E31EA727-12ED-4702-820C-4B6445F28E1A}\Instance\initPropertyBag' } {
            [PSCustomObject] @{
                'TargetKnownFolder' = $null
                'TargetFolderPath'  = 'C:\Users\Demo\Dropbox'
            }
        }

        Mock 'Get-ItemProperty' -ModuleName $moduleName -ParameterFilter { $Path -eq 'HKCU:\SOFTWARE\Classes\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\DefaultIcon' } {
            [PSCustomObject] @{
                '(default)' = 'C:\Users\claudio.spizzi\AppData\Local\Microsoft\OneDrive\OneDrive.exe,0'
            }
        }

        Mock 'Get-ItemProperty' -ModuleName $moduleName -ParameterFilter { $Path -eq 'HKCU:\SOFTWARE\Classes\CLSID\{E31EA727-12ED-4702-820C-4B6445F28E1A}\DefaultIcon' } {
            [PSCustomObject] @{
                '(default)' = 'C:\Program Files (x86)\Dropbox\Client\Dropbox.exe,-6001'
            }
        }

        Mock 'Get-ItemProperty' -ModuleName $moduleName -ParameterFilter { $Path -eq 'HKCU:\SOFTWARE\Classes\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}' } {
            [PSCustomObject] @{
                'SortOrderIndex' = 66
            }
        }

        Mock 'Get-ItemProperty' -ModuleName $moduleName -ParameterFilter { $Path -eq 'HKCU:\SOFTWARE\Classes\CLSID\{E31EA727-12ED-4702-820C-4B6445F28E1A}' } {
            [PSCustomObject] @{
                'SortOrderIndex' = 66
            }
        }

        It 'should return all namespaces' {

            # Act
            $namespaces = Get-FileExplorerNamespace

            # Assert
            $namespaces.Count | Should Be 2
        }

        It 'should return the OneDrive namespace by name' {

            # Act
            $namespace = Get-FileExplorerNamespace -Name 'OneDrive'

            # Assert
            $namespace.Id          | Should Be '018D5C66-4533-4307-9B53-224DE2ED1FE6'
            $namespace.Name        | Should Be 'OneDrive'
            $namespace.Icon        | Should Be 'C:\Users\claudio.spizzi\AppData\Local\Microsoft\OneDrive\OneDrive.exe,0'
            $namespace.Order       | Should Be 66
            $namespace.TargetType  | Should Be 'KnownFolder'
            $namespace.TargetValue | Should Be '{a52bba46-e9e1-435f-b3d9-28daa648c0f6}'
        }

        It 'should return the Dropbox namespace by id' {

            # Act
            $namespace = Get-FileExplorerNamespace -Id '{E31EA727-12ED-4702-820C-4B6445F28E1A}'

            # Assert
            $namespace.Id          | Should Be 'E31EA727-12ED-4702-820C-4B6445F28E1A'
            $namespace.Name        | Should Be 'Dropbox'
            $namespace.Icon        | Should Be 'C:\Program Files (x86)\Dropbox\Client\Dropbox.exe,-6001'
            $namespace.Order       | Should Be 66
            $namespace.TargetType  | Should Be 'FolderPath'
            $namespace.TargetValue | Should Be 'C:\Users\Demo\Dropbox'
        }

        It 'should not return any namespaces' {

            # Act
            $namespace = Get-FileExplorerNamespace -Name 'Demo'

            # Assert
            $namespace | Should BeNullOrEmpty
        }
    }
}


text:
/*
* dashboard.js
*
* test cases for components in the dashboard content block
*
*/

import LoginPage from '../pageobjects/login';
import DashboardPage from '../pageobjects/dashboard';

describe('Dashboard', () => {
  // We should only have to pass through the login page once...
  beforeAll(() => {
    LoginPage.quickLogin();
    DashboardPage.chartRechart.waitForVisible();
  });

  describe('Report widget', () => {
    it('has label Income', () => {
      DashboardPage.reportsWidget.waitForVisible();
      expect(DashboardPage.reportsWidget.$('h3').getText()).to.have.string('Income');
    });

    it('contains expected items and percentages', () => {
      var expected = ['Marketing', '70%', 'Advertisement', '80%', 'Consulting', '40%', 'Development', '60%'];
      var actual = [];
      DashboardPage.reportsWidget.$$('.isoSingleProgressBar').map((item) => {
        actual.push(item.$('h3').getText());
        actual.push(item.$('.ant-progress-text').getText());
      });
      expect(actual).to.eql(expected);
    });
    it('contains expected text in footer', () => {
      expect(DashboardPage.reportsWidget.$('.isoDescription').getText()).to.have.string('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor');
    });
  });

  describe('Table widget', () => {
    it('contains expected column headings', () => {
      var expected = ['First Name', 'Last Name', 'City', 'Street'];
      var actual = [];
      DashboardPage.simpleTable.$('thead').$$('th').map((item) => {
        actual.push(item.getText());
      });
      expect(actual).to.eql(expected);
    });

    it('contains expected values', () => {
      var expected = ['Emelia','Gislason','Lake Zelda','Kulas Shoals','Cloyd','Armstrong','East Pierce','Lyla Heights','Rahul','Funk','Sibylside','Jolie Shoals','Hilbert','Langosh','Anaisshire','Sim Station','Cloyd','Wilderman','North Brad','Ruecker Turnpike'];
      var actual = [];
      DashboardPage.simpleTable.$('tbody').$$('td').map((item) => {
        actual.push(item.getText());
      });
      expect(actual).to.eql(expected);
    });
  });

  describe('Sticker Widgets', () => {
    it('there should be four of them', () => {
      expect(DashboardPage.stickerWidgets.length).to.equal(4);
    });

    it('they should all have the value of 210', () => {
      DashboardPage.stickerWidgets.map((sticker) => {
        expect(sticker.$('h3').getText()).to.have.string('210');
      });
    });

    it('they should have expected labels', () => {
      var expected = ['Unread Email', 'Image Upload', 'Total Message', 'Orders Post'];
      var actual = [];
      DashboardPage.stickerWidgets.map((sticker) => {
        actual.push(sticker.$('.isoLabel').getText());
      });
      expect(actual).to.eql(expected);
    });
  });

  describe('Sales Widgets', () => {
    it('there should be four of them', () => {
      expect(DashboardPage.saleWidgets.length).to.equal(4);
    });

    it('they should all contain the title "Income"', () => {
      DashboardPage.saleWidgets.map((item) => {
        expect(item.$('h3').getText()).to.have.string('INCOME');
      });
    });

    it('they should each contain the amount "$15000"', () => {
      DashboardPage.saleWidgets.map(function(item) {
        expect(item.$('.isoSalePrice').getText()).to.have.string('$15000');
      });
    });

    it('they should each have the same Lorem ipsum... description', () => {
      DashboardPage.saleWidgets.map((item) => {
        expect(item.$('.isoSaleDetails').getText()).to.have.string('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor');
      });
    });
  });

  describe('Card Widgets', () => {
    it('there should be three of them', () => {
      expect(DashboardPage.cardWidgets.length).to.equal(3);
    });

    it('they should have expected values and labels', function() {
      var expected = ['110', 'NEW MESSAGES', '100%', 'VOLUME', '137', 'ACHIEVEMENT'];
      var actual = [];
      DashboardPage.cardWidgets.map((card) => {
        actual.push(card.$('h3').getText());
        actual.push(card.$('.isoLabel').getText());
      });
      expect(actual).to.eql(expected);
    });
  });

  describe('Progress Widgets', () => {
    it('there should be three of them', () => {
      expect(DashboardPage.progressWidgets.length).to.equal(3);
    });

    it('they should contain expected labels and values', () => {
      var expected = ['Download', '50% Complete', 'Support', '80% Satisfied Customer', 'Upload', '65% Complete'];
      var actual = [];
      DashboardPage.progressWidgets.map((item) => {
        actual.push(item.$('h3').getText());
        actual.push(item.$('.isoDescription').getText());
      });
      expect(actual).to.eql(expected);
    });
  });

  describe('Charts', () => {
    it('there are 5 charts shown on the dashboard', () => {
      expect(DashboardPage.chartsGoogle.length + 1).to.equal(5);
    });

    // had to stub this one out - results were variables. Sometimes the expected
    // and actual values would align, other times they wouldn't align.
    //TODO: Investigate intermittent failure!

    // it('Google graph headings match expected values', function() {
    //   var expected = ['Visitor statistics from 2010 to 2016', 'Lengths of dinosaurs, in meters', 'Age of sugar maples vs.', 'Monthly Coffee Production'];
    //   var actual = [];
    //   DashboardPage.chartsGoogle.map(function(chart) {
    //     actual.push(chart.$('[text-anchor="start"]').getText());
    //   });
    //   expect(actual).to.eql(expected);
    //   console.log('Expected values:', expected);
    //   console.log('Actual values:', actual);
    // });
  });

  describe('User Card', () => {
    it('displays their name', () => {
      expect(DashboardPage.userCard.$('h3').getText()).to.have.string('Jhon Doe');
    });

    it('displays their job title', () => {
      expect(DashboardPage.userCard.$('.isoDesgTitle').getText()).to.have.string('Sr. iOS Developer');
    });

    it('displays a description', () => {
      expect(DashboardPage.userCard.$('.isoDescription').getText()).to.have.string('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor ammet dolar consectetur adipisicing elit');
    });
  });

  describe('Page footer', () => {
    it('contains appropriate copyright notice', () => {
      expect(DashboardPage.footer.getText()).to.have.string('Copyright ©2017 by Steven W. Paulovich');
    });
  });
});


text:
* The Go Programming Language (Addison-Wesley Professional Computing Series) by Alan A. A. Donovan and Brian W. Kernighan

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/The%20Go%20Programming%20Language.jpg)

* Go in Practice: Includes 70 Techniques  by Matt Butcher and Matt Farina

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Go%20in%20Practice.jpg)

* Go Web Programming by Sau Sheong Chang

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Go%20Web%20Programming.jpg)

* Go in Action

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/go-in-action.jpg)

* Introducing Go: Build Reliable, Scalable Programs by Caleb Doxsey

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Introducing%20Go%20Build%20Reliable%2C%20Scalable%20Programs.jpg)

* Level Up Your Web Apps With Go: Performance, Concurrency, Scalability by Mal Curtis

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Level%20Up%20Your%20Web%20Apps%20With%20Go.jpg)

* An Introduction to Programming in Go by Caleb Doxsey

![An Introduction to Programming in Go by Caleb Doxsey](https://raw.githubusercontent.com/suifengtec/go/master/imgs/an-introduction-to-programming-in-go.png)

* Go Programming Blueprints - Second Edition by Mat Ryer

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Go%20Programming%20Blueprints%20-%20Second%20Edition.jpg)

* Network Programming with Go: Essential Skills for Using and Securing Networks by Jan Newmarch

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Network%20Programming%20with%20Go.jpg)

* Go: Building Web Applications by Nathan Kozyra and Mat Ryer

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Go%20%20Building%20Web%20Applications.jpg)

* Go Design Patterns by Mario Castro Contreras

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Go%20Design%20Patterns.jpg)

* Web Development with Go: Building Scalable Web Apps and RESTful Services by Shiju Varghese

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Web%20Development%20with%20Go.jpg)

* Microservices in Go: Use Go to Build Scalable Backends by Matthew Campbell

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Microservices%20in%20Go%20%20Use%20Go%20to%20Build%20Scalable%20Backends.jpg)

* Go in 24 Hours, Sams Teach Yourself: Next Generation Systems Programming with Golang by George Ornbo

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Go%20in%2024%20Hours%2C%20Sams%20Teach%20Yourself.jpg)

* Learning Go Web Development by Nathan Kozyra

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Learning%20Go%20Web%20Development.jpg)

* Go: Up and Running by Alan Harris

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Go%20Up%20and%20Running.jpg)

* [Go for Javascript Developers by Maor Zamski,Daniel Singer](https://github.com/pazams/go-for-javascript-developers)

![](https://raw.githubusercontent.com/bulim/go-for-javascript-developers/master/images/thumb.png)

* Webapps in Go the anti textbook by thewhitetulip

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Webapps%20in%20Go%20the%20anti%20textbook.jpg)

* Go Exercises in Plain Language by Tony de Araujo

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Go%20Exercises%20in%20Plain%20Language.jpg)

* Microservices in Go by Matthew Campbell

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Microservices%20in%20Go%20%20Use%20Go%20to%20Build%20Scalable%20Backends.jpg)

* [Go Secure Coding Practices by PauloASilva, ErezYalon](https://www.gitbook.com/book/checkmarx/go-scp/details)
* Go Recipes by Shiju Varghese

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Go%20Recipes%20%20A%20Problem-Solution%20Approach.jpg)

* Learning Go Programming by Vladimir Vivien

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Learning%20Go%20Programming.jpg)

* Mastering Go Web Services by Nathan Kozyra
* Mastering Concurrency in Go by Nathan Kozyra

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Mastering%20Concurrency%20in%20Go.jpg)

* [Go Bootcamp by Matt Aimonetti](http://www.golangbootcamp.com/)

* [Building Web Apps with Go](https://www.gitbook.com/book/codegangsta/building-web-apps-with-go/details)

* Go Cookbook by Aaron Torres

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Go%20Cookbook.png)

* Go: Design Patterns for Real-World Projects by Mario Castro Contreras, Mat Ryer, Vladimir Vivien

![](https://raw.githubusercontent.com/suifengtec/go/master/imgs/Go%20Design%20Patterns%20for%20Real-World%20Projects.jpg)

* Writing An Interpreter In Go by  Thorsten Ball
* Go Programming: Questions and Answers by George Duckett
* Creating Web Applications On The Go by Frank Winchester

## 中文书/已被翻译的书

* Go语言学习笔记 雨痕
* Go并发编程实战(第2版)郝林
* [Go Web编程 谢孟军](https://astaxie.gitbooks.io/build-web-application-with-golang/content/zh/)
* Go语言标准库 / The Golang Standard Library by Example
* [通过例子学习Go/Go by Example](http://books.studygolang.com/gobyexample/)
* Go语言程序设计 (王鹏,清华大学出版社)
* [Go简易教程](https://www.gitbook.com/book/wizardforcel/the-little-go-book/details)
* [Go入门指南](https://github.com/Unknwon/the-way-to-go_ZH_CN)
* [Go语言圣经/The Go Programming Language by Alan A. A. Donovan, Brian W. Kernighan](http://docs.ruanjiadeng.com/gopl-zh/) 或[这里](https://docs.hacknode.org/gopl-zh/)
* [学习Go语言](https://mikespook.com/learning-go/)
* [学习GO语言 英文版 Learning Go ](https://www.miek.nl/go/)
* [Go语言博客实践](http://books.studygolang.com/Go-Blog-In-Action/)
* [深入解析Go](https://www.gitbook.com/book/tiancaiamao/go-internals/details)
* [Go语言程序设计/Programming in Go by Mark Summerfield  许式伟/吕桂华等翻译](https://www.gitbook.com/book/tiancaiamao/go-internals/details)
* Go语言编程 许式伟 等
* Go语言·云动力 樊虹剑

# 相关链接

* [Go 书籍介绍归档](https://github.com/dariubs/GoBooks)
* [Go 官方的书籍归档页面](https://github.com/golang/go/wiki/Books)
* [devFreeBooks](https://devfreebooks.github.io/go/)


text:
layout: post
status: publish
published: true
title: Minor dasBlog problems
author:
  display_name: Tomas Restrepo
  login: tomasr
  email: tomas@winterdom.com
  url: http://winterdom.com/
author_login: tomasr
author_email: tomas@winterdom.com
author_url: http://winterdom.com/
wordpress_id: 912
wordpress_url: http://winterdom.com/2006/02/minordasblogproblems
date: '2006-02-06 15:55:48 +0000'
date_gmt: '2006-02-06 15:55:48 +0000'
categories:
- Blogging
tags: []
comments:
- id: 636
  author: Roshan
  author_email: ''
  author_url: ''
  date: '2007-02-07 23:09:47 +0000'
  date_gmt: '2007-02-07 23:09:47 +0000'
  content: |
    Ping!
---

After the dasBlog migration this weekend, I discover a one issue that is causing some of the posts I imported to dasBlog not to be displayed. Sort of.

Most individual posts will show up correctly, and all will be displayed correctly on the per-date pages. Except, for a few entries that will show up on the per-date page but

not will fail to render if you follow the entry's permalink (either the name-based one, or the guid based on). What's more annoying: you don't

get a 404 error back, just an empty page, as  dasBlog seems to just choke on the request.

So, here's an example: go to /weblog/default,date,2006-01-09.aspx. Try to follow the link for the first post in the page, and you'll get a blank page (no html generated at all).

When that happens, dasBlog will leave in it's log an entry similar to the following:

Error:
Entry was not found: 572

at newtelligence.DasBlog.Web.Services.AggregatorBugHandler.ProcessRequest(HttpContext)

at System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()

at System.Web.HttpApplication.ExecuteStep(IExecutionStep, Boolean&)

at System.Web.HttpApplication.ResumeSteps(Exception)

at System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext, AsyncCallback, Object)

at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest)

at System.Web.HttpRuntime.ProcessRequest(HttpWorkerRequest)

at System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr, Int32)

 while processing .

AFAICT, the problem seems to be with the post-date handling. I have

my dasBlog installation configured to use my timezone (UTC-05:00), and

all the imported entries have all dates and times specified in the same

timezone in the .dayentry.xml files. It seems, that when the time the

entry has reported is too close (how close I haven't verified yet) to

the end of the specified day, dasBlog will just fail to display the

entry completely. At least that's my appreciation of the problem.

Also, a really newbie question. What timezone should dasBlog be

saving the dates for entries created in dasBlog directly? At least for

my site, it seems to be saving the time in UTC-08:00, which seemed

rather weird to me.

Any ideas?

Update: I think I've managed to fix this. The problem, in essence, is that while the date & times stored in dasBlog's content XML files are in "Local Time" (whatever the local time is for the server itself, hence the -8:00 I was seeing), the actual date in the XML filename should be in UTC. This is not very intuitive, as it means that if you open a file named, say, 2006-01-10.dayentry.xml, you might find that the dates on the entries contained therein actually reference an earlier or later day.

If anyone spots any entry giving trouble, please let me know and I'll see if I hosed anything else up :)


text:
<?php

namespace Puphpet\Extension\PostgresqlBundle;

use Puphpet\MainBundle\Extension;

class Configure extends Extension\ExtensionAbstract
{
    const DIR = __DIR__;

    protected $conf = [
        'name'            => 'PostgreSQL',
        'slug'            => 'postgresql',
        'frontController' => 'puphpet.extension.postgresql.front_controller',
    ];
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Ready, Dataset, Go!</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/clean-blog.min.css" rel="stylesheet">

    <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Home
                About
                Blog Posts

Ready, Dataset, Go!

Creating lists and tables in Python

                        Posted on July 1, 2016

Python

Today we used the Jupyter program from Anaconda to create lists and tables with datasets from grouplens.org. We learned how to select rows and columns, filtering them, grouping them, and printing them out. During this time, we also learned about new functions and the difference between normal arguments and keyword arguments.

Graphic Design

We created our logo using Adobe Illustrator. The colors used were selected from the Paletton palette generator. We chose the colors because they looked professional.

How to Create a Logo - 10 step tutorial

1. Learn logo basics.

A good logo must be simple, memorable, enduring, versatile, and finally, appropriate.

2. Sketch concepts.

Be original! Keep your design simple, and avoid things like clipart and generic shapes. If your logo has more than 3 colors, you're doing it wrong.

3. Analyze your best sketches.

Choose the top 3 designs and share them with other people. Absorb feedback and use them to finalize the idea.

4. Configure logo layout.

Make sure everything is spaced out equally. Remember that it doesn't have to be symmetrical, only spacing matters.

5. Select flexible color options.

Sometimes logos don't "work" on certain backgrounds. Be sure to have color choices for light and dark backgrounds.

6. Choose a good, memorable font.

Choose a good font that defines your company. For instance, serif fonts symbolize "old" whereas sans serif fonts symbolize "new." Be sure to avoid a generic font like Times New Roman or Comic Sans.

7. Maintain font flexibility.

Your logo needs to be able to be scaled into any size, large enough for billboards and small enough for business cards. Remember that the logo needs to be legible in any size.

 CC Startup Academy


text:
function saveContent() {
	tinyMCE.setContent(document.getElementById('htmlSource').value);
	tinyMCE.closeWindow(window);
}

function onLoadInit() {
	tinyMCEPopup.resizeToInnerSize();

	// Remove Gecko spellchecking
	if (tinyMCE.isGecko)
		document.body.spellcheck = tinyMCE.getParam("gecko_spellcheck");

	document.getElementById('htmlSource').value = tinyMCE.getContent(tinyMCE.getWindowArg('editor_id'));

	resizeInputs();

	if (tinyMCE.getParam("theme_advanced_source_editor_wrap", true)) {
		setWrap('soft');
		document.getElementById('wraped').checked = true;
	}
}

function setWrap(val) {
	var s = document.getElementById('htmlSource');

	s.wrap = val;

	if (tinyMCE.isGecko) {
		var v = s.value;
		var n = s.cloneNode(false);
		n.setAttribute("wrap", val);
		s.parentNode.replaceChild(n, s);
		n.value = v;
	}
}

function toggleWordWrap(elm) {
	if (elm.checked)
		setWrap('soft');
	else
		setWrap('off');
}

var wHeight=0, wWidth=0, owHeight=0, owWidth=0;

function resizeInputs() {
	var el = document.getElementById('htmlSource');

	if (!tinyMCE.isMSIE) {
		 wHeight = self.innerHeight-80;
		 wWidth = self.innerWidth-16;
	} else {
		 wHeight = document.body.clientHeight - 80;
		 wWidth = document.body.clientWidth - 16;
	}

	el.style.height = Math.abs(wHeight) + 'px';
	el.style.width  = Math.abs(wWidth) + 'px';
}


text:
kubernetes-mesos
================

When [Google Kubernetes][2] meets [Apache Mesos][3]

[![GoDoc] (https://godoc.org/github.com/mesosphere/kubernetes-mesos?status.png)](https://godoc.org/github.com/mesosphere/kubernetes-mesos)
[![Build Status](https://travis-ci.org/mesosphere/kubernetes-mesos.svg)](https://travis-ci.org/mesosphere/kubernetes-mesos)
[![Coverage Status](https://coveralls.io/repos/mesosphere/kubernetes-mesos/badge.svg)](https://coveralls.io/r/mesosphere/kubernetes-mesos)

Kubernetes and Mesos are a match made in heaven.
Kubernetes enables the Pod, an abstraction that represents a group of co-located containers, along with Labels for service discovery, load-balancing, and replication control.
Mesos provides the fine-grained resource allocations for pods across nodes in a cluster, and facilitates resource sharing among Kubernetes and other frameworks running on the same cluster.

This is still very much a work-in-progress, but stay tuned for updates as we continue development.
If you have ideas or patches, feel free to contribute!

Refer to the [documentation pages][12] for a review of core concepts, system architecture, and [known issues][13].

This project is currently based on the [Kubernetes v0.14 release][14] and has customized the release distribution:
components have been added, removed, and/or changed.

### Tutorial

Mesosphere maintains a tutorial for running [Kubernetes-Mesos on GCE][10], which is periodically updated to coincide with releases of this project.

### Binaries

For a binary-only install of the Kubernetes-Mesos framework you can use the Docker-based builder.
The following commands will build and copy the resulting binaries to `./bin`:
```shell
# chcon needed for systems protected by SELinux
$ mkdir bin && chcon -Rt svirt_sandbox_file_t bin
$ docker run --rm -v $(pwd)/bin:/target mesosphere/kubernetes-mesos:build
```

### Build

To build from source follow the instructions below.
Before building anything please review all of the instructions, including any environment setup steps that may be required prior to the actual build.

**NOTE:** Building Kubernetes for Mesos requires Go 1.4+.
* See the [development][1] page for sample environment setup steps.

Kubernetes-Mesos is built using a Makefile to automate the process of patching the vanilla Kubernetes code.
At this time it is **highly recommended** to use the Makefile instead of building components manually using `go build`.
```shell
$ git clone https://github.com/mesosphere/kubernetes-mesos.git k8sm
$ cd k8sm
$ make                             # compile the binaries
$ make test                        # execute unit tests
$ make install DESTDIR=$(pwd)/bin  # install to ./bin
```

### Start the framework

**NETWORKING:** Kubernetes v0.5 introduced "Services v2" which follows an IP-per-Service model.
A consequence of this is that you must provide the Kubernetes-Mesos framework with a [CIDR][8] subnet that will be used for the allocation of IP addresses for Kubernetes services: the `-portal_net` parameter.
Please keep this in mind when reviewing (and attempting) the example below - the CIDR subnet may need to be adjusted for your network.
See the Kubernetes [release notes][9] for additional details regarding the new services model.

The examples that follow assume that you have a running Mesos cluster.
If needed you may download and install Mesos binaries through your OS package manager, or else download them directly from [Mesosphere][4] and install them manually.
Once your Mesos cluster is up and running you're ready to fire up kubernetes-mesos.

To keep things simple the following guide also assumes that you intend to run the mesos-master, etcd, and the kubernetes-mesos framework processes on the same host, exposed on an IP address referred to hereafter as `${servicehost}`.
Alternatively, the instructions also support a multi-mesos-master cluster running with Zookeeper.

```shell
$ export servicehost=...  # IP address of the framework host, perhaps $(hostname -i)
```

#### etcd

If you are not running in a production setting then a single etcd instance will suffice.
To run etcd, see [github.com/coreos/etcd][6], or run it via docker:

```shell
$ sudo docker run -d --hostname $(hostname -f) -p 4001:4001 -p 7001:7001 --name=etcd coreos/etcd
```

**NOTE:** A troublesome etcd bug, [discovered][15] circa Kubernetes v0.14.2, has been fixed in etcd v2.0.9.
If you are running an older version of etcd you may want to consider an upgrade.

#### kubernetes-mesos

Ensure that your Mesos cluster is started.

Create a configuration file for the Mesos cloud provider:

```shell
$ edit ./mesos-cloud.conf
```

The file content should have the following format:

```ini
[mesos-cloud]
	mesos-master        = host:port
	http-client-timeout = 5s
	state-cache-ttl     = 20s
```

**Mesos Cloud Provider Configuration Options:**

- `mesos-master`: Location of the Mesos master.  This value can take the
  form `host:port` or a canonical Zookeeper URL
(`zk://host1:port1,host2:port2/your/znode/path`)
- `http-client-timeout`: Time to wait for a response from the Mesos
  master when querying the state.
- `state-cache-ttl`: Maximum age of the cached Mesos state, after which
  new values will be fetched.

Fire up the kubernetes-mesos framework components (yes, these are **all** required for a working framework):

```shell
$ ./bin/km apiserver \
  --address=${servicehost} \
  --etcd_servers=http://${servicehost}:4001 \
  --portal_net=10.10.10.0/24 \
  --port=8888 \
  --cloud_provider=mesos \
  --cloud_config=./mesos-cloud.conf \
  --v=2 >apiserver.log 2>&1 &

$ ./bin/km controller-manager \
  --master=$servicehost:8888 \
  --cloud_config=./mesos-cloud.conf \
  --v=2 >controller.log 2>&1 &

$ ./bin/km scheduler \
  --mesos_master=${mesos_masster} \
  --address=${servicehost} \
  --etcd_servers=http://${servicehost}:4001 \
  --mesos_user=root \
  --api_servers=$servicehost:8888 \
  --v=2 >scheduler.log 2>&1 &
```

For simpler execution of `kubectl`:
```shell
$ export KUBERNETES_MASTER=http://${servicehost}:8888
```

You can increase the verbosity of the logging for the API server, scheduler, and/or the controller-manager by including, for example, `--v=2`.
This can be very helpful while debugging.

###Launch a Pod

Assuming your framework is running on `${KUBERNETES_MASTER}`, then:

```shell
$ bin/kubectl create -f examples/pod-nginx.json
# -- or --
$ curl -L ${KUBERNETES_MASTER}/api/v1beta1/pods -XPOST -d @examples/pod-nginx.json
```

After the pod get launched, you can check it's status via `kubectl`, `curl` or your web browser:
```shell
$ bin/kubectl get pods
POD          IP           CONTAINER(S)  IMAGE(S)          HOST                       LABELS    STATUS
nginx-id-01  172.17.6.20  nginx-01      dockerfile/nginx  10.22.211.18/10.22.211.18  name=foo  Running

# -- or --
$ curl -L ${KUBERNETES_MASTER}/api/v1beta1/pods
```
```json
{
  "kind": "PodList",
  "creationTimestamp": null,
  "selfLink": "/api/v1beta1/pods?namespace=",
  "resourceVersion": 2800,
  "apiVersion": "v1beta1",
  "items": [
    {
      "id": "nginx-id-01",
      "uid": "2cf6694e-bd16-11e4-90fa-42010adf71e3",
      "creationTimestamp": "2015-02-25T17:46:06Z",
      "selfLink": "/api/v1beta1/pods/nginx-id-01?namespace=default",
      "resourceVersion": 2751,
      "namespace": "default",
      "labels": {
        "name": "foo"
      },
      "desiredState": {
        "manifest": {
          "version": "v1beta2",
          "id": "",
          "volumes": null,
          "containers": [
            {
              "name": "nginx-01",
              "image": "dockerfile/nginx",
              "ports": [
                {
                  "hostPort": 31000,
                  "containerPort": 80,
                  "protocol": "TCP"
                }
              ],
              "resources": {},
              "livenessProbe": {
                "httpGet": {
                  "path": "/",
                  "port": "80"
                },
                "initialDelaySeconds": 30,
                "timeoutSeconds": 1
              },
              "terminationMessagePath": "/dev/termination-log",
              "imagePullPolicy": "PullIfNotPresent",
              "capabilities": {}
            }
          ],
          "restartPolicy": {
            "always": {}
          },
          "dnsPolicy": "ClusterFirst"
        }
      },
      "currentState": {
        "manifest": {
          "version": "",
          "id": "",
          "volumes": null,
          "containers": null,
          "restartPolicy": {}
        },
        "status": "Running",
        "Condition": [
          {
            "kind": "Ready",
            "status": "Full"
          }
        ],
        "host": "10.22.211.18",
        "hostIP": "10.22.211.18",
        "podIP": "172.17.6.20",
        "info": {
          "POD": {
            "state": {
              "running": {
                "startedAt": "2015-02-25T17:46:07Z"
              }
            },
            "ready": false,
            "restartCount": 0,
            "podIP": "172.17.6.20",
            "image": "kubernetes/pause:latest",
            "imageID": "docker://6c4579af347b649857e915521132f15a06186d73faa62145e3eeeb6be0e97c27",
            "containerID": "docker://811760e5070fd3c8e8014aff2a169831adc0c602833b540f689d76be6fadabf1"
          },
          "nginx-01": {
            "state": {
              "running": {
                "startedAt": "2015-02-25T17:46:08Z"
              }
            },
            "ready": true,
            "restartCount": 0,
            "image": "dockerfile/nginx",
            "imageID": "docker://0180c66bffa9450b438970b9350295c1b5d4345a8b4573abe8e2b46b075e63f8",
            "containerID": "docker://371ae01aa63b01875410f5bcca42ccdcc03872d64c351fbdcadcce2cba4a578f"
          }
        }
      }
    }
  ]
}
```

Or, you can run `docker ps` on the appropriate Mesos slave to verify that the example container is running:

```shell
$ docker ps
CONTAINER ID  IMAGE                     COMMAND   CREATED  STATUS  PORTS                  NAMES
371ae01aa63b  dockerfile/nginx:latest   "nginx"   11m ago  Up 11m                         k8s_nginx-01.aa49fb33_nginx-id-01.default.mesos_2cf6694e-bd16-11e4-90fa-42010adf71e3_c4ef9708
811760e5070f  kubernetes/pause:go       "/pause"  11m ago  Up 11m  0.0.0.0:31000->80/tcp  k8s_POD.5c99ea13_nginx-id-01.default.mesos_2cf6694e-bd16-11e4-90fa-42010adf71e3_3d99b13e
```

###Launch a Replication Controller

Assuming your framework is running on `${KUBERNETES_MASTER}` and that you have multiple Mesos slaves in your cluster, then:

```shell
$ bin/kubectl create -f examples/controller-nginx.json
# -- or --
$ curl -L ${KUBERNETES_MASTER}/api/v1beta1/replicationControllers -XPOST -d@examples/controller-nginx.json
```

After the pod get launched, you can check it's status via `kubectl`, `curl` or your web browser:
```shell
$ bin/kubectl get replicationControllers
CONTROLLER          CONTAINER(S)        IMAGE(S)            SELECTOR            REPLICAS
nginxcontroller     nginx               dockerfile/nginx    name=nginx          2

# -- or --
$ curl -L ${KUBERNETES_MASTER}/api/v1beta1/replicationControllers
```
```json
{
  "kind": "ReplicationControllerList",
  "creationTimestamp": null,
  "selfLink": "/api/v1beta1/replicationControllers?namespace=",
  "resourceVersion": 3087,
  "apiVersion": "v1beta1",
  "items": [
    {
      "id": "nginxcontroller",
      "uid": "5f091198-bd18-11e4-90fa-42010adf71e3",
      "creationTimestamp": "2015-02-25T18:01:49Z",
      "selfLink": "/api/v1beta1/replicationControllers/nginxcontroller?namespace=default",
      "resourceVersion": 3041,
      "namespace": "default",
      "desiredState": {
        "replicas": 2,
        "replicaSelector": {
          "name": "nginx"
        },
        "podTemplate": {
          "desiredState": {
            "manifest": {
              "version": "v1beta2",
              "id": "",
              "volumes": null,
              "containers": [
                {
                  "name": "nginx",
                  "image": "dockerfile/nginx",
                  "ports": [
                    {
                      "hostPort": 31001,
                      "containerPort": 80,
                      "protocol": "TCP"
                    }
                  ],
                  "resources": {},
                  "terminationMessagePath": "/dev/termination-log",
                  "imagePullPolicy": "PullIfNotPresent",
                  "capabilities": {}
                }
              ],
              "restartPolicy": {
                "always": {}
              },
              "dnsPolicy": "ClusterFirst"
            }
          },
          "labels": {
            "name": "nginx"
          }
        }
      },
      "currentState": {
        "replicas": 2,
        "podTemplate": {
          "desiredState": {
            "manifest": {
              "version": "",
              "id": "",
              "volumes": null,
              "containers": null,
              "restartPolicy": {}
            }
          }
        }
      },
      "labels": {
        "name": "nginx"
      }
    }
  ]
}
```

### Test

Run test suite with:

```shell
$ make test.v
```

#### Test Coverage

To generate an HTML test coverage report:

```shell
$ go get golang.org/x/tools/cmd/cover
$ make test.cover
```

To view the report, open the file `coverage-report.html` in a web browser.

[1]: DEVELOP.md
[2]: https://github.com/GoogleCloudPlatform/kubernetes
[3]: http://mesos.apache.org/
[4]: http://mesosphere.io/downloads
[5]: https://github.com/tools/godep
[6]: https://github.com/coreos/etcd/releases/
[7]: DEVELOP.md#prerequisites
[8]: http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
[9]: https://github.com/GoogleCloudPlatform/kubernetes/releases/tag/v0.5
[10]: https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/getting-started-guides/mesos.md
[11]: https://github.com/mesosphere/kubernetes-mesos/releases
[12]: docs/README.md
[13]: docs/issues.md
[14]: https://github.com/GoogleCloudPlatform/kubernetes/releases/tag/v0.14.0
[15]: https://github.com/GoogleCloudPlatform/kubernetes/pull/6544


text:
<?php

namespace PeterColes\Themes;

use Mockery as m;
use PeterColes\Themes\FileViewFinder;

class FileViewFinderTest extends \PHPUnit_Framework_TestCase
{
    public function testAddLocation()
    {
        $fileSystem = m::mock('Illuminate\Filesystem\Filesystem');
        $paths = ['foo'];

        $finder = new FileViewFinder($fileSystem, $paths);
        $finder->addLocation('bar');

        $this->assertEquals(['bar', 'foo'], $finder->getPaths());
    }
}


text:
Gophish Hosting

# Launching
Execute `sudo ./launch.sh&`

# Logs
Logs are in `renfish.log`

# SSL Certificate

## Renew
Execute `certbot renew --pre-hook "service nginx stop" --post-hook "service nginx start"`

## Add Subdomain
Execute `certbot certonly --standalone --pre-hook "service nginx stop" --post-hook "service nginx start" -d sudomain.renfish.com`

# Gophish Container

## Pull

```
docker pull bjwbell/gophish-container
```

## Run

```
docker network create --subnet=172.19.0.0/16 gophish
docker run --net gophish bjwbell/gophish-container /gophish/gophish
```


text:
namespace treeface
{

} // namespace treeface


text:
'use strict';

const { Events } = require('../../../util/Constants');

module.exports = (client, { d: data }) => {
  let oldCommand;
  let newCommand;

  if (data.guild_id) {
    const guild = client.guilds.cache.get(data.guild_id);
    if (!guild) return;
    oldCommand = guild.commands.cache.get(data.id)?._clone() ?? null;
    newCommand = guild.commands.add(data);
  } else {
    oldCommand = client.application.commands.cache.get(data.id)?._clone() ?? null;
    newCommand = client.application.commands.add(data);
  }

  /**
   * Emitted when an application command is updated.
   * @event Client#applicationCommandUpdate
   * @param {?ApplicationCommand} oldCommand The command before the update
   * @param {ApplicationCommand} newCommand The command after the update
   */
  client.emit(Events.APPLICATION_COMMAND_UPDATE, oldCommand, newCommand);
};


text:
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.structuralsearch.plugin.ui.filters;

import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiElement;
import com.intellij.structuralsearch.MatchVariableConstraint;
import com.intellij.structuralsearch.NamedScriptableDefinition;
import com.intellij.structuralsearch.SSRBundle;
import com.intellij.structuralsearch.plugin.ui.UIUtil;
import com.intellij.ui.ContextHelpLabel;
import com.intellij.ui.EditorTextField;
import com.intellij.ui.SimpleColoredComponent;
import com.intellij.ui.SimpleTextAttributes;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.util.List;

/**
 * @author Bas Leijdekkers
 */
@SuppressWarnings("ComponentNotRegistered")
public class TextFilter extends FilterAction {

  boolean myShowHierarchy;

  public TextFilter() {
    super(SSRBundle.messagePointer("text.filter.name"));
  }

  @Override
  public @NotNull String getShortText(NamedScriptableDefinition variable) {
    if (!(variable instanceof MatchVariableConstraint)) {
      return "";
    }
    final MatchVariableConstraint constraint = (MatchVariableConstraint)variable;
    final String text = constraint.getRegExp();
    if (text.isEmpty()) {
      return constraint.isWithinHierarchy() ? SSRBundle.message("hierarchy.tooltip.message") : "";
    }
    return SSRBundle.message("text.tooltip.message",
                             constraint.isInvertRegExp() ? 1 : 0,
                             text,
                             constraint.isWholeWordsOnly() ? 1 : 0,
                             constraint.isWithinHierarchy() ? 1 : 0);
  }

  @Override
  public boolean hasFilter() {
    final MatchVariableConstraint variable = myTable.getMatchVariable();
    return variable != null && (!StringUtil.isEmpty(variable.getRegExp()) || variable.isWithinHierarchy());
  }

  @Override
  public void clearFilter() {
    final MatchVariableConstraint variable = myTable.getMatchVariable();
    if (variable == null) {
      return;
    }
    variable.setRegExp("");
    variable.setWholeWordsOnly(false);
    variable.setWithinHierarchy(false);
  }

  @Override
  public boolean isApplicable(List<? extends PsiElement> nodes, boolean completePattern, boolean target) {
    if (!(myTable.getVariable() instanceof MatchVariableConstraint)) {
      return false;
    }
    myShowHierarchy = isApplicableConstraint(UIUtil.TEXT_HIERARCHY, nodes, completePattern, target);
    return isApplicableConstraint(UIUtil.TEXT, nodes, completePattern, target);
  }

  @Override
  protected void setLabel(SimpleColoredComponent component) {
    final MatchVariableConstraint variable = myTable.getMatchVariable();
    if (variable == null) {
      return;
    }
    final String value = variable.isInvertRegExp() ? "!" + variable.getRegExp() : variable.getRegExp();
    myLabel.append(SSRBundle.message("text.0.label", value));
    if (variable.isWholeWordsOnly()) myLabel.append(SSRBundle.message("whole.words.label"), SimpleTextAttributes.GRAYED_ATTRIBUTES);
    if (variable.isWithinHierarchy()) myLabel.append(SSRBundle.message("within.hierarchy.label"), SimpleTextAttributes.GRAYED_ATTRIBUTES);
  }

  @Override
  public FilterEditor<MatchVariableConstraint> getEditor() {
    return new FilterEditor<>(myTable.getMatchVariable(), myTable.getConstraintChangedCallback()) {

      private final EditorTextField myTextField = UIUtil.createRegexComponent("", myTable.getProject());
      private final JCheckBox myHierarchyCheckBox = new JCheckBox(SSRBundle.message("within.type.hierarchy.check.box"), false);
      private final JLabel myTextLabel = new JLabel(SSRBundle.message("text.label"));
      private final ContextHelpLabel myHelpLabel = ContextHelpLabel.create(SSRBundle.message("text.filter.help.text"));

      @Override
      protected void layoutComponents() {
        final GroupLayout layout = new GroupLayout(this);
        setLayout(layout);
        layout.setAutoCreateContainerGaps(true);

        layout.setHorizontalGroup(
          layout.createParallelGroup()
            .addGroup(
              layout.createSequentialGroup()
                .addComponent(myTextLabel)
                .addComponent(myTextField)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 1, 1)
                .addComponent(myHelpLabel)
            )
            .addGroup(
              layout.createSequentialGroup()
                .addComponent(myHierarchyCheckBox)
            )
        );
        layout.setVerticalGroup(
          layout.createSequentialGroup()
            .addGroup(
              layout.createParallelGroup(GroupLayout.Alignment.CENTER)
                .addComponent(myTextLabel)
                .addComponent(myTextField)
                .addComponent(myHelpLabel)
            )
            .addGroup(
              layout.createParallelGroup(GroupLayout.Alignment.CENTER)
                .addComponent(myHierarchyCheckBox)
            )
        );
      }

      @Override
      protected void loadValues() {
        myTextField.setText((myConstraint.isInvertRegExp() ? "!" : "") + myConstraint.getRegExp());
        myHierarchyCheckBox.setSelected(myConstraint.isWithinHierarchy());
        myHierarchyCheckBox.setVisible(myShowHierarchy);
      }

      @Override
      public void saveValues() {
        final String text = myTextField.getText();
        if (text.startsWith("!")) {
          myConstraint.setRegExp(text.substring(1));
          myConstraint.setInvertRegExp(true);
        }
        else {
          myConstraint.setRegExp(text);
          myConstraint.setInvertRegExp(false);
        }
        myConstraint.setWholeWordsOnly(false);
        myConstraint.setWithinHierarchy(myHierarchyCheckBox.isSelected());
      }

      @Override
      public JComponent getPreferredFocusedComponent() {
        return myTextField;
      }

      @Override
      public JComponent[] getFocusableComponents() {
        return new JComponent[]{myTextField};
      }
    };
  }
}


text:
module BTCT
  class Quote
    attr_reader :price, :amount, :exchange

    def initialize(price, amount, exchange)
      @price, @amount, @exchange = price.to_f, amount.to_f, exchange
    end
  end
end


text:
from django.conf import settings
from django.contrib.redirects.middleware import RedirectFallbackMiddleware
from django.contrib.redirects.models import Redirect
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse, HttpResponseForbidden, HttpResponseRedirect
from django.test import TestCase, modify_settings, override_settings

@modify_settings(
    MIDDLEWARE={
        "append": "django.contrib.redirects.middleware.RedirectFallbackMiddleware"
    }
)
@override_settings(APPEND_SLASH=False, ROOT_URLCONF="redirects_tests.urls", SITE_ID=1)
class RedirectTests(TestCase):
    @classmethod
    def setUpTestData(cls):
        cls.site = Site.objects.get(pk=settings.SITE_ID)

    def test_model(self):
        r1 = Redirect.objects.create(
            site=self.site, old_path="/initial", new_path="/new_target"
        )
        self.assertEqual(str(r1), "/initial ---> /new_target")

    def test_redirect(self):
        Redirect.objects.create(
            site=self.site, old_path="/initial", new_path="/new_target"
        )
        response = self.client.get("/initial")
        self.assertRedirects(
            response, "/new_target", status_code=301, target_status_code=404
        )

    @override_settings(APPEND_SLASH=True)
    def test_redirect_with_append_slash(self):
        Redirect.objects.create(
            site=self.site, old_path="/initial/", new_path="/new_target/"
        )
        response = self.client.get("/initial")
        self.assertRedirects(
            response, "/new_target/", status_code=301, target_status_code=404
        )

    @override_settings(APPEND_SLASH=True)
    def test_redirect_with_append_slash_and_query_string(self):
        Redirect.objects.create(
            site=self.site, old_path="/initial/?foo", new_path="/new_target/"
        )
        response = self.client.get("/initial?foo")
        self.assertRedirects(
            response, "/new_target/", status_code=301, target_status_code=404
        )

    @override_settings(APPEND_SLASH=True)
    def test_redirect_not_found_with_append_slash(self):
        """
        Exercise the second Redirect.DoesNotExist branch in
        RedirectFallbackMiddleware.
        """
        response = self.client.get("/test")
        self.assertEqual(response.status_code, 404)

    def test_redirect_shortcircuits_non_404_response(self):
        """RedirectFallbackMiddleware short-circuits on non-404 requests."""
        response = self.client.get("/")
        self.assertEqual(response.status_code, 200)

    def test_response_gone(self):
        """When the redirect target is '', return a 410"""
        Redirect.objects.create(site=self.site, old_path="/initial", new_path="")
        response = self.client.get("/initial")
        self.assertEqual(response.status_code, 410)

    @modify_settings(INSTALLED_APPS={"remove": "django.contrib.sites"})
    def test_sites_not_installed(self):
        def get_response(request):
            return HttpResponse()

        msg = (
            "You cannot use RedirectFallbackMiddleware when "
            "django.contrib.sites is not installed."
        )
        with self.assertRaisesMessage(ImproperlyConfigured, msg):
            RedirectFallbackMiddleware(get_response)

class OverriddenRedirectFallbackMiddleware(RedirectFallbackMiddleware):
    # Use HTTP responses different from the defaults
    response_gone_class = HttpResponseForbidden
    response_redirect_class = HttpResponseRedirect

@modify_settings(
    MIDDLEWARE={"append": "redirects_tests.tests.OverriddenRedirectFallbackMiddleware"}
)
@override_settings(SITE_ID=1)
class OverriddenRedirectMiddlewareTests(TestCase):
    @classmethod
    def setUpTestData(cls):
        cls.site = Site.objects.get(pk=settings.SITE_ID)

    def test_response_gone_class(self):
        Redirect.objects.create(site=self.site, old_path="/initial/", new_path="")
        response = self.client.get("/initial/")
        self.assertEqual(response.status_code, 403)

    def test_response_redirect_class(self):
        Redirect.objects.create(
            site=self.site, old_path="/initial/", new_path="/new_target/"
        )
        response = self.client.get("/initial/")
        self.assertEqual(response.status_code, 302)