diff --git a/Dockerfile b/Dockerfile
index f0aebedbc..30564c217 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -31,7 +31,6 @@ COPY controllers/provider-azure/charts /controllers/provider-azure/charts
COPY controllers/provider-gcp/charts /controllers/provider-gcp/charts
COPY controllers/provider-openstack/charts /controllers/provider-openstack/charts
COPY controllers/provider-alicloud/charts /controllers/provider-alicloud/charts
-COPY controllers/provider-packet/charts /controllers/provider-packet/charts
COPY controllers/provider-vsphere/charts /controllers/provider-vsphere/charts
COPY --from=builder /go/bin/gardener-extension-hyper /gardener-extension-hyper
diff --git a/Makefile b/Makefile
index 89fe8806f..d9b3a0ddd 100644
--- a/Makefile
+++ b/Makefile
@@ -158,20 +158,6 @@ start-provider-alicloud:
--webhook-config-mode=$(WEBHOOK_CONFIG_MODE) \
$(WEBHOOK_PARAM)
-.PHONY: start-provider-packet
-start-provider-packet:
- @LEADER_ELECTION_NAMESPACE=garden GO111MODULE=on go run \
- -mod=vendor \
- -ldflags $(LD_FLAGS) \
- ./controllers/provider-packet/cmd/gardener-extension-provider-packet \
- --config-file=./controllers/provider-packet/example/00-componentconfig.yaml \
- --ignore-operation-annotation=$(IGNORE_OPERATION_ANNOTATION) \
- --leader-election=$(LEADER_ELECTION) \
- --webhook-config-server-host=0.0.0.0 \
- --webhook-config-server-port=8443 \
- --webhook-config-mode=$(WEBHOOK_CONFIG_MODE) \
- $(WEBHOOK_PARAM)
-
.PHONY: start-provider-vsphere
start-provider-vsphere:
@LEADER_ELECTION_NAMESPACE=garden GO111MODULE=on go run \
diff --git a/controllers/hyper/cmd/gardener-extension-hyper/app/app.go b/controllers/hyper/cmd/gardener-extension-hyper/app/app.go
index a5200ecdc..943d537cc 100644
--- a/controllers/hyper/cmd/gardener-extension-hyper/app/app.go
+++ b/controllers/hyper/cmd/gardener-extension-hyper/app/app.go
@@ -9,7 +9,6 @@ import (
providerazure "github.com/gardener/gardener-extensions/controllers/provider-azure/cmd/gardener-extension-provider-azure/app"
providergcp "github.com/gardener/gardener-extensions/controllers/provider-gcp/cmd/gardener-extension-provider-gcp/app"
provideropenstack "github.com/gardener/gardener-extensions/controllers/provider-openstack/cmd/gardener-extension-provider-openstack/app"
- providerpacket "github.com/gardener/gardener-extensions/controllers/provider-packet/cmd/gardener-extension-provider-packet/app"
providervsphere "github.com/gardener/gardener-extensions/controllers/provider-vsphere/cmd/gardener-extension-provider-vsphere/app"
"github.com/spf13/cobra"
@@ -27,7 +26,6 @@ func NewHyperCommand(ctx context.Context) *cobra.Command {
providergcp.NewControllerManagerCommand(ctx),
provideropenstack.NewControllerManagerCommand(ctx),
provideralicloud.NewControllerManagerCommand(ctx),
- providerpacket.NewControllerManagerCommand(ctx),
providervsphere.NewControllerManagerCommand(ctx),
validatoraws.NewValidatorCommand(ctx),
)
diff --git a/controllers/provider-packet/README.md b/controllers/provider-packet/README.md
deleted file mode 100644
index 7853f78de..000000000
--- a/controllers/provider-packet/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-# [Gardener Extension for Packet provider](https://gardener.cloud)
-
-[![CI Build status](https://concourse.ci.infra.gardener.cloud/api/v1/teams/gardener/pipelines/gardener-extensions-master/jobs/master-head-update-job/badge)](https://concourse.ci.infra.gardener.cloud/teams/gardener/pipelines/gardener-extensions-master/jobs/master-head-update-job)
-[![Go Report Card](https://goreportcard.com/badge/github.com/gardener/gardener-extensions/controllers/provider-packet)](https://goreportcard.com/report/github.com/gardener/gardener-extensions/controllers/provider-packet)
-
-Project Gardener implements the automated management and operation of [Kubernetes](https://kubernetes.io/) clusters as a service.
-Its main principle is to leverage Kubernetes concepts for all of its tasks.
-
-Recently, most of the vendor specific logic has been developed [in-tree](https://github.com/gardener/gardener).
-However, the project has grown to a size where it is very hard to extend, maintain, and test.
-With [GEP-1](https://github.com/gardener/gardener/blob/master/docs/proposals/01-extensibility.md) we have proposed how the architecture can be changed in a way to support external controllers that contain their very own vendor specifics.
-This way, we can keep Gardener core clean and independent.
-
-This controller implements Gardener's extension contract for the Packet provider.
-
-An example for a `ControllerRegistration` resource that can be used to register this controller to Gardener can be found [here](example/controller-registration.yaml).
-
-Please find more information regarding the extensibility concepts and a detailed proposal [here](https://github.com/gardener/gardener/blob/master/docs/proposals/01-extensibility.md).
-
-## Supported Kubernetes versions
-
-This extension controller supports the following Kubernetes versions:
-
-| Version | Support | Conformance test results |
-| --------------- | ----------- | ------------------------ |
-| Kubernetes 1.17 | unknown | N/A |
-| Kubernetes 1.16 | 1.16.0+ | N/A |
-| Kubernetes 1.15 | 1.15.0+ | N/A |
-| Kubernetes 1.14 | 1.14.0+ | N/A |
-| Kubernetes 1.13 | 1.13.0+ | N/A |
-| Kubernetes 1.12 | unsupported | N/A |
-| Kubernetes 1.11 | unsupported | N/A |
-| Kubernetes 1.10 | unsupported | N/A |
-
-Please take a look [here](https://github.com/gardener/gardener/blob/master/docs/usage/supported_k8s_versions.md) to see which versions are supported by Gardener in general.
-
-----
-
-## How to start using or developing this extension controller locally
-
-You can run the controller locally on your machine by executing `make start-provider-packet`.
-
-Static code checks and tests can be executed by running `VERIFY=true make all`. We are using Go modules for Golang package dependency management and [Ginkgo](https://github.com/onsi/ginkgo)/[Gomega](https://github.com/onsi/gomega) for testing.
-
-## Feedback and Support
-
-Feedback and contributions are always welcome. Please report bugs or suggestions as [GitHub issues](https://github.com/gardener/gardener-extensions/issues) or join our [Slack channel #gardener](https://kubernetes.slack.com/messages/gardener) (please invite yourself to the Kubernetes workspace [here](http://slack.k8s.io)).
-
-## Learn more!
-
-Please find further resources about out project here:
-
-* [Our landing page gardener.cloud](https://gardener.cloud/)
-* ["Gardener, the Kubernetes Botanist" blog on kubernetes.io](https://kubernetes.io/blog/2018/05/17/gardener/)
-* [GEP-1 (Gardener Enhancement Proposal) on extensibility](https://github.com/gardener/gardener/blob/master/docs/proposals/01-extensibility.md)
-* [GEP-4 (New `core.gardener.cloud/v1alpha1` API)](https://github.com/gardener/gardener/blob/master/docs/proposals/04-new-core-gardener-cloud-apis.md)
-* [Extension contract documentation](https://github.com/gardener/gardener/tree/master/docs/extensions)
-* [Gardener Extensions Golang library](https://godoc.org/github.com/gardener/gardener-extensions/pkg)
-* [Gardener API Reference](https://gardener.cloud/api-reference/)
diff --git a/controllers/provider-packet/charts/images.yaml b/controllers/provider-packet/charts/images.yaml
deleted file mode 100644
index 434a7a3e4..000000000
--- a/controllers/provider-packet/charts/images.yaml
+++ /dev/null
@@ -1,55 +0,0 @@
-images:
-- name: terraformer
- sourceRepository: github.com/gardener/terraformer
- repository: eu.gcr.io/gardener-project/gardener/terraformer
- tag: "0.18.0"
-- name: cloud-controller-manager
- sourceRepository: https://github.com/packethost/packet-ccm
- repository: docker.io/packethost/packet-ccm
- tag: "v1.0.0"
-- name: machine-controller-manager
- sourceRepository: github.com/gardener/machine-controller-manager
- repository: eu.gcr.io/gardener-project/gardener/machine-controller-manager
- tag: "v0.25.0"
-- name: csi-attacher
- sourceRepository: https://github.com/kubernetes-csi/external-attacher
- repository: quay.io/k8scsi/csi-attacher
- tag: v1.0.1
- runtimeVersion: 1.13.x
-- name: csi-attacher
- sourceRepository: https://github.com/kubernetes-csi/external-attacher
- repository: quay.io/k8scsi/csi-attacher
- tag: v1.1.0
- runtimeVersion: 1.14.x
-- name: csi-node-driver-registrar
- sourceRepository: https://github.com/kubernetes-csi/node-driver-registrar
- repository: quay.io/k8scsi/csi-node-driver-registrar
- tag: v1.0.1
- runtimeVersion: 1.13.x
-- name: csi-node-driver-registrar
- sourceRepository: https://github.com/kubernetes-csi/node-driver-registrar
- repository: quay.io/k8scsi/csi-node-driver-registrar
- tag: v1.1.0
- runtimeVersion: 1.14.x
-- name: csi-provisioner
- sourceRepository: https://github.com/kubernetes-csi/external-provisioner
- repository: quay.io/k8scsi/csi-provisioner
- tag: v1.0.1
- runtimeVersion: 1.13.x
-- name: csi-provisioner
- sourceRepository: https://github.com/kubernetes-csi/external-provisioner
- repository: quay.io/k8scsi/csi-provisioner
- tag: v1.1.0
- runtimeVersion: 1.14.x
-- name: packet-storage-interface
- sourceRepository: https://github.com/packethost/csi-packet
- repository: docker.io/packethost/csi-packet
- tag: "v1.0.0"
-- name: etcd-backup-restore
- sourceRepository: github.com/gardener/etcd-backup-restore
- repository: eu.gcr.io/gardener-project/gardener/etcdbrctl
- tag: "0.7.3"
-- name: metabot
- sourceRepository: https://github.com/packethost/metabot
- repository: packethost/metabot
- tag: "v1.0.0"
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/Chart.yaml b/controllers/provider-packet/charts/internal/machine-controller-manager/seed/Chart.yaml
deleted file mode 100644
index 20a7f72d2..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/Chart.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-apiVersion: v1
-description: Helm chart for needed resource for machine-controller-manager in control cluster
-name: machine-controller-manager
-version: 0.1.0
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/mcm-monitoring-dashboard.json b/controllers/provider-packet/charts/internal/machine-controller-manager/seed/mcm-monitoring-dashboard.json
deleted file mode 100644
index 7e7cd9106..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/mcm-monitoring-dashboard.json
+++ /dev/null
@@ -1,1175 +0,0 @@
-{
- "description": "Information about the operations of the Machine Controller Manager",
- "editable": false,
- "gnetId": null,
- "graphTooltip": 0,
- "id": 16,
- "iteration": 1564731005347,
- "links": [
- {
- "icon": "external link",
- "tags": [],
- "targetBlank": true,
- "title": "Machine Controller Manager",
- "tooltip": "",
- "type": "link",
- "url": "https://github.com/gardener/machine-controller-manager"
- }
- ],
- "panels": [
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "decimals": null,
- "description": "State of the managed machines.\n\n| Code | Machine State |\n|---|---|\n| 0 | Running |\n| 1 | Terminating |\n| 2 | Unknown |\n| 3 | Failed |\n| -1 | Available |\n| -2 | Pending |",
- "fill": 0,
- "gridPos": {
- "h": 7,
- "w": 24,
- "x": 0,
- "y": 0
- },
- "id": 5,
- "legend": {
- "alignAsTable": true,
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "rightSide": true,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 2,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "mcm_machine_current_status_phase",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "{{name}}",
- "refId": "A"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeRegions": [],
- "timeShift": null,
- "title": "Managed Machines States",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "decimals": null,
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": "3.2",
- "min": "-2.2",
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": false
- }
- ],
- "yaxis": {
- "align": false,
- "alignLevel": null
- }
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "description": "Shows the CPU usage of the Machine Controller Manager and shows the requests and limits.",
- "fill": 0,
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 0,
- "y": 7
- },
- "id": 13,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 2,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "sum(rate(container_cpu_usage_seconds_total{pod=~\"machine-controller-manager-(.+)\"}[5m])) by (pod)",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "Current ({{pod}})",
- "refId": "A"
- },
- {
- "expr": "sum(kube_pod_container_resource_limits_cpu_cores{pod=~\"machine-controller-manager-(.+)\"}) by (pod)",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "Limits ({{pod}})",
- "refId": "C"
- },
- {
- "expr": "sum(kube_pod_container_resource_requests_cpu_cores{pod=~\"machine-controller-manager-(.+)\"}) by (pod)",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "Requests ({{pod}})",
- "refId": "B"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeRegions": [],
- "timeShift": null,
- "title": "MCM CPU usage",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "decimals": null,
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": "0",
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ],
- "yaxis": {
- "align": false,
- "alignLevel": null
- }
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "description": "Shows the memory usage of the Machine Controller Manager.",
- "fill": 0,
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 12,
- "y": 7
- },
- "id": 11,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 2,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "sum(container_memory_working_set_bytes{pod=~\"machine-controller-manager-(.+)\"}) by (pod)",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "Current ({{pod}})",
- "refId": "A"
- },
- {
- "expr": "sum(kube_pod_container_resource_limits_memory_bytes{pod=~\"machine-controller-manager-(.+)\"}) by (pod)",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "Limits ({{pod}})",
- "refId": "B"
- },
- {
- "expr": "sum(kube_pod_container_resource_requests_memory_bytes{pod=~\"machine-controller-manager-(.+)\"}) by (pod)",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "Requests ({{pod}})",
- "refId": "C"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeRegions": [],
- "timeShift": null,
- "title": "MCM Memory Usage",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "bytes",
- "label": null,
- "logBase": 2,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "none",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": false
- }
- ],
- "yaxis": {
- "align": false,
- "alignLevel": null
- }
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "description": "Indicates if the Machine Controller Manager is frozen due to unreachable API server.\n\n0 = ok; 1= frozen",
- "fill": 0,
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 0,
- "y": 13
- },
- "id": 2,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 2,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 2,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "mcm_machine_controller_frozen",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "{{pod}}",
- "refId": "A"
- }
- ],
- "thresholds": [
- {
- "colorMode": "critical",
- "fill": true,
- "line": true,
- "op": "gt",
- "value": 0.5,
- "yaxis": "left"
- },
- {
- "colorMode": "ok",
- "fill": true,
- "line": true,
- "op": "lt",
- "value": 0.5,
- "yaxis": "left"
- }
- ],
- "timeFrom": null,
- "timeRegions": [],
- "timeShift": null,
- "title": "MCM Frozen Status (API Server reachable)",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "decimals": 0,
- "format": "short",
- "label": "",
- "logBase": 1,
- "max": "1.2",
- "min": "-0.2",
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ],
- "yaxis": {
- "align": false,
- "alignLevel": null
- }
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "decimals": null,
- "description": "Average per Second rate over 1m of IaaS provider api calls split by services. \n\nShows also the rate of failed iaas calls if at least one failed.",
- "fill": 0,
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 12,
- "y": 13
- },
- "id": 4,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 2,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "rate(mcm_cloud_api_requests_total[1m])",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "{{provider}} / {{service}} ({{pod}})",
- "refId": "A"
- },
- {
- "expr": "rate(mcm_cloud_api_requests_failed_total[1m])",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "Error: {{provider}} / {{service}} ({{pod}})",
- "refId": "B"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeRegions": [],
- "timeShift": null,
- "title": "IaaS API Calls",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "decimals": null,
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": "0",
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ],
- "yaxis": {
- "align": false,
- "alignLevel": null
- }
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "decimals": 0,
- "description": "The count of kubernetes resources managed by the Machine Controller Manager.",
- "fill": 0,
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 0,
- "y": 19
- },
- "id": 3,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 2,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "mcm_machine_items_total",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "machine(s)",
- "refId": "A"
- },
- {
- "expr": "mcm_machineset_items_total",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "machine set(s)",
- "refId": "B"
- },
- {
- "expr": "mcm_machinedeployment_items_total",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "machine deployment(s)",
- "refId": "C"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeRegions": [],
- "timeShift": null,
- "title": "Count of Managed Resouces",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "decimals": 0,
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": "0",
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ],
- "yaxis": {
- "align": false,
- "alignLevel": null
- }
- },
- {
- "collapsed": false,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 25
- },
- "id": 9,
- "panels": [],
- "title": "Control Loops",
- "type": "row"
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "description": "Average processing time of items in the workqueue.",
- "fill": 1,
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 0,
- "y": 26
- },
- "id": 19,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 2,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "${controlloop}_work_duration{quantile=\"0.5\"}",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "p50 ({{pod}})",
- "refId": "A"
- },
- {
- "expr": "${controlloop}_work_duration{quantile=\"0.9\"}",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "p90 ({{pod}})",
- "refId": "B"
- },
- {
- "expr": "${controlloop}_work_duration{quantile=\"0.99\"}",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "p99 ({{pod}})",
- "refId": "C"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeRegions": [],
- "timeShift": null,
- "title": "Workqueue item processing time: ${controlloop}",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "ms",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": false
- }
- ],
- "yaxis": {
- "align": false,
- "alignLevel": null
- }
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "description": "How long items stay in the workqueue before they get processed.",
- "fill": 1,
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 12,
- "y": 26
- },
- "id": 18,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 2,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "${controlloop}_queue_latency{quantile=\"0.5\"}",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "p50 ({{pod}})",
- "refId": "A"
- },
- {
- "expr": "${controlloop}_queue_latency{quantile=\"0.9\"}",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "p90 ({{pod}})",
- "refId": "B"
- },
- {
- "expr": "${controlloop}_queue_latency{quantile=\"0.99\"}",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "p99 ({{pod}})",
- "refId": "C"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeRegions": [],
- "timeShift": null,
- "title": "Workqueue item latency: ${controlloop}",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "ms",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": false
- }
- ],
- "yaxis": {
- "align": false,
- "alignLevel": null
- }
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "description": "Current amount of items in the workqueue.",
- "fill": 1,
- "gridPos": {
- "h": 6,
- "w": 8,
- "x": 0,
- "y": 33
- },
- "id": 16,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 2,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "${controlloop}_depth",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "${controlloop} ({{pod}})",
- "refId": "A"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeRegions": [],
- "timeShift": null,
- "title": "Items in Workqueue: ${controlloop}",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": false
- }
- ],
- "yaxis": {
- "align": false,
- "alignLevel": null
- }
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "description": "Average per second rate over 5m of workqueue item adds.",
- "fill": 1,
- "gridPos": {
- "h": 6,
- "w": 8,
- "x": 8,
- "y": 33
- },
- "id": 7,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 2,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "rate(${controlloop}_adds[5m])",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "${controlloop} ({{pod}})",
- "refId": "A"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeRegions": [],
- "timeShift": null,
- "title": "Adds to Workqueue: ${controlloop}",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": false
- }
- ],
- "yaxis": {
- "align": false,
- "alignLevel": null
- }
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "description": "Average per second rate over 5m of workqueue item retries.",
- "fill": 1,
- "gridPos": {
- "h": 6,
- "w": 8,
- "x": 16,
- "y": 33
- },
- "id": 17,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": false,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 2,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "rate(${controlloop}_retries[5m])",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "${controlloop} ({{pod}})",
- "refId": "A"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeRegions": [],
- "timeShift": null,
- "title": "Workqueue item retries: ${controlloop}",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": false
- }
- ],
- "yaxis": {
- "align": false,
- "alignLevel": null
- }
- }
- ],
- "refresh": "30s",
- "schemaVersion": 18,
- "style": "dark",
- "tags": [
- "controlplane",
- "seed"
- ],
- "templating": {
- "list": [
- {
- "allValue": null,
- "current": {
- "tags": [],
- "text": "machine",
- "value": "machine"
- },
- "hide": 0,
- "includeAll": false,
- "label": "Control Loop",
- "multi": false,
- "name": "controlloop",
- "options": [
- {
- "selected": true,
- "text": "machine",
- "value": "machine"
- },
- {
- "selected": false,
- "text": "machineset",
- "value": "machineset"
- },
- {
- "selected": false,
- "text": "machinedeployment",
- "value": "machinedeployment"
- },
- {
- "selected": false,
- "text": "node",
- "value": "node"
- },
- {
- "selected": false,
- "text": "secret",
- "value": "secret"
- },
- {
- "selected": false,
- "text": "machinesafetyapiserver",
- "value": "machinesafetyapiserver"
- },
- {
- "selected": false,
- "text": "machinesafetyorphanvms",
- "value": "machinesafetyorphanvms"
- },
- {
- "selected": false,
- "text": "machinesafetyovershooting",
- "value": "machinesafetyovershooting"
- }
- ],
- "query": "machine, machineset, machinedeployment, node, secret, machinesafetyapiserver, machinesafetyorphanvms, machinesafetyovershooting",
- "skipUrlSync": false,
- "type": "custom"
- }
- ]
- },
- "time": {
- "from": "now-3h",
- "to": "now"
- },
- "timepicker": {
- "refresh_intervals": [
- "5s",
- "10s",
- "30s",
- "1m",
- "5m",
- "15m",
- "30m",
- "1h",
- "2h",
- "1d"
- ],
- "time_options": [
- "5m",
- "15m",
- "1h",
- "6h",
- "12h",
- "24h",
- "2d",
- "7d",
- "14d"
- ]
- },
- "timezone": "browser",
- "title": "Machine Controller Manager",
- "uid": "machine-controller-manager",
- "version": 1
-}
\ No newline at end of file
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/clusterrole.yaml b/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/clusterrole.yaml
deleted file mode 100644
index eccb92fe1..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/clusterrole.yaml
+++ /dev/null
@@ -1,28 +0,0 @@
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
- name: extensions.gardener.cloud:{{ .Values.providerName }}:{{ .Release.Namespace }}:machine-controller-manager
- ownerReferences:
- - apiVersion: v1
- kind: Namespace
- name: {{ .Release.Namespace }}
- uid: {{ .Values.namespace.uid }}
- controller: true
- blockOwnerDeletion: true
-rules:
-- apiGroups:
- - machine.sapcloud.io
- resources:
- - "*"
- verbs:
- - "*"
-- apiGroups:
- - ""
- resources:
- - configmaps
- - secrets
- - endpoints
- - events
- verbs:
- - "*"
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/clusterrolebinding.yaml b/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/clusterrolebinding.yaml
deleted file mode 100644
index bc3368ebf..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/clusterrolebinding.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- name: extensions.gardener.cloud:{{ .Values.providerName }}:{{ .Release.Namespace }}:machine-controller-manager
- ownerReferences:
- - apiVersion: v1
- kind: Namespace
- name: {{ .Release.Namespace }}
- uid: {{ .Values.namespace.uid }}
- controller: true
- blockOwnerDeletion: true
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: extensions.gardener.cloud:{{ .Values.providerName }}:{{ .Release.Namespace }}:machine-controller-manager
-subjects:
-- kind: ServiceAccount
- name: machine-controller-manager
- namespace: {{ .Release.Namespace }}
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/configmap-monitoring.yaml b/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/configmap-monitoring.yaml
deleted file mode 100644
index 425a980d4..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/configmap-monitoring.yaml
+++ /dev/null
@@ -1,51 +0,0 @@
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: machine-controller-manager-monitoring-config
- namespace: {{ .Release.Namespace }}
- labels:
- extensions.gardener.cloud/configuration: monitoring
-data:
- scrape_config: |
- - job_name: machine-controller-manager
- honor_labels: false
- kubernetes_sd_configs:
- - role: endpoints
- namespaces:
- names: [{{ .Release.Namespace }}]
- relabel_configs:
- - source_labels:
- - __meta_kubernetes_service_name
- - __meta_kubernetes_endpoint_port_name
- action: keep
- regex: machine-controller-manager;metrics
- # common metrics
- - action: labelmap
- regex: __meta_kubernetes_service_label_(.+)
- - source_labels: [ __meta_kubernetes_pod_name ]
- target_label: pod
- metric_relabel_configs:
- - source_labels: [ __name__ ]
- regex: ^(mcm_cloud_api_requests_failed_total|mcm_cloud_api_requests_total|mcm_machine_controller_frozen|mcm_machine_current_status_phase|mcm_machine_deployment_failed_machines|mcm_machine_items_total|mcm_machine_set_failed_machines|mcm_machinedeployment_items_total|mcm_machineset_items_total|mcm_scrape_failure_total|machine_adds|machine_depth|machine_queue_latency|machine_retries|machine_work_duration|machinedeployment_adds|machinedeployment_depth|machinedeployment_queue_latency|machinedeployment_retries|machinedeployment_work_duration|machinesafetyapiserver_adds|machinesafetyapiserver_depth|machinesafetyapiserver_queue_latency|machinesafetyapiserver_retries|machinesafetyapiserver_work_duration|machinesafetyorphanvms_adds|machinesafetyorphanvms_depth|machinesafetyorphanvms_queue_latency|machinesafetyorphanvms_retries|machinesafetyorphanvms_work_duration|machinesafetyovershooting_adds|machinesafetyovershooting_depth|machinesafetyovershooting_latency|machinesafetyovershooting_retries|machinesafetyovershooting_work_duration|machineset_adds|machineset_depth|machineset_queue_latency|machineset_retries|machineset_work_duration|node_adds|node_depth|node_queue_latency|node_retries|node_work_duration|secret_adds|secret_depth|secret_queue_latency|secret_retries|secret_work_duration|process_max_fds|process_open_fds)$
- action: keep
-
- alerting_rules: |
- machine-controller-manager.rules.yaml: |
- groups:
- - name: machine-controller-manager.rules
- rules:
- - alert: MachineControllerManagerDown
- expr: absent(up{job="machine-controller-manager"} == 1)
- for: 15m
- labels:
- service: machine-controller-manager
- severity: critical
- type: seed
- visibility: operator
- annotations:
- description: There are no running machine controller manager instances. No shoot nodes can be created/maintained.
- summary: Machine controller manager is down.
-
- dashboard_operators: |
- machine-controller-manager-dashboard.json: |-
-{{ .Files.Get "mcm-monitoring-dashboard.json" | indent 6 }}
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/deployment.yaml b/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/deployment.yaml
deleted file mode 100644
index ea0262169..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/deployment.yaml
+++ /dev/null
@@ -1,86 +0,0 @@
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: machine-controller-manager
- namespace: {{ .Release.Namespace }}
- labels:
- garden.sapcloud.io/role: controlplane
- app: kubernetes
- role: machine-controller-manager
-spec:
- revisionHistoryLimit: 0
- replicas: {{ .Values.replicas }}
- selector:
- matchLabels:
- app: kubernetes
- role: machine-controller-manager
- template:
- metadata:
- annotations:
- scheduler.alpha.kubernetes.io/critical-pod: ''
-{{- if .Values.podAnnotations }}
-{{ toYaml .Values.podAnnotations | indent 8 }}
-{{- end }}
- labels:
- garden.sapcloud.io/role: controlplane
- app: kubernetes
- role: machine-controller-manager
- networking.gardener.cloud/to-dns: allowed
- networking.gardener.cloud/to-public-networks: allowed
- networking.gardener.cloud/to-private-networks: allowed
- networking.gardener.cloud/to-seed-apiserver: allowed
- networking.gardener.cloud/to-shoot-apiserver: allowed
- networking.gardener.cloud/from-prometheus: allowed
- spec:
- serviceAccountName: machine-controller-manager
- terminationGracePeriodSeconds: 5
- containers:
- - name: packet-machine-controller-manager
- image: {{ index .Values.images "machine-controller-manager" }}
- imagePullPolicy: IfNotPresent
- command:
- - ./machine-controller-manager
- - --control-kubeconfig=inClusterConfig
- - --target-kubeconfig=/var/lib/machine-controller-manager/kubeconfig
- - --namespace={{ .Release.Namespace }}
- - --port={{ .Values.metricsPort }}
- - --machine-creation-timeout=20m
- - --machine-drain-timeout=2h
- - --machine-health-timeout=10m
- - --machine-safety-apiserver-statuscheck-timeout=30s
- - --machine-safety-apiserver-statuscheck-period=1m
- - --machine-safety-orphan-vms-period=30m
- - --machine-safety-overshooting-period=1m
- - --safety-up=2
- - --safety-down=1
- - --v=3
- livenessProbe:
- failureThreshold: 3
- httpGet:
- path: /healthz
- port: {{ .Values.metricsPort }}
- scheme: HTTP
- initialDelaySeconds: 30
- periodSeconds: 10
- successThreshold: 1
- timeoutSeconds: 5
- ports:
- - name: metrics
- containerPort: {{ .Values.metricsPort }}
- protocol: TCP
- resources:
- requests:
- cpu: 50m
- memory: 64Mi
- limits:
- cpu: 350m
- memory: 256Mi
- volumeMounts:
- - mountPath: /var/lib/machine-controller-manager
- name: machine-controller-manager
- readOnly: true
- volumes:
- - name: machine-controller-manager
- secret:
- secretName: machine-controller-manager
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/service.yaml b/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/service.yaml
deleted file mode 100644
index d1f2116c2..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/service.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-apiVersion: v1
-kind: Service
-metadata:
- name: machine-controller-manager
- namespace: {{ .Release.Namespace }}
- labels:
- app: kubernetes
- role: machine-controller-manager
-spec:
- type: ClusterIP
- clusterIP: None
- ports:
- - name: metrics
- port: {{ .Values.metricsPort }}
- protocol: TCP
- selector:
- app: kubernetes
- role: machine-controller-manager
\ No newline at end of file
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/serviceaccount.yaml b/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/serviceaccount.yaml
deleted file mode 100644
index 6f14e5bfb..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/serviceaccount.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-apiVersion: v1
-kind: ServiceAccount
-metadata:
- name: machine-controller-manager
- namespace: {{ .Release.Namespace }}
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/vpa.yaml b/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/vpa.yaml
deleted file mode 100644
index 4f89a4c50..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/templates/vpa.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-{{- if .Values.vpa.enabled }}
-apiVersion: autoscaling.k8s.io/v1beta2
-kind: VerticalPodAutoscaler
-metadata:
- name: machine-controller-manager-vpa
- namespace: {{ .Release.Namespace }}
-spec:
- targetRef:
- apiVersion: apps/v1
- kind: Deployment
- name: machine-controller-manager
- updatePolicy:
- updateMode: {{ .Values.vpa.updatePolicy.updateMode | quote }}
-{{- end }}
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/values.yaml b/controllers/provider-packet/charts/internal/machine-controller-manager/seed/values.yaml
deleted file mode 100644
index 4fa079e27..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/seed/values.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-images:
- machine-controller-manager: image-repository:image-tag
-
-replicas: 1
-
-podAnnotations: {}
-
-providerName: provider-foo
-
-namespace:
- uid: uuid-of-namespace
-
-metricsPort: 10258
-
-vpa:
- enabled: true
- updatePolicy:
- updateMode: "Auto"
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/Chart.yaml b/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/Chart.yaml
deleted file mode 100644
index 8a921ab3f..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/Chart.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-apiVersion: v1
-description: Helm chart for needed resource for machine-controller-manager in target cluster
-name: machine-controller-manager
-version: 0.1.0
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/templates/clusterrole-machine-controller-manager.yaml b/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/templates/clusterrole-machine-controller-manager.yaml
deleted file mode 100644
index 2e3d2b928..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/templates/clusterrole-machine-controller-manager.yaml
+++ /dev/null
@@ -1,61 +0,0 @@
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
- name: extensions.gardener.cloud:{{ .Values.providerName }}:machine-controller-manager
-rules:
-- apiGroups:
- - ""
- resources:
- - nodes
- - endpoints
- - replicationcontrollers
- - pods
- - persistentvolumes
- - persistentvolumeclaims
- verbs:
- - create
- - delete
- - deletecollection
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - ""
- resources:
- - pods/eviction
- verbs:
- - create
-- apiGroups:
- - extensions
- - apps
- resources:
- - replicasets
- - statefulsets
- - daemonsets
- - deployments
- verbs:
- - create
- - delete
- - deletecollection
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - batch
- resources:
- - jobs
- - cronjobs
- verbs:
- - create
- - delete
- - deletecollection
- - get
- - list
- - patch
- - update
- - watch
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/templates/clusterrolebinding-machine-controller-manager.yaml b/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/templates/clusterrolebinding-machine-controller-manager.yaml
deleted file mode 100644
index 5c57687ad..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/templates/clusterrolebinding-machine-controller-manager.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- name: extensions.gardener.cloud:{{ .Values.providerName }}:machine-controller-manager
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: extensions.gardener.cloud:{{ .Values.providerName }}:machine-controller-manager
-subjects:
-- kind: User
- name: system:machine-controller-manager
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/templates/role-machine-controller-manager.yaml b/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/templates/role-machine-controller-manager.yaml
deleted file mode 100644
index 1691bcfd9..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/templates/role-machine-controller-manager.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-apiVersion: rbac.authorization.k8s.io/v1
-kind: Role
-metadata:
- namespace: kube-system
- name: extensions.gardener.cloud:{{ .Values.providerName }}:machine-controller-manager
-rules:
-- apiGroups:
- - ""
- resources:
- - secrets
- verbs:
- - create
- - delete
- - get
- - list
\ No newline at end of file
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/templates/rolebinding-machine-controller-manager.yaml b/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/templates/rolebinding-machine-controller-manager.yaml
deleted file mode 100644
index 979f3c60a..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/templates/rolebinding-machine-controller-manager.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: RoleBinding
-metadata:
- name: extensions.gardener.cloud:{{ .Values.providerName }}:machine-controller-manager
- namespace: kube-system
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: Role
- name: extensions.gardener.cloud:{{ .Values.providerName }}:machine-controller-manager
-subjects:
-- kind: User
- name: system:machine-controller-manager
\ No newline at end of file
diff --git a/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/values.yaml b/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/values.yaml
deleted file mode 100644
index 7bc5d27da..000000000
--- a/controllers/provider-packet/charts/internal/machine-controller-manager/shoot/values.yaml
+++ /dev/null
@@ -1 +0,0 @@
-providerName: provider-foo
diff --git a/controllers/provider-packet/charts/internal/machineclass/Chart.yaml b/controllers/provider-packet/charts/internal/machineclass/Chart.yaml
deleted file mode 100644
index 042789c28..000000000
--- a/controllers/provider-packet/charts/internal/machineclass/Chart.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-apiVersion: v1
-description: A Helm chart for PacketMachineClasses controlled by the machine-controller-manager in the shoot cluster
-name: machineclass
-version: 0.1.0
diff --git a/controllers/provider-packet/charts/internal/machineclass/templates/machineclass.yaml b/controllers/provider-packet/charts/internal/machineclass/templates/machineclass.yaml
deleted file mode 100644
index c358780df..000000000
--- a/controllers/provider-packet/charts/internal/machineclass/templates/machineclass.yaml
+++ /dev/null
@@ -1,42 +0,0 @@
-{{- range $index, $machineClass := .Values.machineClasses }}
----
-apiVersion: v1
-kind: Secret
-metadata:
- name: {{ $machineClass.name }}
- namespace: {{ $.Release.Namespace }}
-{{- if $machineClass.labels }}
- labels:
-{{ toYaml $machineClass.labels | indent 4 }}
-{{- end }}
-type: Opaque
-data:
- userData: {{ $machineClass.secret.cloudConfig | b64enc }}
- apiToken: {{ $machineClass.secret.apiToken | b64enc }}
----
-apiVersion: machine.sapcloud.io/v1alpha1
-kind: PacketMachineClass
-metadata:
- name: {{ $machineClass.name }}
- namespace: {{ $.Release.Namespace }}
-spec:
- projectID: {{ $machineClass.projectID }}
- OS: {{ $machineClass.OS }}
- billingCycle: {{ $machineClass.billingCycle }}
- machineType: {{ $machineClass.machineType }}
- sshKeys:
-{{ toYaml $machineClass.sshKeys | indent 4 }}
-{{- if $machineClass.metadata }}
- metadata:
-{{ toYaml $machineClass.metadata | indent 2 }}
-{{- end }}
- secretRef:
- name: {{ $machineClass.name }}
- namespace: {{ $.Release.Namespace }}
-{{- if $machineClass.tags }}
- tags:
-{{ toYaml $machineClass.tags | indent 4 }}
-{{- end }}
- facility:
-{{ toYaml $machineClass.facility | indent 2 }}
-{{- end }}
diff --git a/controllers/provider-packet/charts/internal/machineclass/values.yaml b/controllers/provider-packet/charts/internal/machineclass/values.yaml
deleted file mode 100644
index 64d110937..000000000
--- a/controllers/provider-packet/charts/internal/machineclass/values.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-machineClasses:
-- name: class-1
-# labels:
-# foo: bar
- projectID: abcd-1234-fff
- OS: alpine_3
- billingCycle: hourly
- facility:
- - ewr1
- description: An optional description for machines created by that class.
- machineType: t1.small
- sshKeys:
- - 12345-abcd567-aaf2
- secret:
- cloudConfig: abc
- apiToken: "abd5678"
- tags:
- - kubernetes.io/cluster/foo
- - kubernetes.io/role/node
diff --git a/controllers/provider-packet/charts/internal/packet-infra/Chart.yaml b/controllers/provider-packet/charts/internal/packet-infra/Chart.yaml
deleted file mode 100644
index 9fa169f05..000000000
--- a/controllers/provider-packet/charts/internal/packet-infra/Chart.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-apiVersion: v1
-description: Packet chart for main k8s infrastructure
-name: packet-infra
-version: 0.1.0
diff --git a/controllers/provider-packet/charts/internal/packet-infra/templates/main.tf b/controllers/provider-packet/charts/internal/packet-infra/templates/main.tf
deleted file mode 100644
index 5e450460d..000000000
--- a/controllers/provider-packet/charts/internal/packet-infra/templates/main.tf
+++ /dev/null
@@ -1,18 +0,0 @@
-provider "packet" {
- auth_token = "${var.PACKET_API_KEY}"
-}
-
-// Deploy a new ssh key
-resource "packet_project_ssh_key" "publickey" {
- name = "{{ required "clusterName is required" .Values.clusterName }}-ssh-publickey"
- public_key = "{{ required "sshPublicKey is required" .Values.sshPublicKey }}"
- project_id = "{{ required "packet.projectID is required" .Values.packet.projectID }}"
-}
-
-//=====================================================================
-//= Output variables
-//=====================================================================
-
-output "{{ .Values.outputKeys.sshKeyID }}" {
- value = "${packet_project_ssh_key.publickey.id}"
-}
diff --git a/controllers/provider-packet/charts/internal/packet-infra/templates/terraform.tfvars b/controllers/provider-packet/charts/internal/packet-infra/templates/terraform.tfvars
deleted file mode 100644
index 3bbf15f00..000000000
--- a/controllers/provider-packet/charts/internal/packet-infra/templates/terraform.tfvars
+++ /dev/null
@@ -1 +0,0 @@
-# New line is needed! Do not remove this comment.
\ No newline at end of file
diff --git a/controllers/provider-packet/charts/internal/packet-infra/templates/variables.tf b/controllers/provider-packet/charts/internal/packet-infra/templates/variables.tf
deleted file mode 100644
index 3a672e686..000000000
--- a/controllers/provider-packet/charts/internal/packet-infra/templates/variables.tf
+++ /dev/null
@@ -1,4 +0,0 @@
-variable "PACKET_API_KEY" {
- description = "Packet API Key"
- type = "string"
-}
diff --git a/controllers/provider-packet/charts/internal/packet-infra/values.yaml b/controllers/provider-packet/charts/internal/packet-infra/values.yaml
deleted file mode 100644
index b64cad626..000000000
--- a/controllers/provider-packet/charts/internal/packet-infra/values.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-packet:
- projectID: abcd-5678
-
-sshPublicKey: sshkey-12345
-clusterName: test-namespace
-
-outputKeys:
- sshKeyID: key_pair_id
diff --git a/controllers/provider-packet/charts/internal/seed-controlplane/Chart.yaml b/controllers/provider-packet/charts/internal/seed-controlplane/Chart.yaml
deleted file mode 100644
index cbddad666..000000000
--- a/controllers/provider-packet/charts/internal/seed-controlplane/Chart.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-apiVersion: v1
-description: An umbrella chart for control plane resources in the Seed cluster
-name: seed-controlplane
-version: 0.1.0
diff --git a/controllers/provider-packet/charts/internal/seed-controlplane/charts/csi-packet/Chart.yaml b/controllers/provider-packet/charts/internal/seed-controlplane/charts/csi-packet/Chart.yaml
deleted file mode 100644
index f9c0e2b29..000000000
--- a/controllers/provider-packet/charts/internal/seed-controlplane/charts/csi-packet/Chart.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-apiVersion: v1
-description: Helm chart for kubernetes CSI components including external-attacher, external-provisioner, packet-csi-plugin-controller-service
-name: csi-packet
-version: 1.0.0
diff --git a/controllers/provider-packet/charts/internal/seed-controlplane/charts/csi-packet/templates/controller.yaml b/controllers/provider-packet/charts/internal/seed-controlplane/charts/csi-packet/templates/controller.yaml
deleted file mode 100644
index 4d1ba046d..000000000
--- a/controllers/provider-packet/charts/internal/seed-controlplane/charts/csi-packet/templates/controller.yaml
+++ /dev/null
@@ -1,120 +0,0 @@
-kind: Service
-apiVersion: v1
-metadata:
- name: csi-packet-pd
- namespace: {{ .Release.Namespace }}
- labels:
- app: csi-packet-pd
-spec:
- selector:
- app: csi-packet-pd
- ports:
- - name: dummy
- port: 12345
-
----
-
-kind: StatefulSet
-apiVersion: apps/v1
-metadata:
- name: csi-packet-controller
- namespace: {{ .Release.Namespace }}
- labels:
-spec:
- updateStrategy:
- type: RollingUpdate
- rollingUpdate:
- partition: 0
- serviceName: csi-packet-pd
- replicas: {{ .Values.replicas }}
- selector:
- matchLabels:
- app: csi-packet-pd-driver
- template:
- metadata:
-{{- if .Values.podAnnotations }}
- annotations:
-{{ toYaml .Values.podAnnotations | indent 8 }}
-{{- end }}
- labels:
- app: csi-packet-pd-driver
- spec:
- containers:
- - name: csi-external-provisioner
- imagePullPolicy: IfNotPresent
- image: {{ index .Values.images "csi-provisioner" }}
- args:
- - "--v=5"
- - "--provisioner=net.packet.csi"
- - "--csi-address=$(ADDRESS)"
- - "--kubeconfig=/var/lib/csi-provisioner/kubeconfig"
- env:
- - name: ADDRESS
- value: /csi/csi.sock
-{{- if .Values.provisionerResources }}
- resources:
-{{ toYaml .Values.provisionerResources | indent 12 }}
-{{- end }}
- volumeMounts:
- - name: socket-dir
- mountPath: /var/lib/kubelet/plugins/csi.packet.com
- - name: csi-provisioner
- mountPath: /var/lib/csi-provisioner
- - name: csi-attacher
- imagePullPolicy: IfNotPresent
- image: {{ index .Values.images "csi-attacher" }}
- args:
- - "--v=5"
- - "--csi-address=$(ADDRESS)"
- - "--kubeconfig=/var/lib/csi-attacher/kubeconfig"
- env:
- - name: ADDRESS
- value: /var/lib/kubelet/plugins/csi.packet.com/csi.sock
-{{- if .Values.attacherResources }}
- resources:
-{{ toYaml .Values.attacherResources | indent 12 }}
-{{- end }}
- volumeMounts:
- - name: csi-attacher
- mountPath: /var/lib/csi-attacher
- - name: socket-dir
- mountPath: /var/lib/kubelet/plugins/csi.packet.com
- - name: packet-driver
- imagePullPolicy: IfNotPresent
- image: {{ index .Values.images "packet-storage-interface" }}
- args:
- - "--endpoint=$(CSI_ENDPOINT)"
- - "--nodeid=$(KUBE_NODE_NAME)"
- env:
- - name: CSI_ENDPOINT
- value: unix://var/lib/kubelet/plugins/csi.packet.com/csi.sock
- - name: KUBE_NODE_NAME
- valueFrom:
- fieldRef:
- fieldPath: spec.nodeName
- - name: PACKET_AUTH_TOKEN
- valueFrom:
- secretKeyRef:
- name: cloudprovider
- key: apiToken
- - name: PACKET_PROJECT_ID
- valueFrom:
- secretKeyRef:
- name: cloudprovider
- key: projectID
-{{- if .Values.diskpluginResources }}
- resources:
-{{ toYaml .Values.diskpluginResources | indent 12 }}
-{{- end }}
- volumeMounts:
- - name: socket-dir
- mountPath: /var/lib/kubelet/plugins/csi.packet.com
- volumes:
- - name: socket-dir
- emptyDir: {}
- - name: csi-attacher
- secret:
- secretName: csi-attacher
- - name: csi-provisioner
- secret:
- secretName: csi-provisioner
diff --git a/controllers/provider-packet/charts/internal/seed-controlplane/charts/csi-packet/values.yaml b/controllers/provider-packet/charts/internal/seed-controlplane/charts/csi-packet/values.yaml
deleted file mode 100644
index 192be3b93..000000000
--- a/controllers/provider-packet/charts/internal/seed-controlplane/charts/csi-packet/values.yaml
+++ /dev/null
@@ -1,28 +0,0 @@
-images:
- csi-attacher: image-repository:image-tag
- csi-provisioner: image-repository:image-tag
- packet-storage-interface: image-repository:image-tag
-podAnnotations: {}
-replicas: 1
-attacherResources:
- requests:
- cpu: 10m
- memory: 32Mi
- limits:
- cpu: 30m
- memory: 50Mi
-provisionerResources:
- requests:
- cpu: 10m
- memory: 32Mi
- limits:
- cpu: 30m
- memory: 50Mi
-diskpluginResources:
- requests:
- cpu: 20m
- memory: 50Mi
- limits:
- cpu: 50m
- memory: 80Mi
-kubernetesVersion: v1.13.0
diff --git a/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/Chart.yaml b/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/Chart.yaml
deleted file mode 100644
index 36e6fb206..000000000
--- a/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/Chart.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-apiVersion: v1
-description: Helm chart for cloud-controller-manager
-name: packet-cloud-controller-manager
-version: 0.1.0
diff --git a/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/ccm-monitoring-dashboard.json b/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/ccm-monitoring-dashboard.json
deleted file mode 100644
index 89ea38f1f..000000000
--- a/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/ccm-monitoring-dashboard.json
+++ /dev/null
@@ -1,418 +0,0 @@
-{
- "annotations": {
- "list": []
- },
- "editable": true,
- "gnetId": null,
- "graphTooltip": 0,
- "id": 17,
- "links": [],
- "panels": [
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "description": "Shows the memory usage of the cloud-controller-manager.",
- "fill": 0,
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 0,
- "y": 0
- },
- "id": 6,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 2,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "container_memory_working_set_bytes{pod=~\"cloud-controller-manager-(.+)\"}",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "current",
- "refId": "A"
- },
- {
- "expr": "kube_pod_container_resource_limits_memory_bytes{pod=~\"cloud-controller-manager-(.+)\"}",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "limits",
- "refId": "B"
- },
- {
- "expr": "kube_pod_container_resource_requests_memory_bytes{pod=~\"cloud-controller-manager-(.+)\"}",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "requests",
- "refId": "C"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeRegions": [],
- "timeShift": null,
- "title": "Cloud-controller-manager Memory Usage",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "bytes",
- "label": null,
- "logBase": 2,
- "max": null,
- "min": null,
- "show": true
- },
- {
- "format": "none",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": false
- }
- ],
- "yaxis": {
- "align": false,
- "alignLevel": null
- }
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "description": "Shows the CPU usage of the cloud-controller-manager and shows the requests and limits.",
- "fill": 0,
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 12,
- "y": 0
- },
- "id": 4,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 2,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "rate(container_cpu_usage_seconds_total{pod=~\"cloud-controller-manager-(.+)\"}[5m])",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "current",
- "refId": "A"
- },
- {
- "expr": "kube_pod_container_resource_limits_cpu_cores{pod=~\"cloud-controller-manager-(.+)\"}",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "limits",
- "refId": "C"
- },
- {
- "expr": "kube_pod_container_resource_requests_cpu_cores{pod=~\"cloud-controller-manager-(.+)\"}",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "requests",
- "refId": "B"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeRegions": [],
- "timeShift": null,
- "title": "Cloud-controller-manager CPU usage",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": "0",
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": true
- }
- ],
- "yaxis": {
- "align": false,
- "alignLevel": null
- }
- },
- {
- "aliasColors": {},
- "bars": false,
- "dashLength": 10,
- "dashes": false,
- "description": "The average http request rate of the last 5m executed by the Cloud Controller Manager to the cluster API server. The request are split by their response status codes.",
- "fill": 1,
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 0,
- "y": 6
- },
- "id": 8,
- "legend": {
- "avg": false,
- "current": false,
- "max": false,
- "min": false,
- "show": true,
- "total": false,
- "values": false
- },
- "lines": true,
- "linewidth": 1,
- "links": [],
- "nullPointMode": "null",
- "percentage": false,
- "pointradius": 2,
- "points": false,
- "renderer": "flot",
- "seriesOverrides": [],
- "spaceLength": 10,
- "stack": false,
- "steppedLine": false,
- "targets": [
- {
- "expr": "sum(rate(rest_client_requests_total{host=~\".*kube-apiserver.*\", job=\"cloud-controller-manager\"}[5m])) by(code)",
- "format": "time_series",
- "intervalFactor": 1,
- "legendFormat": "{{code}}",
- "refId": "A"
- }
- ],
- "thresholds": [],
- "timeFrom": null,
- "timeRegions": [],
- "timeShift": null,
- "title": "Request Rate to Kube API",
- "tooltip": {
- "shared": true,
- "sort": 0,
- "value_type": "individual"
- },
- "type": "graph",
- "xaxis": {
- "buckets": null,
- "mode": "time",
- "name": null,
- "show": true,
- "values": []
- },
- "yaxes": [
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": "0",
- "show": true
- },
- {
- "format": "short",
- "label": null,
- "logBase": 1,
- "max": null,
- "min": null,
- "show": false
- }
- ],
- "yaxis": {
- "align": false,
- "alignLevel": null
- }
- },
- {
- "cacheTimeout": null,
- "colorBackground": false,
- "colorValue": false,
- "colors": [
- "rgba(245, 54, 54, 0.9)",
- "rgba(237, 129, 40, 0.89)",
- "rgba(50, 172, 45, 0.97)"
- ],
- "datasource": "prometheus",
- "description": "Current uptime status of the cloud controller managers.",
- "editable": false,
- "format": "percent",
- "gauge": {
- "maxValue": 100,
- "minValue": 0,
- "show": true,
- "thresholdLabels": false,
- "thresholdMarkers": true
- },
- "gridPos": {
- "h": 6,
- "w": 5,
- "x": 12,
- "y": 6
- },
- "hideTimeOverride": false,
- "id": 2,
- "interval": null,
- "links": [],
- "mappingType": 1,
- "mappingTypes": [
- {
- "name": "value to text",
- "value": 1
- },
- {
- "name": "range to text",
- "value": 2
- }
- ],
- "maxDataPoints": 100,
- "nullPointMode": "connected",
- "nullText": null,
- "postfix": "",
- "postfixFontSize": "50%",
- "prefix": "",
- "prefixFontSize": "50%",
- "rangeMaps": [
- {
- "from": "null",
- "text": "N/A",
- "to": "null"
- }
- ],
- "sparkline": {
- "fillColor": "rgba(31, 118, 189, 0.18)",
- "full": false,
- "lineColor": "rgb(31, 120, 193)",
- "show": false
- },
- "tableColumn": "",
- "targets": [
- {
- "expr": "(sum(up{job=\"cloud-controller-manager\"} == 1) / sum(up{job=\"kube-controller-manager\"})) * 100",
- "format": "time_series",
- "intervalFactor": 2,
- "refId": "A",
- "step": 600
- }
- ],
- "thresholds": "50, 80",
- "title": "Cloud Controller Managers UP",
- "type": "singlestat",
- "valueFontSize": "80%",
- "valueMaps": [
- {
- "op": "=",
- "text": "N/A",
- "value": "null"
- }
- ],
- "valueName": "avg"
- }
- ],
- "schemaVersion": 18,
- "style": "dark",
- "tags": [],
- "templating": {
- "list": []
- },
- "time": {
- "from": "now-6h",
- "to": "now"
- },
- "timepicker": {
- "refresh_intervals": [
- "5s",
- "10s",
- "30s",
- "1m",
- "5m",
- "15m",
- "30m",
- "1h",
- "2h",
- "1d"
- ],
- "time_options": [
- "5m",
- "15m",
- "1h",
- "6h",
- "12h",
- "24h",
- "2d",
- "7d",
- "30d"
- ]
- },
- "timezone": "",
- "title": "Cloud Controller Manager",
- "uid": "8Uz5D5FWz",
- "version": 7
-}
\ No newline at end of file
diff --git a/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/templates/_helpers.tpl b/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/templates/_helpers.tpl
deleted file mode 100644
index f31adaf43..000000000
--- a/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/templates/_helpers.tpl
+++ /dev/null
@@ -1,3 +0,0 @@
-{{- define "deploymentversion" -}}
-apps/v1
-{{- end -}}
diff --git a/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/templates/cloud-controller-manager.yaml b/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/templates/cloud-controller-manager.yaml
deleted file mode 100644
index eb9401d23..000000000
--- a/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/templates/cloud-controller-manager.yaml
+++ /dev/null
@@ -1,69 +0,0 @@
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: cloud-controller-manager
- namespace: {{ .Release.Namespace }}
- labels:
- app: cloud-controller-manager
- garden.sapcloud.io/role: controlplane
-spec:
- revisionHistoryLimit: 0
- replicas: {{ .Values.replicas }}
- selector:
- matchLabels:
- app: cloud-controller-manager
- template:
- metadata:
- labels:
- app: cloud-controller-manager
- garden.sapcloud.io/role: controlplane
- networking.gardener.cloud/to-dns: allowed
- networking.gardener.cloud/to-public-networks: allowed
- networking.gardener.cloud/to-shoot-apiserver: allowed
- networking.gardener.cloud/from-prometheus: allowed
-{{- if .Values.podAnnotations }}
- annotations:
-{{ toYaml .Values.podAnnotations | indent 8 }}
-{{- end }}
- spec:
- tolerations:
- - key: CriticalAddonsOnly
- operator: Exists
- containers:
- - name: packet-cloud-controller-manager
- image: {{ index .Values.images "cloud-controller-manager" }}
- imagePullPolicy: IfNotPresent
- command:
- - ./cloud-controller-manager
- - --cloud-provider=packet
- - --leader-elect=false
- - --allow-untagged-cloud=true
- - --kubeconfig=/var/lib/cloud-controller-manager/kubeconfig
- env:
- - name: PACKET_AUTH_TOKEN
- valueFrom:
- secretKeyRef:
- name: cloudprovider
- key: apiToken
- - name: PACKET_PROJECT_ID
- valueFrom:
- secretKeyRef:
- name: cloudprovider
- key: projectID
- ports:
- # Packet's CCM is based on K8S 1.11 and uses 10253 port by default.
- - containerPort: 10253
- name: metrics
- protocol: TCP
- {{- if .Values.resources }}
- resources:
-{{ toYaml .Values.resources | indent 10 }}
- {{- end }}
- volumeMounts:
- - name: cloud-controller-manager
- mountPath: /var/lib/cloud-controller-manager
- volumes:
- - name: cloud-controller-manager
- secret:
- secretName: cloud-controller-manager
diff --git a/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/templates/configmap-monitoring.yaml b/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/templates/configmap-monitoring.yaml
deleted file mode 100644
index 769936b1a..000000000
--- a/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/templates/configmap-monitoring.yaml
+++ /dev/null
@@ -1,62 +0,0 @@
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: cloud-controller-manager-monitoring-config
- namespace: {{ .Release.Namespace }}
- labels:
- extensions.gardener.cloud/configuration: monitoring
-data:
- scrape_config: |
- - job_name: cloud-controller-manager
- {{- if semverCompare ">= 1.13" .Values.kubernetesVersion }}
- scheme: https
- tls_config:
- insecure_skip_verify: true
- cert_file: /etc/prometheus/seed/prometheus.crt
- key_file: /etc/prometheus/seed/prometheus.key
- {{- end }}
- honor_labels: false
- kubernetes_sd_configs:
- - role: endpoints
- namespaces:
- names: [{{ .Release.Namespace }}]
- relabel_configs:
- - source_labels:
- - __meta_kubernetes_service_name
- - __meta_kubernetes_endpoint_port_name
- action: keep
- regex: cloud-controller-manager;metrics
- # common metrics
- - action: labelmap
- regex: __meta_kubernetes_service_label_(.+)
- - source_labels: [ __meta_kubernetes_pod_name ]
- target_label: pod
- metric_relabel_configs:
- - source_labels: [ __name__ ]
- regex: ^(rest_client_requests_total|process_max_fds|process_open_fds)$
- action: keep
-
- alerting_rules: |
- cloud-controller-manager.rules.yaml: |
- groups:
- - name: cloud-controller-manager.rules
- rules:
- - alert: CloudControllerManagerDown
- expr: absent(up{job="cloud-controller-manager"} == 1)
- for: 15m
- labels:
- service: cloud-controller-manager
- severity: critical
- type: seed
- visibility: all
- annotations:
- description: All infrastruture specific operations cannot be completed (e.g. creating loadbalancers or persistent volumes).
- summary: Cloud controller manager is down.
-
- dashboard_operators: |
- cloud-controller-manager-dashboard.json: |-
-{{- .Files.Get "ccm-monitoring-dashboard.json" | nindent 6 }}
-
- dashboard_users: |
- cloud-controller-manager-dashboard.json: |-
-{{- .Files.Get "ccm-monitoring-dashboard.json" | nindent 6 }}
diff --git a/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/templates/vpa.yaml b/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/templates/vpa.yaml
deleted file mode 100644
index 472a971b9..000000000
--- a/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/templates/vpa.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-apiVersion: autoscaling.k8s.io/v1beta2
-kind: VerticalPodAutoscaler
-metadata:
- name: cloud-controller-manager-vpa
- namespace: {{ .Release.Namespace }}
-spec:
- targetRef:
- apiVersion: {{ include "deploymentversion" . }}
- kind: Deployment
- name: cloud-controller-manager
- updatePolicy:
- updateMode: Auto
diff --git a/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/values.yaml b/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/values.yaml
deleted file mode 100644
index f72ac7ad7..000000000
--- a/controllers/provider-packet/charts/internal/seed-controlplane/charts/packet-cloud-controller-manager/values.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-replicas: 1
-kubernetesVersion: 1.7.5
-podAnnotations: {}
-images:
- cloud-controller-manager: image-repository
-resources:
- requests:
- cpu: 100m
- memory: 64Mi
- limits:
- cpu: 500m
- memory: 512Mi
diff --git a/controllers/provider-packet/charts/internal/shoot-storageclasses/Chart.yaml b/controllers/provider-packet/charts/internal/shoot-storageclasses/Chart.yaml
deleted file mode 100644
index fe504597c..000000000
--- a/controllers/provider-packet/charts/internal/shoot-storageclasses/Chart.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-apiVersion: v1
-description: A Helm chart for storageclasses that should be installed to the shoot
-name: shoot-storageclasses
-version: 0.1.0
diff --git a/controllers/provider-packet/charts/internal/shoot-storageclasses/templates/_helpers.tpl b/controllers/provider-packet/charts/internal/shoot-storageclasses/templates/_helpers.tpl
deleted file mode 100644
index 50c126b0b..000000000
--- a/controllers/provider-packet/charts/internal/shoot-storageclasses/templates/_helpers.tpl
+++ /dev/null
@@ -1,7 +0,0 @@
-{{- define "storageclassversion" -}}
-{{- if semverCompare ">= 1.13-0" .Capabilities.KubeVersion.GitVersion -}}
-storage.k8s.io/v1
-{{- else -}}
-storage.k8s.io/v1beta1
-{{- end -}}
-{{- end -}}
diff --git a/controllers/provider-packet/charts/internal/shoot-storageclasses/templates/storageclasses.yaml b/controllers/provider-packet/charts/internal/shoot-storageclasses/templates/storageclasses.yaml
deleted file mode 100644
index cabfa3a0a..000000000
--- a/controllers/provider-packet/charts/internal/shoot-storageclasses/templates/storageclasses.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
----
-apiVersion: {{ include "storageclassversion" . }}
-kind: StorageClass
-metadata:
- name: csi-packet-standard
- annotations:
- storageclass.kubernetes.io/is-default-class: "true"
-provisioner: net.packet.csi
-parameters:
- type: standard
----
-apiVersion: {{ include "storageclassversion" . }}
-kind: StorageClass
-metadata:
- name: csi-packet-performance
-provisioner: net.packet.csi
-parameters:
- type: performance
diff --git a/controllers/provider-packet/charts/internal/shoot-system-components/Chart.yaml b/controllers/provider-packet/charts/internal/shoot-system-components/Chart.yaml
deleted file mode 100644
index e44304bee..000000000
--- a/controllers/provider-packet/charts/internal/shoot-system-components/Chart.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-apiVersion: v1
-description: An umbrella chart for control plane resources in the Shoot cluster
-name: shoot-system-components
-version: 0.1.0
diff --git a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/Chart.yaml b/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/Chart.yaml
deleted file mode 100644
index f29693512..000000000
--- a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/Chart.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-apiVersion: v1
-appVersion: "1.0"
-description: A Helm chart for Kubernetes
-name: csi-packet
-version: 0.1.0
diff --git a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/credential-secret.yaml b/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/credential-secret.yaml
deleted file mode 100644
index 72fc2e9fc..000000000
--- a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/credential-secret.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
-apiVersion: v1
-kind: Secret
-metadata:
- name: csi-diskplugin-packet
- namespace: kube-system
-data:
- apiToken: {{ index .Values.credential.apiToken }}
- projectID: {{ index .Values.credential.projectID }}
-type: Opaque
diff --git a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/node.yaml b/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/node.yaml
deleted file mode 100644
index 5a507f740..000000000
--- a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/node.yaml
+++ /dev/null
@@ -1,131 +0,0 @@
-apiVersion: apps/v1
-kind: DaemonSet
-metadata:
- name: csi-node
- namespace: kube-system
-spec:
- selector:
- matchLabels:
- app: csi-packet-driver
- template:
- metadata:
- labels:
- app: csi-packet-driver
- annotations:
- checksum/secret-csi-diskplugin-packet: {{ include (print $.Template.BasePath "/credential-secret.yaml") . | sha256sum }}
- spec:
- hostNetwork: true
- serviceAccount: csi-node-sa
- containers:
- - name: csi-driver-registrar
- imagePullPolicy: IfNotPresent
- image: {{ index .Values.images "csi-node-driver-registrar" }}
- args:
- - "--v=5"
- - "--csi-address=$(ADDRESS)"
- - "--kubelet-registration-path=/var/lib/kubelet/plugins/net.packet.csi/csi.sock"
- env:
- - name: ADDRESS
- value: /csi/csi.sock
- - name: KUBE_NODE_NAME
- valueFrom:
- fieldRef:
- fieldPath: spec.nodeName
- volumeMounts:
- - name: plugin-dir
- mountPath: /csi
- - name: registration-dir
- mountPath: /registration
- # - name: registrar-socket-dir
- # mountPath: /var/lib/csi/sockets/
- - name: packet-driver
- securityContext:
- privileged: true
- imagePullPolicy: Always
- image: {{ index .Values.images "packet-storage-interface" }}
- args:
- - "--endpoint=$(CSI_ENDPOINT)"
- - "--nodeid=$(KUBE_NODE_NAME)"
- env:
- - name: CSI_ENDPOINT
- value: unix:///csi/csi.sock
- - name: KUBE_NODE_NAME
- valueFrom:
- fieldRef:
- fieldPath: spec.nodeName
- - name: PACKET_AUTH_TOKEN
- valueFrom:
- secretKeyRef:
- name: csi-diskplugin-packet
- key: apiToken
- - name: PACKET_PROJECT_ID
- valueFrom:
- secretKeyRef:
- name: csi-diskplugin-packet
- key: projectID
- volumeMounts:
- - name: kubelet-dir
- mountPath: /var/lib/kubelet/pods
- mountPropagation: "Bidirectional"
- - name: plugin-dir
- mountPath: /csi
- - name: sys-devices
- mountPath: /sys/devices
- - mountPath: /dev
- name: dev
- - mountPath: /etc
- name: etc
- - mountPath: /run/udev
- name: run-udev
- - mountPath: /var/lib/iscsi
- name: var-lib-iscsi
- - name: lib-modules
- mountPath: /lib/modules
- - mountPath: /usr/share/ca-certificates/
- name: ca-certs-alternative
- readOnly: true
- volumes:
- # TODO(dependency): this will work when kublet registrar functionality exists
- #- name: registrar-socket-dir
- # hostPath:
- # path: /var/lib/kubelet/device-plugins/
- # type: DirectoryOrCreate
- - name: registration-dir
- hostPath:
- path: /var/lib/kubelet/plugins_registry
- type: Directory
- - name: kubelet-dir
- hostPath:
- path: /var/lib/kubelet/pods
- type: Directory
- - name: plugin-dir
- hostPath:
- path: /var/lib/kubelet/plugins/net.packet.csi/
- type: DirectoryOrCreate
- - name: dev
- hostPath:
- path: /dev
- type: Directory
- - name: etc
- hostPath:
- path: /etc/
- - name: var-lib-iscsi
- hostPath:
- path: /var/lib/iscsi/
- type: DirectoryOrCreate
- - name: sys-devices
- hostPath:
- path: /sys/devices
- type: Directory
- - name: run-udev
- hostPath:
- path: /run/udev/
- type: Directory
- - name: lib-modules
- hostPath:
- path: /lib/modules
- type: Directory
- - name: ca-certs-alternative
- hostPath:
- path: /usr/share/ca-certificates/
- type: DirectoryOrCreate
diff --git a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/psp/csi-attacher-rbac.yaml b/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/psp/csi-attacher-rbac.yaml
deleted file mode 100644
index 1a74b454e..000000000
--- a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/psp/csi-attacher-rbac.yaml
+++ /dev/null
@@ -1,79 +0,0 @@
-# This YAML file contains all RBAC objects that are necessary to run external
-# CSI attacher.
-#
-# In production, each CSI driver deployment has to be customized:
-# - to avoid conflicts, use non-default namespace and different names
-# for non-namespaced entities like the ClusterRole
-# - decide whether the deployment replicates the external CSI
-# attacher, in which case leadership election must be enabled;
-# this influences the RBAC setup, see below
-apiVersion: v1
-kind: ServiceAccount
-metadata:
- name: csi-attacher
- namespace: kube-system
----
-# Attacher must be able to work with PVs, nodes and VolumeAttachments
-kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: packet.provider.extensions.gardener.cloud:kube-system:csi-attacher
-rules:
-- apiGroups: [""]
- resources: ["persistentvolumes"]
- verbs: ["get", "list", "watch", "update"]
-- apiGroups: [""]
- resources: ["nodes"]
- verbs: ["get", "list", "watch", "update"]
-{{- if semverCompare "< 1.14" .Values.kubernetesVersion }}
-- apiGroups: ["csi.storage.k8s.io"]
- resources: ["csinodeinfos"]
- verbs: ["get", "list", "watch"]
-{{- else }}
-- apiGroups: ["storage.k8s.io"]
- resources: ["csinodes"]
- verbs: ["get", "list", "watch"]
-{{- end }}
-- apiGroups: ["storage.k8s.io"]
- resources: ["volumeattachments"]
- verbs: ["get", "list", "watch", "update"]
-- apiGroups: [""]
- resources: ["events"]
- verbs: ["create", "patch", "update"]
----
-kind: ClusterRoleBinding
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: packet.provider.extensions.gardener.cloud:csi-attacher
-subjects:
-- kind: User
- name: system:csi-attacher
-roleRef:
- kind: ClusterRole
- name: packet.provider.extensions.gardener.cloud:kube-system:csi-attacher
- apiGroup: rbac.authorization.k8s.io
----
-# Attacher must be able to work with config map in current namespace
-# if (and only if) leadership election is enabled
-kind: Role
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- namespace: kube-system
- name: csi-attacher
-rules:
-- apiGroups: [""]
- resources: ["configmaps"]
- verbs: ["get", "watch", "list", "delete", "update", "create"]
----
-kind: RoleBinding
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: csi-attacher
- namespace: kube-system
-subjects:
-- kind: User
- name: system:csi-attacher
-roleRef:
- kind: Role
- name: csi-attacher
- apiGroup: rbac.authorization.k8s.io
diff --git a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/psp/csi-plugin-psp.yaml b/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/psp/csi-plugin-psp.yaml
deleted file mode 100644
index e8d79d758..000000000
--- a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/psp/csi-plugin-psp.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-apiVersion: policy/v1beta1
-kind: PodSecurityPolicy
-metadata:
- name: gardener.kube-system.csi-disk-plugin-packet
-spec:
- privileged: true
- allowPrivilegeEscalation: true
- volumes:
- - hostPath
- - secret
- hostNetwork: true
- allowedHostPaths:
- - pathPrefix: /var/lib/kubelet
- - pathPrefix: /dev
- runAsUser:
- rule: RunAsAny
- seLinux:
- rule: RunAsAny
- supplementalGroups:
- rule: RunAsAny
- fsGroup:
- rule: RunAsAny
- readOnlyRootFilesystem: false
diff --git a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/psp/csi-plugin-rbac.yaml b/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/psp/csi-plugin-rbac.yaml
deleted file mode 100644
index 994558a3c..000000000
--- a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/psp/csi-plugin-rbac.yaml
+++ /dev/null
@@ -1,45 +0,0 @@
-apiVersion: v1
-kind: ServiceAccount
-metadata:
- name: csi-disk-plugin-packet
- namespace: kube-system
----
-kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: packet.provider.extensions.gardener.cloud:psp:kube-system:csi-disk-plugin-packet
-rules:
-- apiGroups: [""]
- resources: ["nodes"]
- verbs: ["get", "list", "update"]
-- apiGroups: [""]
- resources: ["namespaces"]
- verbs: ["get", "list"]
-- apiGroups: [""]
- resources: ["persistentvolumes"]
- verbs: ["get", "list", "watch", "update"]
-- apiGroups: ["storage.k8s.io"]
- resources: ["volumeattachments"]
- verbs: ["get", "list", "watch", "update"]
-- apiGroups:
- - policy
- - extensions
- resourceNames:
- - gardener.kube-system.csi-disk-plugin-packet
- resources:
- - podsecuritypolicies
- verbs:
- - use
----
-kind: ClusterRoleBinding
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: packet.provider.extensions.gardener.cloud:psp:csi-disk-plugin-packet
-subjects:
-- kind: ServiceAccount
- name: csi-disk-plugin-packet
- namespace: kube-system
-roleRef:
- kind: ClusterRole
- name: packet.provider.extensions.gardener.cloud:psp:kube-system:csi-disk-plugin-packet
- apiGroup: rbac.authorization.k8s.io
diff --git a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/psp/csi-provisioner-rbac.yaml b/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/psp/csi-provisioner-rbac.yaml
deleted file mode 100644
index 856775af3..000000000
--- a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/templates/psp/csi-provisioner-rbac.yaml
+++ /dev/null
@@ -1,53 +0,0 @@
-apiVersion: v1
-kind: ServiceAccount
-metadata:
- name: csi-provisioner
- namespace: kube-system
----
-kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: packet.provider.extensions.gardener.cloud:kube-system:csi-provisioner
-rules:
-- apiGroups: [""]
- resources: ["persistentvolumes"]
- verbs: ["get", "list", "watch", "create", "delete"]
-- apiGroups: [""]
- resources: ["persistentvolumeclaims"]
- verbs: ["get", "list", "watch", "update"]
-- apiGroups: ["storage.k8s.io"]
- resources: ["storageclasses"]
- verbs: ["get", "list", "watch"]
-- apiGroups: [""]
- resources: ["events"]
- verbs: ["list", "watch", "create", "update", "patch"]
-- apiGroups: ["snapshot.storage.k8s.io"]
- resources: ["volumesnapshots"]
- verbs: ["get", "list"]
-- apiGroups: ["snapshot.storage.k8s.io"]
- resources: ["volumesnapshotcontents"]
- verbs: ["get", "list"]
-{{- if semverCompare "< 1.14" .Values.kubernetesVersion }}
-- apiGroups: ["csi.storage.k8s.io"]
- resources: ["csinodeinfos"]
- verbs: ["get", "list", "watch"]
-{{- else }}
-- apiGroups: ["storage.k8s.io"]
- resources: ["csinodes"]
- verbs: ["get", "list", "watch"]
-{{- end }}
-- apiGroups: [""]
- resources: ["nodes"]
- verbs: ["get", "list", "watch"]
----
-kind: ClusterRoleBinding
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: packet.provider.extensions.gardener.cloud:csi-provisioner
-subjects:
-- kind: User
- name: system:csi-provisioner
-roleRef:
- kind: ClusterRole
- name: packet.provider.extensions.gardener.cloud:kube-system:csi-provisioner
- apiGroup: rbac.authorization.k8s.io
diff --git a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/values.yaml b/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/values.yaml
deleted file mode 100644
index 27ca28823..000000000
--- a/controllers/provider-packet/charts/internal/shoot-system-components/charts/csi-packet/values.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-images:
- csi-node-driver-registrar: image-repository:image-tag
- packet-storage-interface: image-repository:image-tag
-credential:
- apiToken: apiToken
- projectID: projectID
-kubernetesVersion: v1.13.0
diff --git a/controllers/provider-packet/charts/internal/shoot-system-components/charts/packet-cloud-controller-manager/Chart.yaml b/controllers/provider-packet/charts/internal/shoot-system-components/charts/packet-cloud-controller-manager/Chart.yaml
deleted file mode 100644
index 36e6fb206..000000000
--- a/controllers/provider-packet/charts/internal/shoot-system-components/charts/packet-cloud-controller-manager/Chart.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-apiVersion: v1
-description: Helm chart for cloud-controller-manager
-name: packet-cloud-controller-manager
-version: 0.1.0
diff --git a/controllers/provider-packet/charts/internal/shoot-system-components/charts/packet-cloud-controller-manager/templates/rbac-node-controller.yaml b/controllers/provider-packet/charts/internal/shoot-system-components/charts/packet-cloud-controller-manager/templates/rbac-node-controller.yaml
deleted file mode 100644
index 5790d597c..000000000
--- a/controllers/provider-packet/charts/internal/shoot-system-components/charts/packet-cloud-controller-manager/templates/rbac-node-controller.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
- name: system:controller:cloud-node-controller
-rules:
-- apiGroups:
- - ""
- resources:
- - nodes
- verbs:
- - delete
- - get
- - patch
- - update
- - list
-- apiGroups:
- - ""
- resources:
- - nodes/status
- verbs:
- - patch
-- apiGroups:
- - ""
- resources:
- - events
- verbs:
- - create
- - patch
- - update
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- name: system:controller:cloud-node-controller
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: system:controller:cloud-node-controller
-subjects:
-- kind: ServiceAccount
- name: cloud-node-controller
- namespace: kube-system
diff --git a/controllers/provider-packet/charts/internal/shoot-system-components/charts/packet-cloud-controller-manager/values.yaml b/controllers/provider-packet/charts/internal/shoot-system-components/charts/packet-cloud-controller-manager/values.yaml
deleted file mode 100644
index e69de29bb..000000000
diff --git a/controllers/provider-packet/charts/provider-packet/Chart.yaml b/controllers/provider-packet/charts/provider-packet/Chart.yaml
deleted file mode 100644
index 7ded74924..000000000
--- a/controllers/provider-packet/charts/provider-packet/Chart.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-apiVersion: v1
-appVersion: "1.0"
-description: A Helm chart for the Gardener Packet Provider extension
-name: provider-packet
-version: 0.1.0
diff --git a/controllers/provider-packet/charts/provider-packet/doc.go b/controllers/provider-packet/charts/provider-packet/doc.go
deleted file mode 100644
index a8310cb55..000000000
--- a/controllers/provider-packet/charts/provider-packet/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-//go:generate ../../../../hack/generate-controller-registration.sh provider-packet . ../../example/controller-registration.yaml ControlPlane:packet Infrastructure:packet Worker:packet
-
-// Package chart enables go:generate support for generating the correct controller registration.
-package chart
diff --git a/controllers/provider-packet/charts/provider-packet/templates/_helpers.tpl b/controllers/provider-packet/charts/provider-packet/templates/_helpers.tpl
deleted file mode 100644
index bca9212de..000000000
--- a/controllers/provider-packet/charts/provider-packet/templates/_helpers.tpl
+++ /dev/null
@@ -1,27 +0,0 @@
-{{- define "name" -}}
-gardener-extension-provider-packet
-{{- end -}}
-
-{{- define "labels.app.key" -}}
-app.kubernetes.io/name
-{{- end -}}
-{{- define "labels.app.value" -}}
-{{ include "name" . }}
-{{- end -}}
-
-{{- define "labels" -}}
-{{ include "labels.app.key" . }}: {{ include "labels.app.value" . }}
-app.kubernetes.io/instance: {{ .Release.Name }}
-{{- end -}}
-
-{{- define "image" -}}
- {{- if hasPrefix "sha256:" .Values.image.tag }}
- {{- printf "%s@%s" .Values.image.repository .Values.image.tag }}
- {{- else }}
- {{- printf "%s:%s" .Values.image.repository .Values.image.tag }}
- {{- end }}
-{{- end }}
-
-{{- define "deploymentversion" -}}
-apps/v1
-{{- end -}}
\ No newline at end of file
diff --git a/controllers/provider-packet/charts/provider-packet/templates/configmap-imagevector-overwrite.yaml b/controllers/provider-packet/charts/provider-packet/templates/configmap-imagevector-overwrite.yaml
deleted file mode 100644
index 42499d851..000000000
--- a/controllers/provider-packet/charts/provider-packet/templates/configmap-imagevector-overwrite.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-{{- if .Values.imageVectorOverwrite }}
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: {{ include "name" . }}-imagevector-overwrite
- namespace: {{ .Release.Namespace }}
- labels:
-{{ include "labels" . | indent 4 }}
-data:
- images_overwrite.yaml: |
-{{ .Values.imageVectorOverwrite | indent 4 }}
-{{- end }}
diff --git a/controllers/provider-packet/charts/provider-packet/templates/configmap-logging.yaml b/controllers/provider-packet/charts/provider-packet/templates/configmap-logging.yaml
deleted file mode 100644
index d2ad2f250..000000000
--- a/controllers/provider-packet/charts/provider-packet/templates/configmap-logging.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: {{ include "name" . }}-logging-config
- namespace: garden
- labels:
- extensions.gardener.cloud/configuration: logging
-data:
- filter-kubernetes.conf: |
- [FILTER]
- Name parser
- Match kubernetes.cloud-controller-manager*packet-cloud-controller-manager*
- Key_Name log
- Parser kubeapiserverParser
- Reserve_Data True
-
- [FILTER]
- Name parser
- Match kubernetes.machine-controller-manager*packet-machine-controller-manager*
- Key_Name log
- Parser kubeapiserverParser
- Reserve_Data True
-
- [FILTER]
- Name record_modifier
- Match *packet-cloud-controller-manager*
- Record type user
diff --git a/controllers/provider-packet/charts/provider-packet/templates/configmap.yaml b/controllers/provider-packet/charts/provider-packet/templates/configmap.yaml
deleted file mode 100644
index 9b8d01604..000000000
--- a/controllers/provider-packet/charts/provider-packet/templates/configmap.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: {{ include "name" . }}-configmap
- namespace: {{ .Release.Namespace }}
- labels:
-{{ include "labels" . | indent 4 }}
-data:
- config.yaml: |
- ---
- apiVersion: packet.provider.extensions.config.gardener.cloud/v1alpha1
- kind: ControllerConfiguration
-{{- if .Values.config.clientConnection }}
- clientConnection:
- acceptContentTypes: {{ required ".Values.config.clientConnection.acceptContentTypes is required" .Values.config.clientConnection.acceptContentTypes }}
- contentType: {{ required ".Values.config.clientConnection.contentType is required" .Values.config.clientConnection.contentType }}
- qps: {{ required ".Values.config.clientConnection.qps is required" .Values.config.clientConnection.qps }}
- burst: {{ required ".Values.config.clientConnection.burst is required" .Values.config.clientConnection.burst }}
-{{- end }}
- etcd:
- storage:
- className: {{ .Values.config.etcd.storage.className }}
- capacity: {{ .Values.config.etcd.storage.capacity }}
diff --git a/controllers/provider-packet/charts/provider-packet/templates/deployment.yaml b/controllers/provider-packet/charts/provider-packet/templates/deployment.yaml
deleted file mode 100644
index 44bc0d6c1..000000000
--- a/controllers/provider-packet/charts/provider-packet/templates/deployment.yaml
+++ /dev/null
@@ -1,90 +0,0 @@
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: {{ include "name" . }}
- namespace: {{ .Release.Namespace }}
-{{- if .Values.ignoreResources }}
- annotations:
- resources.gardener.cloud/ignore: "true"
-{{- end }}
- labels:
-{{ include "labels" . | indent 4 }}
-spec:
- revisionHistoryLimit: 0
- replicas: {{ .Values.replicaCount }}
- selector:
- matchLabels:
-{{ include "labels" . | indent 6 }}
- template:
- metadata:
- annotations:
- {{- if .Values.imageVectorOverwrite }}
- checksum/configmap-packet-imagevector-overwrite: {{ include (print $.Template.BasePath "/configmap-imagevector-overwrite.yaml") . | sha256sum }}
- {{- end }}
- checksum/configmap-{{ include "name" . }}-config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
- labels:
-{{ include "labels" . | indent 8 }}
- spec:
- containers:
- - name: {{ include "name" . }}
- image: {{ include "image" . }}
- imagePullPolicy: {{ .Values.image.pullPolicy }}
- command:
- - /gardener-extension-hyper
- - provider-packet-controller-manager
- - --config-file=/etc/{{ include "name" . }}/config/config.yaml
- - --controlplane-max-concurrent-reconciles={{ .Values.controllers.controlplane.concurrentSyncs }}
- - --infrastructure-max-concurrent-reconciles={{ .Values.controllers.infrastructure.concurrentSyncs }}
- - --ignore-operation-annotation={{ .Values.controllers.ignoreOperationAnnotation }}
- - --worker-max-concurrent-reconciles={{ .Values.controllers.worker.concurrentSyncs }}
- - --webhook-config-namespace={{ .Release.Namespace }}
- - --webhook-config-server-port={{ .Values.webhookConfig.serverPort }}
- - --disable-controllers={{ .Values.disableControllers | join "," }}
- - --disable-webhooks={{ .Values.disableWebhooks | join "," }}
- env:
- - name: LEADER_ELECTION_NAMESPACE
- valueFrom:
- fieldRef:
- fieldPath: metadata.namespace
- {{- if .Values.imageVectorOverwrite }}
- - name: IMAGEVECTOR_OVERWRITE
- value: /charts_overwrite/images_overwrite.yaml
- {{- end }}
- ports:
- - name: webhook-server
- containerPort: {{ .Values.webhookConfig.serverPort }}
- protocol: TCP
-{{- if .Values.resources }}
- resources:
-{{ toYaml .Values.resources | nindent 10 }}
-{{- end }}
- volumeMounts:
- - name: config
- mountPath: /etc/{{ include "name" . }}/config
- {{- if .Values.imageVectorOverwrite }}
- - name: imagevector-overwrite
- mountPath: /charts_overwrite/
- readOnly: true
- {{- end }}
- serviceAccountName: {{ include "name" . }}
- affinity:
- podAntiAffinity:
- requiredDuringSchedulingIgnoredDuringExecution:
- - labelSelector:
- matchExpressions:
- - key: {{ include "labels.app.key" . }}
- operator: In
- values:
- - {{ include "labels.app.value" . }}
- topologyKey: "kubernetes.io/hostname"
- volumes:
- - name: config
- configMap:
- name: {{ include "name" . }}-configmap
- defaultMode: 420
- {{- if .Values.imageVectorOverwrite }}
- - name: imagevector-overwrite
- configMap:
- name: {{ include "name" . }}-imagevector-overwrite
- defaultMode: 420
- {{- end }}
diff --git a/controllers/provider-packet/charts/provider-packet/templates/poddisruptionbudget.yaml b/controllers/provider-packet/charts/provider-packet/templates/poddisruptionbudget.yaml
deleted file mode 100644
index 6a135cc62..000000000
--- a/controllers/provider-packet/charts/provider-packet/templates/poddisruptionbudget.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-{{- if gt (int .Values.replicaCount) 1 }}
-apiVersion: policy/v1beta1
-kind: PodDisruptionBudget
-metadata:
- name: {{ include "name" . }}
- namespace: {{ .Release.Namespace }}
- labels:
-{{ include "labels" . | indent 4 }}
-spec:
- maxUnavailable: {{ sub (int .Values.replicaCount) 1 }}
- selector:
- matchLabels:
-{{ include "labels" . | indent 6 }}
-{{- end }}
diff --git a/controllers/provider-packet/charts/provider-packet/templates/rbac.yaml b/controllers/provider-packet/charts/provider-packet/templates/rbac.yaml
deleted file mode 100644
index b453fe67a..000000000
--- a/controllers/provider-packet/charts/provider-packet/templates/rbac.yaml
+++ /dev/null
@@ -1,97 +0,0 @@
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
- name: {{ include "name" . }}
- labels:
-{{ include "labels" . | indent 4 }}
-rules:
-- apiGroups:
- - extensions.gardener.cloud
- resources:
- - clusters
- - infrastructures
- - infrastructures/status
- - controlplanes
- - controlplanes/status
- - workers
- - workers/status
- verbs:
- - get
- - list
- - watch
- - patch
- - update
-- apiGroups:
- - resources.gardener.cloud
- resources:
- - managedresources
- verbs:
- - "*"
-- apiGroups:
- - ""
- resources:
- - configmaps
- resourceNames:
- - provider-packet-leader-election
- verbs:
- - get
- - watch
- - update
- - patch
-- apiGroups:
- - ""
- - apps
- - batch
- - rbac.authorization.k8s.io
- - admissionregistration.k8s.io
- - apiextensions.k8s.io
- - networking.k8s.io
- resources:
- - namespaces
- - events
- - secrets
- - configmaps
- - endpoints
- - deployments
- - services
- - serviceaccounts
- - clusterroles
- - clusterrolebindings
- - roles
- - rolebindings
- - jobs
- - pods
- - pods/log
- - mutatingwebhookconfigurations
- - customresourcedefinitions
- - networkpolicies
- verbs:
- - "*"
-- apiGroups:
- - machine.sapcloud.io
- resources:
- - "*"
- verbs:
- - "*"
-- apiGroups:
- - autoscaling.k8s.io
- resources:
- - verticalpodautoscalers
- verbs:
- - "*"
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- name: {{ include "name" . }}
- labels:
-{{ include "labels" . | indent 4 }}
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: {{ include "name" . }}
-subjects:
-- kind: ServiceAccount
- name: {{ include "name" . }}
- namespace: {{ .Release.Namespace }}
diff --git a/controllers/provider-packet/charts/provider-packet/templates/service.yaml b/controllers/provider-packet/charts/provider-packet/templates/service.yaml
deleted file mode 100644
index 4520dda48..000000000
--- a/controllers/provider-packet/charts/provider-packet/templates/service.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-apiVersion: v1
-kind: Service
-metadata:
- name: {{ include "name" . }}
- namespace: {{ .Release.Namespace }}
-{{- if .Values.ignoreResources }}
- annotations:
- resources.gardener.cloud/ignore: "true"
-{{- end }}
- labels:
-{{ include "labels" . | indent 4 }}
-spec:
- type: ClusterIP
- selector:
-{{ include "labels" . | indent 6 }}
- ports:
- - port: 443
- protocol: TCP
- targetPort: {{ .Values.webhookConfig.serverPort }}
diff --git a/controllers/provider-packet/charts/provider-packet/templates/serviceaccount.yaml b/controllers/provider-packet/charts/provider-packet/templates/serviceaccount.yaml
deleted file mode 100644
index 52458f74c..000000000
--- a/controllers/provider-packet/charts/provider-packet/templates/serviceaccount.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-apiVersion: v1
-kind: ServiceAccount
-metadata:
- name: {{ include "name" . }}
- namespace: {{ .Release.Namespace }}
- labels:
-{{ include "labels" . | indent 4 }}
diff --git a/controllers/provider-packet/charts/provider-packet/templates/storageclass.yaml b/controllers/provider-packet/charts/provider-packet/templates/storageclass.yaml
deleted file mode 100644
index 470f8c6f7..000000000
--- a/controllers/provider-packet/charts/provider-packet/templates/storageclass.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-{{- if eq .Values.gardener.seed.provider "packet" }}
-apiVersion: storage.k8s.io/v1
-kind: StorageClass
-metadata:
- name: {{ .Values.config.etcd.storage.className }}
- labels:
-{{ include "labels" . | indent 4 }}
-provisioner: net.packet.csi
-allowVolumeExpansion: true
-parameters:
- plan: standard
-{{- end }}
diff --git a/controllers/provider-packet/charts/provider-packet/templates/vpa.yaml b/controllers/provider-packet/charts/provider-packet/templates/vpa.yaml
deleted file mode 100644
index 5c7774883..000000000
--- a/controllers/provider-packet/charts/provider-packet/templates/vpa.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-{{- if .Values.vpa.enabled}}
-apiVersion: "autoscaling.k8s.io/v1beta2"
-kind: VerticalPodAutoscaler
-metadata:
- name: {{ include "name" . }}-vpa
- namespace: {{ .Release.Namespace }}
-spec:
- targetRef:
- apiVersion: apps/v1
- kind: Deployment
- name: {{ include "name" . }}
- updatePolicy:
- updateMode: {{ .Values.vpa.updatePolicy.updateMode }}
-{{- end }}
diff --git a/controllers/provider-packet/charts/provider-packet/values.yaml b/controllers/provider-packet/charts/provider-packet/values.yaml
deleted file mode 100644
index 61cd7e2cf..000000000
--- a/controllers/provider-packet/charts/provider-packet/values.yaml
+++ /dev/null
@@ -1,55 +0,0 @@
-image:
- repository: eu.gcr.io/gardener-project/gardener/gardener-extension-hyper
- tag: latest
- pullPolicy: IfNotPresent
-
-replicaCount: 1
-resources: {}
-vpa:
- enabled: true
- updatePolicy:
- updateMode: "Auto"
-
-controllers:
- controlplane:
- concurrentSyncs: 5
- infrastructure:
- concurrentSyncs: 5
- worker:
- concurrentSyncs: 5
- ignoreOperationAnnotation: false
-
-disableControllers: []
-disableWebhooks: []
-ignoreResources: false
-
-# imageVectorOverwrite: |
-# images:
-# - name: pause-container
-# sourceRepository: github.com/kubernetes/kubernetes/blob/master/build/pause/Dockerfile
-# repository: gcr.io/google_containers/pause-amd64
-# tag: "3.0"
-# version: 1.11.x
-# - name: pause-container
-# sourceRepository: github.com/kubernetes/kubernetes/blob/master/build/pause/Dockerfile
-# repository: gcr.io/google_containers/pause-amd64
-# tag: "3.1"
-# version: ">= 1.12"
-# ...
-
-webhookConfig:
- serverPort: 443
-
-config:
- clientConnection:
- acceptContentTypes: application/json
- contentType: application/json
- qps: 100
- burst: 130
- etcd:
- storage:
- className: gardener.cloud-fast
- capacity: 25Gi
-gardener:
- seed:
- provider: packet
diff --git a/controllers/provider-packet/cmd/gardener-extension-provider-packet/app/app.go b/controllers/provider-packet/cmd/gardener-extension-provider-packet/app/app.go
deleted file mode 100644
index bb9e408f1..000000000
--- a/controllers/provider-packet/cmd/gardener-extension-provider-packet/app/app.go
+++ /dev/null
@@ -1,169 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package app
-
-import (
- "context"
- "fmt"
- "os"
-
- packetinstall "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet/install"
- packetcmd "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/cmd"
- packetcontrolplane "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/controller/controlplane"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/controller/healthcheck"
- packetinfrastructure "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/controller/infrastructure"
- packetworker "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/controller/worker"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- packetcontrolplaneexposure "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/webhook/controlplaneexposure"
- "github.com/gardener/gardener-extensions/pkg/controller"
- controllercmd "github.com/gardener/gardener-extensions/pkg/controller/cmd"
- "github.com/gardener/gardener-extensions/pkg/controller/worker"
- "github.com/gardener/gardener-extensions/pkg/util"
- webhookcmd "github.com/gardener/gardener-extensions/pkg/webhook/cmd"
-
- machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1"
- "github.com/spf13/cobra"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "sigs.k8s.io/controller-runtime/pkg/manager"
-)
-
-// NewControllerManagerCommand creates a new command for running a Packet provider controller.
-func NewControllerManagerCommand(ctx context.Context) *cobra.Command {
- var (
- restOpts = &controllercmd.RESTOptions{}
- mgrOpts = &controllercmd.ManagerOptions{
- LeaderElection: true,
- LeaderElectionID: controllercmd.LeaderElectionNameID(packet.Name),
- LeaderElectionNamespace: os.Getenv("LEADER_ELECTION_NAMESPACE"),
- WebhookServerPort: 443,
- WebhookCertDir: "/tmp/gardener-extensions-cert",
- }
- configFileOpts = &packetcmd.ConfigOptions{}
-
- // options for the controlplane controller
- controlPlaneCtrlOpts = &controllercmd.ControllerOptions{
- MaxConcurrentReconciles: 5,
- }
-
- // options for the infrastructure controller
- infraCtrlOpts = &controllercmd.ControllerOptions{
- MaxConcurrentReconciles: 5,
- }
- reconcileOpts = &controllercmd.ReconcilerOptions{}
-
- // options for the worker controller
- workerCtrlOpts = &controllercmd.ControllerOptions{
- MaxConcurrentReconciles: 5,
- }
- workerReconcileOpts = &worker.Options{
- DeployCRDs: true,
- }
- workerCtrlOptsUnprefixed = controllercmd.NewOptionAggregator(workerCtrlOpts, workerReconcileOpts)
-
- // options for the health care controller
- healthCheckCtrlOpts = &controllercmd.ControllerOptions{
- MaxConcurrentReconciles: 1,
- }
-
- // options for the webhook server
- webhookServerOptions = &webhookcmd.ServerOptions{
- Namespace: os.Getenv("WEBHOOK_CONFIG_NAMESPACE"),
- }
-
- controllerSwitches = packetcmd.ControllerSwitchOptions()
- webhookSwitches = packetcmd.WebhookSwitchOptions()
- webhookOptions = webhookcmd.NewAddToManagerOptions(packet.Name, webhookServerOptions, webhookSwitches)
-
- aggOption = controllercmd.NewOptionAggregator(
- restOpts,
- mgrOpts,
- controllercmd.PrefixOption("controlplane-", controlPlaneCtrlOpts),
- controllercmd.PrefixOption("infrastructure-", infraCtrlOpts),
- controllercmd.PrefixOption("worker-", &workerCtrlOptsUnprefixed),
- controllercmd.PrefixOption("healthcheck-", healthCheckCtrlOpts),
- controllerSwitches,
- configFileOpts,
- reconcileOpts,
- webhookOptions,
- )
- )
-
- cmd := &cobra.Command{
- Use: fmt.Sprintf("%s-controller-manager", packet.Name),
-
- Run: func(cmd *cobra.Command, args []string) {
- if err := aggOption.Complete(); err != nil {
- controllercmd.LogErrAndExit(err, "Error completing options")
- }
-
- util.ApplyClientConnectionConfigurationToRESTConfig(configFileOpts.Completed().Config.ClientConnection, restOpts.Completed().Config)
-
- if workerReconcileOpts.Completed().DeployCRDs {
- if err := worker.ApplyMachineResourcesForConfig(ctx, restOpts.Completed().Config); err != nil {
- controllercmd.LogErrAndExit(err, "Error ensuring the machine CRDs")
- }
- }
-
- mgr, err := manager.New(restOpts.Completed().Config, mgrOpts.Completed().Options())
- if err != nil {
- controllercmd.LogErrAndExit(err, "Could not instantiate manager")
- }
-
- scheme := mgr.GetScheme()
- if err := controller.AddToScheme(scheme); err != nil {
- controllercmd.LogErrAndExit(err, "Could not update manager scheme")
- }
-
- if err := packetinstall.AddToScheme(scheme); err != nil {
- controllercmd.LogErrAndExit(err, "Could not update manager scheme")
- }
-
- // add common meta types to schema for controller-runtime to use v1.ListOptions
- metav1.AddToGroupVersion(scheme, machinev1alpha1.SchemeGroupVersion)
- // add types required for Health check
- scheme.AddKnownTypes(machinev1alpha1.SchemeGroupVersion,
- &machinev1alpha1.MachineDeploymentList{},
- )
-
- configFileOpts.Completed().ApplyETCDStorage(&packetcontrolplaneexposure.DefaultAddOptions.ETCDStorage)
- configFileOpts.Completed().ApplyHealthCheckConfig(&healthcheck.DefaultAddOptions.HealthCheckConfig)
- controlPlaneCtrlOpts.Completed().Apply(&packetcontrolplane.DefaultAddOptions.Controller)
- healthCheckCtrlOpts.Completed().Apply(&healthcheck.DefaultAddOptions.Controller)
- infraCtrlOpts.Completed().Apply(&packetinfrastructure.DefaultAddOptions.Controller)
- reconcileOpts.Completed().Apply(&packetinfrastructure.DefaultAddOptions.IgnoreOperationAnnotation)
- reconcileOpts.Completed().Apply(&packetcontrolplane.DefaultAddOptions.IgnoreOperationAnnotation)
- reconcileOpts.Completed().Apply(&packetworker.DefaultAddOptions.IgnoreOperationAnnotation)
- workerCtrlOpts.Completed().Apply(&packetworker.DefaultAddOptions.Controller)
-
- _, shootWebhooks, err := webhookOptions.Completed().AddToManager(mgr)
- if err != nil {
- controllercmd.LogErrAndExit(err, "Could not add webhooks to manager")
- }
- packetcontrolplane.DefaultAddOptions.ShootWebhooks = shootWebhooks
-
- if err := controllerSwitches.Completed().AddToManager(mgr); err != nil {
- controllercmd.LogErrAndExit(err, "Could not add controllers to manager")
- }
-
- if err := mgr.Start(ctx.Done()); err != nil {
- controllercmd.LogErrAndExit(err, "Error running manager")
- }
- },
- }
-
- aggOption.AddFlags(cmd.Flags())
-
- return cmd
-}
diff --git a/controllers/provider-packet/cmd/gardener-extension-provider-packet/main.go b/controllers/provider-packet/cmd/gardener-extension-provider-packet/main.go
deleted file mode 100644
index 997e0fc36..000000000
--- a/controllers/provider-packet/cmd/gardener-extension-provider-packet/main.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package main
-
-import (
- "github.com/gardener/gardener-extensions/controllers/provider-packet/cmd/gardener-extension-provider-packet/app"
- "github.com/gardener/gardener-extensions/pkg/controller"
- controllercmd "github.com/gardener/gardener-extensions/pkg/controller/cmd"
- "github.com/gardener/gardener-extensions/pkg/log"
-
- runtimelog "sigs.k8s.io/controller-runtime/pkg/log"
-)
-
-func main() {
- runtimelog.SetLogger(log.ZapLogger(false))
- cmd := app.NewControllerManagerCommand(controller.SetupSignalHandlerContext())
-
- if err := cmd.Execute(); err != nil {
- controllercmd.LogErrAndExit(err, "error executing the main controller command")
- }
-}
diff --git a/controllers/provider-packet/docs/usage-as-end-user.md b/controllers/provider-packet/docs/usage-as-end-user.md
deleted file mode 100644
index 83f846269..000000000
--- a/controllers/provider-packet/docs/usage-as-end-user.md
+++ /dev/null
@@ -1,96 +0,0 @@
-# Using the Packet provider extension with Gardener as end-user
-
-The [`core.gardener.cloud/v1beta1.Shoot` resource](https://github.com/gardener/gardener/blob/master/example/90-shoot.yaml) declares a few fields that are meant to contain provider-specific configuration.
-
-In this document we are describing how this configuration looks like for Packet and provide an example `Shoot` manifest with minimal configuration that you can use to create an Packet cluster (modulo the landscape-specific information like cloud profile names, secret binding names, etc.).
-
-## Provider secret data
-
-Every shoot cluster references a `SecretBinding` which itself references a `Secret`, and this `Secret` contains the provider credentials of your Packet project.
-This `Secret` must look as follows:
-
-```yaml
-apiVersion: v1
-kind: Secret
-metadata:
- name: core-packet
- namespace: garden-dev
-type: Opaque
-data:
- apiToken: base64(api-token)
- projectID: base64(project-id)
-```
-
-Please look up https://www.packet.com/developers/api/ as well.
-
-## `InfrastructureConfig`
-
-Currently, there is no infrastructure configuration possible for the Packet environment.
-
-An example `InfrastructureConfig` for the Packet extension looks as follows:
-
-```yaml
-apiVersion: packet.provider.extensions.gardener.cloud/v1alpha1
-kind: InfrastructureConfig
-```
-
-The Packet extension will only create a key pair.
-
-## `ControlPlaneConfig`
-
-The control plane configuration mainly contains values for the Packet-specific control plane components.
-Today, the Packet extension deploys the `cloud-controller-manager` and the CSI controllers, however, it doesn't offer any configuration options at the moment.
-
-An example `ControlPlaneConfig` for the Packet extension looks as follows:
-
-```yaml
-apiVersion: packet.provider.extensions.gardener.cloud/v1alpha1
-kind: ControlPlaneConfig
-```
-
-## Example `Shoot` manifest
-
-Please find below an example `Shoot` manifest:
-
-```yaml
-apiVersion: core.gardener.cloud/v1alpha1
-kind: Shoot
-metadata:
- name: johndoe-packet
- namespace: garden-dev
-spec:
- cloudProfileName: packet
- region: EWR1
- secretBindingName: core-packet
- provider:
- type: packet
- infrastructureConfig:
- apiVersion: packet.provider.extensions.gardener.cloud/v1alpha1
- kind: InfrastructureConfig
- controlPlaneConfig:
- apiVersion: packet.provider.extensions.gardener.cloud/v1alpha1
- kind: ControlPlaneConfig
- workers:
- - name: worker-xoluy
- machine:
- type: t1.small
- minimum: 2
- maximum: 2
- volume:
- size: 50Gi
- type: storage_1
- networking:
- nodes: 10.250.0.0/16
- type: calico
- kubernetes:
- version: 1.16.1
- maintenance:
- autoUpdate:
- kubernetesVersion: true
- machineImageVersion: true
- addons:
- kubernetes-dashboard:
- enabled: true
- nginx-ingress:
- enabled: true
-```
diff --git a/controllers/provider-packet/docs/usage-as-operator.md b/controllers/provider-packet/docs/usage-as-operator.md
deleted file mode 100644
index 1d09dd615..000000000
--- a/controllers/provider-packet/docs/usage-as-operator.md
+++ /dev/null
@@ -1,67 +0,0 @@
-# Using the Packet provider extension with Gardener as operator
-
-The [`core.gardener.cloud/v1alpha1.CloudProfile` resource](https://github.com/gardener/gardener/blob/master/example/30-cloudprofile.yaml) declares a `providerConfig` field that is meant to contain provider-specific configuration.
-
-In this document we are describing how this configuration looks like for Packet and provide an example `CloudProfile` manifest with minimal configuration that you can use to allow creating Packet shoot clusters.
-
-## `CloudProfileConfig`
-
-The cloud profile configuration contains information about the real machine image IDs in the Packet environment (IDs).
-You have to map every version that you specify in `.spec.machineImages[].versions` here such that the Packet extension knows the ID for every version you want to offer.
-
-An example `CloudProfileConfig` for the Packet extension looks as follows:
-
-```yaml
-apiVersion: packet.provider.extensions.gardener.cloud/v1alpha1
-kind: CloudProfileConfig
-machineImages:
-- name: coreos
- versions:
- - version: 2135.6.0
- id: coreos-2135.6.0-id
-```
-
-## Example `CloudProfile` manifest
-
-Please find below an example `CloudProfile` manifest:
-
-```yaml
-apiVersion: core.gardener.cloud/v1beta1
-kind: CloudProfile
-metadata:
- name: packet
-spec:
- type: packet
- kubernetes:
- versions:
- - version: 1.16.1
- - version: 1.16.0
- expirationDate: "2020-04-05T01:02:03Z"
- machineImages:
- - name: coreos
- versions:
- - version: 2135.6.0
- machineTypes:
- - name: t1.small
- cpu: "4"
- gpu: "0"
- memory: 8Gi
- usable: true
- volumeTypes:
- - name: storage_1
- class: standard
- usable: true
- - name: storage_2
- class: performance
- usable: true
- regions:
- - name: EWR1
- providerConfig:
- apiVersion: packet.provider.extensions.gardener.cloud/v1alpha1
- kind: CloudProfileConfig
- machineImages:
- - name: coreos
- versions:
- - version: 2135.6.0
- id: coreos-2135.6.0-id
-```
diff --git a/controllers/provider-packet/example/00-componentconfig.yaml b/controllers/provider-packet/example/00-componentconfig.yaml
deleted file mode 100644
index 9807b9fca..000000000
--- a/controllers/provider-packet/example/00-componentconfig.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
----
-apiVersion: packet.provider.extensions.config.gardener.cloud/v1alpha1
-kind: ControllerConfiguration
-clientConnection:
- acceptContentTypes: application/json
- contentType: application/json
- qps: 100
- burst: 130
-etcd:
- storage:
- className: gardener.cloud-fast
- capacity: 25Gi
-#healthCheckConfig:
-# syncPeriod: 30s
\ No newline at end of file
diff --git a/controllers/provider-packet/example/10-fake-shoot-controlplane.yaml b/controllers/provider-packet/example/10-fake-shoot-controlplane.yaml
deleted file mode 100644
index cf28cea19..000000000
--- a/controllers/provider-packet/example/10-fake-shoot-controlplane.yaml
+++ /dev/null
@@ -1,183 +0,0 @@
-# This manifest creates a namespace into which an etcd as well as an kube-apiserver will be deployed.
-# Also, some certificates will be generated that are needed by the controllers. All of this together
-# is providing a test environment. The control planes deployed by Gardener look similar.
----
-apiVersion: v1
-kind: Namespace
-metadata:
- name: shoot--foobar--packet
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: etcd
- namespace: shoot--foobar--packet
-spec:
- replicas: 1
- selector:
- matchLabels:
- run: etcd
- template:
- metadata:
- labels:
- run: etcd
- spec:
- containers:
- - image: quay.io/coreos/etcd:v3.3.12
- name: etcd
- command:
- - etcd
- - -advertise-client-urls=http://0.0.0.0:2379
- - -listen-client-urls=http://0.0.0.0:2379
- - -data-dir=/etcd-data
- volumeMounts:
- - mountPath: /etcd-data
- name: data
- volumes:
- - name: data
- emptyDir: {}
----
-apiVersion: v1
-kind: Service
-metadata:
- name: etcd
- namespace: shoot--foobar--packet
-spec:
- ports:
- - port: 2379
- selector:
- run: etcd
- type: ClusterIP
----
-apiVersion: v1
-kind: Secret
-metadata:
- name: ca
- namespace: shoot--foobar--packet
-type: Opaque
-data:
- ca.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMrakNDQWVLZ0F3SUJBZ0lVVHAzWHZocldPVk04WkdlODZZb1hNVi9VSjdBd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0ZURVRNQkVHQTFVRUF4TUthM1ZpWlhKdVpYUmxjekFlRncweE9UQXlNamN4TlRNME1EQmFGdzB5TkRBeQpNall4TlRNME1EQmFNQlV4RXpBUkJnTlZCQU1UQ210MVltVnlibVYwWlhNd2dnRWlNQTBHQ1NxR1NJYjNEUUVCCkFRVUFBNElCRHdBd2dnRUtBb0lCQVFDeWkwUUdPY3YyYlRmM044T0xOOTdSd3NnSDZRQXI4d1NwQU9ydHRCSmcKRm5mblUyVDFSSGd4bTdxZDE5MFdMOERDaHYwZFpmNzZkNmVTUTRacmpqeUFyVHp1ZmI0RHRQd2crVldxN1h2RgpCTnluKzJoZjRTeVNrd2Q2azdYTGhVVFJ4MDQ4SWJCeUM0ditGRXZtb0xBd3JjMGQwRzE0ZWM2c25EKzdqTzdlCmt5a1EvTmdBT0w3UDZrRHM5ejYrYk9mZ0YwbkdOK2JtZVdRcUplalIwdCtPeVFEQ3g1L0ZNdFVmRVZSNVFYODAKYWVlZmdwM0pGWmI2ZkF3OUtoTHRkUlYzRlAwdHo2aFMrZTRTZzBtd0FBT3FpalpzVjg3a1A1R1l6anRjZkExMgpsRFlsL25iMUd0VnZ2a1FENDlWblY3bURubDZtRzNMQ01OQ05INldsWk52M0FnTUJBQUdqUWpCQU1BNEdBMVVkCkR3RUIvd1FFQXdJQkJqQVBCZ05WSFJNQkFmOEVCVEFEQVFIL01CMEdBMVVkRGdRV0JCU0ZBM0x2Sk0yMWQ4cXMKWlZWQ2U2UnJUVDl3aVRBTkJna3Foa2lHOXcwQkFRc0ZBQU9DQVFFQW5zL0VKM3lLc2p0SVNvdGVRNzE0cjJVbQpCTVB5VVlUVGRSSEQ4TFpNZDNSeWt2c2FjRjJsMnk4OE56NndKY0F1b1VqMWg4YUJEUDVvWFZ0Tm1GVDlqeWJTClRYclJ2V2krYWVZZGI1NTZuRUE1L2E5NGUrY2IrQ2szcXkvMXhnUW9TNDU3QVpRT0Rpc0RaTkJZV2tBRnMyTGMKdWNwY0F0WEp0SXRoVm03RmpvQUhZY3NyWTA0eUFpWUVKTEQwMlRqVURYZzRpR09HTWtWSGRtaGF3QkRCRjNBagplc2ZjcUZ3amk2SnlBS0ZSQUNQb3d5a1FPTkZ3VVNvbTg5dVlFU1NDSkZ2TkNrOU1KbWpKMlB6RFV0NkN5cFI0CmVwRmRkMWZYTHd1d243ZnZQTW1KcUQzSHRMYWxYMUFabVBrK0JJOGV6ZkFpVmNWcW5USlFNWGxZUHBZZTlBPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
- ca.key: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBc290RUJqbkw5bTAzOXpmRGl6ZmUwY0xJQitrQUsvTUVxUURxN2JRU1lCWjM1MU5rCjlVUjRNWnU2bmRmZEZpL0F3b2I5SFdYKytuZW5ra09HYTQ0OGdLMDg3bjIrQTdUOElQbFZxdTE3eFFUY3AvdG8KWCtFc2twTUhlcE8xeTRWRTBjZE9QQ0d3Y2d1TC9oUkw1cUN3TUszTkhkQnRlSG5Pckp3L3U0enUzcE1wRVB6WQpBRGkreitwQTdQYyt2bXpuNEJkSnhqZm01bmxrS2lYbzBkTGZqc2tBd3NlZnhUTFZIeEZVZVVGL05Hbm5uNEtkCnlSV1crbndNUFNvUzdYVVZkeFQ5TGMrb1V2bnVFb05Kc0FBRHFvbzJiRmZPNUQrUm1NNDdYSHdOZHBRMkpmNTIKOVJyVmI3NUVBK1BWWjFlNWc1NWVwaHR5d2pEUWpSK2xwV1RiOXdJREFRQUJBb0lCQURTSEZuZENiOGhMTDZqeQo1ZnZDYnpLRlBMWmZEV2JnczJGSlhOU2NJci9VUEdoNU4zMlZMRXRrQm81RG9NN1RNOEhIVnhaY0dKejFzUDR1CkVaRDVJc0cwdGZWd1Z3UGVMa05CTjd2MjdHLzFVem0wbEd1STRzVW9ybzJZZ1dha0NiQXlFOGxMSEE4aGFJbFMKelZYSHRxNUxvOG4rdFFZNXg5MHVodTJWcy8wVkRscXdNNzNhbDNrdThLRS9XMkxTK0xXMTkrYjV1UXQrZEg5ZQpjdDN5UnpHMXorUWNpT3JVN3dSNHMxTlViOGJ0eXNZNHpwNVo1bXNaMHBobXN1eWR0SVVESUpndjBYU2EzbHZsCkJ2M2M0MFhneGdHVkRHam1sS2dqbWM0TFNVVlA3Rk5wQlBZRFphL2gyTWNYeDZYYUlyd1huVVdNaUFLdi9IK0kKazdHMjRBa0NnWUVBNXBSbEJzTHVhaUsyekxpQ2k1UFNXU0xBZVZ3K1BMSGJZS2tELzBzOFhLQjEyUzI3Tk00cwpQdUpFWFMzZnFqKzl1aFhiM0VtUmxycEthVldRWDc1b1RJaG0yZDN0ZDNEbHNjOUZUcDZSdkZweU5ZUWRXZTJjClNFUE42UnF5VTlQTVBuYlhoaWp5U2ZNNGRQeGRCdUxlRG1DZWNvaDl1MzJ2bmczT3ZONXdOOVVDZ1lFQXhqcEgKV2VBbFFaTFFQNDdPNWNiejVNRVowc0JqbDA4Y3RMdUFFbU5aRnJVcWR3VjlESWdpc210OHlYWHowSWVRdGdkQwpxUWFoekdCU1lkc3JQZGtTS1JCYkw3eEdMSVhGVkNvOFhNYi83ZEJGdTI5NzBqeStBWnlXMGdycFg4UmJYU1VoCk9mZm5BeEpQY1U0Nzg5OFlpWUNTMkNUNWJaMkszRlY2YktncjFwc0NnWUVBM3ZMTlhHUlBNc0N1RC9TNEJVM0IKTGY2MExLUk1hVk52MDE2WlJ0ZndYWCtwYzMwTWJscUwzYUhhaUY0Nnpkc2tFREhpakhWMkdFKzRjM0VRVUFORAp4Zng5dGxzbnFUMjRXdDBYSHBXa1JJTVB1ejhyUWpERjAvbjd0MURnN0x6MTE5QUJSTytDbG81ZUlIK0RVNDA1Ck9KMmpsd3J5eDc4WGQ3UFNHanphTktFQ2dZQldxbkk1bENzVndVZDFFazNZM2lRUjFtOGcybVp3Wi9GSC8xWWUKTS90bVZ5ekt2c2FPYlJLbWFTSTB2bklyc0ttUFBCdGo1UGRtY0pKMElDdUdyZG9udy9QcUtlbVFXNmdMaFMvQQo3R3hHb0RGc29uQkRXYlZFNVI1M2xMZTEzQmFKNGNybUdrR1E4VGQwZFZ6MjRZcEx5Ny9uNmpwM04xTFh4RE56ClFBOXlrd0tCZ1FEUm8yR2VTeHRsUHJYNUlIakRWeTRBLzFqc3lBSTZHdEhqVXdVY3J6NVAzV1JKL0FQK1UzUisKYkUzMmxjV3A5OEFmUkZyYjFJNkYybVJXcHB2VjlFV2R0SnpjYzEyeUR1bUlUalVJdHhvMkxiY0d3SklGN1ZYZwpFODNuK0IrNmZ1WEl6Q1IyeTUrQjVyTTZPYnl1Z1NZUndGWG91dW9SeXhUL3VXRWl3U0J4ZXc9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=
----
-apiVersion: v1
-kind: Secret
-metadata:
- name: kube-apiserver
- namespace: shoot--foobar--packet
-type: Opaque
-data:
- kube-apiserver.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVEakNDQXZhZ0F3SUJBZ0lVSjQzbHJublpXSmYyTEV2OWMxVDVoaDAzb1Fvd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0ZURVRNQkVHQTFVRUF4TUthM1ZpWlhKdVpYUmxjekFlRncweE9UQTBNekF4TVRVNU1EQmFGdzB5T1RBMApNamN4TVRVNU1EQmFNQnN4R1RBWEJnTlZCQU1URUhONWMzUmxiVHBoY0dselpYSjJaWEl3Z2dFaU1BMEdDU3FHClNJYjNEUUVCQVFVQUE0SUJEd0F3Z2dFS0FvSUJBUURFTjVKUUhsODJKeTdWeDcvT3VDOWl6dFhPZG1CSUV6Q0sKY3VCa0RxbVZhY3ZLUi90VjhZellCb2lVZCtVR0dKWG5TSFVjT1ArR200a0tPQkxOMDNpV3Fkakx2amU5d0tiZgp2ZVoxKzhaSFdDdUtTWXEzZE5BdXdKSzZqdnl3dDErOHhZUS9uYzVGYWkvR0owVE92NFE5YUlZd0VUV0t5eVFyCm4vU2NyY1M5NXJQTFhueFQvbVlxZCttczhBc0RQOUNDRWZoQnRCejN4ZmJ3RHk4L1BkSnp5dC9mOVVqR3JhcjMKbU1sbzdUL1V1VTcxYk1TUU1tNWtHZXNFSXU1RkozL2t5NTlpamdScW5FQ0JUbkZSeENzamh3anRQSkYveHFZYwpQdlJIT3RweU5nTUVsRmZqRlh5ZkU3Z1UzaGJScGRRRmtYeEpGT2V6eGdyMzQrRTN0SkFCQWdNQkFBR2pnZ0ZPCk1JSUJTakFPQmdOVkhROEJBZjhFQkFNQ0JhQXdFd1lEVlIwbEJBd3dDZ1lJS3dZQkJRVUhBd0V3REFZRFZSMFQKQVFIL0JBSXdBREFkQmdOVkhRNEVGZ1FVMktlb2lxUEJQN29aRmEyVFJqcTFzU25xdkkwd0h3WURWUjBqQkJndwpGb0FVaFFOeTd5VE50WGZLckdWVlFudWthMDAvY0lrd2dkUUdBMVVkRVFTQnpEQ0J5WUlPYTNWaVpTMWhjR2x6ClpYSjJaWEtDSG10MVltVXRZWEJwYzJWeWRtVnlMbk5vYjI5MExTMW1iMjh0TFdKaGNvSWlhM1ZpWlMxaGNHbHoKWlhKMlpYSXVjMmh2YjNRdExXWnZieTB0WW1GeUxuTjJZNElLYTNWaVpYSnVaWFJsYzRJU2EzVmlaWEp1WlhSbApjeTVrWldaaGRXeDBnaFpyZFdKbGNtNWxkR1Z6TG1SbFptRjFiSFF1YzNaamdpUnJkV0psY201bGRHVnpMbVJsClptRjFiSFF1YzNaakxtTnNkWE4wWlhJdWJHOWpZV3lDQ1d4dlkyRnNhRzl6ZEljRWZ3QUFBWWNFWkVBQUFUQU4KQmdrcWhraUc5dzBCQVFzRkFBT0NBUUVBcENGSmkxaWx2SDZEc1VuSmxRTDhOcEttN0dXejJoSWlPd2hqQzZHeQp0TjVhWGNDdXkyc0RvRFB2R1dHd3NEZjhHL1JyTGIwNEhJU0JUbUhTUGJvNHZQSnQvcXBacU10bGtLOWFOQ3NlCmtEU3E5UTM5a0hFSmtNcmgrYnpJMUtVa1gycEZoZ0g0bG5qZzA5TVc1KzdMTVBJRXdSVFpjanc5WjJuM0QxTVYKeUIveFpTR1h3V0JSbVg4cjdJcEVmYzNQK0Rmc015MUdEN2c5S2p0cVRIUkg5Tml3cUhoSFpOMkZYZ2w1S2JWYQpjcmwrQmxjemZtbUNubEFOMmpONU85YzV1dHhLRDVOVEdVS1R2b2J0Rkt0VE55dUV0THk2WUZBd2ZGSEx3aEZaCkdURGxJdWpPNVlyK2g0bHpqQ1ZHSCtZdWZSYzRSbVRXMHNadTZseVRiRjRGdnc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
- kube-apiserver.key: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFb2dJQkFBS0NBUUVBeERlU1VCNWZOaWN1MWNlL3pyZ3ZZczdWem5aZ1NCTXdpbkxnWkE2cGxXbkx5a2Y3ClZmR00yQWFJbEhmbEJoaVY1MGgxSERqL2hwdUpDamdTemRONGxxbll5NzQzdmNDbTM3M21kZnZHUjFncmlrbUsKdDNUUUxzQ1N1bzc4c0xkZnZNV0VQNTNPUldvdnhpZEV6citFUFdpR01CRTFpc3NrSzUvMG5LM0V2ZWF6eTE1OApVLzVtS25mcHJQQUxBei9RZ2hINFFiUWM5OFgyOEE4dlB6M1NjOHJmMy9WSXhxMnE5NWpKYU8wLzFMbE85V3pFCmtESnVaQm5yQkNMdVJTZC81TXVmWW80RWFweEFnVTV4VWNRckk0Y0k3VHlSZjhhbUhENzBSenJhY2pZREJKUlgKNHhWOG54TzRGTjRXMGFYVUJaRjhTUlRuczhZSzkrUGhON1NRQVFJREFRQUJBb0lCQUJsZGRiU1Z1SWt2bDRaYgpSQmhkQndNbTZjeSswTU9BZDQzdU84T3pnWWluSElrUnRSUHZIZDN2T2tpM0Z3d3FzWFlzajdjT1J6b0hjVGU0CjkvVlRtUXNnK2IyYzRXZk9OOFJFc0Q0Z1JnbURCRjNrRStLVFh6WXIvc3ZQSUN0WUNUQkYrRXFoQThGRmNOZVUKeS9oT0diSTJpT0k5MTBZUjdLTVhFbkFPcHBoRnVCYzhJbXRrT2w2MWZlRG15ZnRzTnZ1N25FSXRTeldDZy9XawpoUHVWYTZWMGxETEdjK2JRQi82bGVoK1FvNWxhRmRBSnhjT25VOUYzcWtMTVUrbnZ5YUh5OHR4L25VbitJK3pECnV1VGdJQngzUC91cGVSYi8rQUZvSGN4L3hRZDc5V3h1UXdyYlYrL3RmMzN4SE9VQXNYMTYvYWd2eHY2TzhpdmUKRXBKN3JJRUNnWUVBeEtseHdnYWVwaWo1b0tKVzJJTVE5emFVMEs0Ykh5QTVKV3l1cThQd1BQWmpMalhWNFE4aQpidHlOWW1VK2xMMDZxUDUrdWdBUDduamVoRHM0NktJMUlVa1Nvamx2WUhUTSswUHQ0WUZiVHlMYVh4QW5qRXVyCmtHeXBnUmdWRi9ZSm1zVms3bDIrakF5U2NFeE9nNDFudmJRMzh5L0NMNEZjT3pmUkdEVTRINDBDZ1lFQS8ydkUKeW9OU2hhaUp3QVpaRExrTHVXTVp6UDNxUzFyaDNaaGt5UmxUcHBENm50UWEyaVEwK0hXSDM3c1QzRmlYa28rNApjU015OUN1cnNsL05EV3l2aXNzMDJ0bkJScG5ZaFBoK0VHWnY5ZmkzYUVQR3k2ZmR0cVEzNituWG9kOS9hcWNGClhhUlVyZjdoZ212MUJQQ3NtMVFkZldaRjdxTmQ4Y0FRNWdCZEMwVUNnWUJuZTFYZHA4Z1JYTnhGdDBhRmRTb1gKTzBSQkxtd2RDOEttTzdNSnRQZVR6SDVSMFlneWZkazdocGhxM3lWMzlMNktNQ2dVelhXVW9VdE5QekJwMFBpdQpCQnBtL0Z2cjRHb0FDVFdDQktROFZ2V2JNZy90VmQvNEJnV0haVm1zR3czZ3Y5K2xRZlRERXRaM2V0K1JmM1hJCkw2MkZMR3M4dmcvL0pSYkVhelNWL1FLQmdEOWUrYUJWSExCVXRIaVVHcHZ4ZlZzdG4wVWc2blJ2eEFJNndTYXoKeGZGWm54U3hBMGlFR3pCWjJMQkZ0aFBCVnpuaHRwMDdZblQ2TU1zOHdaOUhDL2FmbkNtQVJWZkM2OWx4M2JVcgo5VE5OMWhOa1hYcEIxOXhzdWdNcUxYblgvY0QwVjN4NFBSbytWcTBKSSsxcDJTbGdvVUJ2azRJMXZpVXd4Z0NLCnJvc1JBb0dBVkVDODI4YlRXYk1xVzlBN2tCVWJzQWpMdHJZNVZhNjFjeGg5M2pOeHpJbnlHS2JEMVF5ZEFRSXMKNDlrcjZUSURaZUpGY2M5ZjFaQU5RRjZSTXRLL1g2QzFjRjl5TEJTWXNTL1d5VTg1dzhtbFN3SmNqcCtnWWNYVApZaE9vdHloM0dwbnlnSGQycUw3M1pIVmMrRFFVZWdJTkdSbGhUM2YxWjFiQmxpd0VyU2s9Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==
----
-apiVersion: v1
-kind: Secret
-metadata:
- name: gardener
- namespace: shoot--foobar--packet
-type: Opaque
-data:
- ca.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMrakNDQWVLZ0F3SUJBZ0lVVHAzWHZocldPVk04WkdlODZZb1hNVi9VSjdBd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0ZURVRNQkVHQTFVRUF4TUthM1ZpWlhKdVpYUmxjekFlRncweE9UQXlNamN4TlRNME1EQmFGdzB5TkRBeQpNall4TlRNME1EQmFNQlV4RXpBUkJnTlZCQU1UQ210MVltVnlibVYwWlhNd2dnRWlNQTBHQ1NxR1NJYjNEUUVCCkFRVUFBNElCRHdBd2dnRUtBb0lCQVFDeWkwUUdPY3YyYlRmM044T0xOOTdSd3NnSDZRQXI4d1NwQU9ydHRCSmcKRm5mblUyVDFSSGd4bTdxZDE5MFdMOERDaHYwZFpmNzZkNmVTUTRacmpqeUFyVHp1ZmI0RHRQd2crVldxN1h2RgpCTnluKzJoZjRTeVNrd2Q2azdYTGhVVFJ4MDQ4SWJCeUM0ditGRXZtb0xBd3JjMGQwRzE0ZWM2c25EKzdqTzdlCmt5a1EvTmdBT0w3UDZrRHM5ejYrYk9mZ0YwbkdOK2JtZVdRcUplalIwdCtPeVFEQ3g1L0ZNdFVmRVZSNVFYODAKYWVlZmdwM0pGWmI2ZkF3OUtoTHRkUlYzRlAwdHo2aFMrZTRTZzBtd0FBT3FpalpzVjg3a1A1R1l6anRjZkExMgpsRFlsL25iMUd0VnZ2a1FENDlWblY3bURubDZtRzNMQ01OQ05INldsWk52M0FnTUJBQUdqUWpCQU1BNEdBMVVkCkR3RUIvd1FFQXdJQkJqQVBCZ05WSFJNQkFmOEVCVEFEQVFIL01CMEdBMVVkRGdRV0JCU0ZBM0x2Sk0yMWQ4cXMKWlZWQ2U2UnJUVDl3aVRBTkJna3Foa2lHOXcwQkFRc0ZBQU9DQVFFQW5zL0VKM3lLc2p0SVNvdGVRNzE0cjJVbQpCTVB5VVlUVGRSSEQ4TFpNZDNSeWt2c2FjRjJsMnk4OE56NndKY0F1b1VqMWg4YUJEUDVvWFZ0Tm1GVDlqeWJTClRYclJ2V2krYWVZZGI1NTZuRUE1L2E5NGUrY2IrQ2szcXkvMXhnUW9TNDU3QVpRT0Rpc0RaTkJZV2tBRnMyTGMKdWNwY0F0WEp0SXRoVm03RmpvQUhZY3NyWTA0eUFpWUVKTEQwMlRqVURYZzRpR09HTWtWSGRtaGF3QkRCRjNBagplc2ZjcUZ3amk2SnlBS0ZSQUNQb3d5a1FPTkZ3VVNvbTg5dVlFU1NDSkZ2TkNrOU1KbWpKMlB6RFV0NkN5cFI0CmVwRmRkMWZYTHd1d243ZnZQTW1KcUQzSHRMYWxYMUFabVBrK0JJOGV6ZkFpVmNWcW5USlFNWGxZUHBZZTlBPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
- gardener.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURSRENDQWl5Z0F3SUJBZ0lVRWFQVkVoYXMyck5wMHRwQWVwbGs2UE00emZrd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0ZURVRNQkVHQTFVRUF4TUthM1ZpWlhKdVpYUmxjekFlRncweE9UQXlNamN4TlRNMU1EQmFGdzB5T1RBeQpNalF4TlRNMU1EQmFNQ3d4RnpBVkJnTlZCQW9URG5ONWMzUmxiVHB0WVhOMFpYSnpNUkV3RHdZRFZRUURFd2huCllYSmtaVzVsY2pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTUlJRTd3SVJ4amEKYlcrdldJTFF1QjZ6WkI0by9vU0NOaWp1UVZGQy9FYkhzREtJZjVNcHpnWlMrQ3FTbFBTYnM3UkNvL2JPVVhCcApLZE52c01lOW82RXRGSnZTd3MrTlFpY0d5TEsvN2FTZmhwQkYyL3R6amUzYU40MiswS2RaRG81TWNuWW1PYVY4CmtFeGhRbmpyQkVQd05hRW12MnRyTGljdG1XYjNBZjFKZmgrU0RkNkh6S1ZkS2FWYzd1R2NvOEtSL2xxRTBNUGkKRkI0clFabnJvNFMxMXVVSWx6ckc2VFdvZVNUMXlrWXlSazNxQnlLSG12NnBUaWhKa2ZWcXRLS0RWNzdTajZIOApkenIvdm1WMlpSYzhVSTh4d3Y0ZVgvbjQzcXpwUHNJNU14a0FHQ0tkSTVFb3lvSHNtTWNJckQ1d1NkZkNHd3F5Ckd2U3drNTBDaiswQ0F3RUFBYU4xTUhNd0RnWURWUjBQQVFIL0JBUURBZ1dnTUJNR0ExVWRKUVFNTUFvR0NDc0cKQVFVRkJ3TUNNQXdHQTFVZEV3RUIvd1FDTUFBd0hRWURWUjBPQkJZRUZPUk1UTnF1eWFQaERQY1ZiSDZxZlQ3eApBZE50TUI4R0ExVWRJd1FZTUJhQUZJVURjdThremJWM3lxeGxWVUo3cEd0TlAzQ0pNQTBHQ1NxR1NJYjNEUUVCCkN3VUFBNElCQVFBUXZGOFRlZFBlL2F1WWxNM2t0aW9sRlpIcHpSSG5QcHZjU3hOWU03ZE5IbjBFOWlPRFlYK1AKUTZBZ1lGcE5XRzN6V0dqZC9jQXJwVXhjb25CV2FwWmpCWHhKYS9oL0htSktpdHRDVmRGM2NVQ0lwK3VZdVYyWgpsR3l5TmM4ZHRVanFKZmd3cVkrQzZxZmFUVmQ3SlZRcjlZczZhTWl5TEZEclh3N1ZFWU5CWWZUUEwrSWRGUzVDCjIxSXNXY2w4bGJLa3RTYWxVTlF1NUNVTFVBT3FhdXJpRCt2QTl3TW8wZERtMGMrQTZLUEJNOVVzay9tNlFXcmwKWTRjb1cwT1ArZG9BelpMeUpTRDQ3UUdRWTVOZHB6Rm5lR2o0Y3pMSFgyMVJudkc0SFV2VlpjcTZGdmFPZitnRwpzRGc5emsrRzRoV2hrNGlZV0dnQnJTU3ZwR01XZzY0RQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
- gardener.key: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBd2dnVHZBaEhHTnB0YjY5WWd0QzRIck5rSGlqK2hJSTJLTzVCVVVMOFJzZXdNb2gvCmt5bk9CbEw0S3BLVTlKdXp0RUtqOXM1UmNHa3AwMit3eDcyam9TMFVtOUxDejQxQ0p3Yklzci90cEorR2tFWGIKKzNPTjdkbzNqYjdRcDFrT2preHlkaVk1cFh5UVRHRkNlT3NFUS9BMW9TYS9hMnN1SnkyWlp2Y0IvVWwrSDVJTgozb2ZNcFYwcHBWenU0Wnlqd3BIK1dvVFF3K0lVSGl0Qm1ldWpoTFhXNVFpWE9zYnBOYWg1SlBYS1JqSkdUZW9ICklvZWEvcWxPS0VtUjlXcTBvb05YdnRLUG9meDNPdisrWlhabEZ6eFFqekhDL2g1ZitmamVyT2srd2prekdRQVkKSXAwamtTaktnZXlZeHdpc1BuQkoxOEliQ3JJYTlMQ1RuUUtQN1FJREFRQUJBb0lCQVFDeVd0NVpEM3JiRzUxUQo5bXQwQkF2YkhLZEJHZ21ySUU1TW5ZV28vdHdLNisvSTQ3UHhRSkpET2Uwb3BRa0xPRHlkekV3UHlHTVA0M3N4CkFoQUw2d1FJV2ZvQnFtQ3NqSHBzaVUzZkVaR09xNXp6N1dOaTVqdG1raHBTenozWk5vR3N5QlRIQ2lnZk9Ec2sKR3BzUnIyYUNWTUhYV2xqR2t3VWZ1a2l5WHdlVEhHckFsVGlNdHErakN0N0NvK1VGMDR0VUVBMVZHajlOT2ZSbQpwNmp5OTVlVkpyWmtkVkZ2UUtSeDRnczJtcFg0bnBHaFhKUExQYk14RXExNzJyalZqbWpxRjZPTGU0YVBRd2g5CkN5cGdmUjBCM2M5enU0MlBnSTFtU1o1UHRPK2pabS9udmRnZkZIOHlRVnIwTll6bHVQS2VRb0dvTFpnMWI5dTYKdndWYnUwMjVBb0dCQU94MGYza1NMbUNJWGJ1T3h1bzNEWk1nQmFINXpCOEdqWVFJVmVnVHA4RUM4bWd2c2J1agppSFpjaFFQZjFjVExaMmhqTUYvK01VM2RVMXFpU2RpaEEyOG9hY3ozV283QjNrVW91ZU5kTDFwa251TURjMUMzClA5NzFrK25MTUNXZDdERXBSc2tJaUVXTXQ1Y2E4bFpGd1pRcno1aEFTZ1BVOGd3bStSaGh0SEdyQW9HQkFOSVIKNEpPVlNZVGpvSU53bjBpYjNyMGJvT0ZRcXlVa1Y0NWJmY3RNYzhxbngwYWx1Q0ZCVDBjdGhnYUVIdlRpWnZGQwowMVVHWFBSSEg0TXdiZmlDcnhoTE9hTFYwYkdaOSs4VTNkYVFOSDJSRjFtSVZOL0lYRG9GWUR5dlFrUm90OGFQCnI0VEhLWUIwNGVCSWlsS1NRRUEzbUFRN3l3RjdaQ1RqMm9PWGJwekhBb0dBSU5qT0hITjZIYzdUdG9wTzk1cE8KT0hIcVZtWHRCU0pUNWxPQ0c0c2ZjcUNHTEJMMERhelorQmRDSXhlbENvRjNDL2s3YnhwUW54QnYwOWRYaXRCVApPYzNUWkxXM3pyei9zM3ZFMXVETEF6T1hIdElMNHRxUjlOY0loU0hFdm5VQnFwS2hVcXZzd2p5YUJGT3A5bklhClFnc1QrNEp5eGJWL0tsRC9xWE5wTGFFQ2dZQThNLzltakZ3N2gzalM4bzNUbzBnY2JqU1hIaVZPU2JJR0RGWnEKMHdoRVJmMG9WQW9IRGM2SW1aVlZmTHZhZHFBRitKN1VPVFNlbFZ1RW4zYUV4LzhpT1R6VlcrM3l0aXVHQ3piZwpiUWQrRFB6aUhkNGxIQ2pDUUJRcWtCZXZ2MHNienNZQWlZdHRVeElBMHdsQlRNUzVJcldnVVBxRy9EUGhGcVBqCkhwMEd0UUtCZ1FDd2RqOE9SMkRROUJ4VlI5ejFzMEZvSG1rNDRQaDFtUEt0bVVmMWZoZEhDN2tsMlVURm5yVXIKd1hyWWZqVjRsSHVjaitvMklNUjBGVCs4QjJZS0FWTGNMZEZyaWJtY0cxZHNrRHR0bXBxdWpLY2t1OXAveWdmNApxd0Z5QWJjR0I2OGtRZVpJSXVYOTM3UzJRY3AxUExwVjl2Zm9JUURkRVVBM1JBTjBSRC80ZlE9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=
- kubeconfig: LS0tCmFwaVZlcnNpb246IHYxCmtpbmQ6IENvbmZpZwpjdXJyZW50LWNvbnRleHQ6IHNtYWxsLWNsdXN0ZXIKY2x1c3RlcnM6Ci0gbmFtZTogc21hbGwtY2x1c3RlcgogIGNsdXN0ZXI6CiAgICBjZXJ0aWZpY2F0ZS1hdXRob3JpdHktZGF0YTogTFMwdExTMUNSVWRKVGlCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2sxSlNVTXJha05EUVdWTFowRjNTVUpCWjBsVlZIQXpXSFpvY2xkUFZrMDRXa2RsT0RaWmIxaE5WaTlWU2pkQmQwUlJXVXBMYjFwSmFIWmpUa0ZSUlV3S1FsRkJkMFpVUlZSTlFrVkhRVEZWUlVGNFRVdGhNMVpwV2xoS2RWcFlVbXhqZWtGbFJuY3dlRTlVUVhsTmFtTjRUbFJOTUUxRVFtRkdkekI1VGtSQmVRcE5hbGw0VGxSTk1FMUVRbUZOUWxWNFJYcEJVa0puVGxaQ1FVMVVRMjEwTVZsdFZubGliVll3V2xoTmQyZG5SV2xOUVRCSFExTnhSMU5KWWpORVVVVkNDa0ZSVlVGQk5FbENSSGRCZDJkblJVdEJiMGxDUVZGRGVXa3dVVWRQWTNZeVlsUm1NMDQ0VDB4T09UZFNkM05uU0RaUlFYSTRkMU53UVU5eWRIUkNTbWNLUm01bWJsVXlWREZTU0dkNGJUZHhaREU1TUZkTU9FUkRhSFl3WkZwbU56WmtObVZUVVRSYWNtcHFlVUZ5VkhwMVptSTBSSFJRZDJjclZsZHhOMWgyUmdwQ1RubHVLekpvWmpSVGVWTnJkMlEyYXpkWVRHaFZWRko0TURRNFNXSkNlVU0wZGl0R1JYWnRiMHhCZDNKak1HUXdSekUwWldNMmMyNUVLemRxVHpkbENtdDVhMUV2VG1kQlQwdzNVRFpyUkhNNWVqWXJZazltWjBZd2JrZE9LMkp0WlZkUmNVcGxhbEl3ZEN0UGVWRkVRM2cxTDBaTmRGVm1SVlpTTlZGWU9EQUtZV1ZsWm1kd00wcEdXbUkyWmtGM09VdG9USFJrVWxZelJsQXdkSG8yYUZNclpUUlRaekJ0ZDBGQlQzRnBhbHB6VmpnM2ExQTFSMWw2YW5SalprRXhNZ3BzUkZsc0wyNWlNVWQwVm5aMmExRkVORGxXYmxZM2JVUnViRFp0UnpOTVEwMU9RMDVJTmxkc1drNTJNMEZuVFVKQlFVZHFVV3BDUVUxQk5FZEJNVlZrQ2tSM1JVSXZkMUZGUVhkSlFrSnFRVkJDWjA1V1NGSk5Ra0ZtT0VWQ1ZFRkVRVkZJTDAxQ01FZEJNVlZrUkdkUlYwSkNVMFpCTTB4MlNrMHlNV1E0Y1hNS1dsWldRMlUyVW5KVVZEbDNhVlJCVGtKbmEzRm9hMmxIT1hjd1FrRlJjMFpCUVU5RFFWRkZRVzV6TDBWS00zbExjMnAwU1ZOdmRHVlJOekUwY2pKVmJRcENUVkI1VlZsVVZHUlNTRVE0VEZwTlpETlNlV3QyYzJGalJqSnNNbms0T0U1Nk5uZEtZMEYxYjFWcU1XZzRZVUpFVURWdldGWjBUbTFHVkRscWVXSlRDbFJZY2xKMlYya3JZV1ZaWkdJMU5UWnVSVUUxTDJFNU5HVXJZMklyUTJzemNYa3ZNWGhuVVc5VE5EVTNRVnBSVDBScGMwUmFUa0paVjJ0QlJuTXlUR01LZFdOd1kwRjBXRXAwU1hSb1ZtMDNSbXB2UVVoWlkzTnlXVEEwZVVGcFdVVktURVF3TWxScVZVUllaelJwUjA5SFRXdFdTR1J0YUdGM1FrUkNSak5CYWdwbGMyWmpjVVozYW1rMlNubEJTMFpTUVVOUWIzZDVhMUZQVGtaM1ZWTnZiVGc1ZFZsRlUxTkRTa1oyVGtOck9VMUtiV3BLTWxCNlJGVjBOa041Y0ZJMENtVndSbVJrTVdaWVRIZDFkMjQzWm5aUVRXMUtjVVF6U0hSTVlXeFlNVUZhYlZCckswSkpPR1Y2WmtGcFZtTldjVzVVU2xGTldHeFpVSEJaWlRsQlBUMEtMUzB0TFMxRlRrUWdRMFZTVkVsR1NVTkJWRVV0TFMwdExRbz0KICAgIHNlcnZlcjogaHR0cHM6Ly9sb2NhbGhvc3Q6MzIyMjMKY29udGV4dHM6Ci0gbmFtZTogc21hbGwtY2x1c3RlcgogIGNvbnRleHQ6CiAgICBjbHVzdGVyOiBzbWFsbC1jbHVzdGVyCiAgICB1c2VyOiBzbWFsbC1jbHVzdGVyCnVzZXJzOgotIG5hbWU6IHNtYWxsLWNsdXN0ZXIKICB1c2VyOgogICAgY2xpZW50LWNlcnRpZmljYXRlLWRhdGE6IExTMHRMUzFDUlVkSlRpQkRSVkpVU1VaSlEwRlVSUzB0TFMwdENrMUpTVVJTUkVORFFXbDVaMEYzU1VKQlowbFZSV0ZRVmtWb1lYTXljazV3TUhSd1FXVndiR3MyVUUwMGVtWnJkMFJSV1VwTGIxcEphSFpqVGtGUlJVd0tRbEZCZDBaVVJWUk5Ra1ZIUVRGVlJVRjRUVXRoTTFacFdsaEtkVnBZVW14amVrRmxSbmN3ZUU5VVFYbE5hbU40VGxSTk1VMUVRbUZHZHpCNVQxUkJlUXBOYWxGNFRsUk5NVTFFUW1GTlEzZDRSbnBCVmtKblRsWkNRVzlVUkc1T05XTXpVbXhpVkhCMFdWaE9NRnBZU25wTlVrVjNSSGRaUkZaUlVVUkZkMmh1Q2xsWVNtdGFWelZzWTJwRFEwRlRTWGRFVVZsS1MyOWFTV2gyWTA1QlVVVkNRbEZCUkdkblJWQkJSRU5EUVZGdlEyZG5SVUpCVFVsSlJUZDNTVko0YW1FS1lsY3JkbGRKVEZGMVFqWjZXa0kwYnk5dlUwTk9hV3AxVVZaR1F5OUZZa2h6UkV0SlpqVk5jSHBuV2xNclEzRlRiRkJUWW5NM1VrTnZMMkpQVlZoQ2NBcExaRTUyYzAxbE9XODJSWFJHU25aVGQzTXJUbEZwWTBkNVRFc3ZOMkZUWm1od1FrWXlMM1I2YW1VellVNDBNaXN3UzJSYVJHODFUV051V1cxUFlWWTRDbXRGZUdoUmJtcHlRa1ZRZDA1aFJXMTJNblJ5VEdsamRHMVhZak5CWmpGS1ptZ3JVMFJrTmtoNlMxWmtTMkZXWXpkMVIyTnZPRXRTTDJ4eFJUQk5VR2tLUmtJMGNsRmFibkp2TkZNeE1YVlZTV3g2Y2tjMlZGZHZaVk5VTVhscldYbFNhek54UW5sTFNHMTJObkJVYVdoS2EyWldjWFJMUzBSV056ZFRhalpJT0Fwa2VuSXZkbTFXTWxwU1l6aFZTVGg0ZDNZMFpWZ3ZialF6Y1hwd1VITkpOVTE0YTBGSFEwdGtTVFZGYjNsdlNITnRUV05KY2tRMWQxTmtaa05IZDNGNUNrZDJVM2RyTlRCRGFpc3dRMEYzUlVGQllVNHhUVWhOZDBSbldVUldVakJRUVZGSUwwSkJVVVJCWjFkblRVSk5SMEV4VldSS1VWRk5UVUZ2UjBORGMwY0tRVkZWUmtKM1RVTk5RWGRIUVRGVlpFVjNSVUl2ZDFGRFRVRkJkMGhSV1VSV1VqQlBRa0paUlVaUFVrMVVUbkYxZVdGUWFFUlFZMVppU0RaeFpsUTNlQXBCWkU1MFRVSTRSMEV4VldSSmQxRlpUVUpoUVVaSlZVUmpkVGhyZW1KV00zbHhlR3hXVlVvM2NFZDBUbEF6UTBwTlFUQkhRMU54UjFOSllqTkVVVVZDQ2tOM1ZVRkJORWxDUVZGQlVYWkdPRlJsWkZCbEwyRjFXV3hOTTJ0MGFXOXNSbHBJY0hwU1NHNVFjSFpqVTNoT1dVMDNaRTVJYmpCRk9XbFBSRmxZSzFBS1VUWkJaMWxHY0U1WFJ6TjZWMGRxWkM5alFYSndWWGhqYjI1Q1YyRndXbXBDV0hoS1lTOW9MMGh0U2t0cGRIUkRWbVJHTTJOVlEwbHdLM1ZaZFZZeVdncHNSM2w1VG1NNFpIUlZhbkZLWm1kM2NWa3JRelp4Wm1GVVZtUTNTbFpSY2psWmN6WmhUV2w1VEVaRWNsaDNOMVpGV1U1Q1dXWlVVRXdyU1dSR1V6VkRDakl4U1hOWFkydzRiR0pMYTNSVFlXeFZUbEYxTlVOVlRGVkJUM0ZoZFhKcFJDdDJRVGwzVFc4d1pFUnRNR01yUVRaTFVFSk5PVlZ6YXk5dE5sRlhjbXdLV1RSamIxY3dUMUFyWkc5QmVscE1lVXBUUkRRM1VVZFJXVFZPWkhCNlJtNWxSMm8wWTNwTVNGZ3lNVkp1ZGtjMFNGVjJWbHBqY1RaR2RtRlBaaXRuUndwelJHYzVlbXNyUnpSb1YyaHJOR2xaVjBkblFuSlRVM1p3UjAxWFp6WTBSUW90TFMwdExVVk9SQ0JEUlZKVVNVWkpRMEZVUlMwdExTMHRDZz09CiAgICBjbGllbnQta2V5LWRhdGE6IExTMHRMUzFDUlVkSlRpQlNVMEVnVUZKSlZrRlVSU0JMUlZrdExTMHRMUXBOU1VsRmNFRkpRa0ZCUzBOQlVVVkJkMmRuVkhaQmFFaEhUbkIwWWpZNVdXZDBRelJJY2s1clNHbHFLMmhKU1RKTFR6VkNWVlZNT0ZKelpYZE5iMmd2Q210NWJrOUNiRXcwUzNCTFZUbEtkWHAwUlV0cU9YTTFVbU5IYTNBd01pdDNlRGN5YW05VE1GVnRPVXhEZWpReFEwcDNZa2x6Y2k5MGNFb3JSMnRGV0dJS0t6TlBUamRrYnpOcVlqZFJjREZyVDJwcmVIbGthVmsxY0ZoNVVWUkhSa05sVDNORlVTOUJNVzlUWVM5aE1uTjFTbmt5V2xwMlkwSXZWV3dyU0RWSlRnb3piMlpOY0ZZd2NIQldlblUwV25scWQzQklLMWR2VkZGM0swbFZTR2wwUW0xbGRXcG9URmhYTlZGcFdFOXpZbkJPWVdnMVNsQllTMUpxU2tkVVpXOUlDa2x2WldFdmNXeFBTMFZ0VWpsWGNUQnZiMDVZZG5STFVHOW1lRE5QZGlzcldsaGFiRVo2ZUZGcWVraERMMmcxWml0bWFtVnlUMnNyZDJwcmVrZFJRVmtLU1hBd2FtdFRha3RuWlhsWmVIZHBjMUJ1UWtveE9FbGlRM0pKWVRsTVExUnVVVXRRTjFGSlJFRlJRVUpCYjBsQ1FWRkRlVmQwTlZwRU0zSmlSelV4VVFvNWJYUXdRa0YyWWtoTFpFSkhaMjF5U1VVMVRXNVpWMjh2ZEhkTE5pc3ZTVFEzVUhoUlNrcEVUMlV3YjNCUmEweFBSSGxrZWtWM1VIbEhUVkEwTTNONENrRm9RVXcyZDFGSlYyWnZRbkZ0UTNOcVNIQnphVlV6WmtWYVIwOXhOWHA2TjFkT2FUVnFkRzFyYUhCVGVub3pXazV2UjNONVFsUklRMmxuWms5RWMyc0tSM0J6VW5JeVlVTldUVWhZVjJ4cVIydDNWV1oxYTJsNVdIZGxWRWhIY2tGc1ZHbE5kSEVyYWtOME4wTnZLMVZHTURSMFZVVkJNVlpIYWpsT1QyWlNiUXB3Tm1wNU9UVmxWa3B5V210a1ZrWjJVVXRTZURSbmN6SnRjRmcwYm5CSGFGaEtVRXhRWWsxNFJYRXhOekp5YWxacWJXcHhSalpQVEdVMFlWQlJkMmc1Q2tONWNHZG1VakJDTTJNNWVuVTBNbEJuU1RGdFUxbzFVSFJQSzJwYWJTOXVkbVJuWmtaSU9IbFJWbkl3VGxsNmJIVlFTMlZSYjBkdlRGcG5NV0k1ZFRZS2RuZFdZblV3TWpWQmIwZENRVTk0TUdZemExTk1iVU5KV0dKMVQzaDFiek5FV2sxblFtRklOWHBDT0VkcVdWRkpWbVZuVkhBNFJVTTRiV2QyYzJKMWFncHBTRnBqYUZGUVpqRmpWRXhhTW1ocVRVWXZLMDFWTTJSVk1YRnBVMlJwYUVFeU9HOWhZM296VjI4M1FqTnJWVzkxWlU1a1RERndhMjUxVFVSak1VTXpDbEE1TnpGcksyNU1UVU5YWkRkRVJYQlNjMnRKYVVWWFRYUTFZMkU0YkZwR2QxcFJjbm8xYUVGVFoxQlZPR2QzYlN0U2FHaDBTRWR5UVc5SFFrRk9TVklLTkVwUFZsTlpWR3B2U1U1M2JqQnBZak55TUdKdlQwWlJjWGxWYTFZME5XSm1ZM1JOWXpoeGJuZ3dZV3gxUTBaQ1ZEQmpkR2huWVVWSWRsUnBXblpHUXdvd01WVkhXRkJTU0VnMFRYZGlabWxEY25ob1RFOWhURll3WWtkYU9TczRWVE5rWVZGT1NESlNSakZ0U1ZaT0wwbFlSRzlHV1VSNWRsRnJVbTkwT0dGUUNuSTBWRWhMV1VJd05HVkNTV2xzUzFOUlJVRXpiVUZSTjNsM1JqZGFRMVJxTW05UFdHSndla2hCYjBkQlNVNXFUMGhJVGpaSVl6ZFVkRzl3VHprMWNFOEtUMGhJY1ZadFdIUkNVMHBVTld4UFEwYzBjMlpqY1VOSFRFSk1NRVJoZWxvclFtUkRTWGhsYkVOdlJqTkRMMnMzWW5od1VXNTRRbll3T1dSWWFYUkNWQXBQWXpOVVdreFhNM3B5ZWk5ek0zWkZNWFZFVEVGNlQxaElkRWxNTkhSeFVqbE9ZMGxvVTBoRmRtNVZRbkZ3UzJoVmNYWnpkMnA1WVVKR1QzQTVia2xoQ2xGbmMxUXJORXA1ZUdKV0wwdHNSQzl4V0U1d1RHRkZRMmRaUVRoTkx6bHRha1ozTjJnemFsTTRiek5VYnpCblkySnFVMWhJYVZaUFUySkpSMFJHV25FS01IZG9SVkptTUc5V1FXOUlSR00yU1cxYVZsWm1USFpoWkhGQlJpdEtOMVZQVkZObGJGWjFSVzR6WVVWNEx6aHBUMVI2Vmxjck0zbDBhWFZIUTNwaVp3cGlVV1FyUkZCNmFVaGtOR3hJUTJwRFVVSlJjV3RDWlhaMk1ITmllbk5aUVdsWmRIUlZlRWxCTUhkc1FsUk5VelZKY2xkblZWQnhSeTlFVUdoR2NWQnFDa2h3TUVkMFVVdENaMUZEZDJScU9FOVNNa1JST1VKNFZsSTVlakZ6TUVadlNHMXJORFJRYURGdFVFdDBiVlZtTVdab1pFaEROMnRzTWxWVVJtNXlWWElLZDFoeVdXWnFWalJzU0hWamFpdHZNa2xOVWpCR1ZDczRRakpaUzBGV1RHTk1aRVp5YVdKdFkwY3haSE5yUkhSMGJYQnhkV3BMWTJ0MU9YQXZlV2RtTkFweGQwWjVRV0pqUjBJMk9HdFJaVnBKU1hWWU9UTTNVekpSWTNBeFVFeHdWamwyWm05SlVVUmtSVlZCTTFKQlRqQlNSQzgwWmxFOVBRb3RMUzB0TFVWT1JDQlNVMEVnVUZKSlZrRlVSU0JMUlZrdExTMHRMUW89Cg==
----
-apiVersion: v1
-kind: Service
-metadata:
- name: kube-apiserver
- namespace: shoot--foobar--packet
-spec:
- ports:
- - name: kube-apiserver
- port: 443
- protocol: TCP
- targetPort: 443
- selector:
- app: kubernetes
- role: apiserver
- type: NodePort
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- labels:
- app: kubernetes
- role: apiserver
- name: kube-apiserver
- namespace: shoot--foobar--packet
-spec:
- progressDeadlineSeconds: 600
- replicas: 1
- revisionHistoryLimit: 0
- selector:
- matchLabels:
- app: kubernetes
- role: apiserver
- strategy:
- rollingUpdate:
- maxSurge: 25%
- maxUnavailable: 25%
- type: RollingUpdate
- template:
- metadata:
- labels:
- app: kubernetes
- role: apiserver
- spec:
- containers:
- - command:
- - /hyperkube
- - apiserver
- - --enable-admission-plugins=Priority,NamespaceLifecycle,LimitRanger,PodSecurityPolicy,ServiceAccount,NodeRestriction,DefaultStorageClass,Initializers,DefaultTolerationSeconds,ResourceQuota,StorageObjectInUseProtection,MutatingAdmissionWebhook,ValidatingAdmissionWebhook
- - --disable-admission-plugins=PersistentVolumeLabel
- - --allow-privileged=true
- - --anonymous-auth=false
- - --authorization-mode=Node,RBAC
- - --client-ca-file=/srv/kubernetes/ca/ca.crt
- - --enable-aggregator-routing=true
- - --enable-bootstrap-token-auth=true
- - --http2-max-streams-per-connection=1000
- - --endpoint-reconciler-type=none
- - --etcd-servers=http://etcd:2379
- - --kubelet-preferred-address-types=InternalIP,Hostname,ExternalIP
- - --insecure-port=0
- - --profiling=false
- - --secure-port=443
- - --service-cluster-ip-range=100.64.0.0/13
- - --tls-cert-file=/srv/kubernetes/apiserver/kube-apiserver.crt
- - --tls-private-key-file=/srv/kubernetes/apiserver/kube-apiserver.key
- - --v=2
- image: k8s.gcr.io/hyperkube:v1.12.6
- imagePullPolicy: IfNotPresent
- name: kube-apiserver
- ports:
- - containerPort: 443
- name: https
- protocol: TCP
- - containerPort: 8080
- name: local
- protocol: TCP
- terminationMessagePath: /dev/termination-log
- terminationMessagePolicy: File
- volumeMounts:
- - mountPath: /srv/kubernetes/ca
- name: ca
- - mountPath: /srv/kubernetes/apiserver
- name: kube-apiserver
- dnsPolicy: ClusterFirst
- restartPolicy: Always
- schedulerName: default-scheduler
- securityContext: {}
- terminationGracePeriodSeconds: 30
- tolerations:
- - effect: NoExecute
- operator: Exists
- volumes:
- - name: ca
- secret:
- defaultMode: 420
- secretName: ca
- - name: kube-apiserver
- secret:
- defaultMode: 420
- secretName: kube-apiserver
diff --git a/controllers/provider-packet/example/20-crd-cluster.yaml b/controllers/provider-packet/example/20-crd-cluster.yaml
deleted file mode 100644
index 9397fd5ab..000000000
--- a/controllers/provider-packet/example/20-crd-cluster.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
----
-apiVersion: apiextensions.k8s.io/v1beta1
-kind: CustomResourceDefinition
-metadata:
- name: clusters.extensions.gardener.cloud
-spec:
- group: extensions.gardener.cloud
- versions:
- - name: v1alpha1
- served: true
- storage: true
- version: v1alpha1
- scope: Cluster
- names:
- plural: clusters
- singular: cluster
- kind: Cluster
- additionalPrinterColumns:
- - name: Age
- type: date
- JSONPath: .metadata.creationTimestamp
- subresources:
- status: {}
diff --git a/controllers/provider-packet/example/20-crd-controlplane.yaml b/controllers/provider-packet/example/20-crd-controlplane.yaml
deleted file mode 100644
index 8926518a6..000000000
--- a/controllers/provider-packet/example/20-crd-controlplane.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-apiVersion: apiextensions.k8s.io/v1beta1
-kind: CustomResourceDefinition
-metadata:
- name: controlplanes.extensions.gardener.cloud
-spec:
- group: extensions.gardener.cloud
- versions:
- - name: v1alpha1
- served: true
- storage: true
- version: v1alpha1
- scope: Namespaced
- names:
- plural: controlplanes
- singular: controlplane
- kind: ControlPlane
- shortNames:
- - cp
- additionalPrinterColumns:
- - name: Type
- type: string
- description: The control plane type.
- JSONPath: .spec.type
- - name: State
- type: string
- JSONPath: .status.lastOperation.state
- - name: Age
- type: date
- JSONPath: .metadata.creationTimestamp
- subresources:
- status: {}
diff --git a/controllers/provider-packet/example/20-crd-infrastructure.yaml b/controllers/provider-packet/example/20-crd-infrastructure.yaml
deleted file mode 100644
index 4ab9e233f..000000000
--- a/controllers/provider-packet/example/20-crd-infrastructure.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
----
-apiVersion: apiextensions.k8s.io/v1beta1
-kind: CustomResourceDefinition
-metadata:
- name: infrastructures.extensions.gardener.cloud
-spec:
- group: extensions.gardener.cloud
- versions:
- - name: v1alpha1
- served: true
- storage: true
- version: v1alpha1
- scope: Namespaced
- names:
- plural: infrastructures
- singular: infrastructure
- kind: Infrastructure
- shortNames:
- - infra
- additionalPrinterColumns:
- - name: Type
- type: string
- description: The type of the cloud provider for this resource.
- JSONPath: .spec.type
- - name: Region
- type: string
- description: The region into which the infrastructure should be deployed.
- JSONPath: .spec.region
- - name: State
- type: string
- JSONPath: .status.lastOperation.state
- - name: Age
- type: date
- JSONPath: .metadata.creationTimestamp
- subresources:
- status: {}
diff --git a/controllers/provider-packet/example/20-crd-managedresource.yaml b/controllers/provider-packet/example/20-crd-managedresource.yaml
deleted file mode 100644
index 3237f2064..000000000
--- a/controllers/provider-packet/example/20-crd-managedresource.yaml
+++ /dev/null
@@ -1,28 +0,0 @@
----
-apiVersion: apiextensions.k8s.io/v1beta1
-kind: CustomResourceDefinition
-metadata:
- name: managedresources.resources.gardener.cloud
-spec:
- group: resources.gardener.cloud
- versions:
- - name: v1alpha1
- served: true
- storage: true
- version: v1alpha1
- scope: Namespaced
- names:
- plural: managedresources
- singular: managedresource
- kind: ManagedResource
- shortNames:
- - mr
- additionalPrinterColumns:
- - name: Class
- type: string
- JSONPath: .spec.class
- - name: Age
- type: date
- JSONPath: .metadata.creationTimestamp
- subresources:
- status: {}
diff --git a/controllers/provider-packet/example/20-crd-operatingsystemconfig.yaml b/controllers/provider-packet/example/20-crd-operatingsystemconfig.yaml
deleted file mode 100644
index 2c2db728e..000000000
--- a/controllers/provider-packet/example/20-crd-operatingsystemconfig.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-apiVersion: apiextensions.k8s.io/v1beta1
-kind: CustomResourceDefinition
-metadata:
- name: operatingsystemconfigs.extensions.gardener.cloud
-spec:
- group: extensions.gardener.cloud
- versions:
- - name: v1alpha1
- served: true
- storage: true
- version: v1alpha1
- scope: Namespaced
- names:
- plural: operatingsystemconfigs
- singular: operatingsystemconfig
- kind: OperatingSystemConfig
- shortNames:
- - osc
- additionalPrinterColumns:
- - name: Type
- type: string
- description: The type of the operating system configuration.
- JSONPath: .spec.type
- - name: State
- type: string
- JSONPath: .status.lastOperation.state
- - name: Age
- type: date
- JSONPath: .metadata.creationTimestamp
- subresources:
- status: {}
diff --git a/controllers/provider-packet/example/20-crd-vpa.yaml b/controllers/provider-packet/example/20-crd-vpa.yaml
deleted file mode 100644
index a54d9e4bf..000000000
--- a/controllers/provider-packet/example/20-crd-vpa.yaml
+++ /dev/null
@@ -1,60 +0,0 @@
-apiVersion: apiextensions.k8s.io/v1beta1
-kind: CustomResourceDefinition
-metadata:
- name: verticalpodautoscalers.autoscaling.k8s.io
-spec:
- group: autoscaling.k8s.io
- scope: Namespaced
- names:
- plural: verticalpodautoscalers
- singular: verticalpodautoscaler
- kind: VerticalPodAutoscaler
- shortNames:
- - vpa
- version: v1beta1
- versions:
- - name: v1beta1
- served: true
- storage: false
- - name: v1beta2
- served: true
- storage: true
- validation:
- # openAPIV3Schema is the schema for validating custom objects.
- openAPIV3Schema:
- properties:
- spec:
- required: []
- properties:
- targetRef:
- type: object
- updatePolicy:
- properties:
- updateMode:
- type: string
- resourcePolicy:
- properties:
- containerPolicies:
- type: array
----
-apiVersion: apiextensions.k8s.io/v1beta1
-kind: CustomResourceDefinition
-metadata:
- name: verticalpodautoscalercheckpoints.autoscaling.k8s.io
-spec:
- group: autoscaling.k8s.io
- scope: Namespaced
- names:
- plural: verticalpodautoscalercheckpoints
- singular: verticalpodautoscalercheckpoint
- kind: VerticalPodAutoscalerCheckpoint
- shortNames:
- - vpacheckpoint
- version: v1beta1
- versions:
- - name: v1beta1
- served: true
- storage: false
- - name: v1beta2
- served: true
- storage: true
diff --git a/controllers/provider-packet/example/20-crd-worker.yaml b/controllers/provider-packet/example/20-crd-worker.yaml
deleted file mode 100644
index c4cc1a865..000000000
--- a/controllers/provider-packet/example/20-crd-worker.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
----
-apiVersion: apiextensions.k8s.io/v1beta1
-kind: CustomResourceDefinition
-metadata:
- name: workers.extensions.gardener.cloud
-spec:
- group: extensions.gardener.cloud
- versions:
- - name: v1alpha1
- served: true
- storage: true
- version: v1alpha1
- scope: Namespaced
- names:
- plural: workers
- singular: worker
- kind: Worker
- additionalPrinterColumns:
- - name: Type
- type: string
- description: The worker type.
- JSONPath: .spec.type
- - name: Age
- type: date
- JSONPath: .metadata.creationTimestamp
- subresources:
- status: {}
diff --git a/controllers/provider-packet/example/30-controlplane.yaml b/controllers/provider-packet/example/30-controlplane.yaml
deleted file mode 100644
index 72eb9cda6..000000000
--- a/controllers/provider-packet/example/30-controlplane.yaml
+++ /dev/null
@@ -1,62 +0,0 @@
----
-apiVersion: v1
-kind: Namespace
-metadata:
- name: shoot--foobar--packet
- labels:
-# backup.gardener.cloud/provider: packet
-# seed.gardener.cloud/provider: packet
- shoot.gardener.cloud/provider: packet
----
-apiVersion: v1
-kind: Secret
-metadata:
- name: cloudprovider
- namespace: shoot--foobar--packet
-type: Opaque
-data:
- apiToken: YXBpVG9rZW4K # apiToken
- projectID: cHJvamVjdElkCg== # projectId
----
-apiVersion: extensions.gardener.cloud/v1alpha1
-kind: Cluster
-metadata:
- name: shoot--foobar--packet
-spec:
- cloudProfile:
- apiVersion: core.gardener.cloud/v1alpha1
- kind: CloudProfile
- seed:
- apiVersion: core.gardener.cloud/v1alpha1
- kind: Seed
- shoot:
- apiVersion: core.gardener.cloud/v1alpha1
- kind: Shoot
- spec:
- networking:
- pods: 10.250.0.0/19
- kubernetes:
- version: 1.13.4
- hibernation:
- enabled: false
- status:
- lastOperation:
- state: Succeeded
----
-apiVersion: extensions.gardener.cloud/v1alpha1
-kind: ControlPlane
-metadata:
- name: control-plane
- namespace: shoot--foobar--packet
-spec:
- type: packet
- region: WER1
- secretRef:
- name: cloudprovider
- namespace: shoot--foobar--packet
- providerConfig:
- apiVersion: packet.provider.extensions.gardener.cloud/v1alpha1
- kind: ControlPlaneConfig
- infrastructureProviderStatus:
- apiVersion: packet.provider.extensions.gardener.cloud/v1alpha1
- kind: InfrastructureStatus
diff --git a/controllers/provider-packet/example/30-infrastructure.yaml b/controllers/provider-packet/example/30-infrastructure.yaml
deleted file mode 100644
index c778a3c5b..000000000
--- a/controllers/provider-packet/example/30-infrastructure.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
----
-apiVersion: v1
-kind: Namespace
-metadata:
- name: shoot--foobar--packet
----
-apiVersion: v1
-kind: Secret
-metadata:
- name: cloudprovider
- namespace: shoot--foobar--packet
-type: Opaque
-data:
-# apiToken: base64(api-token)
-# projectID: base64(project-id)
----
-apiVersion: extensions.gardener.cloud/v1alpha1
-kind: Cluster
-metadata:
- name: shoot--foobar--packet
-spec:
- cloudProfile:
- apiVersion: core.gardener.cloud/v1alpha1
- kind: CloudProfile
- seed:
- apiVersion: core.gardener.cloud/v1alpha1
- kind: Seed
- shoot:
- apiVersion: core.gardener.cloud/v1alpha1
- kind: Shoot
- status:
- lastOperation:
- state: Succeeded
-
----
-apiVersion: extensions.gardener.cloud/v1alpha1
-kind: Infrastructure
-metadata:
- name: infrastructure
- namespace: shoot--foobar--packet
-spec:
- type: packet
- region: ewr1
- secretRef:
- name: cloudprovider
- namespace: shoot--foobar--packet
- providerConfig:
- apiVersion: packet.provider.extensions.gardener.cloud/v1alpha1
- kind: InfrastructureConfig
- sshPublicKey: c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFDQVFEbk5rZkkxSWhBdGMyUXlrQ2sxTXNEMGpyNHQwUTR3OG9ZQkk0M215eElGc1hTRWFoQlhGSlBEeGl3akQ2KzQ1dHVHa0x2Y2d1WVZYcnFIOTl5eFM3eHpRUGZmdU5kelBhTWhIVjBHRFZIVDkyK2J5MTdtUDRVZDBFQTlVR29KeU1VeUVxZG45b1k1aURSUktRVHFzdW5QR0hpWVVnQ3ZPMElJT0kySTNtM0FIdlpWN2lhSVhKVE53eGE3ZVFTVTFjNVMzS2lseHhHTXJ5Y3hkNW83QWRtVTNqc3JhMVdqN2tjSFlseTVINkppVExsY0FxNVJQYzVXOUhnTHhlODZnUXNzN2pZN2t5NXJ1elBZV3ppdS94QlZBNGJQRXhVY2dIL3ZZTnl0aWg4OTBHWGRlcm1IOW5QSXpRZWlSWUlMdzJsaEMrdzBMdjM3QXdBYVNWRFlnY3NWNkdENllKaXN3VFV5ZStXdU9iZm1nWlFqaUppbUkwWWlrY2U2d3l2MFRHUW1BM3lnVDE1MDBoMnZMWXNMdWJJRjZGNkJRcTlKcDZ0M0w2RENoMmgvY3RSZEl2SXE2SWRPQnpOeGl4V2trbHJQbkhwS3B3eFEzVVJDRDRHMHhBK3dWZmtML05ueVhDSGM2Qk0zVUNhVDBpdExycjkwRGFTNWFvYVVGVHJuS2tDN1JxUWlwU3ZYVUcrQ1RqWnljLzRsblFOOSt6WmwvVE05QmxTYTQ3VGc1Myt6NjcxSmhRZXNBNUIrNVRtSFNGdHgwbXFzWnRJSng4dEtyR1VPeG1tTTVVb2J4VGp2TXBrMWpJWU4vWFJOdCt4R2VSbFVEZW9xalJMZnJOdjljZFF4Z0hzZXhmd3VUeERHYjlnb21RR0hRSjQrMW1kYjVUK2NmV0pUUTNCQXc9PQ==
diff --git a/controllers/provider-packet/example/30-worker.yaml b/controllers/provider-packet/example/30-worker.yaml
deleted file mode 100644
index 3c3614399..000000000
--- a/controllers/provider-packet/example/30-worker.yaml
+++ /dev/null
@@ -1,81 +0,0 @@
----
-apiVersion: v1
-kind: Secret
-metadata:
- name: cloudprovider
- namespace: shoot--foobar--packet
-type: Opaque
-data:
- apiToken: ZGF0YQo=
- projectID: ZGF0YQo=
----
-apiVersion: extensions.gardener.cloud/v1alpha1
-kind: Cluster
-metadata:
- name: shoot--foobar--packet
-spec:
- cloudProfile:
- apiVersion: core.gardener.cloud/v1alpha1
- kind: CloudProfile
- spec:
- providerConfig:
- apiVersion: packet.provider.extensions.gardener.cloud/v1alpha1
- kind: CloudProfileConfig
- machineImages:
- - name: coreos
- versions:
- - version: 2023.5.0
- id: packetimageid
- seed:
- apiVersion: core.gardener.cloud/v1alpha1
- kind: Seed
- shoot:
- apiVersion: core.gardener.cloud/v1alpha1
- kind: Shoot
- spec:
- kubernetes:
- version: 1.13.4
- status:
- lastOperation:
- state: Succeeded
----
-# This resource does result in the deployment of the machine-controller-manager, the machine classes,
-# and the desired MachineDeployments. However, it does not create actual virtual machines because the
-# needed infrastructure does probably not exist.
-apiVersion: extensions.gardener.cloud/v1alpha1
-kind: Worker
-metadata:
- name: worker
- namespace: shoot--foobar--packet
- annotations:
- gardener.cloud/operation: reconcile
-spec:
- type: packet
- region: ewr1
- secretRef:
- name: cloudprovider
- namespace: shoot--foobar--packet
- infrastructureProviderStatus:
- apiVersion: packet.provider.extensions.gardener.cloud/v1alpha1
- kind: InfrastructureStatus
- pools:
- - name: cpu-worker
- machineType: c1.small
- machineImage:
- name: coreos
- version: 2023.5.0
- minimum: 1
- maximum: 1
- maxSurge: 1
- maxUnavailable: 0
- # labels:
- # key: value
- # annotations:
- # key: value
- # taints: # See also https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
- # - key: foo
- # value: bar
- # effect: NoSchedule
- userData: IyEvYmluL2Jhc2gKCmVjaG8gImhlbGxvIHdvcmxkIgo=
- zones:
- - ewr1
diff --git a/controllers/provider-packet/example/controller-registration.yaml b/controllers/provider-packet/example/controller-registration.yaml
deleted file mode 100644
index b3f0bf763..000000000
--- a/controllers/provider-packet/example/controller-registration.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
----
-apiVersion: core.gardener.cloud/v1alpha1
-kind: ControllerRegistration
-metadata:
- name: provider-packet
-spec:
- resources:
- - kind: ControlPlane
- type: packet
- - kind: Infrastructure
- type: packet
- - kind: Worker
- type: packet
- deployment:
- type: helm
- providerConfig:
- chart: H4sIAAAAAAAAA+0c/W/btrI/+68gvDegHWr5I7a7p4c+PDfxOmNtYiRZi2EYAlqibTWyqFFUUq/b//7uSEqWZPmrSdN11SFAZH4cj+R98XhSKPiN5zLRCKlzzWTz0SeAFsCzXk/9Byj+V8/to2670+v0+1je7vR7nUek9ymIKUIcSSoIeSQ4l9va7ar/QiEs7P/xnAppLenCv78xdu1/p9Mr7H+332o/Iq37I2EzfOX7T0PvDRORxwOb3LRrNAwzP60jq9Vw2U3NZZEjvFCq8gH5kfkL4iCnkCkXRM4ZeUmFywImyFjxERkbviLsvWQBIqwFdMFsUmC42k3JcJ97Ub4iKMq/yx1rxu93jB3y32l1jgryf/Ss26/k/yGg2STHPFwKbzaX5LHzhHRa7X+Ti8GYXAwJyDYN1A86nXq+RyUjDl+ENFhaZOD7RHWLiGAREzfMtcjl3IsINGUE/vueA6LPXBIHqAlQTQyAzeDfBZ/KWyoYeaWbPCU3FumArnBYKAmNSMAl9OPQRdx6EWALVPdXo+PhKRCGI9SaTfhLMJQMkuI2Go10rBZ5jA3qpqr+5D+IYsljsqBLHJTEMJhMJ2EIgtFx2rAAgcPIrSfnmhqNxUIcvxgcfCIpNKfQIYRf02xDQqUhWsFcytBuNm9vby2qKLa4mDXNokVNM9cGUG16/Rz4LMLV/j32BMx4siSgr6EDnQCtPr1VGzYTDOokR6pvhSe9YPaURGbBEY3rRVJ4k1jmFi2hEaaebQDLBixQH1yQ0UWdvBhcjC6eIpK3o8sfz36+JG8H5+eD08vR8IKcnZPjs9OT0eXo7BR+/UAGp7+Qn0anJ08J83AnYTlDgTMAMj1cTuAYxHXBWI6ExKZEIXO8qefA1IJZTGeMzDiYiwBmREImFl6E2xoBgS6i8b2FJ6lURWvzsmrQZMbtGRop5GPLaqZ/c9B9zaSm4fBACu77oBQFm+FaKKRWNC8aL2IZNOw9hfmw5qau6E+BnKnKMcyG2QbBKJgKCs1iR8YiLX3LxTUT5hcSrqwqLoA2uizAHY9Idj5RHIbcGGRTiOuES+BwIZgjyYo6kqOuFmaxV9b3a4Ki/ZcMGBn4KbrHk+Dh579uv9eqzn8PAZv3/2rOfNCykSXDO54Fd+x/u9PpF/b/WftZ5f89CHz40CAum3oBeEV4QKuTxl9/1WbmNNdIT2+N4rkNO7LAVc1rWSw+nTA/ApcmtK7ZUuNTP+IJ2G4GrGV5vIlj5XBsQHFD/dgQ9eEDuDSOH7spqRYxHbcQst63SCBiscmGFmZ8NdL6LLwAuAd8QtXdOmc+o+BqnAJxpZSlpHkLMLeaMkKwxpuSOY3GAurfk3o0p51e34Zh3+DwMBS2tySdkbRHKLxATkn92+h/30bFloKFPPIkF8ttKGCOrAyh/dEIYbKZeRc3xGWhz5cLFkhz6E+ZI2retLPL9bml4uuBzfofvMWpN1vQsKF2+gY8SC4a6IDjqYIdECPcZf+7/cL5v9NtHXUr/f8QYJRPTqjfqK0+S3Zaq75cmPDaC1wbDzTAIa9pWFswSV0qqQ2KQIf5ypV1OSuZThGwYIkmVcVax2i9bJdoc0T/JxSC1ZKki60TctSI0VWeb23yJyLZOus8uoxO+9xbdq+wj/z7fDaDs+RH3wrs8v967XZB/tvtTiX/DwL3JdiGRxqaa/ISrb3JjPxi9Cv1LCMr8TYtx+exaxgv1sEJmxjMqUBPPV8Cv2YcMeyAEo1of/1h9OpyeP5bjRhQzlgBQioiJtImr6l05oUmWfRIVTYqtKAB6AvxnRaZxsb6dICf2PKqSAdMK60fK3rWCYDNUYFVMc4TfK7jrVcnsCRJ2aWIWe1TLcGCOnNw4bYswpYWf6tlEMzhwr1acNebemsLsP+Wnis8RC5DhjFj8aVahT30/51vg3fe/4CzVzj/96r734eB+9L/Kbd8UmdOj5K6cCiIjUZD/c9ORPOylfC2lbE1BkPB5Ny0qR/OaVthStfACP9x1h7VCg6zwef4HhALLQPwIvGuSU0RCC6U20aBUAcvlnAMqL4EJRKptUqvduo78FvrCPDmJulf30VfWX9DslrlpPRAqjI9DyMn2zGl4/fw0FWBHoeNix3S8SaxiOSBI6o+h42pu+TPFDg8k46b8EcERxEwOHZqbxyfRtFpIoGFIbCnZbpYacvVxKA73jB6crm7t2n4jzvoVFAKm+3/Klp3Vwdgh/3v97pr9v/ZUauy/w8BWbOZBGK1ATxJ939vL2BP269C4dmg0yzggoE3z2PhJIaIBgE3t/laC4qkvmi8dXeb1CX4/vW8Vj3EycB0AxxKsBsPF+RHD5Xi8hWmFdikpWpUtkWU06Km8JjHgdSDRjBpjCVpuhd4sni1Hx19jSARQoMgs/rKdyiuDMKecbzUHsyZcx3Fi0yUxxx9SiN0uQ1/rG4KyL+sS0Om9QK2eEzlnNT3ihrXn6g561sOICJLWMEmbqB1qxP6EcTuIGtPLvo+6ZFwUuJMUTgZi3SzGrtkSINav3wrc2203mwc+/6YAxvmDby+ognTytyq8gUcat0VBzVIs+Tabw4emci0KdiLkjNypnHD7EgDk6meN8HRaJZP2uxEM+PfF9HgKCGmzsA477HAiYWAVW/giT5wYIDoed63MXSlz6q3tep5sQycKLskOJKXS8g5fKx8/52jKdXV4CHTp4vGSrY3DqC6nCU9BmmHIu5blUR0+Ax0v12U37LJnPPrZINTtf98y4lvY28d3Wlg/lKWKtNKn78sEwLCHKcCNteLMB8qw4u5yZnq1YEuApF9x72A1J/WN+EyY5chemuqNmBhwU1WqLSsvxoOTobnV8NXw2NMj7s6HbweXowHx8O0JSHqqvkHwRd2phDjncx3z9k0X2rKUZHZqYWw0m34WLuQ0Dt6PXg5fAPEnp1fnb0Znr89H12u0WqTpsoYy9yuNEuvW7Zpd9z0aH3BEg7Ru54ZOdWnyAk5bbcPuxBUYJI73LfJ5fG4eJoXeR9EQ1qoDIDkv2Ay33qPP0lg7EC7VXK6U6vG/XjBXqOnUDLlNHSewAIb6h3erTvvuuObbubKiFnb9Uw7wah7FvhgiNAd27zzuD+ewwaOg4hPd1tETEEO8AibYR13EEhvsFZB0tP4SQzmf3YBLoQb+/A0UtrTFA/fMyfORmX0eijLfpHz4TLLgN7cUOex5j2wpPs1W27MJknzTQq9CNEmAMYjo2CtUknb2lA42B5ZK9kOkofc57PlT0hjPZ/LMueRVItuemhmXfNaCtzmJKHCLHV7RwoTcNmUxr58zV3o1+20TNVBrLwfIx9O7y7B2EL7F3BhvPn8D9IFBk/E6q2fSezO2McGAnblf/S6z4r3v/3uUXX+fwgwIjaT5DGek8oOtU9Iu5gCEqrjRPOmPQHPIwkYjLl7kjLMC8Uw9x05+LgDPbjAPwf0hno+um8KfRRPdk74zgf5L0EFbJZ/MaHO/bwIukP+j9r9Qv4HiD+ohEr+HwDw+iwr2WrXaSznXHh/6NdDrr9X/sHqdtCHNWPinPvsEPk+RHJF7KPn0cBbvZeCx6FyQxqbk0ZqOTcdmzqaykj9yJ/KS8uawAcy1lXZgEFJSbapPi3nnlfV4C1MDDmoDJVz6UX64Ra1iXoK06c4hLVk69PeFPpcn7WOwbhpaZ6I+nf1deT1esniJT5alKlTmljXF6NAoKrxl1KXeElaOvXb4jxXky8nqqEi0uphkvbdyKC6g2veCsu94JRtEHoZJspUgB+M+4d5bmlpYVVSC6VpAqcQznHqMWKOYDJaXztlAELuJQ1XlypJR3UKyv2g+kgUZdkYeI+tFUxAZIBeXb5qsVb1jk/0A7h0q4emTr0BnomlelfMnJ9z6VdmTBiSL5LVUOnc3qrWrJzyCby9WM4kC1kRDRUfl6429tyNCjiBRw71t+0b4JBg232YddJci2wR+Z104Qu95J9MJcIQJgqULMEWCmtpGkNGWe+gB3yidyC/Su/qzhe5M/r9uHCf2+BVkIPN/p/RRvfgAu46//V7xff/n3Va1fnvQaA0/8vI/Vd27ytVvpNRmKNx7vy3371tGstuqEebdLtHag75oLOKxFEBftFBMexPsv875d94I3dRA7vkv9Mt5v+3er0q//NBYJv8J3b/swZxPvcC/cNhi/zrjECVTng3J2CX/HeL8R/8IlCnkv+HABP/Zb+nJii1shFjbppDTeqaQerFUHCSOFo8GV3o8mNkn3INckAS6yEKQ1GMtDFh49nUMtngTuTVqO/z2zfqYmv4PqSBnoK6qAypgOGkydPBQA/OjQYuLMcXEcn9ONgs/zchvafvAO68/1nz//tHVf7nw0DhihU3XX9dyC3IeX090mLufzp1I/JvTJxlzN1BGmfZ/xUSGHtPDyL12JUTnebGlOWyYvlaPuuuO19ooEOUJqdOddAl+po3o71wxbKNrVW7L+EOqCj/OtXgfj8AukP+O51+8fufvVa3V8n/Q4DOMlUx0+QLHzZhsTVzBEp4mhEKfILBwbRgW66opDObKCOCohZmclNH01Mux/i5QJDCWvbO1Sbt2ipsSz78VQPBQrqMNkrTibYLZh0VT71Wy6QCmvfG0usb3amQ3miTHhTnr4S2NNQ3PdswbcrStMmU+hGr1dazEm3y62+1Qo6hKivESVIU35CyjBh8Me4bknz4wFbPSW5MSONI50mqFDpVR4jGe55hgJkn5/EEPLNFc5UklH2c+HzSXFCMlDQnsee7TYW6ecJBiwj1eUaNO8tWCU9xPvPZ1SoxWvdt0IXb75puioXqR1arbgrSz8S2rXbbev9lz6q9Nqv6f5/jzDq6wrKsWi0XCrJrOmMuSXvEwFLNSavKXzMse8nQfDASGzXfRTxIWHj1wl9pC/UqXrulk5vMe3LtI/y5emut8M5a5o21fOCuMaWRTBql76V1ei+99LtTerrMIE5sVPJi59/TklZQQQUVVFBBBRVUUEEFFVRQQQUVVFBBBRVUUEEFFVRQweeH/wPcBDuGAHgAAA==
- values:
- image:
- tag: v1.3.0-dev
diff --git a/controllers/provider-packet/hack/api-reference/api.json b/controllers/provider-packet/hack/api-reference/api.json
deleted file mode 100644
index d50497d19..000000000
--- a/controllers/provider-packet/hack/api-reference/api.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "hideMemberFields": [
- "TypeMeta"
- ],
- "hideTypePatterns": [
- "ParseError$",
- "List$"
- ],
- "externalPackages": [
- {
- "typeMatchPrefix": "^k8s\\.io/(api|apimachinery/pkg/apis)/",
- "docsURLTemplate": "https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.15/#{{lower .TypeIdentifier}}-{{arrIndex .PackageSegments -1}}-{{arrIndex .PackageSegments -2}}"
- }
- ],
- "typeDisplayNamePrefixOverrides": {
- "k8s.io/api/": "Kubernetes ",
- "k8s.io/apimachinery/pkg/apis/": "Kubernetes "
- },
- "markdownDisabled": false
-}
diff --git a/controllers/provider-packet/hack/api-reference/api.md b/controllers/provider-packet/hack/api-reference/api.md
deleted file mode 100644
index 186a204c5..000000000
--- a/controllers/provider-packet/hack/api-reference/api.md
+++ /dev/null
@@ -1,343 +0,0 @@
-
Packages:
-
-packet.provider.extensions.gardener.cloud/v1alpha1
-
-
Package v1alpha1 contains the Packet provider API resources.
-
-Resource Types:
-
-CloudProfileConfig
-
-
-
CloudProfileConfig contains provider-specific configuration that is embedded into Gardener’s CloudProfile
-resource.
-
-
-
-
-Field |
-Description |
-
-
-
-
-
-apiVersion
-string |
-
-
-packet.provider.extensions.gardener.cloud/v1alpha1
-
- |
-
-
-
-kind
-string
- |
-CloudProfileConfig |
-
-
-
-machineImages
-
-
-[]MachineImages
-
-
- |
-
- MachineImages is the list of machine images that are understood by the controller. It maps
-logical names and versions to provider-specific identifiers.
- |
-
-
-
-ControlPlaneConfig
-
-
-
ControlPlaneConfig contains configuration settings for the control plane.
-
-
-
-
-Field |
-Description |
-
-
-
-
-
-apiVersion
-string |
-
-
-packet.provider.extensions.gardener.cloud/v1alpha1
-
- |
-
-
-
-kind
-string
- |
-ControlPlaneConfig |
-
-
-
-InfrastructureConfig
-
-
-
InfrastructureConfig infrastructure configuration resource
-
-
-
-
-Field |
-Description |
-
-
-
-
-
-apiVersion
-string |
-
-
-packet.provider.extensions.gardener.cloud/v1alpha1
-
- |
-
-
-
-kind
-string
- |
-InfrastructureConfig |
-
-
-
-WorkerStatus
-
-
-
WorkerStatus contains information about created worker resources.
-
-
-
-
-Field |
-Description |
-
-
-
-
-
-apiVersion
-string |
-
-
-packet.provider.extensions.gardener.cloud/v1alpha1
-
- |
-
-
-
-kind
-string
- |
-WorkerStatus |
-
-
-
-machineImages
-
-
-[]MachineImage
-
-
- |
-
-(Optional)
- MachineImages is a list of machine images that have been used in this worker. Usually, the extension controller
-gets the mapping from name/version to the provider-specific machine image data in its componentconfig. However, if
-a version that is still in use gets removed from this componentconfig it cannot reconcile anymore existing Worker
-resources that are still using this version. Hence, it stores the used versions in the provider status to ensure
-reconciliation is possible.
- |
-
-
-
-InfrastructureStatus
-
-
-
InfrastructureStatus contains information about created infrastructure resources.
-
-
-
-
-Field |
-Description |
-
-
-
-
-
-sshKeyID
-
-string
-
- |
-
- |
-
-
-
-MachineImage
-
-
-(Appears on:
-WorkerStatus)
-
-
-
MachineImage is a mapping from logical names and versions to provider-specific machine image data.
-
-
-
-
-Field |
-Description |
-
-
-
-
-
-name
-
-string
-
- |
-
- Name is the logical name of the machine image.
- |
-
-
-
-version
-
-string
-
- |
-
- Version is the logical version of the machine image.
- |
-
-
-
-id
-
-string
-
- |
-
- ID is the id of the image.
- |
-
-
-
-MachineImageVersion
-
-
-(Appears on:
-MachineImages)
-
-
-
MachineImageVersion contains a version and a provider-specific identifier.
-
-
-
-
-Field |
-Description |
-
-
-
-
-
-version
-
-string
-
- |
-
- Version is the version of the image.
- |
-
-
-
-id
-
-string
-
- |
-
- ID is the id of the image.
- |
-
-
-
-MachineImages
-
-
-(Appears on:
-CloudProfileConfig)
-
-
-
MachineImages is a mapping from logical names and versions to provider-specific identifiers.
-
-
-
-
-Field |
-Description |
-
-
-
-
-
-name
-
-string
-
- |
-
- Name is the logical name of the machine image.
- |
-
-
-
-versions
-
-
-[]MachineImageVersion
-
-
- |
-
- Versions contains versions and a provider-specific identifier.
- |
-
-
-
-
diff --git a/controllers/provider-packet/hack/api-reference/config.json b/controllers/provider-packet/hack/api-reference/config.json
deleted file mode 100644
index d27ff9914..000000000
--- a/controllers/provider-packet/hack/api-reference/config.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "hideMemberFields": [
- "TypeMeta"
- ],
- "hideTypePatterns": [
- "ParseError$",
- "List$"
- ],
- "externalPackages": [
- {
- "typeMatchPrefix": "^k8s\\.io/component-base/config/v1alpha1",
- "docsURLTemplate": "https://godoc.org/k8s.io/component-base/config/v1alpha1#{{.TypeIdentifier}}"
- },
- {
- "typeMatchPrefix": "^k8s\\.io/apimachinery/pkg/api/resource\\.Quantity$",
- "docsURLTemplate": "https://godoc.org/k8s.io/apimachinery/pkg/api/resource#Quantity"
- },
- {
- "typeMatchPrefix": "^k8s\\.io/(api|apimachinery/pkg/apis)/",
- "docsURLTemplate": "https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.15/#{{lower .TypeIdentifier}}-{{arrIndex .PackageSegments -1}}-{{arrIndex .PackageSegments -2}}"
- },
- {
- "typeMatchPrefix": "github.com/gardener/gardener-extensions/pkg/controller/healthcheck/config",
- "docsURLTemplate": "https://github.com/gardener/gardener-extensions/pkg/controller/healthcheck/config"
- }
- ],
- "typeDisplayNamePrefixOverrides": {
- "k8s.io/api/": "Kubernetes ",
- "k8s.io/apimachinery/pkg/apis/": "Kubernetes ",
- "k8s.io/component-base/config/": "Kubernetes "
- },
- "markdownDisabled": false
-}
diff --git a/controllers/provider-packet/hack/api-reference/config.md b/controllers/provider-packet/hack/api-reference/config.md
deleted file mode 100644
index 12521dcee..000000000
--- a/controllers/provider-packet/hack/api-reference/config.md
+++ /dev/null
@@ -1,147 +0,0 @@
-Packages:
-
-packet.provider.extensions.config.gardener.cloud/v1alpha1
-
-
Package v1alpha1 contains the Packet provider configuration API resources.
-
-Resource Types:
-
-ControllerConfiguration
-
-
-
ControllerConfiguration defines the configuration for the Packet provider.
-
-
-ETCD
-
-
-(Appears on:
-ControllerConfiguration)
-
-
-
ETCD is an etcd configuration.
-
-
-
-
-Field |
-Description |
-
-
-
-
-
-storage
-
-
-ETCDStorage
-
-
- |
-
- ETCDStorage is the etcd storage configuration.
- |
-
-
-
-ETCDStorage
-
-
-(Appears on:
-ETCD)
-
-
-
ETCDStorage is an etcd storage configuration.
-
-
-
-
-Field |
-Description |
-
-
-
-
-
-className
-
-string
-
- |
-
-(Optional)
- ClassName is the name of the storage class used in etcd-main volume claims.
- |
-
-
-
-capacity
-
-
-k8s.io/apimachinery/pkg/api/resource.Quantity
-
-
- |
-
-(Optional)
- Capacity is the storage capacity used in etcd-main volume claims.
- |
-
-
-
-
diff --git a/controllers/provider-packet/hack/generate-code b/controllers/provider-packet/hack/generate-code
deleted file mode 100755
index 47cf0a58d..000000000
--- a/controllers/provider-packet/hack/generate-code
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-rm -f $GOPATH/bin/*-gen
-
-PROJECT_ROOT=$(dirname $0)/../../..
-
-bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-internal-groups.sh \
- deepcopy,defaulter \
- github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/client \
- github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis \
- github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis \
- "packet:v1alpha1" \
- --go-header-file "${PROJECT_ROOT}/hack/LICENSE_BOILERPLATE.txt"
-
-bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-internal-groups.sh \
- conversion \
- github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/client \
- github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis \
- github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis \
- "packet:v1alpha1" \
- --extra-peer-dirs=github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet,github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet/v1alpha1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/conversion,k8s.io/apimachinery/pkg/runtime \
- --go-header-file "${PROJECT_ROOT}/hack/LICENSE_BOILERPLATE.txt"
-
-bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-internal-groups.sh \
- deepcopy,defaulter \
- github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/client/componentconfig \
- github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis \
- github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis \
- "config:v1alpha1" \
- --go-header-file "${PROJECT_ROOT}/hack/LICENSE_BOILERPLATE.txt"
-
-bash "${PROJECT_ROOT}"/vendor/k8s.io/code-generator/generate-internal-groups.sh \
- conversion \
- github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/client/componentconfig \
- github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis \
- github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis \
- "config:v1alpha1" \
- --extra-peer-dirs=github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config,github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config/v1alpha1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/conversion,k8s.io/apimachinery/pkg/runtime, github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config/v1alpha1 \
- --go-header-file "${PROJECT_ROOT}/hack/LICENSE_BOILERPLATE.txt"
diff --git a/controllers/provider-packet/pkg/apis/config/doc.go b/controllers/provider-packet/pkg/apis/config/doc.go
deleted file mode 100644
index 3cf7220b3..000000000
--- a/controllers/provider-packet/pkg/apis/config/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// +k8s:deepcopy-gen=package
-// +groupName="packet.provider.extensions.config.gardener.cloud"
-
-package config // import "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config"
diff --git a/controllers/provider-packet/pkg/apis/config/install/install.go b/controllers/provider-packet/pkg/apis/config/install/install.go
deleted file mode 100644
index a9283c6c2..000000000
--- a/controllers/provider-packet/pkg/apis/config/install/install.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package install
-
-import (
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config/v1alpha1"
-
- "k8s.io/apimachinery/pkg/runtime"
- utilruntime "k8s.io/apimachinery/pkg/util/runtime"
-)
-
-var (
- schemeBuilder = runtime.NewSchemeBuilder(
- v1alpha1.AddToScheme,
- config.AddToScheme,
- setVersionPriority,
- )
-
- // AddToScheme adds all APIs to the scheme.
- AddToScheme = schemeBuilder.AddToScheme
-)
-
-func setVersionPriority(scheme *runtime.Scheme) error {
- return scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion)
-}
-
-// Install installs all APIs in the scheme.
-func Install(scheme *runtime.Scheme) {
- utilruntime.Must(AddToScheme(scheme))
-}
diff --git a/controllers/provider-packet/pkg/apis/config/loader/loader.go b/controllers/provider-packet/pkg/apis/config/loader/loader.go
deleted file mode 100644
index d3289b3e5..000000000
--- a/controllers/provider-packet/pkg/apis/config/loader/loader.go
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package loader
-
-import (
- "io/ioutil"
-
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config/install"
-
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/runtime/schema"
- "k8s.io/apimachinery/pkg/runtime/serializer/json"
- "k8s.io/apimachinery/pkg/runtime/serializer/versioning"
-)
-
-var (
- Codec runtime.Codec
- Scheme *runtime.Scheme
-)
-
-func init() {
- Scheme = runtime.NewScheme()
- install.Install(Scheme)
- yamlSerializer := json.NewYAMLSerializer(json.DefaultMetaFactory, Scheme, Scheme)
- Codec = versioning.NewDefaultingCodecForScheme(
- Scheme,
- yamlSerializer,
- yamlSerializer,
- schema.GroupVersion{Version: "v1alpha1"},
- runtime.InternalGroupVersioner,
- )
-}
-
-// LoadFromFile takes a filename and de-serializes the contents into ControllerConfiguration object.
-func LoadFromFile(filename string) (*config.ControllerConfiguration, error) {
- bytes, err := ioutil.ReadFile(filename)
- if err != nil {
- return nil, err
- }
-
- return Load(bytes)
-}
-
-// Load takes a byte slice and de-serializes the contents into ControllerConfiguration object.
-// Encapsulates de-serialization without assuming the source is a file.
-func Load(data []byte) (*config.ControllerConfiguration, error) {
- cfg := &config.ControllerConfiguration{}
-
- if len(data) == 0 {
- return cfg, nil
- }
-
- decoded, _, err := Codec.Decode(data, &schema.GroupVersionKind{Version: "v1alpha1", Kind: "Config"}, cfg)
- if err != nil {
- return nil, err
- }
-
- return decoded.(*config.ControllerConfiguration), nil
-}
diff --git a/controllers/provider-packet/pkg/apis/config/register.go b/controllers/provider-packet/pkg/apis/config/register.go
deleted file mode 100644
index 8e4ad2b6e..000000000
--- a/controllers/provider-packet/pkg/apis/config/register.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package config
-
-import (
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/runtime/schema"
-)
-
-// GroupName is the group name use in this package
-const GroupName = "packet.provider.extensions.config.gardener.cloud"
-
-// SchemeGroupVersion is group version used to register these objects
-var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
-
-// Kind takes an unqualified kind and returns a Group qualified GroupKind
-func Kind(kind string) schema.GroupKind {
- return SchemeGroupVersion.WithKind(kind).GroupKind()
-}
-
-// Resource takes an unqualified resource and returns a Group qualified GroupResource
-func Resource(resource string) schema.GroupResource {
- return SchemeGroupVersion.WithResource(resource).GroupResource()
-}
-
-var (
- // SchemeBuilder used to register the Shoot resource.
- SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
- // AddToScheme is a pointer to SchemeBuilder.AddToScheme.
- AddToScheme = SchemeBuilder.AddToScheme
-)
-
-// Adds the list of known types to api.Scheme.
-func addKnownTypes(scheme *runtime.Scheme) error {
- scheme.AddKnownTypes(SchemeGroupVersion,
- &ControllerConfiguration{},
- )
- return nil
-}
diff --git a/controllers/provider-packet/pkg/apis/config/types.go b/controllers/provider-packet/pkg/apis/config/types.go
deleted file mode 100644
index 5420095c6..000000000
--- a/controllers/provider-packet/pkg/apis/config/types.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package config
-
-import (
- healthcheck "github.com/gardener/gardener-extensions/pkg/controller/healthcheck/config"
-
- "k8s.io/apimachinery/pkg/api/resource"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- componentbaseconfig "k8s.io/component-base/config"
-)
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-// ControllerConfiguration defines the configuration for the Packet provider.
-type ControllerConfiguration struct {
- metav1.TypeMeta
-
- // ClientConnection specifies the kubeconfig file and client connection
- // settings for the proxy server to use when communicating with the apiserver.
- ClientConnection *componentbaseconfig.ClientConnectionConfiguration
- // ETCD is the etcd configuration.
- ETCD ETCD
- // HealthCheckConfig is the config for the health check controller
- HealthCheckConfig *healthcheck.HealthCheckConfig
-}
-
-// ETCD is an etcd configuration.
-type ETCD struct {
- // ETCDStorage is the etcd storage configuration.
- Storage ETCDStorage
-}
-
-// ETCDStorage is an etcd storage configuration.
-type ETCDStorage struct {
- // ClassName is the name of the storage class used in etcd-main volume claims.
- ClassName *string
- // Capacity is the storage capacity used in etcd-main volume claims.
- Capacity *resource.Quantity
-}
diff --git a/controllers/provider-packet/pkg/apis/config/v1alpha1/defaults.go b/controllers/provider-packet/pkg/apis/config/v1alpha1/defaults.go
deleted file mode 100644
index fd79168fd..000000000
--- a/controllers/provider-packet/pkg/apis/config/v1alpha1/defaults.go
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package v1alpha1
-
-import (
- "k8s.io/apimachinery/pkg/runtime"
-)
-
-func addDefaultingFuncs(scheme *runtime.Scheme) error {
- return RegisterDefaults(scheme)
-}
diff --git a/controllers/provider-packet/pkg/apis/config/v1alpha1/doc.go b/controllers/provider-packet/pkg/apis/config/v1alpha1/doc.go
deleted file mode 100644
index 7e0c42472..000000000
--- a/controllers/provider-packet/pkg/apis/config/v1alpha1/doc.go
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// +k8s:deepcopy-gen=package
-// +k8s:conversion-gen=github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config
-// +k8s:openapi-gen=true
-// +k8s:defaulter-gen=TypeMeta
-
-//go:generate gen-crd-api-reference-docs -api-dir . -config ../../../../hack/api-reference/config.json -template-dir ../../../../../../hack/api-reference/template -out-file ../../../../hack/api-reference/config.md
-
-// Package v1alpha1 contains the Packet provider configuration API resources.
-// +groupName=packet.provider.extensions.config.gardener.cloud
-package v1alpha1 // import "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config/v1alpha1"
diff --git a/controllers/provider-packet/pkg/apis/config/v1alpha1/register.go b/controllers/provider-packet/pkg/apis/config/v1alpha1/register.go
deleted file mode 100644
index 5b9bc4efe..000000000
--- a/controllers/provider-packet/pkg/apis/config/v1alpha1/register.go
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package v1alpha1
-
-import (
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/runtime/schema"
-)
-
-// GroupName is the group name use in this package
-const GroupName = "packet.provider.extensions.config.gardener.cloud"
-
-// SchemeGroupVersion is group version used to register these objects
-var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
-
-// Resource takes an unqualified resource and returns a Group qualified GroupResource
-func Resource(resource string) schema.GroupResource {
- return SchemeGroupVersion.WithResource(resource).GroupResource()
-}
-
-var (
- // SchemeBuilder used to register the Shoot resource.
- SchemeBuilder runtime.SchemeBuilder
- localSchemeBuilder = &SchemeBuilder
- // AddToScheme is a pointer to SchemeBuilder.AddToScheme.
- AddToScheme = localSchemeBuilder.AddToScheme
-)
-
-func init() {
- // We only register manually written functions here. The registration of the
- // generated functions takes place in the generated files. The separation
- // makes the code compile even when the generated files are missing.
- localSchemeBuilder.Register(addDefaultingFuncs, addKnownTypes)
-}
-
-// Adds the list of known types to api.Scheme.
-func addKnownTypes(scheme *runtime.Scheme) error {
- scheme.AddKnownTypes(SchemeGroupVersion,
- &ControllerConfiguration{},
- )
- return nil
-}
diff --git a/controllers/provider-packet/pkg/apis/config/v1alpha1/types.go b/controllers/provider-packet/pkg/apis/config/v1alpha1/types.go
deleted file mode 100644
index 592315749..000000000
--- a/controllers/provider-packet/pkg/apis/config/v1alpha1/types.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package v1alpha1
-
-import (
- healthcheckconfigv1alpha1 "github.com/gardener/gardener-extensions/pkg/controller/healthcheck/config/v1alpha1"
-
- "k8s.io/apimachinery/pkg/api/resource"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1"
-)
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-// ControllerConfiguration defines the configuration for the Packet provider.
-type ControllerConfiguration struct {
- metav1.TypeMeta `json:",inline"`
-
- // ClientConnection specifies the kubeconfig file and client connection
- // settings for the proxy server to use when communicating with the apiserver.
- // +optional
- ClientConnection *componentbaseconfigv1alpha1.ClientConnectionConfiguration `json:"clientConnection,omitempty"`
- // ETCD is the etcd configuration.
- ETCD ETCD `json:"etcd"`
- // HealthCheckConfig is the config for the health check controller
- // +optional
- HealthCheckConfig *healthcheckconfigv1alpha1.HealthCheckConfig `json:"healthCheckConfig,omitempty"`
-}
-
-// ETCD is an etcd configuration.
-type ETCD struct {
- // ETCDStorage is the etcd storage configuration.
- Storage ETCDStorage `json:"storage"`
-}
-
-// ETCDStorage is an etcd storage configuration.
-type ETCDStorage struct {
- // ClassName is the name of the storage class used in etcd-main volume claims.
- // +optional
- ClassName *string `json:"className,omitempty"`
- // Capacity is the storage capacity used in etcd-main volume claims.
- // +optional
- Capacity *resource.Quantity `json:"capacity,omitempty"`
-}
diff --git a/controllers/provider-packet/pkg/apis/config/v1alpha1/zz_generated.conversion.go b/controllers/provider-packet/pkg/apis/config/v1alpha1/zz_generated.conversion.go
deleted file mode 100644
index 1be524c85..000000000
--- a/controllers/provider-packet/pkg/apis/config/v1alpha1/zz_generated.conversion.go
+++ /dev/null
@@ -1,148 +0,0 @@
-// +build !ignore_autogenerated
-
-/*
-Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by conversion-gen. DO NOT EDIT.
-
-package v1alpha1
-
-import (
- unsafe "unsafe"
-
- config "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config"
- healthcheckconfig "github.com/gardener/gardener-extensions/pkg/controller/healthcheck/config"
- healthcheckconfigv1alpha1 "github.com/gardener/gardener-extensions/pkg/controller/healthcheck/config/v1alpha1"
- resource "k8s.io/apimachinery/pkg/api/resource"
- conversion "k8s.io/apimachinery/pkg/conversion"
- runtime "k8s.io/apimachinery/pkg/runtime"
- componentbaseconfig "k8s.io/component-base/config"
- configv1alpha1 "k8s.io/component-base/config/v1alpha1"
-)
-
-func init() {
- localSchemeBuilder.Register(RegisterConversions)
-}
-
-// RegisterConversions adds conversion functions to the given scheme.
-// Public to allow building arbitrary schemes.
-func RegisterConversions(s *runtime.Scheme) error {
- if err := s.AddGeneratedConversionFunc((*ControllerConfiguration)(nil), (*config.ControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_ControllerConfiguration_To_config_ControllerConfiguration(a.(*ControllerConfiguration), b.(*config.ControllerConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*config.ControllerConfiguration)(nil), (*ControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_ControllerConfiguration_To_v1alpha1_ControllerConfiguration(a.(*config.ControllerConfiguration), b.(*ControllerConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*ETCD)(nil), (*config.ETCD)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_ETCD_To_config_ETCD(a.(*ETCD), b.(*config.ETCD), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*config.ETCD)(nil), (*ETCD)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_ETCD_To_v1alpha1_ETCD(a.(*config.ETCD), b.(*ETCD), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*ETCDStorage)(nil), (*config.ETCDStorage)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_ETCDStorage_To_config_ETCDStorage(a.(*ETCDStorage), b.(*config.ETCDStorage), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*config.ETCDStorage)(nil), (*ETCDStorage)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_ETCDStorage_To_v1alpha1_ETCDStorage(a.(*config.ETCDStorage), b.(*ETCDStorage), scope)
- }); err != nil {
- return err
- }
- return nil
-}
-
-func autoConvert_v1alpha1_ControllerConfiguration_To_config_ControllerConfiguration(in *ControllerConfiguration, out *config.ControllerConfiguration, s conversion.Scope) error {
- out.ClientConnection = (*componentbaseconfig.ClientConnectionConfiguration)(unsafe.Pointer(in.ClientConnection))
- if err := Convert_v1alpha1_ETCD_To_config_ETCD(&in.ETCD, &out.ETCD, s); err != nil {
- return err
- }
- out.HealthCheckConfig = (*healthcheckconfig.HealthCheckConfig)(unsafe.Pointer(in.HealthCheckConfig))
- return nil
-}
-
-// Convert_v1alpha1_ControllerConfiguration_To_config_ControllerConfiguration is an autogenerated conversion function.
-func Convert_v1alpha1_ControllerConfiguration_To_config_ControllerConfiguration(in *ControllerConfiguration, out *config.ControllerConfiguration, s conversion.Scope) error {
- return autoConvert_v1alpha1_ControllerConfiguration_To_config_ControllerConfiguration(in, out, s)
-}
-
-func autoConvert_config_ControllerConfiguration_To_v1alpha1_ControllerConfiguration(in *config.ControllerConfiguration, out *ControllerConfiguration, s conversion.Scope) error {
- out.ClientConnection = (*configv1alpha1.ClientConnectionConfiguration)(unsafe.Pointer(in.ClientConnection))
- if err := Convert_config_ETCD_To_v1alpha1_ETCD(&in.ETCD, &out.ETCD, s); err != nil {
- return err
- }
- out.HealthCheckConfig = (*healthcheckconfigv1alpha1.HealthCheckConfig)(unsafe.Pointer(in.HealthCheckConfig))
- return nil
-}
-
-// Convert_config_ControllerConfiguration_To_v1alpha1_ControllerConfiguration is an autogenerated conversion function.
-func Convert_config_ControllerConfiguration_To_v1alpha1_ControllerConfiguration(in *config.ControllerConfiguration, out *ControllerConfiguration, s conversion.Scope) error {
- return autoConvert_config_ControllerConfiguration_To_v1alpha1_ControllerConfiguration(in, out, s)
-}
-
-func autoConvert_v1alpha1_ETCD_To_config_ETCD(in *ETCD, out *config.ETCD, s conversion.Scope) error {
- if err := Convert_v1alpha1_ETCDStorage_To_config_ETCDStorage(&in.Storage, &out.Storage, s); err != nil {
- return err
- }
- return nil
-}
-
-// Convert_v1alpha1_ETCD_To_config_ETCD is an autogenerated conversion function.
-func Convert_v1alpha1_ETCD_To_config_ETCD(in *ETCD, out *config.ETCD, s conversion.Scope) error {
- return autoConvert_v1alpha1_ETCD_To_config_ETCD(in, out, s)
-}
-
-func autoConvert_config_ETCD_To_v1alpha1_ETCD(in *config.ETCD, out *ETCD, s conversion.Scope) error {
- if err := Convert_config_ETCDStorage_To_v1alpha1_ETCDStorage(&in.Storage, &out.Storage, s); err != nil {
- return err
- }
- return nil
-}
-
-// Convert_config_ETCD_To_v1alpha1_ETCD is an autogenerated conversion function.
-func Convert_config_ETCD_To_v1alpha1_ETCD(in *config.ETCD, out *ETCD, s conversion.Scope) error {
- return autoConvert_config_ETCD_To_v1alpha1_ETCD(in, out, s)
-}
-
-func autoConvert_v1alpha1_ETCDStorage_To_config_ETCDStorage(in *ETCDStorage, out *config.ETCDStorage, s conversion.Scope) error {
- out.ClassName = (*string)(unsafe.Pointer(in.ClassName))
- out.Capacity = (*resource.Quantity)(unsafe.Pointer(in.Capacity))
- return nil
-}
-
-// Convert_v1alpha1_ETCDStorage_To_config_ETCDStorage is an autogenerated conversion function.
-func Convert_v1alpha1_ETCDStorage_To_config_ETCDStorage(in *ETCDStorage, out *config.ETCDStorage, s conversion.Scope) error {
- return autoConvert_v1alpha1_ETCDStorage_To_config_ETCDStorage(in, out, s)
-}
-
-func autoConvert_config_ETCDStorage_To_v1alpha1_ETCDStorage(in *config.ETCDStorage, out *ETCDStorage, s conversion.Scope) error {
- out.ClassName = (*string)(unsafe.Pointer(in.ClassName))
- out.Capacity = (*resource.Quantity)(unsafe.Pointer(in.Capacity))
- return nil
-}
-
-// Convert_config_ETCDStorage_To_v1alpha1_ETCDStorage is an autogenerated conversion function.
-func Convert_config_ETCDStorage_To_v1alpha1_ETCDStorage(in *config.ETCDStorage, out *ETCDStorage, s conversion.Scope) error {
- return autoConvert_config_ETCDStorage_To_v1alpha1_ETCDStorage(in, out, s)
-}
diff --git a/controllers/provider-packet/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go b/controllers/provider-packet/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go
deleted file mode 100644
index 97e5cac1a..000000000
--- a/controllers/provider-packet/pkg/apis/config/v1alpha1/zz_generated.deepcopy.go
+++ /dev/null
@@ -1,106 +0,0 @@
-// +build !ignore_autogenerated
-
-/*
-Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by deepcopy-gen. DO NOT EDIT.
-
-package v1alpha1
-
-import (
- healthcheckconfigv1alpha1 "github.com/gardener/gardener-extensions/pkg/controller/healthcheck/config/v1alpha1"
- runtime "k8s.io/apimachinery/pkg/runtime"
- configv1alpha1 "k8s.io/component-base/config/v1alpha1"
-)
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ControllerConfiguration) DeepCopyInto(out *ControllerConfiguration) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- if in.ClientConnection != nil {
- in, out := &in.ClientConnection, &out.ClientConnection
- *out = new(configv1alpha1.ClientConnectionConfiguration)
- **out = **in
- }
- in.ETCD.DeepCopyInto(&out.ETCD)
- if in.HealthCheckConfig != nil {
- in, out := &in.HealthCheckConfig, &out.HealthCheckConfig
- *out = new(healthcheckconfigv1alpha1.HealthCheckConfig)
- **out = **in
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerConfiguration.
-func (in *ControllerConfiguration) DeepCopy() *ControllerConfiguration {
- if in == nil {
- return nil
- }
- out := new(ControllerConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *ControllerConfiguration) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ETCD) DeepCopyInto(out *ETCD) {
- *out = *in
- in.Storage.DeepCopyInto(&out.Storage)
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ETCD.
-func (in *ETCD) DeepCopy() *ETCD {
- if in == nil {
- return nil
- }
- out := new(ETCD)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ETCDStorage) DeepCopyInto(out *ETCDStorage) {
- *out = *in
- if in.ClassName != nil {
- in, out := &in.ClassName, &out.ClassName
- *out = new(string)
- **out = **in
- }
- if in.Capacity != nil {
- in, out := &in.Capacity, &out.Capacity
- x := (*in).DeepCopy()
- *out = &x
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ETCDStorage.
-func (in *ETCDStorage) DeepCopy() *ETCDStorage {
- if in == nil {
- return nil
- }
- out := new(ETCDStorage)
- in.DeepCopyInto(out)
- return out
-}
diff --git a/controllers/provider-packet/pkg/apis/config/v1alpha1/zz_generated.defaults.go b/controllers/provider-packet/pkg/apis/config/v1alpha1/zz_generated.defaults.go
deleted file mode 100644
index 5db2b64b0..000000000
--- a/controllers/provider-packet/pkg/apis/config/v1alpha1/zz_generated.defaults.go
+++ /dev/null
@@ -1,32 +0,0 @@
-// +build !ignore_autogenerated
-
-/*
-Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by defaulter-gen. DO NOT EDIT.
-
-package v1alpha1
-
-import (
- runtime "k8s.io/apimachinery/pkg/runtime"
-)
-
-// RegisterDefaults adds defaulters functions to the given scheme.
-// Public to allow building arbitrary schemes.
-// All generated defaulters are covering - they call all nested defaulters.
-func RegisterDefaults(scheme *runtime.Scheme) error {
- return nil
-}
diff --git a/controllers/provider-packet/pkg/apis/config/zz_generated.deepcopy.go b/controllers/provider-packet/pkg/apis/config/zz_generated.deepcopy.go
deleted file mode 100644
index bbce583cf..000000000
--- a/controllers/provider-packet/pkg/apis/config/zz_generated.deepcopy.go
+++ /dev/null
@@ -1,106 +0,0 @@
-// +build !ignore_autogenerated
-
-/*
-Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by deepcopy-gen. DO NOT EDIT.
-
-package config
-
-import (
- healthcheckconfig "github.com/gardener/gardener-extensions/pkg/controller/healthcheck/config"
- runtime "k8s.io/apimachinery/pkg/runtime"
- componentbaseconfig "k8s.io/component-base/config"
-)
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ControllerConfiguration) DeepCopyInto(out *ControllerConfiguration) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- if in.ClientConnection != nil {
- in, out := &in.ClientConnection, &out.ClientConnection
- *out = new(componentbaseconfig.ClientConnectionConfiguration)
- **out = **in
- }
- in.ETCD.DeepCopyInto(&out.ETCD)
- if in.HealthCheckConfig != nil {
- in, out := &in.HealthCheckConfig, &out.HealthCheckConfig
- *out = new(healthcheckconfig.HealthCheckConfig)
- **out = **in
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerConfiguration.
-func (in *ControllerConfiguration) DeepCopy() *ControllerConfiguration {
- if in == nil {
- return nil
- }
- out := new(ControllerConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *ControllerConfiguration) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ETCD) DeepCopyInto(out *ETCD) {
- *out = *in
- in.Storage.DeepCopyInto(&out.Storage)
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ETCD.
-func (in *ETCD) DeepCopy() *ETCD {
- if in == nil {
- return nil
- }
- out := new(ETCD)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ETCDStorage) DeepCopyInto(out *ETCDStorage) {
- *out = *in
- if in.ClassName != nil {
- in, out := &in.ClassName, &out.ClassName
- *out = new(string)
- **out = **in
- }
- if in.Capacity != nil {
- in, out := &in.Capacity, &out.Capacity
- x := (*in).DeepCopy()
- *out = &x
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ETCDStorage.
-func (in *ETCDStorage) DeepCopy() *ETCDStorage {
- if in == nil {
- return nil
- }
- out := new(ETCDStorage)
- in.DeepCopyInto(out)
- return out
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/doc.go b/controllers/provider-packet/pkg/apis/packet/doc.go
deleted file mode 100644
index a195dc390..000000000
--- a/controllers/provider-packet/pkg/apis/packet/doc.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// +k8s:deepcopy-gen=package
-// +groupName="packet.provider.extensions.gardener.cloud"
-
-//go:generate ../../../hack/generate-code
-
-package packet // import "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet"
diff --git a/controllers/provider-packet/pkg/apis/packet/helper/helper.go b/controllers/provider-packet/pkg/apis/packet/helper/helper.go
deleted file mode 100644
index 0e14a6c94..000000000
--- a/controllers/provider-packet/pkg/apis/packet/helper/helper.go
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package helper
-
-import (
- "fmt"
-
- api "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet"
-)
-
-// FindMachineImage takes a list of machine images and tries to find the first entry
-// whose name, version, and zone matches with the given name, version, and zone. If no such entry is
-// found then an error will be returned.
-func FindMachineImage(machineImages []api.MachineImage, name, version string) (*api.MachineImage, error) {
- for _, machineImage := range machineImages {
- if machineImage.Name == name && machineImage.Version == version {
- return &machineImage, nil
- }
- }
- return nil, fmt.Errorf("no machine image with name %q, version %q found", name, version)
-}
-
-// FindImageFromCloudProfile takes a list of machine images, and the desired image name and version. It tries
-// to find the image with the given name and version in the desired cloud profile. If it cannot be found then an error
-// is returned.
-func FindImageFromCloudProfile(cloudProfileConfig *api.CloudProfileConfig, imageName, imageVersion string) (string, error) {
- if cloudProfileConfig != nil {
- for _, machineImage := range cloudProfileConfig.MachineImages {
- if machineImage.Name != imageName {
- continue
- }
- for _, version := range machineImage.Versions {
- if imageVersion == version.Version {
- return version.ID, nil
- }
- }
- }
- }
-
- return "", fmt.Errorf("could not find an image for name %q in version %q", imageName, imageVersion)
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/helper/helper_suite_test.go b/controllers/provider-packet/pkg/apis/packet/helper/helper_suite_test.go
deleted file mode 100644
index 5b529dca8..000000000
--- a/controllers/provider-packet/pkg/apis/packet/helper/helper_suite_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package helper_test
-
-import (
- "testing"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-func TestHelper(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Packet API Helper Suite")
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/helper/helper_test.go b/controllers/provider-packet/pkg/apis/packet/helper/helper_test.go
deleted file mode 100644
index 31308d579..000000000
--- a/controllers/provider-packet/pkg/apis/packet/helper/helper_test.go
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package helper_test
-
-import (
- api "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet"
- . "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet/helper"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/extensions/table"
- . "github.com/onsi/gomega"
-)
-
-const configImage = "some-uuid"
-const profileImage = "some-other-uuid"
-
-var _ = Describe("Helper", func() {
- DescribeTable("#FindMachineImage",
- func(machineImages []api.MachineImage, name, version string, expectedMachineImage *api.MachineImage, expectErr bool) {
- machineImage, err := FindMachineImage(machineImages, name, version)
- expectResults(machineImage, expectedMachineImage, err, expectErr)
- },
-
- Entry("list is nil", nil, "foo", "1.2.3", nil, true),
- Entry("empty list", []api.MachineImage{}, "foo", "1.2.3", nil, true),
- Entry("entry not found (no name)", []api.MachineImage{{Name: "bar", Version: "1.2.3", ID: "1234"}}, "foo", "1.2.3", nil, true),
- Entry("entry not found (no version)", []api.MachineImage{{Name: "bar", Version: "1.2.3", ID: "1234"}}, "foo", "1.2.4", nil, true),
- Entry("entry exists", []api.MachineImage{{Name: "bar", Version: "1.2.3", ID: "1234"}}, "bar", "1.2.3", &api.MachineImage{Name: "bar", Version: "1.2.3", ID: "1234"}, false),
- )
-
- DescribeTable("#FindImage",
- func(profileImages []api.MachineImages, imageName, version string, expectedImage string) {
- cfg := &api.CloudProfileConfig{}
- cfg.MachineImages = profileImages
- image, err := FindImageFromCloudProfile(cfg, imageName, version)
-
- Expect(image).To(Equal(expectedImage))
- if expectedImage != "" {
- Expect(err).NotTo(HaveOccurred())
- } else {
- Expect(err).To(HaveOccurred())
- }
- },
-
- Entry("list is nil", nil, "ubuntu", "1", ""),
-
- Entry("profile empty list", []api.MachineImages{}, "ubuntu", "1", ""),
- Entry("profile entry not found (image does not exist)", makeProfileMachineImages("debian", "1"), "ubuntu", "1", ""),
- Entry("profile entry not found (version does not exist)", makeProfileMachineImages("ubuntu", "2"), "ubuntu", "1", ""),
- Entry("profile entry", makeProfileMachineImages("ubuntu", "1"), "ubuntu", "1", profileImage),
- )
-})
-
-func makeProfileMachineImages(name, version string) []api.MachineImages {
- var versions []api.MachineImageVersion
- if len(configImage) != 0 {
- versions = append(versions, api.MachineImageVersion{
- Version: version,
- ID: profileImage,
- })
- }
-
- return []api.MachineImages{
- {
- Name: name,
- Versions: versions,
- },
- }
-}
-
-func expectResults(result, expected interface{}, err error, expectErr bool) {
- if !expectErr {
- Expect(result).To(Equal(expected))
- Expect(err).NotTo(HaveOccurred())
- } else {
- Expect(result).To(BeNil())
- Expect(err).To(HaveOccurred())
- }
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/helper/scheme.go b/controllers/provider-packet/pkg/apis/packet/helper/scheme.go
deleted file mode 100644
index 72dbce06f..000000000
--- a/controllers/provider-packet/pkg/apis/packet/helper/scheme.go
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package helper
-
-import (
- "fmt"
- "github.com/pkg/errors"
-
- "github.com/gardener/gardener-extensions/pkg/controller"
- "github.com/gardener/gardener-extensions/pkg/util"
- extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
-
- api "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet/install"
-
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/runtime/serializer"
- utilruntime "k8s.io/apimachinery/pkg/util/runtime"
-)
-
-var (
- // Scheme is a scheme with the types relevant for OpenStack actuators.
- Scheme *runtime.Scheme
-
- decoder runtime.Decoder
-)
-
-func init() {
- Scheme = runtime.NewScheme()
- utilruntime.Must(install.AddToScheme(Scheme))
-
- decoder = serializer.NewCodecFactory(Scheme).UniversalDecoder()
-}
-
-// InfrastructureConfigFromInfrastructure extracts the InfrastructureConfig from the
-// ProviderConfig section of the given Infrastructure.
-func InfrastructureConfigFromInfrastructure(infra *extensionsv1alpha1.Infrastructure) (*api.InfrastructureConfig, error) {
- config := &api.InfrastructureConfig{}
- if infra.Spec.ProviderConfig != nil && infra.Spec.ProviderConfig.Raw != nil {
- if _, _, err := decoder.Decode(infra.Spec.ProviderConfig.Raw, nil, config); err != nil {
- return nil, err
- }
- return config, nil
- }
- return nil, fmt.Errorf("provider config is not set on the infrastructure resource")
-}
-
-// CloudProfileConfigFromCluster decodes the provider specific cloud profile configuration for a cluster
-func CloudProfileConfigFromCluster(cluster *controller.Cluster) (*api.CloudProfileConfig, error) {
- var cloudProfileConfig *api.CloudProfileConfig
- if cluster != nil && cluster.CloudProfile != nil && cluster.CloudProfile.Spec.ProviderConfig != nil && cluster.CloudProfile.Spec.ProviderConfig.Raw != nil {
- cloudProfileConfig = &api.CloudProfileConfig{}
- if _, _, err := decoder.Decode(cluster.CloudProfile.Spec.ProviderConfig.Raw, nil, cloudProfileConfig); err != nil {
- return nil, errors.Wrapf(err, "could not decode providerConfig of cloudProfile for '%s'", util.ObjectName(cluster.CloudProfile))
- }
- }
- return cloudProfileConfig, nil
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/install/install.go b/controllers/provider-packet/pkg/apis/packet/install/install.go
deleted file mode 100644
index 054d807ea..000000000
--- a/controllers/provider-packet/pkg/apis/packet/install/install.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package install
-
-import (
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet/v1alpha1"
-
- "k8s.io/apimachinery/pkg/runtime"
- utilruntime "k8s.io/apimachinery/pkg/util/runtime"
-)
-
-var (
- schemeBuilder = runtime.NewSchemeBuilder(
- v1alpha1.AddToScheme,
- packet.AddToScheme,
- setVersionPriority,
- )
-
- // AddToScheme adds all APIs to the scheme.
- AddToScheme = schemeBuilder.AddToScheme
-)
-
-func setVersionPriority(scheme *runtime.Scheme) error {
- return scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion)
-}
-
-// Install installs all APIs in the scheme.
-func Install(scheme *runtime.Scheme) {
- utilruntime.Must(AddToScheme(scheme))
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/register.go b/controllers/provider-packet/pkg/apis/packet/register.go
deleted file mode 100644
index 850438519..000000000
--- a/controllers/provider-packet/pkg/apis/packet/register.go
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package packet
-
-import (
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/runtime/schema"
-)
-
-// GroupName is the group name use in this package
-const GroupName = "packet.provider.extensions.gardener.cloud"
-
-// SchemeGroupVersion is group version used to register these objects
-var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
-
-// Kind takes an unqualified kind and returns a Group qualified GroupKind
-func Kind(kind string) schema.GroupKind {
- return SchemeGroupVersion.WithKind(kind).GroupKind()
-}
-
-// Resource takes an unqualified resource and returns a Group qualified GroupResource
-func Resource(resource string) schema.GroupResource {
- return SchemeGroupVersion.WithResource(resource).GroupResource()
-}
-
-var (
- // SchemeBuilder used to register the Shoot resource.
- SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
- // AddToScheme is a pointer to SchemeBuilder.AddToScheme.
- AddToScheme = SchemeBuilder.AddToScheme
-)
-
-// Adds the list of known types to api.Scheme.
-func addKnownTypes(scheme *runtime.Scheme) error {
- scheme.AddKnownTypes(SchemeGroupVersion,
- &CloudProfileConfig{},
- &InfrastructureConfig{},
- &InfrastructureStatus{},
- &ControlPlaneConfig{},
- &WorkerStatus{},
- )
- return nil
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/types_cloudprofile.go b/controllers/provider-packet/pkg/apis/packet/types_cloudprofile.go
deleted file mode 100644
index b9033e488..000000000
--- a/controllers/provider-packet/pkg/apis/packet/types_cloudprofile.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package packet
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-// CloudProfileConfig contains provider-specific configuration that is embedded into Gardener's `CloudProfile`
-// resource.
-type CloudProfileConfig struct {
- metav1.TypeMeta
- // MachineImages is the list of machine images that are understood by the controller. It maps
- // logical names and versions to provider-specific identifiers.
- MachineImages []MachineImages
-}
-
-// MachineImages is a mapping from logical names and versions to provider-specific identifiers.
-type MachineImages struct {
- // Name is the logical name of the machine image.
- Name string
- // Versions contains versions and a provider-specific identifier.
- Versions []MachineImageVersion
-}
-
-// MachineImageVersion contains a version and a provider-specific identifier.
-type MachineImageVersion struct {
- // Version is the version of the image.
- Version string
- // ID is the id of the image.
- ID string
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/types_controlplane.go b/controllers/provider-packet/pkg/apis/packet/types_controlplane.go
deleted file mode 100644
index 7cfba093c..000000000
--- a/controllers/provider-packet/pkg/apis/packet/types_controlplane.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package packet
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-// ControlPlaneConfig contains configuration settings for the control plane.
-type ControlPlaneConfig struct {
- metav1.TypeMeta
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/types_infrastructure.go b/controllers/provider-packet/pkg/apis/packet/types_infrastructure.go
deleted file mode 100644
index bbbd77b04..000000000
--- a/controllers/provider-packet/pkg/apis/packet/types_infrastructure.go
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package packet
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-// InfrastructureConfig infrastructure configuration resource
-type InfrastructureConfig struct {
- metav1.TypeMeta
-}
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-// InfrastructureStatus contains information about created infrastructure resources.
-type InfrastructureStatus struct {
- metav1.TypeMeta
-
- SSHKeyID string
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/types_worker.go b/controllers/provider-packet/pkg/apis/packet/types_worker.go
deleted file mode 100644
index 66d0d76a3..000000000
--- a/controllers/provider-packet/pkg/apis/packet/types_worker.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package packet
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-// WorkerStatus contains information about created worker resources.
-type WorkerStatus struct {
- metav1.TypeMeta
-
- // MachineImages is a list of machine images that have been used in this worker. Usually, the extension controller
- // gets the mapping from name/version to the provider-specific machine image data in its componentconfig. However, if
- // a version that is still in use gets removed from this componentconfig it cannot reconcile anymore existing `Worker`
- // resources that are still using this version. Hence, it stores the used versions in the provider status to ensure
- // reconciliation is possible.
- MachineImages []MachineImage
-}
-
-// MachineImage is a mapping from logical names and versions to provider-specific machine image data.
-type MachineImage struct {
- // Name is the logical name of the machine image.
- Name string
- // Version is the logical version of the machine image.
- Version string
- // ID is the id of the image.
- ID string
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/v1alpha1/defaults.go b/controllers/provider-packet/pkg/apis/packet/v1alpha1/defaults.go
deleted file mode 100644
index 8b665d270..000000000
--- a/controllers/provider-packet/pkg/apis/packet/v1alpha1/defaults.go
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package v1alpha1
-
-import (
- "k8s.io/apimachinery/pkg/runtime"
-)
-
-func addDefaultingFuncs(scheme *runtime.Scheme) error {
- return RegisterDefaults(scheme)
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/v1alpha1/doc.go b/controllers/provider-packet/pkg/apis/packet/v1alpha1/doc.go
deleted file mode 100644
index 3dee8e7f7..000000000
--- a/controllers/provider-packet/pkg/apis/packet/v1alpha1/doc.go
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// +k8s:deepcopy-gen=package
-// +k8s:conversion-gen=github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet
-// +k8s:openapi-gen=true
-// +k8s:defaulter-gen=TypeMeta
-
-//go:generate gen-crd-api-reference-docs -api-dir . -config ../../../../hack/api-reference/api.json -template-dir ../../../../../../hack/api-reference/template -out-file ../../../../hack/api-reference/api.md
-
-// Package v1alpha1 contains the Packet provider API resources.
-// +groupName=packet.provider.extensions.gardener.cloud
-package v1alpha1 // import "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet/v1alpha1"
diff --git a/controllers/provider-packet/pkg/apis/packet/v1alpha1/register.go b/controllers/provider-packet/pkg/apis/packet/v1alpha1/register.go
deleted file mode 100644
index 0d5e455fe..000000000
--- a/controllers/provider-packet/pkg/apis/packet/v1alpha1/register.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package v1alpha1
-
-import (
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/runtime/schema"
-)
-
-// GroupName is the group name use in this package
-const GroupName = "packet.provider.extensions.gardener.cloud"
-
-// SchemeGroupVersion is group version used to register these objects
-var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
-
-// Resource takes an unqualified resource and returns a Group qualified GroupResource
-func Resource(resource string) schema.GroupResource {
- return SchemeGroupVersion.WithResource(resource).GroupResource()
-}
-
-var (
- // SchemeBuilder used to register the Shoot resource.
- SchemeBuilder runtime.SchemeBuilder
- localSchemeBuilder = &SchemeBuilder
- // AddToScheme is a pointer to SchemeBuilder.AddToScheme.
- AddToScheme = localSchemeBuilder.AddToScheme
-)
-
-func init() {
- // We only register manually written functions here. The registration of the
- // generated functions takes place in the generated files. The separation
- // makes the code compile even when the generated files are missing.
- localSchemeBuilder.Register(addDefaultingFuncs, addKnownTypes)
-}
-
-// Adds the list of known types to api.Scheme.
-func addKnownTypes(scheme *runtime.Scheme) error {
- scheme.AddKnownTypes(SchemeGroupVersion,
- &CloudProfileConfig{},
- &InfrastructureConfig{},
- &InfrastructureStatus{},
- &ControlPlaneConfig{},
- &WorkerStatus{},
- )
- return nil
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/v1alpha1/types_cloudprofile.go b/controllers/provider-packet/pkg/apis/packet/v1alpha1/types_cloudprofile.go
deleted file mode 100644
index 26ad8a5ca..000000000
--- a/controllers/provider-packet/pkg/apis/packet/v1alpha1/types_cloudprofile.go
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package v1alpha1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-// +genclient
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-// CloudProfileConfig contains provider-specific configuration that is embedded into Gardener's `CloudProfile`
-// resource.
-type CloudProfileConfig struct {
- metav1.TypeMeta `json:",inline"`
- // MachineImages is the list of machine images that are understood by the controller. It maps
- // logical names and versions to provider-specific identifiers.
- MachineImages []MachineImages `json:"machineImages"`
-}
-
-// MachineImages is a mapping from logical names and versions to provider-specific identifiers.
-type MachineImages struct {
- // Name is the logical name of the machine image.
- Name string `json:"name"`
- // Versions contains versions and a provider-specific identifier.
- Versions []MachineImageVersion `json:"versions"`
-}
-
-// MachineImageVersion contains a version and a provider-specific identifier.
-type MachineImageVersion struct {
- // Version is the version of the image.
- Version string `json:"version"`
- // ID is the id of the image.
- ID string `json:"id"`
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/v1alpha1/types_controlplane.go b/controllers/provider-packet/pkg/apis/packet/v1alpha1/types_controlplane.go
deleted file mode 100644
index 2975e8968..000000000
--- a/controllers/provider-packet/pkg/apis/packet/v1alpha1/types_controlplane.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package v1alpha1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-// +genclient
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-// ControlPlaneConfig contains configuration settings for the control plane.
-type ControlPlaneConfig struct {
- metav1.TypeMeta `json:",inline"`
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/v1alpha1/types_infrastructure.go b/controllers/provider-packet/pkg/apis/packet/v1alpha1/types_infrastructure.go
deleted file mode 100644
index 580c12ad9..000000000
--- a/controllers/provider-packet/pkg/apis/packet/v1alpha1/types_infrastructure.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package v1alpha1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-// +genclient
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-// InfrastructureConfig infrastructure configuration resource
-type InfrastructureConfig struct {
- metav1.TypeMeta `json:",inline"`
-}
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-// InfrastructureStatus contains information about created infrastructure resources.
-type InfrastructureStatus struct {
- metav1.TypeMeta `json:",inline"`
-
- SSHKeyID string `json:"sshKeyID"`
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/v1alpha1/types_worker.go b/controllers/provider-packet/pkg/apis/packet/v1alpha1/types_worker.go
deleted file mode 100644
index 91a196be0..000000000
--- a/controllers/provider-packet/pkg/apis/packet/v1alpha1/types_worker.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package v1alpha1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-// +genclient
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-// WorkerStatus contains information about created worker resources.
-type WorkerStatus struct {
- metav1.TypeMeta `json:",inline"`
-
- // MachineImages is a list of machine images that have been used in this worker. Usually, the extension controller
- // gets the mapping from name/version to the provider-specific machine image data in its componentconfig. However, if
- // a version that is still in use gets removed from this componentconfig it cannot reconcile anymore existing `Worker`
- // resources that are still using this version. Hence, it stores the used versions in the provider status to ensure
- // reconciliation is possible.
- // +optional
- MachineImages []MachineImage `json:"machineImages,omitempty"`
-}
-
-// MachineImage is a mapping from logical names and versions to provider-specific machine image data.
-type MachineImage struct {
- // Name is the logical name of the machine image.
- Name string `json:"name"`
- // Version is the logical version of the machine image.
- Version string `json:"version"`
- // ID is the id of the image.
- ID string `json:"id"`
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/v1alpha1/zz_generated.conversion.go b/controllers/provider-packet/pkg/apis/packet/v1alpha1/zz_generated.conversion.go
deleted file mode 100644
index ad2a05eaf..000000000
--- a/controllers/provider-packet/pkg/apis/packet/v1alpha1/zz_generated.conversion.go
+++ /dev/null
@@ -1,283 +0,0 @@
-// +build !ignore_autogenerated
-
-/*
-Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by conversion-gen. DO NOT EDIT.
-
-package v1alpha1
-
-import (
- unsafe "unsafe"
-
- packet "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet"
- conversion "k8s.io/apimachinery/pkg/conversion"
- runtime "k8s.io/apimachinery/pkg/runtime"
-)
-
-func init() {
- localSchemeBuilder.Register(RegisterConversions)
-}
-
-// RegisterConversions adds conversion functions to the given scheme.
-// Public to allow building arbitrary schemes.
-func RegisterConversions(s *runtime.Scheme) error {
- if err := s.AddGeneratedConversionFunc((*CloudProfileConfig)(nil), (*packet.CloudProfileConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_CloudProfileConfig_To_packet_CloudProfileConfig(a.(*CloudProfileConfig), b.(*packet.CloudProfileConfig), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*packet.CloudProfileConfig)(nil), (*CloudProfileConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_packet_CloudProfileConfig_To_v1alpha1_CloudProfileConfig(a.(*packet.CloudProfileConfig), b.(*CloudProfileConfig), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*ControlPlaneConfig)(nil), (*packet.ControlPlaneConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_ControlPlaneConfig_To_packet_ControlPlaneConfig(a.(*ControlPlaneConfig), b.(*packet.ControlPlaneConfig), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*packet.ControlPlaneConfig)(nil), (*ControlPlaneConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_packet_ControlPlaneConfig_To_v1alpha1_ControlPlaneConfig(a.(*packet.ControlPlaneConfig), b.(*ControlPlaneConfig), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*InfrastructureConfig)(nil), (*packet.InfrastructureConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_InfrastructureConfig_To_packet_InfrastructureConfig(a.(*InfrastructureConfig), b.(*packet.InfrastructureConfig), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*packet.InfrastructureConfig)(nil), (*InfrastructureConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_packet_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(a.(*packet.InfrastructureConfig), b.(*InfrastructureConfig), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*InfrastructureStatus)(nil), (*packet.InfrastructureStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_InfrastructureStatus_To_packet_InfrastructureStatus(a.(*InfrastructureStatus), b.(*packet.InfrastructureStatus), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*packet.InfrastructureStatus)(nil), (*InfrastructureStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_packet_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(a.(*packet.InfrastructureStatus), b.(*InfrastructureStatus), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*MachineImage)(nil), (*packet.MachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_MachineImage_To_packet_MachineImage(a.(*MachineImage), b.(*packet.MachineImage), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*packet.MachineImage)(nil), (*MachineImage)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_packet_MachineImage_To_v1alpha1_MachineImage(a.(*packet.MachineImage), b.(*MachineImage), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*MachineImageVersion)(nil), (*packet.MachineImageVersion)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_MachineImageVersion_To_packet_MachineImageVersion(a.(*MachineImageVersion), b.(*packet.MachineImageVersion), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*packet.MachineImageVersion)(nil), (*MachineImageVersion)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_packet_MachineImageVersion_To_v1alpha1_MachineImageVersion(a.(*packet.MachineImageVersion), b.(*MachineImageVersion), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*MachineImages)(nil), (*packet.MachineImages)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_MachineImages_To_packet_MachineImages(a.(*MachineImages), b.(*packet.MachineImages), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*packet.MachineImages)(nil), (*MachineImages)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_packet_MachineImages_To_v1alpha1_MachineImages(a.(*packet.MachineImages), b.(*MachineImages), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*WorkerStatus)(nil), (*packet.WorkerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_WorkerStatus_To_packet_WorkerStatus(a.(*WorkerStatus), b.(*packet.WorkerStatus), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*packet.WorkerStatus)(nil), (*WorkerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_packet_WorkerStatus_To_v1alpha1_WorkerStatus(a.(*packet.WorkerStatus), b.(*WorkerStatus), scope)
- }); err != nil {
- return err
- }
- return nil
-}
-
-func autoConvert_v1alpha1_CloudProfileConfig_To_packet_CloudProfileConfig(in *CloudProfileConfig, out *packet.CloudProfileConfig, s conversion.Scope) error {
- out.MachineImages = *(*[]packet.MachineImages)(unsafe.Pointer(&in.MachineImages))
- return nil
-}
-
-// Convert_v1alpha1_CloudProfileConfig_To_packet_CloudProfileConfig is an autogenerated conversion function.
-func Convert_v1alpha1_CloudProfileConfig_To_packet_CloudProfileConfig(in *CloudProfileConfig, out *packet.CloudProfileConfig, s conversion.Scope) error {
- return autoConvert_v1alpha1_CloudProfileConfig_To_packet_CloudProfileConfig(in, out, s)
-}
-
-func autoConvert_packet_CloudProfileConfig_To_v1alpha1_CloudProfileConfig(in *packet.CloudProfileConfig, out *CloudProfileConfig, s conversion.Scope) error {
- out.MachineImages = *(*[]MachineImages)(unsafe.Pointer(&in.MachineImages))
- return nil
-}
-
-// Convert_packet_CloudProfileConfig_To_v1alpha1_CloudProfileConfig is an autogenerated conversion function.
-func Convert_packet_CloudProfileConfig_To_v1alpha1_CloudProfileConfig(in *packet.CloudProfileConfig, out *CloudProfileConfig, s conversion.Scope) error {
- return autoConvert_packet_CloudProfileConfig_To_v1alpha1_CloudProfileConfig(in, out, s)
-}
-
-func autoConvert_v1alpha1_ControlPlaneConfig_To_packet_ControlPlaneConfig(in *ControlPlaneConfig, out *packet.ControlPlaneConfig, s conversion.Scope) error {
- return nil
-}
-
-// Convert_v1alpha1_ControlPlaneConfig_To_packet_ControlPlaneConfig is an autogenerated conversion function.
-func Convert_v1alpha1_ControlPlaneConfig_To_packet_ControlPlaneConfig(in *ControlPlaneConfig, out *packet.ControlPlaneConfig, s conversion.Scope) error {
- return autoConvert_v1alpha1_ControlPlaneConfig_To_packet_ControlPlaneConfig(in, out, s)
-}
-
-func autoConvert_packet_ControlPlaneConfig_To_v1alpha1_ControlPlaneConfig(in *packet.ControlPlaneConfig, out *ControlPlaneConfig, s conversion.Scope) error {
- return nil
-}
-
-// Convert_packet_ControlPlaneConfig_To_v1alpha1_ControlPlaneConfig is an autogenerated conversion function.
-func Convert_packet_ControlPlaneConfig_To_v1alpha1_ControlPlaneConfig(in *packet.ControlPlaneConfig, out *ControlPlaneConfig, s conversion.Scope) error {
- return autoConvert_packet_ControlPlaneConfig_To_v1alpha1_ControlPlaneConfig(in, out, s)
-}
-
-func autoConvert_v1alpha1_InfrastructureConfig_To_packet_InfrastructureConfig(in *InfrastructureConfig, out *packet.InfrastructureConfig, s conversion.Scope) error {
- return nil
-}
-
-// Convert_v1alpha1_InfrastructureConfig_To_packet_InfrastructureConfig is an autogenerated conversion function.
-func Convert_v1alpha1_InfrastructureConfig_To_packet_InfrastructureConfig(in *InfrastructureConfig, out *packet.InfrastructureConfig, s conversion.Scope) error {
- return autoConvert_v1alpha1_InfrastructureConfig_To_packet_InfrastructureConfig(in, out, s)
-}
-
-func autoConvert_packet_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(in *packet.InfrastructureConfig, out *InfrastructureConfig, s conversion.Scope) error {
- return nil
-}
-
-// Convert_packet_InfrastructureConfig_To_v1alpha1_InfrastructureConfig is an autogenerated conversion function.
-func Convert_packet_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(in *packet.InfrastructureConfig, out *InfrastructureConfig, s conversion.Scope) error {
- return autoConvert_packet_InfrastructureConfig_To_v1alpha1_InfrastructureConfig(in, out, s)
-}
-
-func autoConvert_v1alpha1_InfrastructureStatus_To_packet_InfrastructureStatus(in *InfrastructureStatus, out *packet.InfrastructureStatus, s conversion.Scope) error {
- out.SSHKeyID = in.SSHKeyID
- return nil
-}
-
-// Convert_v1alpha1_InfrastructureStatus_To_packet_InfrastructureStatus is an autogenerated conversion function.
-func Convert_v1alpha1_InfrastructureStatus_To_packet_InfrastructureStatus(in *InfrastructureStatus, out *packet.InfrastructureStatus, s conversion.Scope) error {
- return autoConvert_v1alpha1_InfrastructureStatus_To_packet_InfrastructureStatus(in, out, s)
-}
-
-func autoConvert_packet_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(in *packet.InfrastructureStatus, out *InfrastructureStatus, s conversion.Scope) error {
- out.SSHKeyID = in.SSHKeyID
- return nil
-}
-
-// Convert_packet_InfrastructureStatus_To_v1alpha1_InfrastructureStatus is an autogenerated conversion function.
-func Convert_packet_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(in *packet.InfrastructureStatus, out *InfrastructureStatus, s conversion.Scope) error {
- return autoConvert_packet_InfrastructureStatus_To_v1alpha1_InfrastructureStatus(in, out, s)
-}
-
-func autoConvert_v1alpha1_MachineImage_To_packet_MachineImage(in *MachineImage, out *packet.MachineImage, s conversion.Scope) error {
- out.Name = in.Name
- out.Version = in.Version
- out.ID = in.ID
- return nil
-}
-
-// Convert_v1alpha1_MachineImage_To_packet_MachineImage is an autogenerated conversion function.
-func Convert_v1alpha1_MachineImage_To_packet_MachineImage(in *MachineImage, out *packet.MachineImage, s conversion.Scope) error {
- return autoConvert_v1alpha1_MachineImage_To_packet_MachineImage(in, out, s)
-}
-
-func autoConvert_packet_MachineImage_To_v1alpha1_MachineImage(in *packet.MachineImage, out *MachineImage, s conversion.Scope) error {
- out.Name = in.Name
- out.Version = in.Version
- out.ID = in.ID
- return nil
-}
-
-// Convert_packet_MachineImage_To_v1alpha1_MachineImage is an autogenerated conversion function.
-func Convert_packet_MachineImage_To_v1alpha1_MachineImage(in *packet.MachineImage, out *MachineImage, s conversion.Scope) error {
- return autoConvert_packet_MachineImage_To_v1alpha1_MachineImage(in, out, s)
-}
-
-func autoConvert_v1alpha1_MachineImageVersion_To_packet_MachineImageVersion(in *MachineImageVersion, out *packet.MachineImageVersion, s conversion.Scope) error {
- out.Version = in.Version
- out.ID = in.ID
- return nil
-}
-
-// Convert_v1alpha1_MachineImageVersion_To_packet_MachineImageVersion is an autogenerated conversion function.
-func Convert_v1alpha1_MachineImageVersion_To_packet_MachineImageVersion(in *MachineImageVersion, out *packet.MachineImageVersion, s conversion.Scope) error {
- return autoConvert_v1alpha1_MachineImageVersion_To_packet_MachineImageVersion(in, out, s)
-}
-
-func autoConvert_packet_MachineImageVersion_To_v1alpha1_MachineImageVersion(in *packet.MachineImageVersion, out *MachineImageVersion, s conversion.Scope) error {
- out.Version = in.Version
- out.ID = in.ID
- return nil
-}
-
-// Convert_packet_MachineImageVersion_To_v1alpha1_MachineImageVersion is an autogenerated conversion function.
-func Convert_packet_MachineImageVersion_To_v1alpha1_MachineImageVersion(in *packet.MachineImageVersion, out *MachineImageVersion, s conversion.Scope) error {
- return autoConvert_packet_MachineImageVersion_To_v1alpha1_MachineImageVersion(in, out, s)
-}
-
-func autoConvert_v1alpha1_MachineImages_To_packet_MachineImages(in *MachineImages, out *packet.MachineImages, s conversion.Scope) error {
- out.Name = in.Name
- out.Versions = *(*[]packet.MachineImageVersion)(unsafe.Pointer(&in.Versions))
- return nil
-}
-
-// Convert_v1alpha1_MachineImages_To_packet_MachineImages is an autogenerated conversion function.
-func Convert_v1alpha1_MachineImages_To_packet_MachineImages(in *MachineImages, out *packet.MachineImages, s conversion.Scope) error {
- return autoConvert_v1alpha1_MachineImages_To_packet_MachineImages(in, out, s)
-}
-
-func autoConvert_packet_MachineImages_To_v1alpha1_MachineImages(in *packet.MachineImages, out *MachineImages, s conversion.Scope) error {
- out.Name = in.Name
- out.Versions = *(*[]MachineImageVersion)(unsafe.Pointer(&in.Versions))
- return nil
-}
-
-// Convert_packet_MachineImages_To_v1alpha1_MachineImages is an autogenerated conversion function.
-func Convert_packet_MachineImages_To_v1alpha1_MachineImages(in *packet.MachineImages, out *MachineImages, s conversion.Scope) error {
- return autoConvert_packet_MachineImages_To_v1alpha1_MachineImages(in, out, s)
-}
-
-func autoConvert_v1alpha1_WorkerStatus_To_packet_WorkerStatus(in *WorkerStatus, out *packet.WorkerStatus, s conversion.Scope) error {
- out.MachineImages = *(*[]packet.MachineImage)(unsafe.Pointer(&in.MachineImages))
- return nil
-}
-
-// Convert_v1alpha1_WorkerStatus_To_packet_WorkerStatus is an autogenerated conversion function.
-func Convert_v1alpha1_WorkerStatus_To_packet_WorkerStatus(in *WorkerStatus, out *packet.WorkerStatus, s conversion.Scope) error {
- return autoConvert_v1alpha1_WorkerStatus_To_packet_WorkerStatus(in, out, s)
-}
-
-func autoConvert_packet_WorkerStatus_To_v1alpha1_WorkerStatus(in *packet.WorkerStatus, out *WorkerStatus, s conversion.Scope) error {
- out.MachineImages = *(*[]MachineImage)(unsafe.Pointer(&in.MachineImages))
- return nil
-}
-
-// Convert_packet_WorkerStatus_To_v1alpha1_WorkerStatus is an autogenerated conversion function.
-func Convert_packet_WorkerStatus_To_v1alpha1_WorkerStatus(in *packet.WorkerStatus, out *WorkerStatus, s conversion.Scope) error {
- return autoConvert_packet_WorkerStatus_To_v1alpha1_WorkerStatus(in, out, s)
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/v1alpha1/zz_generated.deepcopy.go b/controllers/provider-packet/pkg/apis/packet/v1alpha1/zz_generated.deepcopy.go
deleted file mode 100644
index 2066ab8f6..000000000
--- a/controllers/provider-packet/pkg/apis/packet/v1alpha1/zz_generated.deepcopy.go
+++ /dev/null
@@ -1,215 +0,0 @@
-// +build !ignore_autogenerated
-
-/*
-Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by deepcopy-gen. DO NOT EDIT.
-
-package v1alpha1
-
-import (
- runtime "k8s.io/apimachinery/pkg/runtime"
-)
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *CloudProfileConfig) DeepCopyInto(out *CloudProfileConfig) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- if in.MachineImages != nil {
- in, out := &in.MachineImages, &out.MachineImages
- *out = make([]MachineImages, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudProfileConfig.
-func (in *CloudProfileConfig) DeepCopy() *CloudProfileConfig {
- if in == nil {
- return nil
- }
- out := new(CloudProfileConfig)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *CloudProfileConfig) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ControlPlaneConfig) DeepCopyInto(out *ControlPlaneConfig) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneConfig.
-func (in *ControlPlaneConfig) DeepCopy() *ControlPlaneConfig {
- if in == nil {
- return nil
- }
- out := new(ControlPlaneConfig)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *ControlPlaneConfig) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *InfrastructureConfig) DeepCopyInto(out *InfrastructureConfig) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfrastructureConfig.
-func (in *InfrastructureConfig) DeepCopy() *InfrastructureConfig {
- if in == nil {
- return nil
- }
- out := new(InfrastructureConfig)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *InfrastructureConfig) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *InfrastructureStatus) DeepCopyInto(out *InfrastructureStatus) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfrastructureStatus.
-func (in *InfrastructureStatus) DeepCopy() *InfrastructureStatus {
- if in == nil {
- return nil
- }
- out := new(InfrastructureStatus)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *InfrastructureStatus) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MachineImage) DeepCopyInto(out *MachineImage) {
- *out = *in
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineImage.
-func (in *MachineImage) DeepCopy() *MachineImage {
- if in == nil {
- return nil
- }
- out := new(MachineImage)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MachineImageVersion) DeepCopyInto(out *MachineImageVersion) {
- *out = *in
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineImageVersion.
-func (in *MachineImageVersion) DeepCopy() *MachineImageVersion {
- if in == nil {
- return nil
- }
- out := new(MachineImageVersion)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MachineImages) DeepCopyInto(out *MachineImages) {
- *out = *in
- if in.Versions != nil {
- in, out := &in.Versions, &out.Versions
- *out = make([]MachineImageVersion, len(*in))
- copy(*out, *in)
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineImages.
-func (in *MachineImages) DeepCopy() *MachineImages {
- if in == nil {
- return nil
- }
- out := new(MachineImages)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *WorkerStatus) DeepCopyInto(out *WorkerStatus) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- if in.MachineImages != nil {
- in, out := &in.MachineImages, &out.MachineImages
- *out = make([]MachineImage, len(*in))
- copy(*out, *in)
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerStatus.
-func (in *WorkerStatus) DeepCopy() *WorkerStatus {
- if in == nil {
- return nil
- }
- out := new(WorkerStatus)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *WorkerStatus) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/v1alpha1/zz_generated.defaults.go b/controllers/provider-packet/pkg/apis/packet/v1alpha1/zz_generated.defaults.go
deleted file mode 100644
index 5db2b64b0..000000000
--- a/controllers/provider-packet/pkg/apis/packet/v1alpha1/zz_generated.defaults.go
+++ /dev/null
@@ -1,32 +0,0 @@
-// +build !ignore_autogenerated
-
-/*
-Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by defaulter-gen. DO NOT EDIT.
-
-package v1alpha1
-
-import (
- runtime "k8s.io/apimachinery/pkg/runtime"
-)
-
-// RegisterDefaults adds defaulters functions to the given scheme.
-// Public to allow building arbitrary schemes.
-// All generated defaulters are covering - they call all nested defaulters.
-func RegisterDefaults(scheme *runtime.Scheme) error {
- return nil
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/validation/cloudprofile.go b/controllers/provider-packet/pkg/apis/packet/validation/cloudprofile.go
deleted file mode 100644
index 5d7ac9ad8..000000000
--- a/controllers/provider-packet/pkg/apis/packet/validation/cloudprofile.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package validation
-
-import (
- "fmt"
-
- apispacket "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet"
-
- "k8s.io/apimachinery/pkg/util/validation/field"
-)
-
-// ValidateCloudProfileConfig validates a CloudProfileConfig object.
-func ValidateCloudProfileConfig(cloudProfile *apispacket.CloudProfileConfig) field.ErrorList {
- allErrs := field.ErrorList{}
-
- machineImagesPath := field.NewPath("machineImages")
- if len(cloudProfile.MachineImages) == 0 {
- allErrs = append(allErrs, field.Required(machineImagesPath, "must provide at least one machine image"))
- }
- for i, machineImage := range cloudProfile.MachineImages {
- idxPath := machineImagesPath.Index(i)
-
- if len(machineImage.Name) == 0 {
- allErrs = append(allErrs, field.Required(idxPath.Child("name"), "must provide a name"))
- }
-
- if len(machineImage.Versions) == 0 {
- allErrs = append(allErrs, field.Required(idxPath.Child("versions"), fmt.Sprintf("must provide at least one version for machine image %q", machineImage.Name)))
- }
- for j, version := range machineImage.Versions {
- jdxPath := idxPath.Child("versions").Index(j)
-
- if len(version.Version) == 0 {
- allErrs = append(allErrs, field.Required(jdxPath.Child("version"), "must provide a version"))
- }
- if len(version.ID) == 0 {
- allErrs = append(allErrs, field.Required(jdxPath.Child("id"), "must provide an id"))
- }
- }
- }
-
- return allErrs
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/validation/cloudprofile_test.go b/controllers/provider-packet/pkg/apis/packet/validation/cloudprofile_test.go
deleted file mode 100644
index 2da37e3fb..000000000
--- a/controllers/provider-packet/pkg/apis/packet/validation/cloudprofile_test.go
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package validation_test
-
-import (
- apispacket "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet"
- . "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet/validation"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- . "github.com/onsi/gomega/gstruct"
- "k8s.io/apimachinery/pkg/util/validation/field"
-)
-
-var _ = Describe("CloudProfileConfig validation", func() {
- Describe("#ValidateCloudProfileConfig", func() {
- var cloudProfileConfig *apispacket.CloudProfileConfig
-
- BeforeEach(func() {
- cloudProfileConfig = &apispacket.CloudProfileConfig{
- MachineImages: []apispacket.MachineImages{
- {
- Name: "ubuntu",
- Versions: []apispacket.MachineImageVersion{
- {
- Version: "1.2.3",
- ID: "some-image-id",
- },
- },
- },
- },
- }
- })
-
- Context("machine image validation", func() {
- It("should enforce that at least one machine image has been defined", func() {
- cloudProfileConfig.MachineImages = []apispacket.MachineImages{}
-
- errorList := ValidateCloudProfileConfig(cloudProfileConfig)
-
- Expect(errorList).To(ConsistOf(PointTo(MatchFields(IgnoreExtras, Fields{
- "Type": Equal(field.ErrorTypeRequired),
- "Field": Equal("machineImages"),
- }))))
- })
-
- It("should forbid unsupported machine image configuration", func() {
- cloudProfileConfig.MachineImages = []apispacket.MachineImages{{}}
-
- errorList := ValidateCloudProfileConfig(cloudProfileConfig)
-
- Expect(errorList).To(ConsistOf(PointTo(MatchFields(IgnoreExtras, Fields{
- "Type": Equal(field.ErrorTypeRequired),
- "Field": Equal("machineImages[0].name"),
- })), PointTo(MatchFields(IgnoreExtras, Fields{
- "Type": Equal(field.ErrorTypeRequired),
- "Field": Equal("machineImages[0].versions"),
- }))))
- })
-
- It("should forbid unsupported machine image version configuration", func() {
- cloudProfileConfig.MachineImages = []apispacket.MachineImages{
- {
- Name: "abc",
- Versions: []apispacket.MachineImageVersion{{}},
- },
- }
-
- errorList := ValidateCloudProfileConfig(cloudProfileConfig)
-
- Expect(errorList).To(ConsistOf(PointTo(MatchFields(IgnoreExtras, Fields{
- "Type": Equal(field.ErrorTypeRequired),
- "Field": Equal("machineImages[0].versions[0].version"),
- })), PointTo(MatchFields(IgnoreExtras, Fields{
- "Type": Equal(field.ErrorTypeRequired),
- "Field": Equal("machineImages[0].versions[0].id"),
- }))))
- })
- })
- })
-})
diff --git a/controllers/provider-packet/pkg/apis/packet/validation/validation_suite_test.go b/controllers/provider-packet/pkg/apis/packet/validation/validation_suite_test.go
deleted file mode 100644
index 199beb8c8..000000000
--- a/controllers/provider-packet/pkg/apis/packet/validation/validation_suite_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package validation_test
-
-import (
- "testing"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-func TestValidation(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Packet API Validation Suite")
-}
diff --git a/controllers/provider-packet/pkg/apis/packet/zz_generated.deepcopy.go b/controllers/provider-packet/pkg/apis/packet/zz_generated.deepcopy.go
deleted file mode 100644
index 21155b67b..000000000
--- a/controllers/provider-packet/pkg/apis/packet/zz_generated.deepcopy.go
+++ /dev/null
@@ -1,215 +0,0 @@
-// +build !ignore_autogenerated
-
-/*
-Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by deepcopy-gen. DO NOT EDIT.
-
-package packet
-
-import (
- runtime "k8s.io/apimachinery/pkg/runtime"
-)
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *CloudProfileConfig) DeepCopyInto(out *CloudProfileConfig) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- if in.MachineImages != nil {
- in, out := &in.MachineImages, &out.MachineImages
- *out = make([]MachineImages, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudProfileConfig.
-func (in *CloudProfileConfig) DeepCopy() *CloudProfileConfig {
- if in == nil {
- return nil
- }
- out := new(CloudProfileConfig)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *CloudProfileConfig) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ControlPlaneConfig) DeepCopyInto(out *ControlPlaneConfig) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneConfig.
-func (in *ControlPlaneConfig) DeepCopy() *ControlPlaneConfig {
- if in == nil {
- return nil
- }
- out := new(ControlPlaneConfig)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *ControlPlaneConfig) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *InfrastructureConfig) DeepCopyInto(out *InfrastructureConfig) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfrastructureConfig.
-func (in *InfrastructureConfig) DeepCopy() *InfrastructureConfig {
- if in == nil {
- return nil
- }
- out := new(InfrastructureConfig)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *InfrastructureConfig) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *InfrastructureStatus) DeepCopyInto(out *InfrastructureStatus) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfrastructureStatus.
-func (in *InfrastructureStatus) DeepCopy() *InfrastructureStatus {
- if in == nil {
- return nil
- }
- out := new(InfrastructureStatus)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *InfrastructureStatus) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MachineImage) DeepCopyInto(out *MachineImage) {
- *out = *in
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineImage.
-func (in *MachineImage) DeepCopy() *MachineImage {
- if in == nil {
- return nil
- }
- out := new(MachineImage)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MachineImageVersion) DeepCopyInto(out *MachineImageVersion) {
- *out = *in
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineImageVersion.
-func (in *MachineImageVersion) DeepCopy() *MachineImageVersion {
- if in == nil {
- return nil
- }
- out := new(MachineImageVersion)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MachineImages) DeepCopyInto(out *MachineImages) {
- *out = *in
- if in.Versions != nil {
- in, out := &in.Versions, &out.Versions
- *out = make([]MachineImageVersion, len(*in))
- copy(*out, *in)
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineImages.
-func (in *MachineImages) DeepCopy() *MachineImages {
- if in == nil {
- return nil
- }
- out := new(MachineImages)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *WorkerStatus) DeepCopyInto(out *WorkerStatus) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- if in.MachineImages != nil {
- in, out := &in.MachineImages, &out.MachineImages
- *out = make([]MachineImage, len(*in))
- copy(*out, *in)
- }
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkerStatus.
-func (in *WorkerStatus) DeepCopy() *WorkerStatus {
- if in == nil {
- return nil
- }
- out := new(WorkerStatus)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *WorkerStatus) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
diff --git a/controllers/provider-packet/pkg/cmd/config.go b/controllers/provider-packet/pkg/cmd/config.go
deleted file mode 100644
index 93e30ff03..000000000
--- a/controllers/provider-packet/pkg/cmd/config.go
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package cmd
-
-import (
- "fmt"
-
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config"
- configloader "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config/loader"
- healthcheckconfig "github.com/gardener/gardener-extensions/pkg/controller/healthcheck/config"
-
- "github.com/spf13/pflag"
-)
-
-// ConfigOptions are command line options that can be set for config.ControllerConfiguration.
-type ConfigOptions struct {
- // Kubeconfig is the path to a kubeconfig.
- ConfigFilePath string
-
- config *Config
-}
-
-// Config is a completed controller configuration.
-type Config struct {
- // Config is the controller configuration.
- Config *config.ControllerConfiguration
-}
-
-func (c *ConfigOptions) buildConfig() (*config.ControllerConfiguration, error) {
- if len(c.ConfigFilePath) == 0 {
- return nil, fmt.Errorf("config file path not set")
- }
- return configloader.LoadFromFile(c.ConfigFilePath)
-}
-
-// Complete implements RESTCompleter.Complete.
-func (c *ConfigOptions) Complete() error {
- config, err := c.buildConfig()
- if err != nil {
- return err
- }
-
- c.config = &Config{config}
- return nil
-}
-
-// Completed returns the completed Config. Only call this if `Complete` was successful.
-func (c *ConfigOptions) Completed() *Config {
- return c.config
-}
-
-// AddFlags implements Flagger.AddFlags.
-func (c *ConfigOptions) AddFlags(fs *pflag.FlagSet) {
- fs.StringVar(&c.ConfigFilePath, "config-file", "", "path to the controller manager configuration file")
-}
-
-// Apply sets the values of this Config in the given config.ControllerConfiguration.
-func (c *Config) Apply(cfg *config.ControllerConfiguration) {
- *cfg = *c.Config
-}
-
-// ApplyETCDStorage sets the given etcd storage configuration to that of this Config.
-func (c *Config) ApplyETCDStorage(etcdStorage *config.ETCDStorage) {
- *etcdStorage = c.Config.ETCD.Storage
-}
-
-// Options initializes empty config.ControllerConfiguration, applies the set values and returns it.
-func (c *Config) Options() config.ControllerConfiguration {
- var cfg config.ControllerConfiguration
- c.Apply(&cfg)
- return cfg
-}
-
-// ApplyHealthCheckConfig applies the HealthCheckConfig to the config
-func (c *Config) ApplyHealthCheckConfig(config *healthcheckconfig.HealthCheckConfig) {
- if c.Config.HealthCheckConfig != nil {
- *config = *c.Config.HealthCheckConfig
- }
-}
diff --git a/controllers/provider-packet/pkg/cmd/options.go b/controllers/provider-packet/pkg/cmd/options.go
deleted file mode 100644
index fc932901f..000000000
--- a/controllers/provider-packet/pkg/cmd/options.go
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package cmd
-
-import (
- controlplanecontroller "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/controller/controlplane"
- healthcheckcontroller "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/controller/healthcheck"
- infrastructurecontroller "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/controller/infrastructure"
- workercontroller "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/controller/worker"
- controlplanewebhook "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/webhook/controlplane"
- controlplanebackupwebhook "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/webhook/controlplanebackup"
- controlplaneexposurewebhook "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/webhook/controlplaneexposure"
- shootwebhook "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/webhook/shoot"
- controllercmd "github.com/gardener/gardener-extensions/pkg/controller/cmd"
- extensionscontrolplanecontroller "github.com/gardener/gardener-extensions/pkg/controller/controlplane"
- extensionshealthcheckcontroller "github.com/gardener/gardener-extensions/pkg/controller/healthcheck"
- extensionsinfrastructurecontroller "github.com/gardener/gardener-extensions/pkg/controller/infrastructure"
- extensionsworkercontroller "github.com/gardener/gardener-extensions/pkg/controller/worker"
- webhookcmd "github.com/gardener/gardener-extensions/pkg/webhook/cmd"
- extensioncontrolplanewebhook "github.com/gardener/gardener-extensions/pkg/webhook/controlplane"
- extensionshootwebhook "github.com/gardener/gardener-extensions/pkg/webhook/shoot"
-)
-
-// ControllerSwitchOptions are the controllercmd.SwitchOptions for the provider controllers.
-func ControllerSwitchOptions() *controllercmd.SwitchOptions {
- return controllercmd.NewSwitchOptions(
- controllercmd.Switch(extensionsinfrastructurecontroller.ControllerName, infrastructurecontroller.AddToManager),
- controllercmd.Switch(extensionscontrolplanecontroller.ControllerName, controlplanecontroller.AddToManager),
- controllercmd.Switch(extensionsworkercontroller.ControllerName, workercontroller.AddToManager),
- controllercmd.Switch(extensionshealthcheckcontroller.ControllerName, healthcheckcontroller.AddToManager),
- )
-}
-
-// WebhookSwitchOptions are the webhookcmd.SwitchOptions for the provider webhooks.
-func WebhookSwitchOptions() *webhookcmd.SwitchOptions {
- return webhookcmd.NewSwitchOptions(
- webhookcmd.Switch(extensioncontrolplanewebhook.WebhookName, controlplanewebhook.AddToManager),
- webhookcmd.Switch(extensioncontrolplanewebhook.ExposureWebhookName, controlplaneexposurewebhook.AddToManager),
- webhookcmd.Switch(extensioncontrolplanewebhook.BackupWebhookName, controlplanebackupwebhook.AddToManager),
- webhookcmd.Switch(extensionshootwebhook.WebhookName, shootwebhook.AddToManager),
- )
-}
diff --git a/controllers/provider-packet/pkg/controller/controlplane/add.go b/controllers/provider-packet/pkg/controller/controlplane/add.go
deleted file mode 100644
index 1f07beefe..000000000
--- a/controllers/provider-packet/pkg/controller/controlplane/add.go
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package controlplane
-
-import (
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/imagevector"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller"
- "github.com/gardener/gardener-extensions/pkg/controller/controlplane"
- "github.com/gardener/gardener-extensions/pkg/controller/controlplane/genericactuator"
- "github.com/gardener/gardener-extensions/pkg/util"
-
- admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
- "sigs.k8s.io/controller-runtime/pkg/controller"
- "sigs.k8s.io/controller-runtime/pkg/log"
- "sigs.k8s.io/controller-runtime/pkg/manager"
-)
-
-var (
- // DefaultAddOptions are the default AddOptions for AddToManager.
- DefaultAddOptions = AddOptions{}
-
- logger = log.Log.WithName("packet-controlplane-controller")
-)
-
-// AddOptions are options to apply when adding the Packet controlplane controller to the manager.
-type AddOptions struct {
- // Controller are the controller.Options.
- Controller controller.Options
- // IgnoreOperationAnnotation specifies whether to ignore the operation annotation or not.
- IgnoreOperationAnnotation bool
- // ShootWebhooks specifies the list of desired Shoot MutatingWebhooks.
- ShootWebhooks []admissionregistrationv1beta1.MutatingWebhook
-}
-
-// AddToManagerWithOptions adds a controller with the given Options to the given manager.
-// The opts.Reconciler is being set with a newly instantiated actuator.
-func AddToManagerWithOptions(mgr manager.Manager, opts AddOptions) error {
- return controlplane.Add(mgr, controlplane.AddArgs{
- Actuator: genericactuator.NewActuator(packet.Name, controlPlaneSecrets, nil, nil, controlPlaneChart, controlPlaneShootChart,
- storageClassChart, nil, NewValuesProvider(logger), extensionscontroller.ChartRendererFactoryFunc(util.NewChartRendererForShoot),
- imagevector.ImageVector(), "", opts.ShootWebhooks, mgr.GetWebhookServer().Port, logger),
- ControllerOptions: opts.Controller,
- Predicates: controlplane.DefaultPredicates(opts.IgnoreOperationAnnotation),
- Type: packet.Type,
- })
-}
-
-// AddToManager adds a controller with the default Options.
-func AddToManager(mgr manager.Manager) error {
- return AddToManagerWithOptions(mgr, DefaultAddOptions)
-}
diff --git a/controllers/provider-packet/pkg/controller/controlplane/controlplane_suite_test.go b/controllers/provider-packet/pkg/controller/controlplane/controlplane_suite_test.go
deleted file mode 100644
index 895f36c36..000000000
--- a/controllers/provider-packet/pkg/controller/controlplane/controlplane_suite_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package controlplane_test
-
-import (
- "testing"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-func TestController(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Packet Controlplane Suite")
-}
diff --git a/controllers/provider-packet/pkg/controller/controlplane/valuesprovider.go b/controllers/provider-packet/pkg/controller/controlplane/valuesprovider.go
deleted file mode 100644
index db902c1cb..000000000
--- a/controllers/provider-packet/pkg/controller/controlplane/valuesprovider.go
+++ /dev/null
@@ -1,265 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package controlplane
-
-import (
- "context"
- "encoding/base64"
- "path/filepath"
-
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller"
- "github.com/gardener/gardener-extensions/pkg/controller/controlplane/genericactuator"
- "github.com/gardener/gardener-extensions/pkg/util"
-
- v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
- extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
- "github.com/gardener/gardener/pkg/utils/chart"
- "github.com/gardener/gardener/pkg/utils/secrets"
- "github.com/go-logr/logr"
- "github.com/pkg/errors"
- appsv1 "k8s.io/api/apps/v1"
- corev1 "k8s.io/api/core/v1"
- policyv1beta1 "k8s.io/api/policy/v1beta1"
- rbacv1 "k8s.io/api/rbac/v1"
- "k8s.io/apiserver/pkg/authentication/user"
-)
-
-var controlPlaneSecrets = &secrets.Secrets{
- CertificateSecretConfigs: map[string]*secrets.CertificateSecretConfig{
- v1beta1constants.SecretNameCACluster: {
- Name: v1beta1constants.SecretNameCACluster,
- CommonName: "kubernetes",
- CertType: secrets.CACert,
- },
- },
- SecretConfigsFunc: func(cas map[string]*secrets.Certificate, clusterName string) []secrets.ConfigInterface {
- return []secrets.ConfigInterface{
- &secrets.ControlPlaneSecretConfig{
- CertificateSecretConfig: &secrets.CertificateSecretConfig{
- Name: packet.CloudControllerManagerImageName,
- CommonName: "system:cloud-controller-manager",
- Organization: []string{user.SystemPrivilegedGroup},
- CertType: secrets.ClientCert,
- SigningCA: cas[v1beta1constants.SecretNameCACluster],
- },
- KubeConfigRequest: &secrets.KubeConfigRequest{
- ClusterName: clusterName,
- APIServerURL: v1beta1constants.DeploymentNameKubeAPIServer,
- },
- },
- &secrets.ControlPlaneSecretConfig{
- CertificateSecretConfig: &secrets.CertificateSecretConfig{
- Name: "csi-attacher",
- CommonName: "system:csi-attacher",
- Organization: []string{user.SystemPrivilegedGroup},
- CertType: secrets.ClientCert,
- SigningCA: cas[v1beta1constants.SecretNameCACluster],
- },
- KubeConfigRequest: &secrets.KubeConfigRequest{
- ClusterName: clusterName,
- APIServerURL: v1beta1constants.DeploymentNameKubeAPIServer,
- },
- },
- &secrets.ControlPlaneSecretConfig{
- CertificateSecretConfig: &secrets.CertificateSecretConfig{
- Name: "csi-provisioner",
- CommonName: "system:csi-provisioner",
- Organization: []string{user.SystemPrivilegedGroup},
- CertType: secrets.ClientCert,
- SigningCA: cas[v1beta1constants.SecretNameCACluster],
- },
- KubeConfigRequest: &secrets.KubeConfigRequest{
- ClusterName: clusterName,
- APIServerURL: v1beta1constants.DeploymentNameKubeAPIServer,
- },
- },
- }
- },
-}
-
-var controlPlaneChart = &chart.Chart{
- Name: "seed-controlplane",
- Path: filepath.Join(packet.InternalChartsPath, "seed-controlplane"),
- SubCharts: []*chart.Chart{
- {
- Name: "packet-cloud-controller-manager",
- Images: []string{packet.CloudControllerManagerImageName},
- Objects: []*chart.Object{
- {Type: &appsv1.Deployment{}, Name: "cloud-controller-manager"},
- {Type: &corev1.ConfigMap{}, Name: "cloud-controller-manager-monitoring-config"},
- },
- },
- {
- Name: "csi-packet",
- Images: []string{packet.CSIAttacherImageName, packet.CSIProvisionerImageName, packet.CSIPluginImageName},
- Objects: []*chart.Object{
- {Type: &corev1.Service{}, Name: "csi-packet-pd"},
- {Type: &appsv1.StatefulSet{}, Name: "csi-packet-controller"},
- },
- },
- },
-}
-
-var controlPlaneShootChart = &chart.Chart{
- Name: "shoot-system-components",
- Path: filepath.Join(packet.InternalChartsPath, "shoot-system-components"),
- SubCharts: []*chart.Chart{
- {
- Name: "packet-cloud-controller-manager",
- Objects: []*chart.Object{
- {Type: &rbacv1.ClusterRole{}, Name: "system:controller:cloud-node-controller"},
- {Type: &rbacv1.ClusterRoleBinding{}, Name: "system:controller:cloud-node-controller"},
- },
- },
- {
- Name: "csi-packet",
- Images: []string{packet.CSINodeDriverRegistrarImageName, packet.CSIPluginImageName},
- Objects: []*chart.Object{
- {Type: &appsv1.DaemonSet{}, Name: "csi-node"},
- {Type: &corev1.Secret{}, Name: "csi-diskplugin-packet"},
- {Type: &rbacv1.ClusterRole{}, Name: "packet.com:csi-node-sa"},
- {Type: &corev1.ServiceAccount{}, Name: "csi-node-sa"},
- {Type: &rbacv1.ClusterRoleBinding{}, Name: "packet.com:csi-node-sa"},
- {Type: &policyv1beta1.PodSecurityPolicy{}, Name: "gardener.kube-system.csi-disk-plugin-packet"},
- {Type: &corev1.ServiceAccount{}, Name: "csi-attacher"},
- {Type: &rbacv1.ClusterRole{}, Name: "packet.provider.extensions.gardener.cloud:kube-system:csi-attacher"},
- {Type: &rbacv1.ClusterRoleBinding{}, Name: "packet.provider.extensions.gardener.cloud:csi-attacher"},
- {Type: &rbacv1.Role{}, Name: "csi-attacher"},
- {Type: &rbacv1.RoleBinding{}, Name: "csi-attacher"},
- {Type: &corev1.ServiceAccount{}, Name: "csi-disk-plugin-packet"},
- {Type: &rbacv1.ClusterRole{}, Name: "packet.provider.extensions.gardener.cloud:psp:kube-system:csi-disk-plugin-packet"},
- {Type: &rbacv1.ClusterRoleBinding{}, Name: "packet.provider.extensions.gardener.cloud:psp:csi-disk-plugin-packet"},
- {Type: &corev1.ServiceAccount{}, Name: "csi-provisioner"},
- {Type: &rbacv1.ClusterRole{}, Name: "packet.provider.extensions.gardener.cloud:kube-system:csi-provisioner"},
- {Type: &rbacv1.ClusterRoleBinding{}, Name: "packet.provider.extensions.gardener.cloud:csi-provisioner"},
- },
- },
- },
-}
-
-var storageClassChart = &chart.Chart{
- Name: "shoot-storageclasses",
- Path: filepath.Join(packet.InternalChartsPath, "shoot-storageclasses"),
-}
-
-// NewValuesProvider creates a new ValuesProvider for the generic actuator.
-func NewValuesProvider(logger logr.Logger) genericactuator.ValuesProvider {
- return &valuesProvider{
- logger: logger.WithName("packet-values-provider"),
- }
-}
-
-// valuesProvider is a ValuesProvider that provides Packet-specific values for the 2 charts applied by the generic actuator.
-type valuesProvider struct {
- genericactuator.NoopValuesProvider
- logger logr.Logger
-}
-
-// GetControlPlaneChartValues returns the values for the control plane chart applied by the generic actuator.
-func (vp *valuesProvider) GetControlPlaneChartValues(
- ctx context.Context,
- cp *extensionsv1alpha1.ControlPlane,
- cluster *extensionscontroller.Cluster,
- checksums map[string]string,
- scaledDown bool,
-) (map[string]interface{}, error) {
- // Get control plane chart values
- return getControlPlaneChartValues(cp, cluster, checksums, scaledDown)
-}
-
-// GetControlPlaneShootChartValues returns the values for the control plane shoot chart applied by the generic actuator.
-func (vp *valuesProvider) GetControlPlaneShootChartValues(
- ctx context.Context,
- cp *extensionsv1alpha1.ControlPlane,
- cluster *extensionscontroller.Cluster,
- checksum map[string]string,
-) (map[string]interface{}, error) {
- // Get credentials from the referenced secret
- credentials, err := vp.getCredentials(ctx, cp)
- if err != nil {
- return nil, err
- }
-
- // Get control plane shoot chart values
- return getControlPlaneShootChartValues(cluster, credentials)
-}
-
-// getCredentials determines the credentials from the secret referenced in the ControlPlane resource.
-func (vp *valuesProvider) getCredentials(
- ctx context.Context,
- cp *extensionsv1alpha1.ControlPlane,
-) (*packet.Credentials, error) {
- secret, err := extensionscontroller.GetSecretByReference(ctx, vp.Client(), &cp.Spec.SecretRef)
- if err != nil {
- return nil, errors.Wrapf(err, "could not get secret by reference for controlplane '%s'", util.ObjectName(cp))
- }
- credentials, err := packet.ReadCredentialsSecret(secret)
- if err != nil {
- return nil, errors.Wrapf(err, "could not read credentials from secret '%s'", util.ObjectName(secret))
- }
- return credentials, nil
-}
-
-// getCCMChartValues collects and returns the CCM chart values.
-func getControlPlaneChartValues(
- cp *extensionsv1alpha1.ControlPlane,
- cluster *extensionscontroller.Cluster,
- checksums map[string]string,
- scaledDown bool,
-) (map[string]interface{}, error) {
- values := map[string]interface{}{
- "packet-cloud-controller-manager": map[string]interface{}{
- "replicas": extensionscontroller.GetControlPlaneReplicas(cluster, scaledDown, 1),
- "clusterName": cp.Namespace,
- "kubernetesVersion": cluster.Shoot.Spec.Kubernetes.Version,
- "podNetwork": extensionscontroller.GetPodNetwork(cluster),
- "podAnnotations": map[string]interface{}{
- "checksum/secret-cloud-controller-manager": checksums[packet.CloudControllerManagerImageName],
- "checksum/secret-cloudprovider": checksums[v1beta1constants.SecretNameCloudProvider],
- },
- },
- "csi-packet": map[string]interface{}{
- "replicas": extensionscontroller.GetControlPlaneReplicas(cluster, scaledDown, 1),
- "kubernetesVersion": cluster.Shoot.Spec.Kubernetes.Version,
- "regionID": cp.Spec.Region,
- "podAnnotations": map[string]interface{}{
- "checksum/secret-csi-attacher": checksums[packet.CSIAttacherImageName],
- "checksum/secret-csi-provisioner": checksums[packet.CSIProvisionerImageName],
- "checksum/secret-cloudprovider": checksums[v1beta1constants.SecretNameCloudProvider],
- },
- },
- }
-
- return values, nil
-}
-
-// getControlPlaneShootChartValues collects and returns the control plane shoot chart values.
-func getControlPlaneShootChartValues(
- cluster *extensionscontroller.Cluster,
- credentials *packet.Credentials,
-) (map[string]interface{}, error) {
- values := map[string]interface{}{
- "csi-packet": map[string]interface{}{
- "credential": map[string]interface{}{
- "apiToken": base64.StdEncoding.EncodeToString([]byte(credentials.APIToken)),
- "projectID": base64.StdEncoding.EncodeToString([]byte(credentials.ProjectID)),
- },
- "kubernetesVersion": cluster.Shoot.Spec.Kubernetes.Version,
- },
- }
-
- return values, nil
-}
diff --git a/controllers/provider-packet/pkg/controller/controlplane/valuesprovider_test.go b/controllers/provider-packet/pkg/controller/controlplane/valuesprovider_test.go
deleted file mode 100644
index 3bba11227..000000000
--- a/controllers/provider-packet/pkg/controller/controlplane/valuesprovider_test.go
+++ /dev/null
@@ -1,210 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package controlplane
-
-import (
- "context"
- "encoding/json"
-
- apispacket "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller"
- mockclient "github.com/gardener/gardener-extensions/pkg/mock/controller-runtime/client"
-
- gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1"
- v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
- extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
- "github.com/golang/mock/gomock"
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- corev1 "k8s.io/api/core/v1"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "sigs.k8s.io/controller-runtime/pkg/client"
- "sigs.k8s.io/controller-runtime/pkg/log"
- "sigs.k8s.io/controller-runtime/pkg/runtime/inject"
-)
-
-const (
- namespace = "test"
-)
-
-var _ = Describe("ValuesProvider", func() {
- var (
- ctrl *gomock.Controller
-
- // Build scheme
- scheme = runtime.NewScheme()
- _ = apispacket.AddToScheme(scheme)
-
- cp = &extensionsv1alpha1.ControlPlane{
- ObjectMeta: metav1.ObjectMeta{
- Name: "control-plane",
- Namespace: namespace,
- },
- Spec: extensionsv1alpha1.ControlPlaneSpec{
- Region: "EWR1",
- SecretRef: corev1.SecretReference{
- Name: v1beta1constants.SecretNameCloudProvider,
- Namespace: namespace,
- },
- ProviderConfig: &runtime.RawExtension{
- Raw: encode(&apispacket.ControlPlaneConfig{}),
- },
- InfrastructureProviderStatus: &runtime.RawExtension{
- Raw: encode(&apispacket.InfrastructureStatus{}),
- },
- },
- }
-
- cidr = "10.250.0.0/19"
- cluster = &extensionscontroller.Cluster{
- Shoot: &gardencorev1beta1.Shoot{
- Spec: gardencorev1beta1.ShootSpec{
- Networking: gardencorev1beta1.Networking{
- Pods: &cidr,
- },
- Kubernetes: gardencorev1beta1.Kubernetes{
- Version: "1.13.4",
- },
- },
- },
- }
-
- cpSecretKey = client.ObjectKey{Namespace: namespace, Name: v1beta1constants.SecretNameCloudProvider}
- cpSecret = &corev1.Secret{
- ObjectMeta: metav1.ObjectMeta{
- Name: v1beta1constants.SecretNameCloudProvider,
- Namespace: namespace,
- },
- Type: corev1.SecretTypeOpaque,
- Data: map[string][]byte{
- packet.APIToken: []byte("foo"),
- packet.ProjectID: []byte("bar"),
- },
- }
-
- checksums = map[string]string{
- v1beta1constants.SecretNameCloudProvider: "8bafb35ff1ac60275d62e1cbd495aceb511fb354f74a20f7d06ecb48b3a68432",
- "cloud-controller-manager": "3d791b164a808638da9a8df03924be2a41e34cd664e42231c00fe369e3588272",
- "csi-attacher": "2da58ad61c401a2af779a909d22fb42eed93a1524cbfdab974ceedb413fcb914",
- "csi-provisioner": "f75b42d40ab501428c383dfb2336cb1fc892bbee1fc1d739675171e4acc4d911",
- }
-
- controlPlaneChartValues = map[string]interface{}{
- "packet-cloud-controller-manager": map[string]interface{}{
- "replicas": 1,
- "clusterName": namespace,
- "kubernetesVersion": "1.13.4",
- "podNetwork": cidr,
- "podAnnotations": map[string]interface{}{
- "checksum/secret-cloud-controller-manager": "3d791b164a808638da9a8df03924be2a41e34cd664e42231c00fe369e3588272",
- "checksum/secret-cloudprovider": "8bafb35ff1ac60275d62e1cbd495aceb511fb354f74a20f7d06ecb48b3a68432",
- },
- },
- "csi-packet": map[string]interface{}{
- "replicas": 1,
- "kubernetesVersion": "1.13.4",
- "regionID": "EWR1",
- "podAnnotations": map[string]interface{}{
- "checksum/secret-csi-attacher": "2da58ad61c401a2af779a909d22fb42eed93a1524cbfdab974ceedb413fcb914",
- "checksum/secret-csi-provisioner": "f75b42d40ab501428c383dfb2336cb1fc892bbee1fc1d739675171e4acc4d911",
- "checksum/secret-cloudprovider": "8bafb35ff1ac60275d62e1cbd495aceb511fb354f74a20f7d06ecb48b3a68432",
- },
- },
- }
-
- controlPlaneShootChartValues = map[string]interface{}{
- "csi-packet": map[string]interface{}{
- "credential": map[string]interface{}{
- "apiToken": "Zm9v",
- "projectID": "YmFy",
- },
- "kubernetesVersion": "1.13.4",
- },
- }
-
- logger = log.Log.WithName("test")
- )
-
- BeforeEach(func() {
- ctrl = gomock.NewController(GinkgoT())
- })
-
- AfterEach(func() {
- ctrl.Finish()
- })
-
- Describe("#GetConfigChartValues", func() {
- It("should return correct config chart values", func() {
- // Create valuesProvider
- vp := NewValuesProvider(logger)
- err := vp.(inject.Scheme).InjectScheme(scheme)
- Expect(err).NotTo(HaveOccurred())
-
- // Call GetConfigChartValues method and check the result
- values, err := vp.GetConfigChartValues(context.TODO(), cp, cluster)
- Expect(err).NotTo(HaveOccurred())
- Expect(values).To(BeNil())
- })
- })
-
- Describe("#GetControlPlaneChartValues", func() {
- It("should return correct control plane chart values", func() {
- // Create valuesProvider
- vp := NewValuesProvider(logger)
- err := vp.(inject.Scheme).InjectScheme(scheme)
- Expect(err).NotTo(HaveOccurred())
-
- // Call GetControlPlaneChartValues method and check the result
- values, err := vp.GetControlPlaneChartValues(context.TODO(), cp, cluster, checksums, false)
- Expect(err).NotTo(HaveOccurred())
- Expect(values).To(Equal(controlPlaneChartValues))
- })
- })
-
- Describe("#GetControlPlaneShootChartValues", func() {
- It("should return correct control plane shoot chart values", func() {
- // Create mock client
- client := mockclient.NewMockClient(ctrl)
- client.EXPECT().Get(context.TODO(), cpSecretKey, &corev1.Secret{}).DoAndReturn(clientGet(cpSecret))
-
- // Create valuesProvider
- vp := NewValuesProvider(logger)
- err := vp.(inject.Client).InjectClient(client)
- Expect(err).NotTo(HaveOccurred())
-
- // Call GetControlPlaneChartValues method and check the result
- values, err := vp.GetControlPlaneShootChartValues(context.TODO(), cp, cluster, checksums)
- Expect(err).NotTo(HaveOccurred())
- Expect(values).To(Equal(controlPlaneShootChartValues))
- })
- })
-})
-
-func encode(obj runtime.Object) []byte {
- data, _ := json.Marshal(obj)
- return data
-}
-
-func clientGet(result runtime.Object) interface{} {
- return func(ctx context.Context, key client.ObjectKey, obj runtime.Object) error {
- switch obj.(type) {
- case *corev1.Secret:
- *obj.(*corev1.Secret) = *result.(*corev1.Secret)
- }
- return nil
- }
-}
diff --git a/controllers/provider-packet/pkg/controller/healthcheck/add.go b/controllers/provider-packet/pkg/controller/healthcheck/add.go
deleted file mode 100644
index 9304a8fc9..000000000
--- a/controllers/provider-packet/pkg/controller/healthcheck/add.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package healthcheck
-
-import (
- "time"
-
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- genericcontrolplaneactuator "github.com/gardener/gardener-extensions/pkg/controller/controlplane/genericactuator"
- "github.com/gardener/gardener-extensions/pkg/controller/healthcheck"
- healthconfig "github.com/gardener/gardener-extensions/pkg/controller/healthcheck/config"
- "github.com/gardener/gardener-extensions/pkg/controller/healthcheck/general"
- "github.com/gardener/gardener-extensions/pkg/controller/healthcheck/worker"
- genericworkeractuator "github.com/gardener/gardener-extensions/pkg/controller/worker/genericactuator"
- extensionspredicate "github.com/gardener/gardener-extensions/pkg/predicate"
-
- gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1"
- extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "sigs.k8s.io/controller-runtime/pkg/manager"
- "sigs.k8s.io/controller-runtime/pkg/predicate"
-)
-
-var (
- defaultSyncPeriod = time.Second * 30
- // DefaultAddOptions are the default DefaultAddArgs for AddToManager.
- DefaultAddOptions = healthcheck.DefaultAddArgs{
- HealthCheckConfig: healthconfig.HealthCheckConfig{SyncPeriod: metav1.Duration{Duration: defaultSyncPeriod}},
- }
-)
-
-// RegisterHealthChecks registers health checks for each extension resource
-// HealthChecks are grouped by extension (e.g worker), extension.type (e.g aws) and Health Check Type (e.g SystemComponentsHealthy)
-func RegisterHealthChecks(mgr manager.Manager, opts healthcheck.DefaultAddArgs) error {
- normalPredicates := []predicate.Predicate{extensionspredicate.HasPurpose(extensionsv1alpha1.Normal)}
- if err := healthcheck.DefaultRegistration(
- packet.Type,
- extensionsv1alpha1.SchemeGroupVersion.WithKind(extensionsv1alpha1.ControlPlaneResource),
- func() runtime.Object { return &extensionsv1alpha1.ControlPlane{} },
- mgr,
- opts,
- normalPredicates,
- map[healthcheck.HealthCheck]string{
- general.NewSeedDeploymentHealthChecker(packet.CloudControllerManagerName): string(gardencorev1beta1.ShootControlPlaneHealthy),
- general.CheckManagedResource(genericcontrolplaneactuator.ControlPlaneShootChartResourceName): string(gardencorev1beta1.ShootSystemComponentsHealthy),
- general.CheckManagedResource(genericcontrolplaneactuator.StorageClassesChartResourceName): string(gardencorev1beta1.ShootSystemComponentsHealthy),
- }); err != nil {
- return err
- }
-
- return healthcheck.DefaultRegistration(
- packet.Type,
- extensionsv1alpha1.SchemeGroupVersion.WithKind(extensionsv1alpha1.WorkerResource),
- func() runtime.Object { return &extensionsv1alpha1.Worker{} },
- mgr,
- opts,
- nil,
- map[healthcheck.HealthCheck]string{
- general.CheckManagedResource(genericworkeractuator.McmShootResourceName): string(gardencorev1beta1.ShootSystemComponentsHealthy),
- general.NewSeedDeploymentHealthChecker(packet.MachineControllerManagerName): string(gardencorev1beta1.ShootControlPlaneHealthy),
- worker.NewSufficientNodesChecker(): string(gardencorev1beta1.ShootEveryNodeReady),
- })
-}
-
-// AddToManager adds a controller with the default Options.
-func AddToManager(mgr manager.Manager) error {
- return RegisterHealthChecks(mgr, DefaultAddOptions)
-}
diff --git a/controllers/provider-packet/pkg/controller/infrastructure/actuator.go b/controllers/provider-packet/pkg/controller/infrastructure/actuator.go
deleted file mode 100644
index 6e2fc67aa..000000000
--- a/controllers/provider-packet/pkg/controller/infrastructure/actuator.go
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package infrastructure
-
-import (
- "context"
- "github.com/gardener/gardener-extensions/pkg/controller/common"
- "time"
-
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/imagevector"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller"
- "github.com/gardener/gardener-extensions/pkg/controller/infrastructure"
- "github.com/gardener/gardener-extensions/pkg/terraformer"
-
- extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
- glogger "github.com/gardener/gardener/pkg/logger"
- "github.com/go-logr/logr"
- corev1 "k8s.io/api/core/v1"
- "sigs.k8s.io/controller-runtime/pkg/log"
-)
-
-type actuator struct {
- logger logr.Logger
-
- common.ChartRendererContext
-}
-
-// NewActuator creates a new Actuator that updates the status of the handled Infrastructure resources.
-func NewActuator() infrastructure.Actuator {
- return &actuator{
- logger: log.Log.WithName("infrastructure-actuator"),
- }
-}
-
-func (a *actuator) Reconcile(ctx context.Context, config *extensionsv1alpha1.Infrastructure, cluster *extensionscontroller.Cluster) error {
- return a.reconcile(ctx, config, cluster)
-}
-
-func (a *actuator) Delete(ctx context.Context, config *extensionsv1alpha1.Infrastructure, cluster *extensionscontroller.Cluster) error {
- return a.delete(ctx, config, cluster)
-}
-
-// Helper functions
-
-func (a *actuator) newTerraformer(purpose, namespace, name string) (terraformer.Terraformer, error) {
- tf, err := terraformer.NewForConfig(glogger.NewLogger("info"), a.RESTConfig(), purpose, namespace, name, imagevector.TerraformerImage())
- if err != nil {
- return nil, err
- }
-
- return tf.
- SetActiveDeadlineSeconds(630).
- SetDeadlineCleaning(5 * time.Minute).
- SetDeadlinePod(15 * time.Minute), nil
-}
-
-func generateTerraformInfraVariablesEnvironment(secret *corev1.Secret) map[string]string {
- return terraformer.GenerateVariablesEnvironment(secret, map[string]string{
- "PACKET_API_KEY": packet.APIToken,
- })
-}
diff --git a/controllers/provider-packet/pkg/controller/infrastructure/actuator_delete.go b/controllers/provider-packet/pkg/controller/infrastructure/actuator_delete.go
deleted file mode 100644
index 4f27b3cdd..000000000
--- a/controllers/provider-packet/pkg/controller/infrastructure/actuator_delete.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package infrastructure
-
-import (
- "context"
- "fmt"
-
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller"
-
- extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
- kutil "github.com/gardener/gardener/pkg/utils/kubernetes"
- corev1 "k8s.io/api/core/v1"
-)
-
-func (a *actuator) delete(ctx context.Context, infrastructure *extensionsv1alpha1.Infrastructure, cluster *extensionscontroller.Cluster) error {
- tf, err := a.newTerraformer(packet.TerraformerPurposeInfra, infrastructure.Namespace, infrastructure.Name)
- if err != nil {
- return fmt.Errorf("could not create the Terraformer: %+v", err)
- }
-
- providerSecret := &corev1.Secret{}
- if err := a.Client().Get(ctx, kutil.Key(infrastructure.Spec.SecretRef.Namespace, infrastructure.Spec.SecretRef.Name), providerSecret); err != nil {
- return err
- }
-
- return tf.
- SetVariablesEnvironment(generateTerraformInfraVariablesEnvironment(providerSecret)).
- Destroy()
-}
diff --git a/controllers/provider-packet/pkg/controller/infrastructure/actuator_reconcile.go b/controllers/provider-packet/pkg/controller/infrastructure/actuator_reconcile.go
deleted file mode 100644
index 8338f4c8d..000000000
--- a/controllers/provider-packet/pkg/controller/infrastructure/actuator_reconcile.go
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package infrastructure
-
-import (
- "context"
- "fmt"
- "path/filepath"
- "time"
-
- packetv1alpha1 "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet/v1alpha1"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller"
- controllererrors "github.com/gardener/gardener-extensions/pkg/controller/error"
- "github.com/gardener/gardener-extensions/pkg/terraformer"
-
- extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
- kutil "github.com/gardener/gardener/pkg/utils/kubernetes"
- corev1 "k8s.io/api/core/v1"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/client-go/util/retry"
-)
-
-func (a *actuator) reconcile(ctx context.Context, infrastructure *extensionsv1alpha1.Infrastructure, cluster *extensionscontroller.Cluster) error {
- providerSecret := &corev1.Secret{}
- if err := a.Client().Get(ctx, kutil.Key(infrastructure.Spec.SecretRef.Namespace, infrastructure.Spec.SecretRef.Name), providerSecret); err != nil {
- return err
- }
-
- terraformConfig := GenerateTerraformInfraConfig(infrastructure, string(providerSecret.Data[packet.ProjectID]))
-
- terraformState, err := terraformer.UnmarshalRawState(infrastructure.Status.State)
- if err != nil {
- return fmt.Errorf("could not retrieve raw terraform state: %+v", err)
- }
-
- release, err := a.ChartRenderer().Render(filepath.Join(packet.InternalChartsPath, "packet-infra"), "packet-infra", infrastructure.Namespace, terraformConfig)
- if err != nil {
- return fmt.Errorf("could not render Terraform chart: %+v", err)
- }
-
- tf, err := a.newTerraformer(packet.TerraformerPurposeInfra, infrastructure.Namespace, infrastructure.Name)
- if err != nil {
- return fmt.Errorf("could not create terraformer object: %+v", err)
- }
-
- if err := tf.
- SetVariablesEnvironment(generateTerraformInfraVariablesEnvironment(providerSecret)).
- InitializeWith(terraformer.DefaultInitializer(
- a.Client(),
- release.FileContent("main.tf"),
- release.FileContent("variables.tf"),
- []byte(release.FileContent("terraform.tfvars")),
- terraformState.Data),
- ).
- Apply(); err != nil {
-
- a.logger.Error(err, "failed to apply the terraform config", "infrastructure", infrastructure.Name)
- return &controllererrors.RequeueAfterError{
- Cause: err,
- RequeueAfter: 30 * time.Second,
- }
- }
-
- return a.updateProviderStatus(ctx, tf, infrastructure)
-}
-
-// GenerateTerraformInfraConfig generates the Packet Terraform configuration based on the given infrastructure and project.
-func GenerateTerraformInfraConfig(infrastructure *extensionsv1alpha1.Infrastructure, projectID string) map[string]interface{} {
- return map[string]interface{}{
- "packet": map[string]interface{}{
- "projectID": projectID,
- },
- "sshPublicKey": string(infrastructure.Spec.SSHPublicKey),
- "clusterName": infrastructure.Namespace,
- "outputKeys": map[string]interface{}{
- "sshKeyID": packet.SSHKeyID,
- },
- }
-}
-
-func (a *actuator) updateProviderStatus(ctx context.Context, tf terraformer.Terraformer, infrastructure *extensionsv1alpha1.Infrastructure) error {
- outputVarKeys := []string{
- packet.SSHKeyID,
- }
-
- output, err := tf.GetStateOutputVariables(outputVarKeys...)
- if err != nil {
- return err
- }
-
- state, err := tf.GetRawState(ctx)
- if err != nil {
- return err
- }
- stateByte, err := state.Marshal()
- if err != nil {
- return err
- }
-
- return extensionscontroller.TryUpdateStatus(ctx, retry.DefaultBackoff, a.Client(), infrastructure, func() error {
- infrastructure.Status.ProviderStatus = &runtime.RawExtension{
- Object: &packetv1alpha1.InfrastructureStatus{
- TypeMeta: metav1.TypeMeta{
- APIVersion: packetv1alpha1.SchemeGroupVersion.String(),
- Kind: "InfrastructureStatus",
- },
- SSHKeyID: output[packet.SSHKeyID],
- },
- }
- infrastructure.Status.State = &runtime.RawExtension{Raw: stateByte}
- return nil
- })
-}
diff --git a/controllers/provider-packet/pkg/controller/infrastructure/actuator_reconcile_test.go b/controllers/provider-packet/pkg/controller/infrastructure/actuator_reconcile_test.go
deleted file mode 100644
index 222d75aa0..000000000
--- a/controllers/provider-packet/pkg/controller/infrastructure/actuator_reconcile_test.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package infrastructure_test
-
-import (
- . "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/controller/infrastructure"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
-
- extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-var _ = Describe("Actuator Reconcile", func() {
- Describe("#GenerateTerraformInfraConfig", func() {
- It("should compute the correct Terraform config", func() {
- var (
- projectID = "project-1234"
- sshKey = "foo-bar"
- clusterName = "shoot--foo-bar"
-
- infrastructure = &extensionsv1alpha1.Infrastructure{
- ObjectMeta: metav1.ObjectMeta{
- Name: "infra",
- Namespace: clusterName,
- },
- Spec: extensionsv1alpha1.InfrastructureSpec{
- SSHPublicKey: []byte(sshKey),
- },
- }
- )
-
- Expect(GenerateTerraformInfraConfig(infrastructure, projectID)).To(Equal(map[string]interface{}{
- "packet": map[string]interface{}{
- "projectID": projectID,
- },
- "sshPublicKey": sshKey,
- "clusterName": clusterName,
- "outputKeys": map[string]interface{}{
- "sshKeyID": packet.SSHKeyID,
- },
- }))
- })
- })
-})
diff --git a/controllers/provider-packet/pkg/controller/infrastructure/add.go b/controllers/provider-packet/pkg/controller/infrastructure/add.go
deleted file mode 100644
index 296751710..000000000
--- a/controllers/provider-packet/pkg/controller/infrastructure/add.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package infrastructure
-
-import (
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- "github.com/gardener/gardener-extensions/pkg/controller/infrastructure"
-
- "sigs.k8s.io/controller-runtime/pkg/controller"
- "sigs.k8s.io/controller-runtime/pkg/manager"
-)
-
-var (
- // DefaultAddOptions are the default AddOptions for AddToManager.
- DefaultAddOptions = AddOptions{}
-)
-
-// AddOptions are options to apply when adding the Packet infrastructure controller to the manager.
-type AddOptions struct {
- // Controller are the controller.Options.
- Controller controller.Options
- // IgnoreOperationAnnotation specifies whether to ignore the operation annotation or not.
- IgnoreOperationAnnotation bool
-}
-
-// AddToManagerWithOptions adds a controller with the given Options to the given manager.
-// The opts.Reconciler is being set with a newly instantiated actuator.
-func AddToManagerWithOptions(mgr manager.Manager, opts AddOptions) error {
- return infrastructure.Add(mgr, infrastructure.AddArgs{
- Actuator: NewActuator(),
- ControllerOptions: opts.Controller,
- Predicates: infrastructure.DefaultPredicates(opts.IgnoreOperationAnnotation),
- Type: packet.Type,
- })
-}
-
-// AddToManager adds a controller with the default Options.
-func AddToManager(mgr manager.Manager) error {
- return AddToManagerWithOptions(mgr, DefaultAddOptions)
-}
diff --git a/controllers/provider-packet/pkg/controller/infrastructure/infrastructure_suite_test.go b/controllers/provider-packet/pkg/controller/infrastructure/infrastructure_suite_test.go
deleted file mode 100644
index 2a931ed2d..000000000
--- a/controllers/provider-packet/pkg/controller/infrastructure/infrastructure_suite_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package infrastructure_test
-
-import (
- "testing"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-func TestInfrastructure(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Packet Infrastructure Suite")
-}
diff --git a/controllers/provider-packet/pkg/controller/worker/actuator.go b/controllers/provider-packet/pkg/controller/worker/actuator.go
deleted file mode 100644
index 09feeb7fd..000000000
--- a/controllers/provider-packet/pkg/controller/worker/actuator.go
+++ /dev/null
@@ -1,126 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package worker
-
-import (
- "context"
-
- api "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet/helper"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/imagevector"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller"
- "github.com/gardener/gardener-extensions/pkg/controller/common"
- "github.com/gardener/gardener-extensions/pkg/controller/worker"
- "github.com/gardener/gardener-extensions/pkg/controller/worker/genericactuator"
- "github.com/gardener/gardener-extensions/pkg/util"
-
- extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
- gardener "github.com/gardener/gardener/pkg/client/kubernetes"
- "github.com/go-logr/logr"
- "k8s.io/client-go/kubernetes"
- "sigs.k8s.io/controller-runtime/pkg/log"
-)
-
-type delegateFactory struct {
- logger logr.Logger
-
- common.RESTConfigContext
-}
-
-// NewActuator creates a new Actuator that updates the status of the handled WorkerPoolConfigs.
-func NewActuator() worker.Actuator {
- delegateFactory := &delegateFactory{
- logger: log.Log.WithName("worker-actuator"),
- }
-
- return genericactuator.NewActuator(
- log.Log.WithName("packet-worker-actuator"),
- delegateFactory,
- packet.MachineControllerManagerName,
- mcmChart,
- mcmShootChart,
- imagevector.ImageVector(),
- extensionscontroller.ChartRendererFactoryFunc(util.NewChartRendererForShoot),
- )
-}
-
-func (d *delegateFactory) WorkerDelegate(ctx context.Context, worker *extensionsv1alpha1.Worker, cluster *extensionscontroller.Cluster) (genericactuator.WorkerDelegate, error) {
- clientset, err := kubernetes.NewForConfig(d.RESTConfig())
- if err != nil {
- return nil, err
- }
-
- serverVersion, err := clientset.Discovery().ServerVersion()
- if err != nil {
- return nil, err
- }
-
- seedChartApplier, err := gardener.NewChartApplierForConfig(d.RESTConfig())
- if err != nil {
- return nil, err
- }
-
- return NewWorkerDelegate(
- d.ClientContext,
-
- seedChartApplier,
- serverVersion.GitVersion,
-
- worker,
- cluster,
- )
-}
-
-type workerDelegate struct {
- common.ClientContext
-
- seedChartApplier gardener.ChartApplier
- serverVersion string
-
- cloudProfileConfig *api.CloudProfileConfig
- cluster *extensionscontroller.Cluster
- worker *extensionsv1alpha1.Worker
-
- machineClasses []map[string]interface{}
- machineDeployments worker.MachineDeployments
- machineImages []api.MachineImage
-}
-
-// NewWorkerDelegate creates a new context for a worker reconciliation.
-func NewWorkerDelegate(
- clientContext common.ClientContext,
-
- seedChartApplier gardener.ChartApplier,
- serverVersion string,
-
- worker *extensionsv1alpha1.Worker,
- cluster *extensionscontroller.Cluster,
-) (genericactuator.WorkerDelegate, error) {
- config, err := helper.CloudProfileConfigFromCluster(cluster)
- if err != nil {
- return nil, err
- }
- return &workerDelegate{
- ClientContext: clientContext,
-
- seedChartApplier: seedChartApplier,
- serverVersion: serverVersion,
-
- cloudProfileConfig: config,
- cluster: cluster,
- worker: worker,
- }, nil
-}
diff --git a/controllers/provider-packet/pkg/controller/worker/add.go b/controllers/provider-packet/pkg/controller/worker/add.go
deleted file mode 100644
index 0c5f43f93..000000000
--- a/controllers/provider-packet/pkg/controller/worker/add.go
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package worker
-
-import (
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- "github.com/gardener/gardener-extensions/pkg/controller/worker"
-
- machinescheme "github.com/gardener/machine-controller-manager/pkg/client/clientset/versioned/scheme"
- apiextensionsscheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme"
- "sigs.k8s.io/controller-runtime/pkg/controller"
- "sigs.k8s.io/controller-runtime/pkg/manager"
-)
-
-var (
- // DefaultAddOptions are the default AddOptions for AddToManager.
- DefaultAddOptions = AddOptions{}
-)
-
-// AddOptions are options to apply when adding the Packet worker controller to the manager.
-type AddOptions struct {
- // Controller are the controller.Options.
- Controller controller.Options
- // IgnoreOperationAnnotation specifies whether to ignore the operation annotation or not.
- IgnoreOperationAnnotation bool
- // MachineImages is the default list of machine images.
-}
-
-// AddToManagerWithOptions adds a controller with the given Options to the given manager.
-// The opts.Reconciler is being set with a newly instantiated actuator.
-func AddToManagerWithOptions(mgr manager.Manager, opts AddOptions) error {
- scheme := mgr.GetScheme()
- if err := apiextensionsscheme.AddToScheme(scheme); err != nil {
- return err
- }
- if err := machinescheme.AddToScheme(scheme); err != nil {
- return err
- }
-
- return worker.Add(mgr, worker.AddArgs{
- Actuator: NewActuator(),
- ControllerOptions: opts.Controller,
- Predicates: worker.DefaultPredicates(opts.IgnoreOperationAnnotation),
- Type: packet.Type,
- })
-}
-
-// AddToManager adds a controller with the default Options.
-func AddToManager(mgr manager.Manager) error {
- return AddToManagerWithOptions(mgr, DefaultAddOptions)
-}
diff --git a/controllers/provider-packet/pkg/controller/worker/machine_controller_manager.go b/controllers/provider-packet/pkg/controller/worker/machine_controller_manager.go
deleted file mode 100644
index b5ea4c08d..000000000
--- a/controllers/provider-packet/pkg/controller/worker/machine_controller_manager.go
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package worker
-
-import (
- "context"
- "fmt"
- "path/filepath"
-
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller"
-
- "github.com/gardener/gardener/pkg/utils/chart"
- kutil "github.com/gardener/gardener/pkg/utils/kubernetes"
- appsv1 "k8s.io/api/apps/v1"
- corev1 "k8s.io/api/core/v1"
- rbacv1 "k8s.io/api/rbac/v1"
-)
-
-var (
- mcmChart = &chart.Chart{
- Name: packet.MachineControllerManagerName,
- Path: filepath.Join(packet.InternalChartsPath, packet.MachineControllerManagerName, "seed"),
- Images: []string{packet.MachineControllerManagerImageName},
- Objects: []*chart.Object{
- {Type: &appsv1.Deployment{}, Name: packet.MachineControllerManagerName},
- {Type: &corev1.Service{}, Name: packet.MachineControllerManagerName},
- {Type: &corev1.ServiceAccount{}, Name: packet.MachineControllerManagerName},
- {Type: &corev1.Secret{}, Name: packet.MachineControllerManagerName},
- {Type: extensionscontroller.GetVerticalPodAutoscalerObject(), Name: packet.MachineControllerManagerVpaName},
- {Type: &corev1.ConfigMap{}, Name: packet.MachineControllerManagerMonitoringConfigName},
- },
- }
-
- mcmShootChart = &chart.Chart{
- Name: packet.MachineControllerManagerName,
- Path: filepath.Join(packet.InternalChartsPath, packet.MachineControllerManagerName, "shoot"),
- Objects: []*chart.Object{
- {Type: &rbacv1.ClusterRole{}, Name: fmt.Sprintf("extensions.gardener.cloud:%s:%s", packet.Name, packet.MachineControllerManagerName)},
- {Type: &rbacv1.ClusterRoleBinding{}, Name: fmt.Sprintf("extensions.gardener.cloud:%s:%s", packet.Name, packet.MachineControllerManagerName)},
- },
- }
-)
-
-func (w *workerDelegate) GetMachineControllerManagerChartValues(ctx context.Context) (map[string]interface{}, error) {
- namespace := &corev1.Namespace{}
- if err := w.Client().Get(ctx, kutil.Key(w.worker.Namespace), namespace); err != nil {
- return nil, err
- }
-
- return map[string]interface{}{
- "providerName": packet.Name,
- "namespace": map[string]interface{}{
- "uid": namespace.UID,
- },
- }, nil
-}
-
-func (w *workerDelegate) GetMachineControllerManagerShootChartValues(ctx context.Context) (map[string]interface{}, error) {
- return map[string]interface{}{
- "providerName": packet.Name,
- }, nil
-}
diff --git a/controllers/provider-packet/pkg/controller/worker/machine_images.go b/controllers/provider-packet/pkg/controller/worker/machine_images.go
deleted file mode 100644
index 06f174615..000000000
--- a/controllers/provider-packet/pkg/controller/worker/machine_images.go
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package worker
-
-import (
- "context"
- "github.com/gardener/gardener-extensions/pkg/controller/worker"
-
- api "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet/helper"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet/v1alpha1"
-
- "github.com/gardener/gardener-extensions/pkg/util"
-
- "github.com/pkg/errors"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/runtime"
-)
-
-// GetMachineImages returns the used machine images for the `Worker` resource.
-func (w *workerDelegate) GetMachineImages(ctx context.Context) (runtime.Object, error) {
- if w.machineImages == nil {
- if err := w.generateMachineConfig(ctx); err != nil {
- return nil, err
- }
- }
-
- var (
- workerStatus = &api.WorkerStatus{
- TypeMeta: metav1.TypeMeta{
- APIVersion: api.SchemeGroupVersion.String(),
- Kind: "WorkerStatus",
- },
- MachineImages: w.machineImages,
- }
-
- workerStatusV1alpha1 = &v1alpha1.WorkerStatus{
- TypeMeta: metav1.TypeMeta{
- APIVersion: v1alpha1.SchemeGroupVersion.String(),
- Kind: "WorkerStatus",
- },
- }
- )
-
- if err := w.Scheme().Convert(workerStatus, workerStatusV1alpha1, nil); err != nil {
- return nil, err
- }
-
- return workerStatusV1alpha1, nil
-}
-
-func (w *workerDelegate) findMachineImage(name, version string) (string, error) {
- machineImageID, err := helper.FindImageFromCloudProfile(w.cloudProfileConfig, name, version)
- if err == nil {
- return machineImageID, nil
- }
-
- // Try to look up machine image in worker provider status as it was not found in componentconfig.
- if providerStatus := w.worker.Status.ProviderStatus; providerStatus != nil {
- workerStatus := &api.WorkerStatus{}
- if _, _, err := w.Decoder().Decode(providerStatus.Raw, nil, workerStatus); err != nil {
- return "", errors.Wrapf(err, "could not decode worker status of worker '%s'", util.ObjectName(w.worker))
- }
-
- machineImage, err := helper.FindMachineImage(workerStatus.MachineImages, name, version)
- if err != nil {
- return "", worker.ErrorMachineImageNotFound(name, version)
- }
-
- return machineImage.ID, nil
- }
-
- return "", worker.ErrorMachineImageNotFound(name, version)
-}
-
-func appendMachineImage(machineImages []api.MachineImage, machineImage api.MachineImage) []api.MachineImage {
- if _, err := helper.FindMachineImage(machineImages, machineImage.Name, machineImage.Version); err != nil {
- return append(machineImages, machineImage)
- }
- return machineImages
-}
diff --git a/controllers/provider-packet/pkg/controller/worker/machines.go b/controllers/provider-packet/pkg/controller/worker/machines.go
deleted file mode 100644
index 7c279a200..000000000
--- a/controllers/provider-packet/pkg/controller/worker/machines.go
+++ /dev/null
@@ -1,162 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package worker
-
-import (
- "context"
- "fmt"
- "path/filepath"
-
- apispacket "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet"
- packetapi "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller"
- "github.com/gardener/gardener-extensions/pkg/controller/worker"
- genericworkeractuator "github.com/gardener/gardener-extensions/pkg/controller/worker/genericactuator"
-
- v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
- machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1"
- "k8s.io/apimachinery/pkg/runtime"
-)
-
-// MachineClassKind yields the name of the Packet machine class.
-func (w *workerDelegate) MachineClassKind() string {
- return "PacketMachineClass"
-}
-
-// MachineClassList yields a newly initialized PacketMachineClassList object.
-func (w *workerDelegate) MachineClassList() runtime.Object {
- return &machinev1alpha1.PacketMachineClassList{}
-}
-
-// DeployMachineClasses generates and creates the Packet specific machine classes.
-func (w *workerDelegate) DeployMachineClasses(ctx context.Context) error {
- if w.machineClasses == nil {
- if err := w.generateMachineConfig(ctx); err != nil {
- return err
- }
- }
- return w.seedChartApplier.ApplyChart(ctx, filepath.Join(packet.InternalChartsPath, "machineclass"), w.worker.Namespace, "machineclass", map[string]interface{}{"machineClasses": w.machineClasses}, nil)
-}
-
-// GenerateMachineDeployments generates the configuration for the desired machine deployments.
-func (w *workerDelegate) GenerateMachineDeployments(ctx context.Context) (worker.MachineDeployments, error) {
- if w.machineDeployments == nil {
- if err := w.generateMachineConfig(ctx); err != nil {
- return nil, err
- }
- }
- return w.machineDeployments, nil
-}
-
-func (w *workerDelegate) generateMachineClassSecretData(ctx context.Context) (map[string][]byte, error) {
- secret, err := extensionscontroller.GetSecretByReference(ctx, w.Client(), &w.worker.Spec.SecretRef)
- if err != nil {
- return nil, err
- }
-
- credentials, err := packet.ReadCredentialsSecret(secret)
- if err != nil {
- return nil, err
- }
-
- return map[string][]byte{
- machinev1alpha1.PacketAPIKey: credentials.APIToken,
- packet.ProjectID: credentials.ProjectID,
- }, nil
-}
-
-func (w *workerDelegate) generateMachineConfig(ctx context.Context) error {
- var (
- machineDeployments = worker.MachineDeployments{}
- machineClasses []map[string]interface{}
- machineImages []apispacket.MachineImage
- )
-
- machineClassSecretData, err := w.generateMachineClassSecretData(ctx)
- if err != nil {
- return err
- }
-
- infrastructureStatus := &packetapi.InfrastructureStatus{}
- if _, _, err := w.Decoder().Decode(w.worker.Spec.InfrastructureProviderStatus.Raw, nil, infrastructureStatus); err != nil {
- return err
- }
-
- for _, pool := range w.worker.Spec.Pools {
- workerPoolHash, err := worker.WorkerPoolHash(pool, w.cluster)
- if err != nil {
- return err
- }
-
- machineImageID, err := w.findMachineImage(pool.MachineImage.Name, pool.MachineImage.Version)
- if err != nil {
- return err
- }
- machineImages = appendMachineImage(machineImages, apispacket.MachineImage{
- Name: pool.MachineImage.Name,
- Version: pool.MachineImage.Version,
- ID: machineImageID,
- })
-
- machineClassSpec := map[string]interface{}{
- "OS": machineImageID,
- "projectID": string(machineClassSecretData[packet.ProjectID]),
- "billingCycle": "hourly",
- "machineType": pool.MachineType,
- "facility": pool.Zones,
- "sshKeys": []string{infrastructureStatus.SSHKeyID},
- "tags": []string{
- fmt.Sprintf("kubernetes.io/cluster/%s", w.worker.Namespace),
- "kubernetes.io/role/node",
- },
- "secret": map[string]interface{}{
- "cloudConfig": string(pool.UserData),
- },
- }
-
- var (
- deploymentName = fmt.Sprintf("%s-%s", w.worker.Namespace, pool.Name)
- className = fmt.Sprintf("%s-%s", deploymentName, workerPoolHash)
- )
-
- machineDeployments = append(machineDeployments, worker.MachineDeployment{
- Name: deploymentName,
- ClassName: className,
- SecretName: className,
- Minimum: pool.Minimum,
- Maximum: pool.Maximum,
- MaxSurge: pool.MaxSurge,
- MaxUnavailable: pool.MaxUnavailable,
- Labels: pool.Labels,
- Annotations: pool.Annotations,
- Taints: pool.Taints,
- })
-
- machineClassSpec["name"] = className
- machineClassSpec["labels"] = map[string]string{
- v1beta1constants.GardenPurpose: genericworkeractuator.GardenPurposeMachineClass,
- }
- machineClassSpec["secret"].(map[string]interface{})[packet.APIToken] = string(machineClassSecretData[machinev1alpha1.PacketAPIKey])
-
- machineClasses = append(machineClasses, machineClassSpec)
- }
-
- w.machineDeployments = machineDeployments
- w.machineClasses = machineClasses
- w.machineImages = machineImages
-
- return nil
-}
diff --git a/controllers/provider-packet/pkg/controller/worker/machines_test.go b/controllers/provider-packet/pkg/controller/worker/machines_test.go
deleted file mode 100644
index c4f67011c..000000000
--- a/controllers/provider-packet/pkg/controller/worker/machines_test.go
+++ /dev/null
@@ -1,464 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package worker_test
-
-import (
- "context"
- "encoding/json"
- "fmt"
-
- api "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet"
- apiv1alpha1 "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/packet/v1alpha1"
- . "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/controller/worker"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller"
- "github.com/gardener/gardener-extensions/pkg/controller/common"
- "github.com/gardener/gardener-extensions/pkg/controller/worker"
- genericworkeractuator "github.com/gardener/gardener-extensions/pkg/controller/worker/genericactuator"
- mockclient "github.com/gardener/gardener-extensions/pkg/mock/controller-runtime/client"
- mockkubernetes "github.com/gardener/gardener-extensions/pkg/mock/gardener/client/kubernetes"
-
- "path/filepath"
-
- gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1"
- v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
- extensionsv1alpha "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
- machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1"
- "github.com/golang/mock/gomock"
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- corev1 "k8s.io/api/core/v1"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/runtime/serializer"
- "k8s.io/apimachinery/pkg/util/intstr"
- "sigs.k8s.io/controller-runtime/pkg/client"
-)
-
-var _ = Describe("Machines", func() {
- var (
- ctrl *gomock.Controller
- c *mockclient.MockClient
- chartApplier *mockkubernetes.MockChartApplier
- )
-
- BeforeEach(func() {
- ctrl = gomock.NewController(GinkgoT())
-
- c = mockclient.NewMockClient(ctrl)
- chartApplier = mockkubernetes.NewMockChartApplier(ctrl)
- })
-
- AfterEach(func() {
- ctrl.Finish()
- })
-
- Context("workerDelegate", func() {
- workerDelegate, _ := NewWorkerDelegate(common.NewClientContext(nil, nil, nil), nil, "", nil, nil)
-
- Describe("#MachineClassKind", func() {
- It("should return the correct kind of the machine class", func() {
- Expect(workerDelegate.MachineClassKind()).To(Equal("PacketMachineClass"))
- })
- })
-
- Describe("#MachineClassList", func() {
- It("should return the correct type for the machine class list", func() {
- Expect(workerDelegate.MachineClassList()).To(Equal(&machinev1alpha1.PacketMachineClassList{}))
- })
- })
-
- Describe("#GenerateMachineDeployments, #DeployMachineClasses", func() {
- var (
- namespace string
- cloudProfileName string
-
- packetAPIToken string
- packetProjectID string
- region string
-
- machineImageName string
- machineImageVersion string
- machineImage string
-
- machineType string
- sshKeyID string
- userData = []byte("some-user-data")
-
- namePool1 string
- minPool1 int
- maxPool1 int
- maxSurgePool1 intstr.IntOrString
- maxUnavailablePool1 intstr.IntOrString
-
- namePool2 string
- minPool2 int
- maxPool2 int
- maxSurgePool2 intstr.IntOrString
- maxUnavailablePool2 intstr.IntOrString
-
- zone1 = region + "a"
- zone2 = region + "b"
-
- workerPoolHash1 string
- workerPoolHash2 string
-
- shootVersionMajorMinor string
- shootVersion string
- scheme *runtime.Scheme
- decoder runtime.Decoder
- clusterWithoutImages *extensionscontroller.Cluster
- cluster *extensionscontroller.Cluster
- w *extensionsv1alpha.Worker
- )
-
- BeforeEach(func() {
- namespace = "shoot--foobar--packet"
- cloudProfileName = "packet"
-
- region = "eu-west-1"
- packetAPIToken = "api-token"
- packetProjectID = "project-id"
-
- machineImageName = "my-os"
- machineImageVersion = "123"
- machineImage = "uuid"
-
- machineType = "large"
- sshKeyID = "1-2-3-4"
- userData = []byte("some-user-data")
-
- namePool1 = "pool-1"
- minPool1 = 5
- maxPool1 = 10
- maxSurgePool1 = intstr.FromInt(3)
- maxUnavailablePool1 = intstr.FromInt(2)
-
- namePool2 = "pool-2"
- minPool2 = 30
- maxPool2 = 45
- maxSurgePool2 = intstr.FromInt(10)
- maxUnavailablePool2 = intstr.FromInt(15)
-
- zone1 = region + "a"
- zone2 = region + "b"
-
- shootVersionMajorMinor = "1.2"
- shootVersion = shootVersionMajorMinor + ".3"
-
- clusterWithoutImages = &extensionscontroller.Cluster{
- Shoot: &gardencorev1beta1.Shoot{
- Spec: gardencorev1beta1.ShootSpec{
- Kubernetes: gardencorev1beta1.Kubernetes{
- Version: shootVersion,
- },
- },
- },
- }
-
- cloudProfileConfig := &apiv1alpha1.CloudProfileConfig{
- TypeMeta: metav1.TypeMeta{
- APIVersion: apiv1alpha1.SchemeGroupVersion.String(),
- Kind: "CloudProfileConfig",
- },
- MachineImages: []apiv1alpha1.MachineImages{
- {
- Name: machineImageName,
- Versions: []apiv1alpha1.MachineImageVersion{
- {
- Version: machineImageVersion,
- ID: machineImage,
- },
- },
- },
- },
- }
- cloudProfileConfigJSON, _ := json.Marshal(cloudProfileConfig)
- cluster = &extensionscontroller.Cluster{
- CloudProfile: &gardencorev1beta1.CloudProfile{
- ObjectMeta: metav1.ObjectMeta{
- Name: cloudProfileName,
- },
- Spec: gardencorev1beta1.CloudProfileSpec{
- ProviderConfig: &gardencorev1beta1.ProviderConfig{
- RawExtension: runtime.RawExtension{
- Raw: cloudProfileConfigJSON,
- },
- },
- },
- },
- Shoot: clusterWithoutImages.Shoot,
- }
-
- w = &extensionsv1alpha.Worker{
- ObjectMeta: metav1.ObjectMeta{
- Namespace: namespace,
- },
- Spec: extensionsv1alpha.WorkerSpec{
- SecretRef: corev1.SecretReference{
- Name: "secret",
- Namespace: namespace,
- },
- Region: region,
- InfrastructureProviderStatus: &runtime.RawExtension{
- Raw: encode(&api.InfrastructureStatus{
- SSHKeyID: sshKeyID,
- }),
- },
- Pools: []extensionsv1alpha.WorkerPool{
- {
- Name: namePool1,
- Minimum: minPool1,
- Maximum: maxPool1,
- MaxSurge: maxSurgePool1,
- MaxUnavailable: maxUnavailablePool1,
- MachineType: machineType,
- MachineImage: extensionsv1alpha.MachineImage{
- Name: machineImageName,
- Version: machineImageVersion,
- },
- UserData: userData,
- Zones: []string{
- zone1,
- zone2,
- },
- },
- {
- Name: namePool2,
- Minimum: minPool2,
- Maximum: maxPool2,
- MaxSurge: maxSurgePool2,
- MaxUnavailable: maxUnavailablePool2,
- MachineType: machineType,
- MachineImage: extensionsv1alpha.MachineImage{
- Name: machineImageName,
- Version: machineImageVersion,
- },
- UserData: userData,
- Zones: []string{
- zone1,
- zone2,
- },
- },
- },
- },
- }
-
- scheme = runtime.NewScheme()
- _ = api.AddToScheme(scheme)
- _ = apiv1alpha1.AddToScheme(scheme)
- decoder = serializer.NewCodecFactory(scheme).UniversalDecoder()
-
- workerPoolHash1, _ = worker.WorkerPoolHash(w.Spec.Pools[0], cluster)
- workerPoolHash2, _ = worker.WorkerPoolHash(w.Spec.Pools[1], cluster)
-
- workerDelegate, _ = NewWorkerDelegate(common.NewClientContext(c, scheme, decoder), chartApplier, "", w, clusterWithoutImages)
- })
-
- Describe("machine images", func() {
- var (
- defaultMachineClass map[string]interface{}
- machineDeployments worker.MachineDeployments
- machineClasses map[string]interface{}
- )
-
- BeforeEach(func() {
- defaultMachineClass = map[string]interface{}{
- "OS": machineImage,
- "projectID": packetProjectID,
- "billingCycle": "hourly",
- "machineType": machineType,
- "facility": []string{
- zone1,
- zone2,
- },
- "sshKeys": []string{sshKeyID},
- "tags": []string{
- fmt.Sprintf("kubernetes.io/cluster/%s", namespace),
- "kubernetes.io/role/node",
- },
- "secret": map[string]interface{}{
- "cloudConfig": string(userData),
- },
- }
-
- var (
- machineClassPool1 = copyMachineClass(defaultMachineClass)
- machineClassPool2 = copyMachineClass(defaultMachineClass)
-
- machineClassNamePool1 = fmt.Sprintf("%s-%s", namespace, namePool1)
- machineClassNamePool2 = fmt.Sprintf("%s-%s", namespace, namePool2)
-
- machineClassWithHashPool1 = fmt.Sprintf("%s-%s", machineClassNamePool1, workerPoolHash1)
- machineClassWithHashPool2 = fmt.Sprintf("%s-%s", machineClassNamePool2, workerPoolHash2)
- )
-
- addNameAndSecretToMachineClass(machineClassPool1, packetAPIToken, machineClassWithHashPool1)
- addNameAndSecretToMachineClass(machineClassPool2, packetAPIToken, machineClassWithHashPool2)
-
- machineClasses = map[string]interface{}{"machineClasses": []map[string]interface{}{
- machineClassPool1,
- machineClassPool2,
- }}
-
- machineDeployments = worker.MachineDeployments{
- {
- Name: machineClassNamePool1,
- ClassName: machineClassWithHashPool1,
- SecretName: machineClassWithHashPool1,
- Minimum: minPool1,
- Maximum: maxPool1,
- MaxSurge: maxSurgePool1,
- MaxUnavailable: maxUnavailablePool1,
- },
- {
- Name: machineClassNamePool2,
- ClassName: machineClassWithHashPool2,
- SecretName: machineClassWithHashPool2,
- Minimum: minPool2,
- Maximum: maxPool2,
- MaxSurge: maxSurgePool2,
- MaxUnavailable: maxUnavailablePool2,
- },
- }
- })
-
- It("should return the expected machine deployments for profile image types", func() {
- workerDelegate, _ := NewWorkerDelegate(common.NewClientContext(c, scheme, decoder), chartApplier, "", w, cluster)
-
- expectGetSecretCallToWork(c, packetAPIToken, packetProjectID)
-
- // Test workerDelegate.DeployMachineClasses()
-
- chartApplier.
- EXPECT().
- ApplyChart(
- context.TODO(),
- filepath.Join(packet.InternalChartsPath, "machineclass"),
- namespace,
- "machineclass",
- machineClasses,
- nil,
- ).
- Return(nil)
-
- err := workerDelegate.DeployMachineClasses(context.TODO())
- Expect(err).NotTo(HaveOccurred())
-
- // Test workerDelegate.GetMachineImages()
- machineImages, err := workerDelegate.GetMachineImages(context.TODO())
- Expect(machineImages).To(Equal(&apiv1alpha1.WorkerStatus{
- TypeMeta: metav1.TypeMeta{
- APIVersion: apiv1alpha1.SchemeGroupVersion.String(),
- Kind: "WorkerStatus",
- },
- MachineImages: []apiv1alpha1.MachineImage{
- {
- Name: machineImageName,
- Version: machineImageVersion,
- ID: machineImage,
- },
- },
- }))
- Expect(err).NotTo(HaveOccurred())
-
- // Test workerDelegate.GenerateMachineDeployments()
-
- result, err := workerDelegate.GenerateMachineDeployments(context.TODO())
- Expect(err).NotTo(HaveOccurred())
- Expect(result).To(Equal(machineDeployments))
- })
- })
-
- It("should fail because the secret cannot be read", func() {
- c.EXPECT().
- Get(context.TODO(), gomock.Any(), gomock.AssignableToTypeOf(&corev1.Secret{})).
- Return(fmt.Errorf("error"))
-
- result, err := workerDelegate.GenerateMachineDeployments(context.TODO())
- Expect(err).To(HaveOccurred())
- Expect(result).To(BeNil())
- })
-
- It("should fail because the version is invalid", func() {
- expectGetSecretCallToWork(c, packetAPIToken, packetProjectID)
-
- clusterWithoutImages.Shoot.Spec.Kubernetes.Version = "invalid"
- workerDelegate, _ = NewWorkerDelegate(common.NewClientContext(c, scheme, decoder), chartApplier, "", w, cluster)
-
- result, err := workerDelegate.GenerateMachineDeployments(context.TODO())
- Expect(err).To(HaveOccurred())
- Expect(result).To(BeNil())
- })
-
- It("should fail because the infrastructure status cannot be decoded", func() {
- expectGetSecretCallToWork(c, packetAPIToken, packetProjectID)
-
- w.Spec.InfrastructureProviderStatus = &runtime.RawExtension{Raw: []byte(`invalid`)}
-
- workerDelegate, _ = NewWorkerDelegate(common.NewClientContext(c, scheme, decoder), chartApplier, "", w, cluster)
-
- result, err := workerDelegate.GenerateMachineDeployments(context.TODO())
- Expect(err).To(HaveOccurred())
- Expect(result).To(BeNil())
- })
-
- It("should fail because the machine image cannot be found", func() {
- expectGetSecretCallToWork(c, packetAPIToken, packetProjectID)
-
- workerDelegate, _ = NewWorkerDelegate(common.NewClientContext(c, scheme, decoder), chartApplier, "", w, clusterWithoutImages)
-
- result, err := workerDelegate.GenerateMachineDeployments(context.TODO())
- Expect(err).To(HaveOccurred())
- Expect(result).To(BeNil())
- })
- })
- })
-})
-
-func encode(obj runtime.Object) []byte {
- data, _ := json.Marshal(obj)
- return data
-}
-
-func expectGetSecretCallToWork(c *mockclient.MockClient, packetAPIToken, packetProjectID string) {
- c.EXPECT().
- Get(context.TODO(), gomock.Any(), gomock.AssignableToTypeOf(&corev1.Secret{})).
- DoAndReturn(func(_ context.Context, _ client.ObjectKey, secret *corev1.Secret) error {
- secret.Data = map[string][]byte{
- packet.APIToken: []byte(packetAPIToken),
- packet.ProjectID: []byte(packetProjectID),
- }
- return nil
- })
-}
-
-func copyMachineClass(def map[string]interface{}) map[string]interface{} {
- out := make(map[string]interface{}, len(def))
-
- for k, v := range def {
- out[k] = v
- }
-
- return out
-}
-
-func addNameAndSecretToMachineClass(class map[string]interface{}, packetAPIToken, name string) {
- class["name"] = name
- class["labels"] = map[string]string{
- v1beta1constants.GardenPurpose: genericworkeractuator.GardenPurposeMachineClass,
- }
- class["secret"].(map[string]interface{})[packet.APIToken] = packetAPIToken
-}
diff --git a/controllers/provider-packet/pkg/controller/worker/worker_suite_test.go b/controllers/provider-packet/pkg/controller/worker/worker_suite_test.go
deleted file mode 100644
index 326f6b0cc..000000000
--- a/controllers/provider-packet/pkg/controller/worker/worker_suite_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package worker_test
-
-import (
- "testing"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-func TestWorker(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Packet Worker Suite")
-}
diff --git a/controllers/provider-packet/pkg/imagevector/imagevector.go b/controllers/provider-packet/pkg/imagevector/imagevector.go
deleted file mode 100644
index d8fe4fb3e..000000000
--- a/controllers/provider-packet/pkg/imagevector/imagevector.go
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-//go:generate packr2
-
-package imagevector
-
-import (
- "strings"
-
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
-
- "github.com/gardener/gardener/pkg/utils/imagevector"
- "github.com/gobuffalo/packr/v2"
- "k8s.io/apimachinery/pkg/util/runtime"
-)
-
-var imageVector imagevector.ImageVector
-
-func init() {
- box := packr.New("charts", "../../charts")
-
- imagesYaml, err := box.FindString("images.yaml")
- runtime.Must(err)
-
- imageVector, err = imagevector.Read(strings.NewReader(imagesYaml))
- runtime.Must(err)
-
- imageVector, err = imagevector.WithEnvOverride(imageVector)
- runtime.Must(err)
-}
-
-// ImageVector is the image vector that contains all the needed images.
-func ImageVector() imagevector.ImageVector {
- return imageVector
-}
-
-// TerraformerImage retrieves the Terraformer image.
-func TerraformerImage() string {
- image, err := imageVector.FindImage(packet.TerraformerImageName)
- runtime.Must(err)
- return image.String()
-}
diff --git a/controllers/provider-packet/pkg/packet/client/client.go b/controllers/provider-packet/pkg/packet/client/client.go
deleted file mode 100644
index 517b67018..000000000
--- a/controllers/provider-packet/pkg/packet/client/client.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package client
-
-import (
- "strings"
-
- "github.com/packethost/packngo"
-)
-
-type packetClient struct {
- packet *packngo.Client
-}
-
-// NewClient creates a new Client for the given Packet credentials
-func NewClient(packetAPIKey string) ClientInterface {
- token := strings.TrimSpace(packetAPIKey)
-
- if token != "" {
- return &packetClient{packngo.NewClientWithAuth("gardener", token, nil)}
- }
-
- return nil
-}
diff --git a/controllers/provider-packet/pkg/packet/client/types.go b/controllers/provider-packet/pkg/packet/client/types.go
deleted file mode 100644
index 41d4a2054..000000000
--- a/controllers/provider-packet/pkg/packet/client/types.go
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package client
-
-// ClientInterface is an interface which must be implemented by Packet clients.
-type ClientInterface interface {
-}
diff --git a/controllers/provider-packet/pkg/packet/packet_suite_test.go b/controllers/provider-packet/pkg/packet/packet_suite_test.go
deleted file mode 100644
index a9347525a..000000000
--- a/controllers/provider-packet/pkg/packet/packet_suite_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package packet_test
-
-import (
- "testing"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-func TestPacket(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Packet Suite")
-}
diff --git a/controllers/provider-packet/pkg/packet/predicate.go b/controllers/provider-packet/pkg/packet/predicate.go
deleted file mode 100644
index c41ce55b3..000000000
--- a/controllers/provider-packet/pkg/packet/predicate.go
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package packet
-
-// Type is the type of resources managed by the Packet actuator.
-const Type = "packet"
diff --git a/controllers/provider-packet/pkg/packet/secret.go b/controllers/provider-packet/pkg/packet/secret.go
deleted file mode 100644
index 423f4ceb0..000000000
--- a/controllers/provider-packet/pkg/packet/secret.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package packet
-
-import (
- "fmt"
-
- corev1 "k8s.io/api/core/v1"
-)
-
-// ReadCredentialsSecret reads a secret containing credentials.
-func ReadCredentialsSecret(secret *corev1.Secret) (*Credentials, error) {
- if secret.Data == nil {
- return nil, fmt.Errorf("secret does not contain any data")
- }
-
- apiToken, ok := secret.Data[APIToken]
- if !ok {
- return nil, fmt.Errorf("missing %q field in secret", APIToken)
- }
-
- projectID, ok := secret.Data[ProjectID]
- if !ok {
- return nil, fmt.Errorf("missing %q field in secret", ProjectID)
- }
-
- return &Credentials{
- APIToken: apiToken,
- ProjectID: projectID,
- }, nil
-}
diff --git a/controllers/provider-packet/pkg/packet/secret_test.go b/controllers/provider-packet/pkg/packet/secret_test.go
deleted file mode 100644
index fd9e86ff8..000000000
--- a/controllers/provider-packet/pkg/packet/secret_test.go
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package packet_test
-
-import (
- . "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- corev1 "k8s.io/api/core/v1"
-)
-
-var _ = Describe("Secret", func() {
- var secret *corev1.Secret
-
- BeforeEach(func() {
- secret = &corev1.Secret{}
- })
-
- Describe("#ReadCredentialsSecret", func() {
- It("should return an error because api token is missing", func() {
- credentials, err := ReadCredentialsSecret(secret)
-
- Expect(credentials).To(BeNil())
- Expect(err).To(HaveOccurred())
- })
-
- It("should return an error because project id is missing", func() {
- secret.Data = map[string][]byte{
- APIToken: []byte("foo"),
- }
-
- credentials, err := ReadCredentialsSecret(secret)
-
- Expect(credentials).To(BeNil())
- Expect(err).To(HaveOccurred())
- })
-
- It("should return the credentials structure", func() {
- var (
- apiToken = []byte("foo")
- projectID = []byte("bar")
- )
-
- secret.Data = map[string][]byte{
- APIToken: apiToken,
- ProjectID: projectID,
- }
-
- credentials, err := ReadCredentialsSecret(secret)
-
- Expect(credentials).To(Equal(&Credentials{
- APIToken: apiToken,
- ProjectID: projectID,
- }))
- Expect(err).NotTo(HaveOccurred())
- })
- })
-})
diff --git a/controllers/provider-packet/pkg/packet/types.go b/controllers/provider-packet/pkg/packet/types.go
deleted file mode 100644
index aafb556cd..000000000
--- a/controllers/provider-packet/pkg/packet/types.go
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package packet
-
-import "path/filepath"
-
-const (
- // Name is the name of the Packet provider controller.
- Name = "provider-packet"
-
- // TerraformerImageName is the name of the Terraformer image.
- TerraformerImageName = "terraformer"
- // CloudControllerManagerImageName is the name of the cloud-controller-manager image.
- CloudControllerManagerImageName = "cloud-controller-manager"
- // MachineControllerManagerImageName is the name of the MachineControllerManager image.
- MachineControllerManagerImageName = "machine-controller-manager"
- // ETCDBackupRestoreImageName is the name of the etcd backup and restore image.
- ETCDBackupRestoreImageName = "etcd-backup-restore"
-
- // BucketName is a constant for the key in a backup secret that holds the bucket name.
- // The bucket name is written to the backup secret by Gardener as a temporary solution.
- // TODO In the future, the bucket name should come from a BackupBucket resource (see https://github.com/gardener/gardener/blob/master/docs/proposals/02-backupinfra.md)
- BucketName = "bucketName"
-
- // APIToken is a constant for the key in a cloud provider secret and backup secret that holds the Packet API token.
- APIToken = "apiToken"
- // ProjectID is a constant for the key in a cloud provider secret and backup secret that holds the Packet project id.
- ProjectID = "projectID"
- // PacketAPIKey is a constant for the key in a cloud provider secret and backup secret that holds the Packet API key.
- PacketAPIKey = "packetAPIKey"
- // CSIAttacherImageName is the name of the CSI attacher image.
- CSIAttacherImageName = "csi-attacher"
- // CSINodeDriverRegistrarImageName is the name of the CSI driver registrar image.
- CSINodeDriverRegistrarImageName = "csi-node-driver-registrar"
- // CSIProvisionerImageName is the name of the CSI provisioner image.
- CSIProvisionerImageName = "csi-provisioner"
- // CSIPluginImageName is the name of the CSI plugin image.
- CSIPluginImageName = "packet-storage-interface"
- // MetabotImageName is the name of the metabot image.
- MetabotImageName = "metabot"
-
- // TerraformerPurposeInfra is a constant for the complete Terraform setup with purpose 'infrastructure'.
- TerraformerPurposeInfra = "infra"
- // SSHKeyID key for accessing SSH key ID from outputs in terraform
- SSHKeyID = "key_pair_id"
-
- // MachineControllerManagerName is a constant for the name of the machine-controller-manager.
- MachineControllerManagerName = "machine-controller-manager"
- // MachineControllerManagerVpaName is the name of the VerticalPodAutoscaler of the machine-controller-manager deployment.
- MachineControllerManagerVpaName = "machine-controller-manager-vpa"
- // MachineControllerManagerMonitoringConfigName is the name of the ConfigMap containing monitoring stack configurations for machine-controller-manager.
- MachineControllerManagerMonitoringConfigName = "machine-controller-manager-monitoring-config"
- // CloudControllerManagerName is a constant for the name of the CloudController deployed by the worker controller.
- CloudControllerManagerName = "cloud-controller-manager"
-)
-
-var (
- // ChartsPath is the path to the charts
- ChartsPath = filepath.Join("controllers", Name, "charts")
- // InternalChartsPath is the path to the internal charts
- InternalChartsPath = filepath.Join(ChartsPath, "internal")
-)
-
-// Credentials stores Packet credentials.
-type Credentials struct {
- APIToken []byte
- ProjectID []byte
-}
diff --git a/controllers/provider-packet/pkg/webhook/controlplane/add.go b/controllers/provider-packet/pkg/webhook/controlplane/add.go
deleted file mode 100644
index a8114d6e5..000000000
--- a/controllers/provider-packet/pkg/webhook/controlplane/add.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package controlplane
-
-import (
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionswebhook "github.com/gardener/gardener-extensions/pkg/webhook"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane/genericmutator"
-
- extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
- appsv1 "k8s.io/api/apps/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "sigs.k8s.io/controller-runtime/pkg/log"
- "sigs.k8s.io/controller-runtime/pkg/manager"
-)
-
-var logger = log.Log.WithName("packet-controlplane-webhook")
-
-// AddToManager creates a webhook and adds it to the manager.
-func AddToManager(mgr manager.Manager) (*extensionswebhook.Webhook, error) {
- logger.Info("Adding webhook to manager")
- fciCodec := controlplane.NewFileContentInlineCodec()
- return controlplane.Add(mgr, controlplane.AddArgs{
- Kind: controlplane.KindShoot,
- Provider: packet.Type,
- Types: []runtime.Object{&appsv1.Deployment{}, &extensionsv1alpha1.OperatingSystemConfig{}},
- Mutator: genericmutator.NewMutator(NewEnsurer(logger), controlplane.NewUnitSerializer(),
- controlplane.NewKubeletConfigCodec(fciCodec), fciCodec, logger),
- })
-}
diff --git a/controllers/provider-packet/pkg/webhook/controlplane/ensurer.go b/controllers/provider-packet/pkg/webhook/controlplane/ensurer.go
deleted file mode 100644
index bef8aff80..000000000
--- a/controllers/provider-packet/pkg/webhook/controlplane/ensurer.go
+++ /dev/null
@@ -1,144 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package controlplane
-
-import (
- "context"
-
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionswebhook "github.com/gardener/gardener-extensions/pkg/webhook"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane/genericmutator"
-
- "github.com/coreos/go-systemd/unit"
- v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
- "github.com/go-logr/logr"
- appsv1 "k8s.io/api/apps/v1"
- corev1 "k8s.io/api/core/v1"
- kubeletconfigv1beta1 "k8s.io/kubelet/config/v1beta1"
- "sigs.k8s.io/controller-runtime/pkg/client"
-)
-
-// NewEnsurer creates a new controlplane ensurer.
-func NewEnsurer(logger logr.Logger) genericmutator.Ensurer {
- return &ensurer{
- logger: logger.WithName("packet-controlplane-ensurer"),
- }
-}
-
-type ensurer struct {
- genericmutator.NoopEnsurer
- client client.Client
- logger logr.Logger
-}
-
-// InjectClient injects the given client into the ensurer.
-func (e *ensurer) InjectClient(client client.Client) error {
- e.client = client
- return nil
-}
-
-// EnsureKubeAPIServerDeployment ensures that the kube-apiserver deployment conforms to the provider requirements.
-func (e *ensurer) EnsureKubeAPIServerDeployment(ctx context.Context, ectx genericmutator.EnsurerContext, dep *appsv1.Deployment) error {
- ps := &dep.Spec.Template.Spec
- if c := extensionswebhook.ContainerWithName(ps.Containers, "kube-apiserver"); c != nil {
- ensureKubeAPIServerCommandLineArgs(c)
- ensureEnvVars(c)
- }
- return controlplane.EnsureSecretChecksumAnnotation(ctx, &dep.Spec.Template, e.client, dep.Namespace, v1beta1constants.SecretNameCloudProvider)
-}
-
-// EnsureKubeControllerManagerDeployment ensures that the kube-controller-manager deployment conforms to the provider requirements.
-func (e *ensurer) EnsureKubeControllerManagerDeployment(ctx context.Context, ectx genericmutator.EnsurerContext, dep *appsv1.Deployment) error {
- ps := &dep.Spec.Template.Spec
- if c := extensionswebhook.ContainerWithName(ps.Containers, "kube-controller-manager"); c != nil {
- ensureKubeControllerManagerCommandLineArgs(c)
- }
- return nil
-}
-
-func ensureKubeAPIServerCommandLineArgs(c *corev1.Container) {
- // Ensure CSI-related admission plugins
- c.Command = extensionswebhook.EnsureNoStringWithPrefixContains(c.Command, "--enable-admission-plugins=",
- "PersistentVolumeLabel", ",")
- c.Command = extensionswebhook.EnsureStringWithPrefixContains(c.Command, "--disable-admission-plugins=",
- "PersistentVolumeLabel", ",")
-
- // Ensure CSI-related feature gates
- c.Command = extensionswebhook.EnsureNoStringWithPrefixContains(c.Command, "--feature-gates=",
- "VolumeSnapshotDataSource=false", ",")
- c.Command = extensionswebhook.EnsureNoStringWithPrefixContains(c.Command, "--feature-gates=",
- "CSINodeInfo=false", ",")
- c.Command = extensionswebhook.EnsureNoStringWithPrefixContains(c.Command, "--feature-gates=",
- "CSIDriverRegistry=false", ",")
- c.Command = extensionswebhook.EnsureNoStringWithPrefixContains(c.Command, "--feature-gates=",
- "KubeletPluginsWatcher=false", ",")
- c.Command = extensionswebhook.EnsureStringWithPrefixContains(c.Command, "--feature-gates=",
- "VolumeSnapshotDataSource=true", ",")
- c.Command = extensionswebhook.EnsureStringWithPrefixContains(c.Command, "--feature-gates=",
- "CSINodeInfo=true", ",")
- c.Command = extensionswebhook.EnsureStringWithPrefixContains(c.Command, "--feature-gates=",
- "CSIDriverRegistry=true", ",")
-}
-
-func ensureKubeControllerManagerCommandLineArgs(c *corev1.Container) {
- c.Command = extensionswebhook.EnsureStringWithPrefix(c.Command, "--cloud-provider=", "external")
-}
-
-var (
- credentialsEnvVar = corev1.EnvVar{
- Name: "PACKET_API_KEY",
- ValueFrom: &corev1.EnvVarSource{
- SecretKeyRef: &corev1.SecretKeySelector{
- Key: packet.APIToken,
- LocalObjectReference: corev1.LocalObjectReference{
- Name: v1beta1constants.SecretNameCloudProvider,
- },
- },
- },
- }
-)
-
-func ensureEnvVars(c *corev1.Container) {
- c.Env = extensionswebhook.EnsureEnvVarWithName(c.Env, credentialsEnvVar)
-}
-
-// EnsureKubeletServiceUnitOptions ensures that the kubelet.service unit options conform to the provider requirements.
-func (e *ensurer) EnsureKubeletServiceUnitOptions(ctx context.Context, ectx genericmutator.EnsurerContext, opts []*unit.UnitOption) ([]*unit.UnitOption, error) {
- if opt := extensionswebhook.UnitOptionWithSectionAndName(opts, "Service", "ExecStart"); opt != nil {
- command := extensionswebhook.DeserializeCommandLine(opt.Value)
- command = ensureKubeletCommandLineArgs(command)
- opt.Value = extensionswebhook.SerializeCommandLine(command, 1, " \\\n ")
- }
- return opts, nil
-}
-
-func ensureKubeletCommandLineArgs(command []string) []string {
- command = extensionswebhook.EnsureStringWithPrefix(command, "--cloud-provider=", "external")
- command = extensionswebhook.EnsureStringWithPrefix(command, "--enable-controller-attach-detach=", "true")
- return command
-}
-
-// EnsureKubeletConfiguration ensures that the kubelet configuration conforms to the provider requirements.
-func (e *ensurer) EnsureKubeletConfiguration(ctx context.Context, ectx genericmutator.EnsurerContext, kubeletConfig *kubeletconfigv1beta1.KubeletConfiguration) error {
- // Ensure CSI-related feature gates
- if kubeletConfig.FeatureGates == nil {
- kubeletConfig.FeatureGates = make(map[string]bool)
- }
- kubeletConfig.FeatureGates["VolumeSnapshotDataSource"] = true
- kubeletConfig.FeatureGates["CSINodeInfo"] = true
- kubeletConfig.FeatureGates["CSIDriverRegistry"] = true
- return nil
-}
diff --git a/controllers/provider-packet/pkg/webhook/controlplane/ensurer_test.go b/controllers/provider-packet/pkg/webhook/controlplane/ensurer_test.go
deleted file mode 100644
index e68ed143b..000000000
--- a/controllers/provider-packet/pkg/webhook/controlplane/ensurer_test.go
+++ /dev/null
@@ -1,308 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package controlplane
-
-import (
- "context"
- "testing"
-
- mockclient "github.com/gardener/gardener-extensions/pkg/mock/controller-runtime/client"
- extensionswebhook "github.com/gardener/gardener-extensions/pkg/webhook"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane/genericmutator"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane/test"
-
- "github.com/coreos/go-systemd/unit"
- v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
- "github.com/golang/mock/gomock"
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- appsv1 "k8s.io/api/apps/v1"
- corev1 "k8s.io/api/core/v1"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/runtime"
- kubeletconfigv1beta1 "k8s.io/kubelet/config/v1beta1"
- "sigs.k8s.io/controller-runtime/pkg/client"
- "sigs.k8s.io/controller-runtime/pkg/runtime/inject"
-)
-
-const (
- namespace = "test"
-)
-
-func TestController(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Packet Controlplane Webhook Suite")
-}
-
-var _ = Describe("Ensurer", func() {
- var (
- ctrl *gomock.Controller
-
- dummyContext = genericmutator.NewEnsurerContext(nil, nil)
-
- secretKey = client.ObjectKey{Namespace: namespace, Name: v1beta1constants.SecretNameCloudProvider}
- secret = &corev1.Secret{
- ObjectMeta: metav1.ObjectMeta{Namespace: namespace, Name: v1beta1constants.SecretNameCloudProvider},
- Data: map[string][]byte{"foo": []byte("bar")},
- }
-
- annotations = map[string]string{
- "checksum/secret-" + v1beta1constants.SecretNameCloudProvider: "8bafb35ff1ac60275d62e1cbd495aceb511fb354f74a20f7d06ecb48b3a68432",
- }
- )
-
- BeforeEach(func() {
- ctrl = gomock.NewController(GinkgoT())
- })
-
- AfterEach(func() {
- ctrl.Finish()
- })
-
- Describe("#EnsureKubeAPIServerDeployment", func() {
- It("should add missing elements to kube-apiserver deployment", func() {
- var (
- dep = &appsv1.Deployment{
- ObjectMeta: metav1.ObjectMeta{Namespace: namespace, Name: v1beta1constants.DeploymentNameKubeAPIServer},
- Spec: appsv1.DeploymentSpec{
- Template: corev1.PodTemplateSpec{
- Spec: corev1.PodSpec{
- Containers: []corev1.Container{
- {
- Name: "kube-apiserver",
- },
- },
- },
- },
- },
- }
- )
-
- // Create mock client
- client := mockclient.NewMockClient(ctrl)
- client.EXPECT().Get(context.TODO(), secretKey, &corev1.Secret{}).DoAndReturn(clientGet(secret))
-
- // Create ensurer
- ensurer := NewEnsurer(logger)
- err := ensurer.(inject.Client).InjectClient(client)
- Expect(err).To(Not(HaveOccurred()))
-
- // Call EnsureKubeAPIServerDeployment method and check the result
- err = ensurer.EnsureKubeAPIServerDeployment(context.TODO(), dummyContext, dep)
- Expect(err).To(Not(HaveOccurred()))
- checkKubeAPIServerDeployment(dep, annotations)
- })
-
- It("should modify existing elements of kube-apiserver deployment", func() {
- var (
- dep = &appsv1.Deployment{
- ObjectMeta: metav1.ObjectMeta{Namespace: namespace, Name: v1beta1constants.DeploymentNameKubeAPIServer},
- Spec: appsv1.DeploymentSpec{
- Template: corev1.PodTemplateSpec{
- Spec: corev1.PodSpec{
- Containers: []corev1.Container{
- {
- Name: "kube-apiserver",
- Command: []string{
- "--enable-admission-plugins=Priority,PersistentVolumeLabel",
- "--disable-admission-plugins=",
- "--feature-gates=Foo=true",
- },
- Env: []corev1.EnvVar{
- {Name: "PACKET_API_KEY", Value: "?"},
- },
- },
- },
- },
- },
- },
- }
- )
-
- // Create mock client
- client := mockclient.NewMockClient(ctrl)
- client.EXPECT().Get(context.TODO(), secretKey, &corev1.Secret{}).DoAndReturn(clientGet(secret))
-
- // Create ensurer
- ensurer := NewEnsurer(logger)
- err := ensurer.(inject.Client).InjectClient(client)
- Expect(err).To(Not(HaveOccurred()))
-
- // Call EnsureKubeAPIServerDeployment method and check the result
- err = ensurer.EnsureKubeAPIServerDeployment(context.TODO(), dummyContext, dep)
- Expect(err).To(Not(HaveOccurred()))
- checkKubeAPIServerDeployment(dep, annotations)
- })
- })
-
- Describe("#EnsureKubeControllerManagerDeployment", func() {
- It("should add missing elements to kube-controller-manager deployment", func() {
- var (
- dep = &appsv1.Deployment{
- ObjectMeta: metav1.ObjectMeta{Namespace: namespace, Name: v1beta1constants.DeploymentNameKubeControllerManager},
- Spec: appsv1.DeploymentSpec{
- Template: corev1.PodTemplateSpec{
- Spec: corev1.PodSpec{
- Containers: []corev1.Container{
- {
- Name: "kube-controller-manager",
- },
- },
- },
- },
- },
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(logger)
-
- // Call EnsureKubeControllerManagerDeployment method and check the result
- err := ensurer.EnsureKubeControllerManagerDeployment(context.TODO(), dummyContext, dep)
- Expect(err).To(Not(HaveOccurred()))
- checkKubeControllerManagerDeployment(dep)
- })
-
- It("should modify existing elements of kube-controller-manager deployment", func() {
- var (
- dep = &appsv1.Deployment{
- ObjectMeta: metav1.ObjectMeta{Name: v1beta1constants.DeploymentNameKubeControllerManager},
- Spec: appsv1.DeploymentSpec{
- Template: corev1.PodTemplateSpec{
- Spec: corev1.PodSpec{
- Containers: []corev1.Container{
- {
- Name: "kube-controller-manager",
- Command: []string{
- "--cloud-provider=?",
- },
- Env: []corev1.EnvVar{
- {Name: "PACKET_API_KEY", Value: "?"},
- },
- },
- },
- },
- },
- },
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(logger)
-
- // Call EnsureKubeControllerManagerDeployment method and check the result
- err := ensurer.EnsureKubeControllerManagerDeployment(context.TODO(), dummyContext, dep)
- Expect(err).To(Not(HaveOccurred()))
- checkKubeControllerManagerDeployment(dep)
- })
- })
-
- Describe("#EnsureKubeletServiceUnitOptions", func() {
- It("should modify existing elements of kubelet.service unit options", func() {
- var (
- oldUnitOptions = []*unit.UnitOption{
- {
- Section: "Service",
- Name: "ExecStart",
- Value: `/opt/bin/hyperkube kubelet \
- --config=/var/lib/kubelet/config/kubelet`,
- },
- }
- newUnitOptions = []*unit.UnitOption{
- {
- Section: "Service",
- Name: "ExecStart",
- Value: `/opt/bin/hyperkube kubelet \
- --config=/var/lib/kubelet/config/kubelet \
- --cloud-provider=external \
- --enable-controller-attach-detach=true`,
- },
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(logger)
-
- // Call EnsureKubeletServiceUnitOptions method and check the result
- opts, err := ensurer.EnsureKubeletServiceUnitOptions(context.TODO(), dummyContext, oldUnitOptions)
- Expect(err).To(Not(HaveOccurred()))
- Expect(opts).To(Equal(newUnitOptions))
- })
- })
-
- Describe("#EnsureKubeletConfiguration", func() {
- It("should modify existing elements of kubelet configuration", func() {
- var (
- oldKubeletConfig = &kubeletconfigv1beta1.KubeletConfiguration{
- FeatureGates: map[string]bool{
- "Foo": true,
- },
- }
- newKubeletConfig = &kubeletconfigv1beta1.KubeletConfiguration{
- FeatureGates: map[string]bool{
- "Foo": true,
- "VolumeSnapshotDataSource": true,
- "CSINodeInfo": true,
- "CSIDriverRegistry": true,
- },
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(logger)
-
- // Call EnsureKubeletConfiguration method and check the result
- kubeletConfig := *oldKubeletConfig
- err := ensurer.EnsureKubeletConfiguration(context.TODO(), dummyContext, &kubeletConfig)
- Expect(err).To(Not(HaveOccurred()))
- Expect(&kubeletConfig).To(Equal(newKubeletConfig))
- })
- })
-})
-
-func checkKubeAPIServerDeployment(dep *appsv1.Deployment, annotations map[string]string) {
- // Check that the kube-apiserver container still exists and contains all needed command line args,
- // env vars, and volume mounts
- c := extensionswebhook.ContainerWithName(dep.Spec.Template.Spec.Containers, "kube-apiserver")
- Expect(c).To(Not(BeNil()))
- Expect(c.Command).To(Not(test.ContainElementWithPrefixContaining("--enable-admission-plugins=", "PersistentVolumeLabel", ",")))
- Expect(c.Command).To(test.ContainElementWithPrefixContaining("--disable-admission-plugins=", "PersistentVolumeLabel", ","))
- Expect(c.Command).To(test.ContainElementWithPrefixContaining("--feature-gates=", "VolumeSnapshotDataSource=true", ","))
- Expect(c.Command).To(test.ContainElementWithPrefixContaining("--feature-gates=", "CSINodeInfo=true", ","))
- Expect(c.Command).To(test.ContainElementWithPrefixContaining("--feature-gates=", "CSIDriverRegistry=true", ","))
-
- // Check that the Pod template contains all needed checksum annotations
- Expect(dep.Spec.Template.Annotations).To(Equal(annotations))
-}
-
-func checkKubeControllerManagerDeployment(dep *appsv1.Deployment) {
- // Check that the kube-controller-manager container still exists and contains all needed command line args,
- // env vars, and volume mounts
- c := extensionswebhook.ContainerWithName(dep.Spec.Template.Spec.Containers, "kube-controller-manager")
- Expect(c).To(Not(BeNil()))
- Expect(c.Command).To(ContainElement("--cloud-provider=external"))
-}
-
-func clientGet(result runtime.Object) interface{} {
- return func(ctx context.Context, key client.ObjectKey, obj runtime.Object) error {
- switch obj.(type) {
- case *corev1.Secret:
- *obj.(*corev1.Secret) = *result.(*corev1.Secret)
- case *corev1.ConfigMap:
- *obj.(*corev1.ConfigMap) = *result.(*corev1.ConfigMap)
- }
- return nil
- }
-}
diff --git a/controllers/provider-packet/pkg/webhook/controlplanebackup/add.go b/controllers/provider-packet/pkg/webhook/controlplanebackup/add.go
deleted file mode 100644
index eb4e73641..000000000
--- a/controllers/provider-packet/pkg/webhook/controlplanebackup/add.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package controlplanebackup
-
-import (
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/imagevector"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionswebhook "github.com/gardener/gardener-extensions/pkg/webhook"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane/genericmutator"
-
- appsv1 "k8s.io/api/apps/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "sigs.k8s.io/controller-runtime/pkg/log"
- "sigs.k8s.io/controller-runtime/pkg/manager"
-)
-
-var logger = log.Log.WithName("packet-controlplanebackup-webhook")
-
-// AddToManager creates a webhook with the default options and adds it to the manager.
-func AddToManager(mgr manager.Manager) (*extensionswebhook.Webhook, error) {
- logger.Info("Adding webhook to manager")
- return controlplane.Add(mgr, controlplane.AddArgs{
- Kind: controlplane.KindBackup,
- Provider: packet.Type,
- Types: []runtime.Object{&appsv1.StatefulSet{}},
- Mutator: genericmutator.NewMutator(NewEnsurer(imagevector.ImageVector(), logger), nil, nil, nil, logger),
- })
-}
diff --git a/controllers/provider-packet/pkg/webhook/controlplanebackup/ensurer.go b/controllers/provider-packet/pkg/webhook/controlplanebackup/ensurer.go
deleted file mode 100644
index ec18dd963..000000000
--- a/controllers/provider-packet/pkg/webhook/controlplanebackup/ensurer.go
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package controlplanebackup
-
-import (
- "context"
-
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller"
- extensionswebhook "github.com/gardener/gardener-extensions/pkg/webhook"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane/genericmutator"
-
- v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
- "github.com/gardener/gardener/pkg/utils/imagevector"
- "github.com/go-logr/logr"
- "github.com/pkg/errors"
- appsv1 "k8s.io/api/apps/v1"
- corev1 "k8s.io/api/core/v1"
-)
-
-// NewEnsurer creates a new controlplaneexposure ensurer.
-func NewEnsurer(imageVector imagevector.ImageVector, logger logr.Logger) genericmutator.Ensurer {
- return &ensurer{
- imageVector: imageVector,
- logger: logger.WithName("packet-controlplanebackup-ensurer"),
- }
-}
-
-type ensurer struct {
- genericmutator.NoopEnsurer
- imageVector imagevector.ImageVector
- logger logr.Logger
-}
-
-// EnsureETCDStatefulSet ensures that the etcd stateful sets conform to the provider requirements.
-func (e *ensurer) EnsureETCDStatefulSet(ctx context.Context, ectx genericmutator.EnsurerContext, ss *appsv1.StatefulSet) error {
- cluster, err := ectx.GetCluster(ctx)
- if err != nil {
- return err
- }
- return e.ensureContainers(&ss.Spec.Template.Spec, ss.Name, cluster)
-}
-
-func (e *ensurer) ensureContainers(ps *corev1.PodSpec, name string, cluster *extensionscontroller.Cluster) error {
- c, err := e.getBackupRestoreContainer(name, cluster)
- if err != nil {
- return err
- }
- ps.Containers = extensionswebhook.EnsureContainerWithName(ps.Containers, *c)
- return nil
-}
-
-func (e *ensurer) getBackupRestoreContainer(name string, cluster *extensionscontroller.Cluster) (*corev1.Container, error) {
- // Find etcd-backup-restore image
- // TODO Get seed version from clientset when it's possible to inject it
- image, err := e.imageVector.FindImage(packet.ETCDBackupRestoreImageName, imagevector.TargetVersion(cluster.Shoot.Spec.Kubernetes.Version))
- if err != nil {
- return nil, errors.Wrapf(err, "could not find image %s", packet.ETCDBackupRestoreImageName)
- }
-
- // Determine volume claim template name
- // It is only specified for the etcd-main stateful set (backup is enabled)
- var (
- volumeClaimTemplateName = name
- )
- if name == v1beta1constants.ETCDMain {
- volumeClaimTemplateName = controlplane.EtcdMainVolumeClaimTemplateName
- }
-
- return controlplane.GetBackupRestoreContainer(name, volumeClaimTemplateName, "", "", "", image.String(), nil, nil, nil), nil
-}
diff --git a/controllers/provider-packet/pkg/webhook/controlplanebackup/ensurer_test.go b/controllers/provider-packet/pkg/webhook/controlplanebackup/ensurer_test.go
deleted file mode 100644
index 29ed05094..000000000
--- a/controllers/provider-packet/pkg/webhook/controlplanebackup/ensurer_test.go
+++ /dev/null
@@ -1,243 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package controlplanebackup
-
-import (
- "context"
- "testing"
-
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller"
- "github.com/gardener/gardener-extensions/pkg/util"
- extensionswebhook "github.com/gardener/gardener-extensions/pkg/webhook"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane/genericmutator"
-
- gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1"
- v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
- "github.com/gardener/gardener/pkg/utils/imagevector"
- "github.com/golang/mock/gomock"
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- appsv1 "k8s.io/api/apps/v1"
- corev1 "k8s.io/api/core/v1"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-const (
- namespace = "test"
-)
-
-func TestController(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Packet Controlplane Backup Webhook Suite")
-}
-
-var _ = Describe("Ensurer", func() {
- Describe("#EnsureETCDStatefulSet", func() {
- var (
- ctrl *gomock.Controller
-
- imageVector = imagevector.ImageVector{
- {
- Name: packet.ETCDBackupRestoreImageName,
- Repository: "test-repository",
- Tag: util.StringPtr("test-tag"),
- },
- }
-
- cluster = &extensionscontroller.Cluster{
- Shoot: &gardencorev1beta1.Shoot{
- Spec: gardencorev1beta1.ShootSpec{
- Kubernetes: gardencorev1beta1.Kubernetes{
- Version: "1.13.4",
- },
- },
- },
- }
-
- dummyContext = genericmutator.NewInternalEnsurerContext(cluster)
- )
-
- BeforeEach(func() {
- ctrl = gomock.NewController(GinkgoT())
- })
-
- AfterEach(func() {
- ctrl.Finish()
- })
-
- It("should add or modify elements to etcd-main statefulset", func() {
- var (
- ss = &appsv1.StatefulSet{
- ObjectMeta: metav1.ObjectMeta{Namespace: namespace, Name: v1beta1constants.ETCDMain},
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(imageVector, logger)
-
- // Call EnsureETCDStatefulSet method and check the result
- err := ensurer.EnsureETCDStatefulSet(context.TODO(), dummyContext, ss)
- Expect(err).To(Not(HaveOccurred()))
- checkETCDMainStatefulSet(ss, nil)
- })
-
- It("should modify existing elements of etcd-main statefulset", func() {
- var (
- ss = &appsv1.StatefulSet{
- ObjectMeta: metav1.ObjectMeta{Namespace: namespace, Name: v1beta1constants.ETCDMain},
- Spec: appsv1.StatefulSetSpec{
- Template: corev1.PodTemplateSpec{
- Spec: corev1.PodSpec{
- Containers: []corev1.Container{
- {
- Name: "backup-restore",
- },
- },
- },
- },
- },
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(imageVector, logger)
-
- // Call EnsureETCDStatefulSet method and check the result
- err := ensurer.EnsureETCDStatefulSet(context.TODO(), dummyContext, ss)
- Expect(err).To(Not(HaveOccurred()))
- checkETCDMainStatefulSet(ss, nil)
- })
-
- It("should not modify elements to same etcd-main statefulset", func() {
- var (
- ss = &appsv1.StatefulSet{
- ObjectMeta: metav1.ObjectMeta{Namespace: namespace, Name: v1beta1constants.ETCDMain},
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(imageVector, logger)
-
- // Call EnsureETCDStatefulSet method and check the result
- err := ensurer.EnsureETCDStatefulSet(context.TODO(), dummyContext, ss)
- Expect(err).To(Not(HaveOccurred()))
- oldSS := ss.DeepCopy()
-
- // Re-ensure on existing statefulset
- err = ensurer.EnsureETCDStatefulSet(context.TODO(), dummyContext, ss)
-
- Expect(err).To(Not(HaveOccurred()))
- Expect(ss).Should(Equal(oldSS))
-
- // Re-ensure on new statefulset request
- newSS := &appsv1.StatefulSet{
- ObjectMeta: metav1.ObjectMeta{Namespace: namespace, Name: v1beta1constants.ETCDEvents},
- }
- err = ensurer.EnsureETCDStatefulSet(context.TODO(), dummyContext, newSS)
-
- Expect(err).To(Not(HaveOccurred()))
- Expect(ss).Should(Equal(oldSS))
- })
-
- It("should add or modify elements to etcd-events statefulset", func() {
- var (
- ss = &appsv1.StatefulSet{
- ObjectMeta: metav1.ObjectMeta{Name: v1beta1constants.ETCDEvents},
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(imageVector, logger)
-
- // Call EnsureETCDStatefulSet method and check the result
- err := ensurer.EnsureETCDStatefulSet(context.TODO(), dummyContext, ss)
- Expect(err).To(Not(HaveOccurred()))
- checkETCDEventsStatefulSet(ss)
- })
-
- It("should modify existing elements of etcd-events statefulset", func() {
- var (
- ss = &appsv1.StatefulSet{
- ObjectMeta: metav1.ObjectMeta{Name: v1beta1constants.ETCDEvents},
- Spec: appsv1.StatefulSetSpec{
- Template: corev1.PodTemplateSpec{
- Spec: corev1.PodSpec{
- Containers: []corev1.Container{
- {
- Name: "backup-restore",
- },
- },
- },
- },
- },
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(imageVector, logger)
-
- // Call EnsureETCDStatefulSet method and check the result
- err := ensurer.EnsureETCDStatefulSet(context.TODO(), dummyContext, ss)
- Expect(err).To(Not(HaveOccurred()))
- checkETCDEventsStatefulSet(ss)
- })
-
- It("should not modify elements to same etcd-events statefulset", func() {
- var (
- ss = &appsv1.StatefulSet{
- ObjectMeta: metav1.ObjectMeta{Namespace: namespace, Name: v1beta1constants.ETCDEvents},
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(imageVector, logger)
-
- // Call EnsureETCDStatefulSet method and check the result
- err := ensurer.EnsureETCDStatefulSet(context.TODO(), dummyContext, ss)
- Expect(err).To(Not(HaveOccurred()))
- oldSS := ss.DeepCopy()
-
- // Re-ensure on existing statefulset
- err = ensurer.EnsureETCDStatefulSet(context.TODO(), dummyContext, ss)
-
- Expect(err).To(Not(HaveOccurred()))
- Expect(ss).Should(Equal(oldSS))
-
- // Re-ensure on new statefulset request
- newSS := &appsv1.StatefulSet{
- ObjectMeta: metav1.ObjectMeta{Namespace: namespace, Name: v1beta1constants.ETCDEvents},
- }
- err = ensurer.EnsureETCDStatefulSet(context.TODO(), dummyContext, newSS)
-
- Expect(err).To(Not(HaveOccurred()))
- Expect(ss).Should(Equal(oldSS))
- })
- })
-})
-
-func checkETCDMainStatefulSet(ss *appsv1.StatefulSet, annotations map[string]string) {
- c := extensionswebhook.ContainerWithName(ss.Spec.Template.Spec.Containers, "backup-restore")
- Expect(c).To(Equal(controlplane.GetBackupRestoreContainer(v1beta1constants.ETCDMain, controlplane.EtcdMainVolumeClaimTemplateName, "", "", "",
- "test-repository:test-tag", nil, nil, nil)))
- Expect(ss.Spec.Template.Annotations).To(Equal(annotations))
-}
-
-func checkETCDEventsStatefulSet(ss *appsv1.StatefulSet) {
- c := extensionswebhook.ContainerWithName(ss.Spec.Template.Spec.Containers, "backup-restore")
- Expect(c).To(Equal(controlplane.GetBackupRestoreContainer(v1beta1constants.ETCDEvents, v1beta1constants.ETCDEvents, "", "", "",
- "test-repository:test-tag", nil, nil, nil)))
-}
diff --git a/controllers/provider-packet/pkg/webhook/controlplaneexposure/add.go b/controllers/provider-packet/pkg/webhook/controlplaneexposure/add.go
deleted file mode 100644
index 6fd5c4508..000000000
--- a/controllers/provider-packet/pkg/webhook/controlplaneexposure/add.go
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package controlplaneexposure
-
-import (
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionswebhook "github.com/gardener/gardener-extensions/pkg/webhook"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane/genericmutator"
-
- appsv1 "k8s.io/api/apps/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "sigs.k8s.io/controller-runtime/pkg/log"
- "sigs.k8s.io/controller-runtime/pkg/manager"
-)
-
-var (
- // DefaultAddOptions are the default AddOptions for AddToManager.
- DefaultAddOptions = AddOptions{}
-)
-
-// AddOptions are options to apply when adding the AWS exposure webhook to the manager.
-type AddOptions struct {
- // ETCDStorage is the etcd storage configuration.
- ETCDStorage config.ETCDStorage
-}
-
-var logger = log.Log.WithName("packet-controlplaneexposure-webhook")
-
-// AddToManagerWithOptions creates a webhook with the given options and adds it to the manager.
-func AddToManagerWithOptions(mgr manager.Manager, opts AddOptions) (*extensionswebhook.Webhook, error) {
- logger.Info("Adding webhook to manager")
- return controlplane.Add(mgr, controlplane.AddArgs{
- Kind: controlplane.KindSeed,
- Provider: packet.Type,
- Types: []runtime.Object{&appsv1.Deployment{}, &appsv1.StatefulSet{}},
- Mutator: genericmutator.NewMutator(NewEnsurer(&opts.ETCDStorage, logger), nil, nil, nil, logger),
- })
-}
-
-// AddToManager creates a webhook with the default options and adds it to the manager.
-func AddToManager(mgr manager.Manager) (*extensionswebhook.Webhook, error) {
- return AddToManagerWithOptions(mgr, DefaultAddOptions)
-}
diff --git a/controllers/provider-packet/pkg/webhook/controlplaneexposure/ensurer.go b/controllers/provider-packet/pkg/webhook/controlplaneexposure/ensurer.go
deleted file mode 100644
index d58c62620..000000000
--- a/controllers/provider-packet/pkg/webhook/controlplaneexposure/ensurer.go
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package controlplaneexposure
-
-import (
- "context"
-
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config"
- extensionswebhook "github.com/gardener/gardener-extensions/pkg/webhook"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane/genericmutator"
-
- v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
- "github.com/go-logr/logr"
- appsv1 "k8s.io/api/apps/v1"
- corev1 "k8s.io/api/core/v1"
-)
-
-// NewEnsurer creates a new controlplaneexposure ensurer.
-func NewEnsurer(etcdStorage *config.ETCDStorage, logger logr.Logger) genericmutator.Ensurer {
- return &ensurer{
- etcdStorage: etcdStorage,
- logger: logger.WithName("packet-controlplaneexposure-ensurer"),
- }
-}
-
-type ensurer struct {
- genericmutator.NoopEnsurer
- etcdStorage *config.ETCDStorage
- logger logr.Logger
-}
-
-// EnsureETCDStatefulSet ensures that the etcd stateful sets conform to the provider requirements.
-func (e *ensurer) EnsureETCDStatefulSet(ctx context.Context, ectx genericmutator.EnsurerContext, ss *appsv1.StatefulSet) error {
- e.ensureVolumeClaimTemplates(&ss.Spec, ss.Name)
- return nil
-}
-
-func (e *ensurer) ensureVolumeClaimTemplates(spec *appsv1.StatefulSetSpec, name string) {
- t := e.getVolumeClaimTemplate(name)
- spec.VolumeClaimTemplates = extensionswebhook.EnsurePVCWithName(spec.VolumeClaimTemplates, *t)
-}
-
-func (e *ensurer) getVolumeClaimTemplate(name string) *corev1.PersistentVolumeClaim {
- var (
- etcdStorage config.ETCDStorage
- volumeClaimTemplateName = name
- )
-
- if name == v1beta1constants.ETCDMain {
- etcdStorage = *e.etcdStorage
- volumeClaimTemplateName = controlplane.EtcdMainVolumeClaimTemplateName
- }
-
- return controlplane.GetETCDVolumeClaimTemplate(volumeClaimTemplateName, etcdStorage.ClassName, etcdStorage.Capacity)
-}
diff --git a/controllers/provider-packet/pkg/webhook/controlplaneexposure/ensurer_test.go b/controllers/provider-packet/pkg/webhook/controlplaneexposure/ensurer_test.go
deleted file mode 100644
index 0e5bf0e8a..000000000
--- a/controllers/provider-packet/pkg/webhook/controlplaneexposure/ensurer_test.go
+++ /dev/null
@@ -1,235 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package controlplaneexposure
-
-import (
- "context"
- "testing"
-
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/apis/config"
- "github.com/gardener/gardener-extensions/pkg/util"
- extensionswebhook "github.com/gardener/gardener-extensions/pkg/webhook"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane"
- "github.com/gardener/gardener-extensions/pkg/webhook/controlplane/genericmutator"
-
- v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
- "github.com/golang/mock/gomock"
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- appsv1 "k8s.io/api/apps/v1"
- corev1 "k8s.io/api/core/v1"
- "k8s.io/apimachinery/pkg/api/resource"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-const (
- namespace = "test"
-)
-
-func TestController(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Packet Controlplane Exposure Webhook Suite")
-}
-
-var _ = Describe("Ensurer", func() {
- var (
- etcdStorage = &config.ETCDStorage{
- ClassName: util.StringPtr("gardener.cloud-fast"),
- Capacity: util.QuantityPtr(resource.MustParse("25Gi")),
- }
-
- ctrl *gomock.Controller
-
- dummyContext = genericmutator.NewEnsurerContext(nil, nil)
- )
-
- BeforeEach(func() {
- ctrl = gomock.NewController(GinkgoT())
- })
-
- AfterEach(func() {
- ctrl.Finish()
- })
-
- Describe("#EnsureKubeAPIServerDeployment", func() {
- It("should add missing elements to kube-apiserver deployment", func() {
- var (
- dep = &appsv1.Deployment{
- ObjectMeta: metav1.ObjectMeta{Name: v1beta1constants.DeploymentNameKubeAPIServer, Namespace: namespace},
- Spec: appsv1.DeploymentSpec{
- Template: corev1.PodTemplateSpec{
- Spec: corev1.PodSpec{
- Containers: []corev1.Container{
- {
- Name: "kube-apiserver",
- },
- },
- },
- },
- },
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(etcdStorage, logger)
-
- // Call EnsureKubeAPIServerDeployment method and check the result
- err := ensurer.EnsureKubeAPIServerDeployment(context.TODO(), dummyContext, dep)
- Expect(err).To(Not(HaveOccurred()))
- checkKubeAPIServerDeployment(dep)
- })
-
- It("should modify existing elements of kube-apiserver deployment", func() {
- var (
- dep = &appsv1.Deployment{
- ObjectMeta: metav1.ObjectMeta{Name: v1beta1constants.DeploymentNameKubeAPIServer, Namespace: namespace},
- Spec: appsv1.DeploymentSpec{
- Template: corev1.PodTemplateSpec{
- Spec: corev1.PodSpec{
- Containers: []corev1.Container{
- {
- Name: "kube-apiserver",
- Command: []string{},
- },
- },
- },
- },
- },
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(etcdStorage, logger)
-
- // Call EnsureKubeAPIServerDeployment method and check the result
- err := ensurer.EnsureKubeAPIServerDeployment(context.TODO(), dummyContext, dep)
- Expect(err).To(Not(HaveOccurred()))
- checkKubeAPIServerDeployment(dep)
- })
- })
-
- Describe("#EnsureETCDStatefulSet", func() {
- It("should add or modify elements to etcd-main statefulset", func() {
- var (
- ss = &appsv1.StatefulSet{
- ObjectMeta: metav1.ObjectMeta{Name: v1beta1constants.ETCDMain},
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(etcdStorage, logger)
-
- // Call EnsureETCDStatefulSet method and check the result
- err := ensurer.EnsureETCDStatefulSet(context.TODO(), dummyContext, ss)
- Expect(err).To(Not(HaveOccurred()))
- checkETCDMainStatefulSet(ss)
- })
-
- It("should modify existing elements of etcd-main statefulset", func() {
- var (
- ss = &appsv1.StatefulSet{
- ObjectMeta: metav1.ObjectMeta{Name: v1beta1constants.ETCDMain},
- Spec: appsv1.StatefulSetSpec{
- VolumeClaimTemplates: []corev1.PersistentVolumeClaim{
- {
- ObjectMeta: metav1.ObjectMeta{Name: "etcd-main"},
- Spec: corev1.PersistentVolumeClaimSpec{
- AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce},
- Resources: corev1.ResourceRequirements{
- Requests: corev1.ResourceList{
- corev1.ResourceStorage: resource.MustParse("10Gi"),
- },
- },
- },
- },
- },
- },
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(etcdStorage, logger)
-
- // Call EnsureETCDStatefulSet method and check the result
- err := ensurer.EnsureETCDStatefulSet(context.TODO(), dummyContext, ss)
- Expect(err).To(Not(HaveOccurred()))
- checkETCDMainStatefulSet(ss)
- })
-
- It("should add or modify elements to etcd-events statefulset", func() {
- var (
- ss = &appsv1.StatefulSet{
- ObjectMeta: metav1.ObjectMeta{Name: v1beta1constants.ETCDEvents},
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(etcdStorage, logger)
-
- // Call EnsureETCDStatefulSet method and check the result
- err := ensurer.EnsureETCDStatefulSet(context.TODO(), dummyContext, ss)
- Expect(err).To(Not(HaveOccurred()))
- checkETCDEventsStatefulSet(ss)
- })
-
- It("should modify existing elements of etcd-events statefulset", func() {
- var (
- ss = &appsv1.StatefulSet{
- ObjectMeta: metav1.ObjectMeta{Name: v1beta1constants.ETCDEvents},
- Spec: appsv1.StatefulSetSpec{
- VolumeClaimTemplates: []corev1.PersistentVolumeClaim{
- {
- ObjectMeta: metav1.ObjectMeta{Name: "etcd-events"},
- Spec: corev1.PersistentVolumeClaimSpec{
- AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce},
- Resources: corev1.ResourceRequirements{
- Requests: corev1.ResourceList{
- corev1.ResourceStorage: resource.MustParse("20Gi"),
- },
- },
- },
- },
- },
- },
- }
- )
-
- // Create ensurer
- ensurer := NewEnsurer(etcdStorage, logger)
-
- // Call EnsureETCDStatefulSet method and check the result
- err := ensurer.EnsureETCDStatefulSet(context.TODO(), dummyContext, ss)
- Expect(err).To(Not(HaveOccurred()))
- checkETCDEventsStatefulSet(ss)
- })
- })
-})
-
-func checkKubeAPIServerDeployment(dep *appsv1.Deployment) {
- // Check that the kube-apiserver container still exists and contains all needed command line args
- c := extensionswebhook.ContainerWithName(dep.Spec.Template.Spec.Containers, "kube-apiserver")
- Expect(c).To(Not(BeNil()))
-}
-
-func checkETCDMainStatefulSet(ss *appsv1.StatefulSet) {
- pvc := extensionswebhook.PVCWithName(ss.Spec.VolumeClaimTemplates, controlplane.EtcdMainVolumeClaimTemplateName)
- Expect(pvc).To(Equal(controlplane.GetETCDVolumeClaimTemplate(controlplane.EtcdMainVolumeClaimTemplateName, util.StringPtr("gardener.cloud-fast"),
- util.QuantityPtr(resource.MustParse("25Gi")))))
-}
-
-func checkETCDEventsStatefulSet(ss *appsv1.StatefulSet) {
- pvc := extensionswebhook.PVCWithName(ss.Spec.VolumeClaimTemplates, v1beta1constants.ETCDEvents)
- Expect(pvc).To(Equal(controlplane.GetETCDVolumeClaimTemplate(v1beta1constants.ETCDEvents, nil, nil)))
-}
diff --git a/controllers/provider-packet/pkg/webhook/shoot/add.go b/controllers/provider-packet/pkg/webhook/shoot/add.go
deleted file mode 100644
index c72e22e15..000000000
--- a/controllers/provider-packet/pkg/webhook/shoot/add.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package shoot
-
-import (
- extensionswebhook "github.com/gardener/gardener-extensions/pkg/webhook"
- "github.com/gardener/gardener-extensions/pkg/webhook/shoot"
-
- appsv1 "k8s.io/api/apps/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "sigs.k8s.io/controller-runtime/pkg/log"
- "sigs.k8s.io/controller-runtime/pkg/manager"
-)
-
-var (
- // DefaultAddOptions are the default AddOptions for AddToManager.
- DefaultAddOptions = AddOptions{}
-)
-
-// AddOptions are options to apply when adding the Packet shoot webhook to the manager.
-type AddOptions struct{}
-
-var logger = log.Log.WithName("packet-shoot-webhook")
-
-// AddToManagerWithOptions creates a webhook with the given options and adds it to the manager.
-func AddToManagerWithOptions(mgr manager.Manager, opts AddOptions) (*extensionswebhook.Webhook, error) {
- logger.Info("Adding webhook to manager")
- return shoot.Add(mgr, shoot.AddArgs{
- Types: []runtime.Object{&appsv1.Deployment{}},
- Mutator: NewMutator(),
- })
-}
-
-// AddToManager creates a webhook with the default options and adds it to the manager.
-func AddToManager(mgr manager.Manager) (*extensionswebhook.Webhook, error) {
- return AddToManagerWithOptions(mgr, DefaultAddOptions)
-}
diff --git a/controllers/provider-packet/pkg/webhook/shoot/mutator.go b/controllers/provider-packet/pkg/webhook/shoot/mutator.go
deleted file mode 100644
index 39682453e..000000000
--- a/controllers/provider-packet/pkg/webhook/shoot/mutator.go
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain m copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package shoot
-
-import (
- "context"
-
- extensionswebhook "github.com/gardener/gardener-extensions/pkg/webhook"
-
- "github.com/go-logr/logr"
- "github.com/pkg/errors"
- appsv1 "k8s.io/api/apps/v1"
- "k8s.io/apimachinery/pkg/api/meta"
- "k8s.io/apimachinery/pkg/runtime"
- "sigs.k8s.io/controller-runtime/pkg/log"
-)
-
-type mutator struct {
- logger logr.Logger
-}
-
-// NewMutator creates a new Mutator that mutates resources in the shoot cluster.
-func NewMutator() extensionswebhook.Mutator {
- return &mutator{
- logger: log.Log.WithName("shoot-mutator"),
- }
-}
-
-func (m *mutator) Mutate(ctx context.Context, obj runtime.Object) error {
- acc, err := meta.Accessor(obj)
- if err != nil {
- return errors.Wrapf(err, "could not create accessor during webhook")
- }
- // If the object does have a deletion timestamp then we don't want to mutate anything.
- if acc.GetDeletionTimestamp() != nil {
- return nil
- }
-
- switch x := obj.(type) {
- case *appsv1.Deployment:
- switch x.Name {
- case "vpn-shoot":
- extensionswebhook.LogMutation(logger, x.Kind, x.Namespace, x.Name)
- return m.mutateVPNShootDeployment(ctx, x)
- }
- }
- return nil
-}
diff --git a/controllers/provider-packet/pkg/webhook/shoot/shoot_suite_test.go b/controllers/provider-packet/pkg/webhook/shoot/shoot_suite_test.go
deleted file mode 100644
index dd7d7beba..000000000
--- a/controllers/provider-packet/pkg/webhook/shoot/shoot_suite_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package shoot_test
-
-import (
- "testing"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-func TestShoot(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Packet Shoot Webhook Suite")
-}
diff --git a/controllers/provider-packet/pkg/webhook/shoot/vpn_shoot.go b/controllers/provider-packet/pkg/webhook/shoot/vpn_shoot.go
deleted file mode 100644
index b4b3f3ca1..000000000
--- a/controllers/provider-packet/pkg/webhook/shoot/vpn_shoot.go
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package shoot
-
-import (
- "context"
-
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/imagevector"
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- extensionswebhook "github.com/gardener/gardener-extensions/pkg/webhook"
-
- appsv1 "k8s.io/api/apps/v1"
- corev1 "k8s.io/api/core/v1"
-)
-
-const (
- metabotInitContainerName = "metabot"
- metabotVolumeName = "shared-init-config"
- metabotVolumeMountPath = "/init-config"
-)
-
-func (m *mutator) mutateVPNShootDeployment(ctx context.Context, deployment *appsv1.Deployment) error {
- metabotImage, err := imagevector.ImageVector().FindImage(packet.MetabotImageName)
- if err != nil {
- return err
- }
-
- template := &deployment.Spec.Template
- ps := &template.Spec
-
- for _, initContainer := range ps.InitContainers {
- if initContainer.Name == metabotInitContainerName {
- return nil
- }
- }
-
- volumeMount := corev1.VolumeMount{
- Name: metabotVolumeName,
- MountPath: metabotVolumeMountPath,
- }
-
- ps.InitContainers = append(ps.InitContainers, corev1.Container{
- Name: metabotInitContainerName,
- Image: metabotImage.String(),
- Args: []string{
- "ip",
- "4",
- "private",
- "parent",
- "network",
- },
- VolumeMounts: []corev1.VolumeMount{volumeMount},
- })
-
- if c := extensionswebhook.ContainerWithName(ps.Containers, "vpn-shoot"); c != nil {
- c.VolumeMounts = extensionswebhook.EnsureVolumeMountWithName(c.VolumeMounts, volumeMount)
- }
- ps.Volumes = extensionswebhook.EnsureVolumeWithName(ps.Volumes, corev1.Volume{
- Name: metabotVolumeName,
- VolumeSource: corev1.VolumeSource{
- EmptyDir: &corev1.EmptyDirVolumeSource{},
- },
- })
-
- return nil
-}
diff --git a/controllers/provider-packet/pkg/webhook/shoot/vpn_shoot_test.go b/controllers/provider-packet/pkg/webhook/shoot/vpn_shoot_test.go
deleted file mode 100644
index b6464bc2c..000000000
--- a/controllers/provider-packet/pkg/webhook/shoot/vpn_shoot_test.go
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package shoot
-
-import (
- "context"
-
- extensionswebhook "github.com/gardener/gardener-extensions/pkg/webhook"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- appsv1 "k8s.io/api/apps/v1"
- corev1 "k8s.io/api/core/v1"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-var _ = Describe("Mutator", func() {
- Describe("#mutateVPNShootDeployment", func() {
- It("should correctly inject the init container", func() {
- deployment := &appsv1.Deployment{
- ObjectMeta: metav1.ObjectMeta{
- Name: "vpn-shoot",
- Namespace: metav1.NamespaceSystem,
- },
- Spec: appsv1.DeploymentSpec{
- Template: corev1.PodTemplateSpec{
- Spec: corev1.PodSpec{
- Containers: []corev1.Container{
- {
- Name: "vpn-shoot",
- },
- },
- },
- },
- },
- }
-
- mutator := &mutator{}
- err := mutator.mutateVPNShootDeployment(context.TODO(), deployment)
-
- Expect(err).To(Not(HaveOccurred()))
- checkVPNShootDeployment(deployment)
- })
- })
-})
-
-func checkVPNShootDeployment(deployment *appsv1.Deployment) {
- // Check init container
- ic := extensionswebhook.ContainerWithName(deployment.Spec.Template.Spec.InitContainers, metabotInitContainerName)
- Expect(ic).To(Not(BeNil()))
- Expect(ic.Name).To(Equal(metabotInitContainerName))
- Expect(ic.Image).ToNot(BeNil())
- Expect(extensionswebhook.StringWithPrefixIndex(ic.Args, "ip")).NotTo(Equal(-1))
- Expect(extensionswebhook.StringWithPrefixIndex(ic.Args, "4")).NotTo(Equal(-1))
- Expect(extensionswebhook.StringWithPrefixIndex(ic.Args, "private")).NotTo(Equal(-1))
- Expect(extensionswebhook.StringWithPrefixIndex(ic.Args, "parent")).NotTo(Equal(-1))
- Expect(extensionswebhook.StringWithPrefixIndex(ic.Args, "network")).NotTo(Equal(-1))
- Expect(ic.VolumeMounts).To(ContainElement(corev1.VolumeMount{
- Name: metabotVolumeName,
- MountPath: metabotVolumeMountPath,
- }))
-
- // Check that the vpn-shoot container still exists and contains all needed volume mounts
- c := extensionswebhook.ContainerWithName(deployment.Spec.Template.Spec.Containers, "vpn-shoot")
- Expect(c).To(Not(BeNil()))
- Expect(c.VolumeMounts).To(ContainElement(corev1.VolumeMount{
- Name: metabotVolumeName,
- MountPath: metabotVolumeMountPath,
- }))
-
- // Check that the pod spec contains all needed volumes
- Expect(deployment.Spec.Template.Spec.Volumes).To(ContainElement(corev1.Volume{
- Name: metabotVolumeName,
- VolumeSource: corev1.VolumeSource{
- EmptyDir: &corev1.EmptyDirVolumeSource{},
- },
- }))
-}
diff --git a/controllers/provider-packet/test/integration/healthcheck/test.go b/controllers/provider-packet/test/integration/healthcheck/test.go
deleted file mode 100644
index e89f81b2c..000000000
--- a/controllers/provider-packet/test/integration/healthcheck/test.go
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-/**
- Overview
- - Tests the health checks of the extension: provider-packet.
- - Manipulates health check relevant resources and expects the extension-provider to properly report the results as conditions in the respective CRD (ControlPlane(Type Normal) & Worker CRD).
-
- Prerequisites
- - A Shoot exists.
-
- Test-cases:
- 1) ControlPlane
- 1.1) HealthCondition Type: Shoot ControlPlaneHealthy
- - delete the deployment 'cloud-controller-manager' and verify health check conditions in the ControlPlane status.
- 1.2) HealthCondition Type: Shoot SystemComponentsHealthy
- - update the ManagedResource 'extension-controlplane-shoot' with an unhealthy condition and verify health check conditions in the ControlPlane status.
- 2) Worker
- 2.1) HealthCondition Type: Shoot ControlPlaneHealthy
- - delete the deployment 'machine-controller-manager' and verify health check conditions in the Worker status.
- 2.2) HealthCondition Type: Shoot SystemComponentsHealthy
- - update the ManagedResource 'extension-worker-mcm-shoot' with an unhealthy condition and verify health check conditions in the Worker status.
- 2.3) HealthCondition Type: Shoot EveryNodeReady
- - delete a machine of the shoot cluster and verify the health check conditions in the Worker status report a missing node.
- **/
-
-package healthcheck
-
-import (
- "context"
- "fmt"
- "time"
-
- "github.com/gardener/gardener-extensions/controllers/provider-packet/pkg/packet"
- genericcontrolplaneactuator "github.com/gardener/gardener-extensions/pkg/controller/controlplane/genericactuator"
- genericworkeractuator "github.com/gardener/gardener-extensions/pkg/controller/worker/genericactuator"
- healthcheckoperation "github.com/gardener/gardener-extensions/test/integration/healthcheck"
- "github.com/gardener/gardener/pkg/client/kubernetes"
- "k8s.io/apimachinery/pkg/runtime"
-
- gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1"
- "github.com/gardener/gardener/test/framework"
- machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1"
- "github.com/onsi/ginkgo"
- utilruntime "k8s.io/apimachinery/pkg/util/runtime"
-)
-
-const (
- timeout = 10 * time.Minute
- nodeRecreationTimeout = 20 * time.Minute
- setupContextTimeout = 2 * time.Minute
-)
-
-var _ = ginkgo.Describe("Provider-packet integration test: health checks", func() {
- f := createShootFramework()
-
- ginkgo.Context("ControlPlane", func() {
-
- ginkgo.Context("Condition type: ShootControlPlaneHealthy", func() {
- f.Serial().Release().CIt(fmt.Sprintf("ControlPlane CRD should contain unhealthy condition because the deployment '%s' cannot be found in the shoot namespace in the seed", packet.CloudControllerManagerName), func(ctx context.Context) {
- err := healthcheckoperation.ControlPlaneHealthCheckDeleteSeedDeployment(ctx, f, f.Shoot.GetName(), packet.CloudControllerManagerName, gardencorev1beta1.ShootControlPlaneHealthy)
- framework.ExpectNoError(err)
- }, timeout)
- })
-
- ginkgo.Context("Condition type: ShootSystemComponentsHealthy", func() {
- f.Serial().Release().CIt(fmt.Sprintf("ControlPlane CRD should contain unhealthy condition due to ManagedResource ('%s') unhealthy", genericcontrolplaneactuator.ControlPlaneShootChartResourceName), func(ctx context.Context) {
- err := healthcheckoperation.ControlPlaneHealthCheckWithManagedResource(ctx, setupContextTimeout, f, genericcontrolplaneactuator.ControlPlaneShootChartResourceName, gardencorev1beta1.ShootSystemComponentsHealthy)
- framework.ExpectNoError(err)
- }, timeout)
- })
- })
-
- ginkgo.Context("Worker", func() {
-
- ginkgo.Context("Condition type: ShootControlPlaneHealthy", func() {
- f.Serial().Release().CIt(fmt.Sprintf("Worker CRD should contain unhealthy condition because the deployment '%s' cannot be found in the shoot namespace in the seed", packet.MachineControllerManagerName), func(ctx context.Context) {
- err := healthcheckoperation.WorkerHealthCheckDeleteSeedDeployment(ctx, f, f.Shoot.GetName(), packet.MachineControllerManagerName, gardencorev1beta1.ShootControlPlaneHealthy)
- framework.ExpectNoError(err)
- }, timeout)
- })
-
- ginkgo.Context("Condition type: ShootSystemComponentsHealthy", func() {
- f.Serial().Release().CIt(fmt.Sprintf("Worker CRD should contain unhealthy condition due to ManagedResource ('%s') unhealthy", genericworkeractuator.McmShootResourceName), func(ctx context.Context) {
- err := healthcheckoperation.WorkerHealthCheckWithManagedResource(ctx, setupContextTimeout, f, genericworkeractuator.McmShootResourceName, gardencorev1beta1.ShootSystemComponentsHealthy)
- framework.ExpectNoError(err)
- }, timeout)
- })
-
- ginkgo.Context("Condition type: ShootEveryNodeReady", func() {
- f.Serial().Release().CIt("Worker CRD should contain unhealthy condition because not enough machines are available", func(ctx context.Context) {
- err := healthcheckoperation.MachineDeletionHealthCheck(ctx, f)
- framework.ExpectNoError(err)
- }, nodeRecreationTimeout)
- })
- })
-})
-
-func createShootFramework() *framework.ShootFramework {
- extensionSeedScheme := kubernetes.SeedScheme
- seedSchemeBuilder := runtime.NewSchemeBuilder(
- machinev1alpha1.AddToScheme,
- )
- utilruntime.Must(seedSchemeBuilder.AddToScheme(extensionSeedScheme))
- return framework.NewShootFramework(&framework.ShootConfig{
- SeedScheme: nil,
- })
-}
diff --git a/controllers/provider-packet/test/integration/suites/run_suite_test.go b/controllers/provider-packet/test/integration/suites/run_suite_test.go
deleted file mode 100644
index 5489696ec..000000000
--- a/controllers/provider-packet/test/integration/suites/run_suite_test.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2020 Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package shoot_suite_test
-
-import (
- "flag"
- "fmt"
- "os"
- "testing"
-
- _ "github.com/gardener/gardener-extensions/controllers/provider-packet/test/integration/healthcheck"
-
- "github.com/gardener/gardener/test/framework"
- "github.com/gardener/gardener/test/framework/config"
- "github.com/gardener/gardener/test/framework/reporter"
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var (
- configFilePath = flag.String("config", "", "Specify the configuration file")
- esIndex = flag.String("es-index", "gardener-testsuite", "Specify the elastic search index where the report should be ingested")
- reportFilePath = flag.String("report-file", "/tmp/shoot_res.json", "Specify the file to write the test results")
-)
-
-func TestMain(m *testing.M) {
- framework.RegisterShootFrameworkFlags(nil)
- flag.Parse()
-
- if err := config.ParseConfigForFlags(*configFilePath, flag.CommandLine); err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(1)
- }
-
- RegisterFailHandler(Fail)
-
- AfterSuite(func() {
- framework.CommonAfterSuite()
- })
-
- os.Exit(m.Run())
-}
-
-func TestGardenerSuite(t *testing.T) {
- RunSpecsWithDefaultAndCustomReporters(t, "Provider-packet Test Suite", []Reporter{reporter.NewGardenerESReporter(*reportFilePath, *esIndex)})
-}
diff --git a/extensions.yaml b/extensions.yaml
index ce3657cb7..713ea8cf4 100644
--- a/extensions.yaml
+++ b/extensions.yaml
@@ -36,8 +36,7 @@ extensions:
gitHubRepo: https://github.com/gardener/gardener-extensions
path: controllers/provider-alicloud
- name: provider-packet
- gitHubRepo: https://github.com/gardener/gardener-extensions
- path: controllers/provider-packet
+ gitHubRepo: https://github.com/gardener/gardener-extension-provider-packet
- name: provider-vsphere
gitHubRepo: https://github.com/gardener/gardener-extensions
path: controllers/provider-vsphere
diff --git a/go.mod b/go.mod
index e2fc5862d..dfee4a5b4 100644
--- a/go.mod
+++ b/go.mod
@@ -26,7 +26,6 @@ require (
github.com/huandu/xstrings v1.3.0
github.com/onsi/ginkgo v1.10.1
github.com/onsi/gomega v1.7.0
- github.com/packethost/packngo v0.0.0-20181217122008-b3b45f1b4979
github.com/pkg/errors v0.8.1
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v0.0.5
diff --git a/hack/test.sh b/hack/test.sh
index 1ee3a90c9..98dd35e5c 100755
--- a/hack/test.sh
+++ b/hack/test.sh
@@ -20,10 +20,10 @@ DIRNAME="$(echo "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd
source "$DIRNAME/common.sh"
# Network policies tests must only be ran separately.
-SKIP_NETWORKPOLICY_TESTS=$(echo controllers/provider-{alicloud,aws,azure,gcp,openstack,packet,vsphere}/test/e2e/networkpolicies | sed 's/ /,/g')
+SKIP_NETWORKPOLICY_TESTS=$(echo controllers/provider-{alicloud,aws,azure,gcp,openstack,vsphere}/test/e2e/networkpolicies | sed 's/ /,/g')
#skip integration tests
-SKIP_INTEGRATION_TESTS+=$(echo controllers/provider-{alicloud,aws,azure,gcp,openstack,packet,vsphere}/test/integration | sed 's/ /,/g')
+SKIP_INTEGRATION_TESTS+=$(echo controllers/provider-{alicloud,aws,azure,gcp,openstack,vsphere}/test/integration | sed 's/ /,/g')
header_text "Test"
echo ${SKIP_INTEGRATION_TESTS}
diff --git a/vendor/github.com/packethost/packngo/.drone.yml b/vendor/github.com/packethost/packngo/.drone.yml
deleted file mode 100644
index 88ac5fd0f..000000000
--- a/vendor/github.com/packethost/packngo/.drone.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-workspace:
- base: /go
- path: src/github.com/packethost/packngo
-
-pipeline:
- lint:
- image: golang:1.9
- commands:
- - go get -v -u github.com/alecthomas/gometalinter
- - gometalinter --install
- - go get -v -t ./...
- - |
- gometalinter --disable=gas ./... || :
- - |
- gometalinter --disable-all --enable=gas ./... || :
- - |
- gofmt -d . | (! grep '.') || ok=false
- - if ! $ok; then exit 1; fi
-
- build:
- image: golang:1.9
- commands:
- - go build -i -v ./...
-
- test:
- image: golang:1.9
- commands:
- - go test ./...
diff --git a/vendor/github.com/packethost/packngo/.gitignore b/vendor/github.com/packethost/packngo/.gitignore
deleted file mode 100644
index 55510dc77..000000000
--- a/vendor/github.com/packethost/packngo/.gitignore
+++ /dev/null
@@ -1,29 +0,0 @@
-### Go template
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
-*.test
-*.prof
-*.swp
-
-# idea
-.idea**/**
diff --git a/vendor/github.com/packethost/packngo/CHANGELOG.md b/vendor/github.com/packethost/packngo/CHANGELOG.md
deleted file mode 100644
index 34e5d3114..000000000
--- a/vendor/github.com/packethost/packngo/CHANGELOG.md
+++ /dev/null
@@ -1,54 +0,0 @@
-# Changelog
-All notable changes to this project will be documented in this file.
-
-The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
-This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
-
-## [Unreleased]
-
-This release contains a bunch of fixes to the package api after some more real
-world use. There a few breaks in backwards compatibility, but we are tying to
-minimize them and move towards a 1.0 release.
-
-### Added
-- "acceptance" tests which run against production api (will incur charges)
-- HardwareReservation to Device
-- RootPassword to Device
-- Spot market support
-- Management and Manageable fields to discern between Elastic IPs and device unique IP
-- Support for Volume attachments to Device and Volume
-- Support for ProvisionEvents
-- DoRequest sugar to Client
-- Add ListProject function to the SSHKeys interface
-- Operations for switching between Network Modes, aka "L2 support"
- Support for Organization, Payment Method and Billing address resources
-
-### Fixed
-- User.Emails json tag is fixed to match api response
-- Single error object api response is now handled correctly
-
-### Changed
-- IPService was split to DeviceIPService and ProjectIPService
-- Renamed Device.IPXEScriptUrl -> Device.IPXEScriptURL
-- Renamed DeviceCreateRequest.HostName -> DeviceCreateRequest.Hostname
-- Renamed DeviceCreateRequest.IPXEScriptUrl -> DeviceCreateRequest.IPXEScriptURL
-- Renamed DeviceUpdateRequest.HostName -> DeviceUpdateRequest.Hostname
-- Renamed DeviceUpdateRequest.IPXEScriptUrl -> DeviceUpdateRequest.IPXEScriptURL
-- Sync with packet.net api change to /projects/{id}/ips which no longer returns
- the address in CIDR form
-- Removed package level exported functions that should have never existed
-
-## [0.1.0] - 2017-08-17
-
-Initial release, supports most of the api for interacting with:
-
-- Plans
-- Users
-- Emails
-- SSH Keys
-- Devices
-- Projects
-- Facilities
-- Operating Systems
-- IP Reservations
-- Volumes
diff --git a/vendor/github.com/packethost/packngo/LICENSE.txt b/vendor/github.com/packethost/packngo/LICENSE.txt
deleted file mode 100644
index 57c50110c..000000000
--- a/vendor/github.com/packethost/packngo/LICENSE.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-Copyright (c) 2014 The packngo AUTHORS. All rights reserved.
-
-MIT License
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-======================
-Portions of the client are based on code at:
-https://github.com/google/go-github/ and
-https://github.com/digitalocean/godo
-
-Copyright (c) 2013 The go-github AUTHORS. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
diff --git a/vendor/github.com/packethost/packngo/README.md b/vendor/github.com/packethost/packngo/README.md
deleted file mode 100644
index 307c4eef7..000000000
--- a/vendor/github.com/packethost/packngo/README.md
+++ /dev/null
@@ -1,127 +0,0 @@
-# packngo
-Packet Go Api Client
-
-![](https://www.packet.net/media/images/xeiw-packettwitterprofilew.png)
-
-
-Installation
-------------
-
-`go get github.com/packethost/packngo`
-
-Usage
------
-
-To authenticate to the Packet API, you must have your API token exported in env var `PACKET_AUTH_TOKEN`.
-
-This code snippet initializes Packet API client, and lists your Projects:
-
-```go
-package main
-
-import (
- "log"
-
- "github.com/packethost/packngo"
-)
-
-func main() {
- c, err := packngo.NewClient()
- if err != nil {
- log.Fatal(err)
- }
-
- ps, _, err := c.Projects.List(nil)
- if err != nil {
- log.Fatal(err)
- }
- for _, p := range ps {
- log.Println(p.ID, p.Name)
- }
-}
-
-```
-
-This lib is used by the official [terraform-provider-packet](https://github.com/terraform-providers/terraform-provider-packet).
-
-You can also learn a lot from the `*_test.go` sources. Almost all out tests touch the Packet API, so you can see how auth, querying and POSTing works. For example [devices_test.go](devices_test.go).
-
-
-Linked resources in Get\* and List\* functions
-----------------------------------------------
-Most of the Get and List functions have *GetOptions resp. *ListOptions paramters. If you supply them, you can specify which attributes of resources in the return set can be excluded or included. This is useful for linked resources, e.g members of a project, devices in a project.
-
-Linked resources usually have only the `Href` attribute populated, allowing you to fetch them in another API call. But if you explicitly `include` the linked resoruce attribute, it will be populated in the result set of the linking resource.
-
-For example, if you want to list users in a project, you can fetch the project via `Projects.Get(pid, nil)` call. Result from the call will be a Project struct which has `Users []User` attribute. The items in the `[]User` slice only have the URL attribute non-zero, the rest of the fields will be type defaults. You can then parse the ID of the User resources and fetch them consequently. Or, you can use the ListOptions struct in the project fetch call to include the Users (`members` JSON tag) as
-
-```go
-Projects.Get(pid, &packngo.ListOptions{Includes: []{'members'}})`
-```
-
-Then, every item in the `[]User` slice will have all (not only the URL) attributes populated. Following code illustrates the Includes and Excludes.
-
-
-
-```go
-import (
- "log"
-
- "github.com/packethost/packngo"
-)
-
-func listProjectsAndUsers(lo *packngo.ListOptions) {
- c, err := packngo.NewClient()
- if err != nil {
- log.Fatal(err)
- }
-
- ps, _, err := c.Projects.List(lo)
- if err != nil {
- log.Fatal(err)
- }
- log.Printf("Listing for listOptions %+v\n", lo)
- for _, p := range ps {
- log.Printf("project resource %s has %d users", p.Name, len(p.Users))
- for _, u := range p.Users {
- if u.Email != "" && u.FullName != "" {
- log.Printf(" user %s has email %s\n", u.FullName, u.Email)
- } else {
- log.Printf(" only got user link %s\n", u.URL)
- }
- }
- }
-}
-
-func main() {
- loMembers := &packngo.ListOptions{Includes: []string{"members"}}
- loMembersOut := &packngo.ListOptions{Excludes: []string{"members"}}
- listProjectsAndUsers(loMembers)
- listProjectsAndUsers(nil)
- listProjectsAndUsers(loMembersOut)
-}
-```
-
-
-Acceptance Tests
-----------------
-
-If you want to run tests against the actual Packet API, you must set envvar `PACKET_TEST_ACTUAL_API` to non-empty string for the `go test`. The device tests wait for the device creation, so it's best to run a few in parallel.
-
-To run a particular test, you can do
-
-```
-$ PACKNGO_TEST_ACTUAL_API=1 go test -v -run=TestAccDeviceBasic
-```
-
-If you want to see HTTP requests, set the `PACKNGO_DEBUG` env var to non-empty string, for example:
-
-```
-$ PACKNGO_DEBUG=1 PACKNGO_TEST_ACTUAL_API=1 go test -v -run=TestAccVolumeUpdate
-```
-
-
-Committing
-----------
-
-Before committing, it's a good idea to run `gofmt -w *.go`. ([gofmt](https://golang.org/cmd/gofmt/))
diff --git a/vendor/github.com/packethost/packngo/batches.go b/vendor/github.com/packethost/packngo/batches.go
deleted file mode 100644
index ca314b37f..000000000
--- a/vendor/github.com/packethost/packngo/batches.go
+++ /dev/null
@@ -1,97 +0,0 @@
-package packngo
-
-import (
- "fmt"
-)
-
-const batchBasePath = "/batches"
-
-// BatchService interface defines available batch methods
-type BatchService interface {
- Get(batchID string, getOpt *GetOptions) (*Batch, *Response, error)
- List(ProjectID string, listOpt *ListOptions) ([]Batch, *Response, error)
- Create(projectID string, batches *BatchCreateRequest) ([]Batch, *Response, error)
- Delete(string, bool) (*Response, error)
-}
-
-// Batch type
-type Batch struct {
- ID string `json:"id"`
- State string `json:"state,omitempty"`
- Quantity int32 `json:"quantity,omitempty"`
- CreatedAt *Timestamp `json:"created_at,omitempty"`
- Href string `json:"href,omitempty"`
- Project Href `json:"project,omitempty"`
- Devices []Device `json:"devices,omitempty"`
-}
-
-//BatchesList represents collection of batches
-type batchesList struct {
- Batches []Batch `json:"batches,omitempty"`
-}
-
-// BatchCreateRequest type used to create batch of device instances
-type BatchCreateRequest struct {
- Batches []BatchCreateDevice `json:"batches"`
-}
-
-// BatchCreateDevice type used to describe batch instances
-type BatchCreateDevice struct {
- DeviceCreateRequest
- Quantity int32 `json:"quantity"`
- FacilityDiversityLevel int32 `json:"facility_diversity_level,omitempty"`
-}
-
-// BatchServiceOp implements BatchService
-type BatchServiceOp struct {
- client *Client
-}
-
-// Get returns batch details
-func (s *BatchServiceOp) Get(batchID string, getOpt *GetOptions) (*Batch, *Response, error) {
- params := createGetOptionsURL(getOpt)
- path := fmt.Sprintf("%s/%s?%s", batchBasePath, batchID, params)
- batch := new(Batch)
-
- resp, err := s.client.DoRequest("GET", path, nil, batch)
- if err != nil {
- return nil, resp, err
- }
-
- return batch, resp, err
-}
-
-// List returns batches on a project
-func (s *BatchServiceOp) List(projectID string, listOpt *ListOptions) (batches []Batch, resp *Response, err error) {
- params := createListOptionsURL(listOpt)
- path := fmt.Sprintf("%s/%s%s?%s", projectBasePath, projectID, batchBasePath, params)
- subset := new(batchesList)
- resp, err = s.client.DoRequest("GET", path, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- batches = append(batches, subset.Batches...)
- return batches, resp, err
-}
-
-// Create function to create batch of device instances
-func (s *BatchServiceOp) Create(projectID string, request *BatchCreateRequest) ([]Batch, *Response, error) {
- path := fmt.Sprintf("%s/%s/devices/batch", projectBasePath, projectID)
-
- batches := new(batchesList)
- resp, err := s.client.DoRequest("POST", path, request, batches)
-
- if err != nil {
- return nil, resp, err
- }
-
- return batches.Batches, resp, err
-}
-
-// Delete function to remove an instance batch
-func (s *BatchServiceOp) Delete(id string, removeDevices bool) (*Response, error) {
- path := fmt.Sprintf("%s/%s?remove_associated_instances=%t", batchBasePath, id, removeDevices)
-
- return s.client.DoRequest("DELETE", path, nil, nil)
-}
diff --git a/vendor/github.com/packethost/packngo/bgp_configs.go b/vendor/github.com/packethost/packngo/bgp_configs.go
deleted file mode 100644
index aa21c5561..000000000
--- a/vendor/github.com/packethost/packngo/bgp_configs.go
+++ /dev/null
@@ -1,81 +0,0 @@
-package packngo
-
-import "fmt"
-
-var bgpConfigBasePath = "/bgp-config"
-
-// BGPConfigService interface defines available BGP config methods
-type BGPConfigService interface {
- Get(projectID string, getOpt *GetOptions) (*BGPConfig, *Response, error)
- Create(string, CreateBGPConfigRequest) (*Response, error)
- // Delete(configID string) (resp *Response, err error) TODO: Not in Packet API
-}
-
-// BGPConfigServiceOp implements BgpConfigService
-type BGPConfigServiceOp struct {
- client *Client
-}
-
-// CreateBGPConfigRequest struct
-type CreateBGPConfigRequest struct {
- DeploymentType string `json:"deployment_type,omitempty"`
- Asn int `json:"asn,omitempty"`
- Md5 string `json:"md5,omitempty"`
- UseCase string `json:"use_case,omitempty"`
-}
-
-// BGPConfig represents a Packet BGP Config
-type BGPConfig struct {
- ID string `json:"id,omitempty"`
- Status string `json:"status,omitempty"`
- DeploymentType string `json:"deployment_type,omitempty"`
- Asn int `json:"asn,omitempty"`
- RouteObject string `json:"route_object,omitempty"`
- Md5 string `json:"md5,omitempty"`
- MaxPrefix int `json:"max_prefix,omitempty"`
- Project Project `json:"project,omitempty"`
- CreatedAt Timestamp `json:"created_at,omitempty"`
- RequestedAt Timestamp `json:"requested_at,omitempty"`
- Sessions []BGPSession `json:"sessions,omitempty"`
- Href string `json:"href,omitempty"`
-}
-
-// Create function
-func (s *BGPConfigServiceOp) Create(projectID string, request CreateBGPConfigRequest) (*Response, error) {
- path := fmt.Sprintf("%s/%s%ss", projectBasePath, projectID, bgpConfigBasePath)
-
- resp, err := s.client.DoRequest("POST", path, request, nil)
- if err != nil {
- return resp, err
- }
-
- return resp, err
-}
-
-// Get function
-func (s *BGPConfigServiceOp) Get(projectID string, getOpt *GetOptions) (bgpConfig *BGPConfig, resp *Response, err error) {
- params := createGetOptionsURL(getOpt)
-
- path := fmt.Sprintf("%s/%s%s?%s", projectBasePath, projectID, bgpConfigBasePath, params)
-
- subset := new(BGPConfig)
-
- resp, err = s.client.DoRequest("GET", path, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- return subset, resp, err
-}
-
-// Delete function TODO: this is not implemented in the Packet API
-// func (s *BGPConfigServiceOp) Delete(configID string) (resp *Response, err error) {
-// path := fmt.Sprintf("%ss/%s", bgpConfigBasePath, configID)
-
-// resp, err = s.client.DoRequest("DELETE", path, nil, nil)
-// if err != nil {
-// return resp, err
-// }
-
-// return resp, err
-// }
diff --git a/vendor/github.com/packethost/packngo/bgp_sessions.go b/vendor/github.com/packethost/packngo/bgp_sessions.go
deleted file mode 100644
index b18f6fa1a..000000000
--- a/vendor/github.com/packethost/packngo/bgp_sessions.go
+++ /dev/null
@@ -1,70 +0,0 @@
-package packngo
-
-import "fmt"
-
-var bgpSessionBasePath = "/bgp/sessions"
-
-// BGPSessionService interface defines available BGP session methods
-type BGPSessionService interface {
- Get(string, *GetOptions) (*BGPSession, *Response, error)
- Create(string, CreateBGPSessionRequest) (*BGPSession, *Response, error)
- Delete(string) (*Response, error)
-}
-
-type bgpSessionsRoot struct {
- Sessions []BGPSession `json:"bgp_sessions"`
- Meta meta `json:"meta"`
-}
-
-// BGPSessionServiceOp implements BgpSessionService
-type BGPSessionServiceOp struct {
- client *Client
-}
-
-// BGPSession represents a Packet BGP Session
-type BGPSession struct {
- ID string `json:"id,omitempty"`
- Status string `json:"status,omitempty"`
- LearnedRoutes []string `json:"learned_routes,omitempty"`
- AddressFamily string `json:"address_family,omitempty"`
- Device Device `json:"device,omitempty"`
- Href string `json:"href,omitempty"`
-}
-
-// CreateBGPSessionRequest struct
-type CreateBGPSessionRequest struct {
- AddressFamily string `json:"address_family"`
-}
-
-// Create function
-func (s *BGPSessionServiceOp) Create(deviceID string, request CreateBGPSessionRequest) (*BGPSession, *Response, error) {
- path := fmt.Sprintf("%s/%s%s", deviceBasePath, deviceID, bgpSessionBasePath)
- session := new(BGPSession)
-
- resp, err := s.client.DoRequest("POST", path, request, session)
- if err != nil {
- return nil, resp, err
- }
-
- return session, resp, err
-}
-
-// Delete function
-func (s *BGPSessionServiceOp) Delete(id string) (*Response, error) {
- path := fmt.Sprintf("%s/%s", bgpSessionBasePath, id)
-
- return s.client.DoRequest("DELETE", path, nil, nil)
-}
-
-// Get function
-func (s *BGPSessionServiceOp) Get(id string, getOpt *GetOptions) (session *BGPSession, response *Response, err error) {
- params := createGetOptionsURL(getOpt)
- path := fmt.Sprintf("%s/%s?%s", bgpSessionBasePath, id, params)
- session = new(BGPSession)
- response, err = s.client.DoRequest("GET", path, nil, session)
- if err != nil {
- return nil, response, err
- }
-
- return session, response, err
-}
diff --git a/vendor/github.com/packethost/packngo/billing_address.go b/vendor/github.com/packethost/packngo/billing_address.go
deleted file mode 100644
index 93255b322..000000000
--- a/vendor/github.com/packethost/packngo/billing_address.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package packngo
-
-type BillingAddress struct {
- StreetAddress string `json:"street_address,omitempty"`
- PostalCode string `json:"postal_code,omitempty"`
- CountryCode string `json:"country_code_alpha2,omitempty"`
-}
diff --git a/vendor/github.com/packethost/packngo/capacities.go b/vendor/github.com/packethost/packngo/capacities.go
deleted file mode 100644
index fa51413be..000000000
--- a/vendor/github.com/packethost/packngo/capacities.go
+++ /dev/null
@@ -1,79 +0,0 @@
-package packngo
-
-const capacityBasePath = "/capacity"
-
-// CapacityService interface defines available capacity methods
-type CapacityService interface {
- List() (*CapacityReport, *Response, error)
- Check(*CapacityInput) (*CapacityInput, *Response, error)
-}
-
-// CapacityInput struct
-type CapacityInput struct {
- Servers []ServerInfo `json:"servers,omitempty"`
-}
-
-// ServerInfo struct
-type ServerInfo struct {
- Facility string `json:"facility,omitempty"`
- Plan string `json:"plan,omitempty"`
- Quantity int `json:"quantity,omitempty"`
- Available bool `json:"available,omitempty"`
-}
-
-type capacityRoot struct {
- Capacity CapacityReport `json:"capacity,omitempty"`
-}
-
-// CapacityReport map
-type CapacityReport map[string]map[string]CapacityPerBaremetal
-
-// // CapacityPerFacility struct
-// type CapacityPerFacility struct {
-// T1SmallX86 *CapacityPerBaremetal `json:"t1.small.x86,omitempty"`
-// C1SmallX86 *CapacityPerBaremetal `json:"c1.small.x86,omitempty"`
-// M1XlargeX86 *CapacityPerBaremetal `json:"m1.xlarge.x86,omitempty"`
-// C1XlargeX86 *CapacityPerBaremetal `json:"c1.xlarge.x86,omitempty"`
-
-// Baremetal0 *CapacityPerBaremetal `json:"baremetal_0,omitempty"`
-// Baremetal1 *CapacityPerBaremetal `json:"baremetal_1,omitempty"`
-// Baremetal1e *CapacityPerBaremetal `json:"baremetal_1e,omitempty"`
-// Baremetal2 *CapacityPerBaremetal `json:"baremetal_2,omitempty"`
-// Baremetal2a *CapacityPerBaremetal `json:"baremetal_2a,omitempty"`
-// Baremetal2a2 *CapacityPerBaremetal `json:"baremetal_2a2,omitempty"`
-// Baremetal3 *CapacityPerBaremetal `json:"baremetal_3,omitempty"`
-// }
-
-// CapacityPerBaremetal struct
-type CapacityPerBaremetal struct {
- Level string `json:"level,omitempty"`
-}
-
-// CapacityList struct
-type CapacityList struct {
- Capacity CapacityReport `json:"capacity,omitempty"`
-}
-
-// CapacityServiceOp implements CapacityService
-type CapacityServiceOp struct {
- client *Client
-}
-
-// List returns a list of facilities and plans with their current capacity.
-func (s *CapacityServiceOp) List() (*CapacityReport, *Response, error) {
- root := new(capacityRoot)
-
- resp, err := s.client.DoRequest("GET", capacityBasePath, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return &root.Capacity, nil, nil
-}
-
-// Check validates if a deploy can be fulfilled.
-func (s *CapacityServiceOp) Check(input *CapacityInput) (cap *CapacityInput, resp *Response, err error) {
- cap = new(CapacityInput)
- resp, err = s.client.DoRequest("POST", capacityBasePath, input, cap)
- return cap, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/devices.go b/vendor/github.com/packethost/packngo/devices.go
deleted file mode 100644
index 277436334..000000000
--- a/vendor/github.com/packethost/packngo/devices.go
+++ /dev/null
@@ -1,279 +0,0 @@
-package packngo
-
-import (
- "fmt"
-)
-
-const deviceBasePath = "/devices"
-
-// DeviceService interface defines available device methods
-type DeviceService interface {
- List(ProjectID string, listOpt *ListOptions) ([]Device, *Response, error)
- Get(DeviceID string, getOpt *GetOptions) (*Device, *Response, error)
- Create(*DeviceCreateRequest) (*Device, *Response, error)
- Update(string, *DeviceUpdateRequest) (*Device, *Response, error)
- Delete(string) (*Response, error)
- Reboot(string) (*Response, error)
- PowerOff(string) (*Response, error)
- PowerOn(string) (*Response, error)
- Lock(string) (*Response, error)
- Unlock(string) (*Response, error)
- ListBGPSessions(deviceID string, listOpt *ListOptions) ([]BGPSession, *Response, error)
- ListEvents(string, *ListOptions) ([]Event, *Response, error)
-}
-
-type devicesRoot struct {
- Devices []Device `json:"devices"`
- Meta meta `json:"meta"`
-}
-
-// Device represents a Packet device
-type Device struct {
- ID string `json:"id"`
- Href string `json:"href,omitempty"`
- Hostname string `json:"hostname,omitempty"`
- State string `json:"state,omitempty"`
- Created string `json:"created_at,omitempty"`
- Updated string `json:"updated_at,omitempty"`
- Locked bool `json:"locked,omitempty"`
- BillingCycle string `json:"billing_cycle,omitempty"`
- Storage map[string]interface{} `json:"storage,omitempty"`
- Tags []string `json:"tags,omitempty"`
- Network []*IPAddressAssignment `json:"ip_addresses"`
- Volumes []*Volume `json:"volumes"`
- OS *OS `json:"operating_system,omitempty"`
- Plan *Plan `json:"plan,omitempty"`
- Facility *Facility `json:"facility,omitempty"`
- Project *Project `json:"project,omitempty"`
- ProvisionEvents []*Event `json:"provisioning_events,omitempty"`
- ProvisionPer float32 `json:"provisioning_percentage,omitempty"`
- UserData string `json:"userdata,omitempty"`
- RootPassword string `json:"root_password,omitempty"`
- IPXEScriptURL string `json:"ipxe_script_url,omitempty"`
- AlwaysPXE bool `json:"always_pxe,omitempty"`
- HardwareReservation Href `json:"hardware_reservation,omitempty"`
- SpotInstance bool `json:"spot_instance,omitempty"`
- SpotPriceMax float64 `json:"spot_price_max,omitempty"`
- TerminationTime *Timestamp `json:"termination_time,omitempty"`
- NetworkPorts []Port `json:"network_ports,omitempty"`
- CustomData map[string]interface{} `json:"customdata,omitempty"`
- SSHKeys []SSHKey `json:"ssh_keys,omitempty"`
-}
-
-func (d Device) String() string {
- return Stringify(d)
-}
-
-// DeviceCreateRequest type used to create a Packet device
-type DeviceCreateRequest struct {
- Hostname string `json:"hostname"`
- Plan string `json:"plan"`
- Facility []string `json:"facility"`
- OS string `json:"operating_system"`
- BillingCycle string `json:"billing_cycle"`
- ProjectID string `json:"project_id"`
- UserData string `json:"userdata"`
- Storage string `json:"storage,omitempty"`
- Tags []string `json:"tags"`
- IPXEScriptURL string `json:"ipxe_script_url,omitempty"`
- PublicIPv4SubnetSize int `json:"public_ipv4_subnet_size,omitempty"`
- AlwaysPXE bool `json:"always_pxe,omitempty"`
- HardwareReservationID string `json:"hardware_reservation_id,omitempty"`
- SpotInstance bool `json:"spot_instance,omitempty"`
- SpotPriceMax float64 `json:"spot_price_max,omitempty,string"`
- TerminationTime *Timestamp `json:"termination_time,omitempty"`
- CustomData string `json:"customdata,omitempty"`
- // UserSSHKeys is a list of user UUIDs - essentialy a list of
- // collaborators. The users must be a collaborator in the same project
- // where the device is created. The user's SSH keys then go to the
- // device.
- UserSSHKeys []string `json:"user_ssh_keys,omitempty"`
- // Project SSHKeys is a list of SSHKeys resource UUIDs. If this param
- // is supplied, only the listed SSHKeys will go to the device.
- // Any other Project SSHKeys and any User SSHKeys will not be present
- // in the device.
- ProjectSSHKeys []string `json:"project_ssh_keys,omitempty"`
- Features map[string]string `json:"features,omitempty"`
-}
-
-// DeviceUpdateRequest type used to update a Packet device
-type DeviceUpdateRequest struct {
- Hostname *string `json:"hostname,omitempty"`
- Description *string `json:"description,omitempty"`
- UserData *string `json:"userdata,omitempty"`
- Locked *bool `json:"locked,omitempty"`
- Tags *[]string `json:"tags,omitempty"`
- AlwaysPXE *bool `json:"always_pxe,omitempty"`
- IPXEScriptURL *string `json:"ipxe_script_url,omitempty"`
- CustomData *string `json:"customdata,omitempty"`
-}
-
-func (d DeviceCreateRequest) String() string {
- return Stringify(d)
-}
-
-// DeviceActionRequest type used to execute actions on devices
-type DeviceActionRequest struct {
- Type string `json:"type"`
-}
-
-func (d DeviceActionRequest) String() string {
- return Stringify(d)
-}
-
-// DeviceServiceOp implements DeviceService
-type DeviceServiceOp struct {
- client *Client
-}
-
-// List returns devices on a project
-func (s *DeviceServiceOp) List(projectID string, listOpt *ListOptions) (devices []Device, resp *Response, err error) {
- listOpt = makeSureListOptionsInclude(listOpt, "facility")
- params := createListOptionsURL(listOpt)
- path := fmt.Sprintf("%s/%s%s?%s", projectBasePath, projectID, deviceBasePath, params)
-
- for {
- subset := new(devicesRoot)
-
- resp, err = s.client.DoRequest("GET", path, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- devices = append(devices, subset.Devices...)
-
- if subset.Meta.Next != nil && (listOpt == nil || listOpt.Page == 0) {
- path = subset.Meta.Next.Href
- if params != "" {
- path = fmt.Sprintf("%s&%s", path, params)
- }
- continue
- }
-
- return
- }
-}
-
-// Get returns a device by id
-func (s *DeviceServiceOp) Get(deviceID string, getOpt *GetOptions) (*Device, *Response, error) {
- getOpt = makeSureGetOptionsInclude(getOpt, "facility")
- params := createGetOptionsURL(getOpt)
-
- path := fmt.Sprintf("%s/%s?%s", deviceBasePath, deviceID, params)
- device := new(Device)
- resp, err := s.client.DoRequest("GET", path, nil, device)
- if err != nil {
- return nil, resp, err
- }
- return device, resp, err
-}
-
-// Create creates a new device
-func (s *DeviceServiceOp) Create(createRequest *DeviceCreateRequest) (*Device, *Response, error) {
- path := fmt.Sprintf("%s/%s%s", projectBasePath, createRequest.ProjectID, deviceBasePath)
- device := new(Device)
-
- resp, err := s.client.DoRequest("POST", path, createRequest, device)
- if err != nil {
- return nil, resp, err
- }
-
- return device, resp, err
-}
-
-// Update updates an existing device
-func (s *DeviceServiceOp) Update(deviceID string, updateRequest *DeviceUpdateRequest) (*Device, *Response, error) {
- path := fmt.Sprintf("%s/%s?include=facility", deviceBasePath, deviceID)
- device := new(Device)
-
- resp, err := s.client.DoRequest("PUT", path, updateRequest, device)
- if err != nil {
- return nil, resp, err
- }
-
- return device, resp, err
-}
-
-// Delete deletes a device
-func (s *DeviceServiceOp) Delete(deviceID string) (*Response, error) {
- path := fmt.Sprintf("%s/%s", deviceBasePath, deviceID)
-
- return s.client.DoRequest("DELETE", path, nil, nil)
-}
-
-// Reboot reboots on a device
-func (s *DeviceServiceOp) Reboot(deviceID string) (*Response, error) {
- path := fmt.Sprintf("%s/%s/actions", deviceBasePath, deviceID)
- action := &DeviceActionRequest{Type: "reboot"}
-
- return s.client.DoRequest("POST", path, action, nil)
-}
-
-// PowerOff powers on a device
-func (s *DeviceServiceOp) PowerOff(deviceID string) (*Response, error) {
- path := fmt.Sprintf("%s/%s/actions", deviceBasePath, deviceID)
- action := &DeviceActionRequest{Type: "power_off"}
-
- return s.client.DoRequest("POST", path, action, nil)
-}
-
-// PowerOn powers on a device
-func (s *DeviceServiceOp) PowerOn(deviceID string) (*Response, error) {
- path := fmt.Sprintf("%s/%s/actions", deviceBasePath, deviceID)
- action := &DeviceActionRequest{Type: "power_on"}
-
- return s.client.DoRequest("POST", path, action, nil)
-}
-
-type lockType struct {
- Locked bool `json:"locked"`
-}
-
-// Lock sets a device to "locked"
-func (s *DeviceServiceOp) Lock(deviceID string) (*Response, error) {
- path := fmt.Sprintf("%s/%s", deviceBasePath, deviceID)
- action := lockType{Locked: true}
-
- return s.client.DoRequest("PATCH", path, action, nil)
-}
-
-// Unlock sets a device to "unlocked"
-func (s *DeviceServiceOp) Unlock(deviceID string) (*Response, error) {
- path := fmt.Sprintf("%s/%s", deviceBasePath, deviceID)
- action := lockType{Locked: false}
-
- return s.client.DoRequest("PATCH", path, action, nil)
-}
-
-// ListBGPSessions returns all BGP Sessions associated with the device
-func (s *DeviceServiceOp) ListBGPSessions(deviceID string, listOpt *ListOptions) (bgpSessions []BGPSession, resp *Response, err error) {
- params := createListOptionsURL(listOpt)
- path := fmt.Sprintf("%s/%s%s?%s", deviceBasePath, deviceID, bgpSessionBasePath, params)
-
- for {
- subset := new(bgpSessionsRoot)
-
- resp, err = s.client.DoRequest("GET", path, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- bgpSessions = append(bgpSessions, subset.Sessions...)
-
- if subset.Meta.Next != nil && (listOpt == nil || listOpt.Page == 0) {
- path = subset.Meta.Next.Href
- if params != "" {
- path = fmt.Sprintf("%s&%s", path, params)
- }
- continue
- }
- return
- }
-}
-
-// ListEvents returns list of device events
-func (s *DeviceServiceOp) ListEvents(deviceID string, listOpt *ListOptions) ([]Event, *Response, error) {
- path := fmt.Sprintf("%s/%s%s", deviceBasePath, deviceID, eventBasePath)
-
- return listEvents(s.client, path, listOpt)
-}
diff --git a/vendor/github.com/packethost/packngo/email.go b/vendor/github.com/packethost/packngo/email.go
deleted file mode 100644
index acce8999b..000000000
--- a/vendor/github.com/packethost/packngo/email.go
+++ /dev/null
@@ -1,87 +0,0 @@
-package packngo
-
-import "fmt"
-
-const emailBasePath = "/emails"
-
-// EmailRequest type used to add an email address to the current user
-type EmailRequest struct {
- Address string `json:"address,omitempty"`
- Default *bool `json:"default,omitempty"`
-}
-
-// EmailService interface defines available email methods
-type EmailService interface {
- Get(string, *GetOptions) (*Email, *Response, error)
- Create(*EmailRequest) (*Email, *Response, error)
- Update(string, *EmailRequest) (*Email, *Response, error)
- Delete(string) (*Response, error)
-}
-
-// Email represents a user's email address
-type Email struct {
- ID string `json:"id"`
- Address string `json:"address"`
- Default bool `json:"default,omitempty"`
- URL string `json:"href,omitempty"`
-}
-
-func (e Email) String() string {
- return Stringify(e)
-}
-
-// EmailServiceOp implements EmailService
-type EmailServiceOp struct {
- client *Client
-}
-
-// Get retrieves an email by id
-func (s *EmailServiceOp) Get(emailID string, getOpt *GetOptions) (*Email, *Response, error) {
- params := createGetOptionsURL(getOpt)
- path := fmt.Sprintf("%s/%s?%s", emailBasePath, emailID, params)
- email := new(Email)
-
- resp, err := s.client.DoRequest("GET", path, nil, email)
- if err != nil {
- return nil, resp, err
- }
-
- return email, resp, err
-}
-
-// Create adds a new email address to the current user.
-func (s *EmailServiceOp) Create(request *EmailRequest) (*Email, *Response, error) {
- email := new(Email)
-
- resp, err := s.client.DoRequest("POST", emailBasePath, request, email)
- if err != nil {
- return nil, resp, err
- }
-
- return email, resp, err
-}
-
-// Delete removes the email addres from the current user account
-func (s *EmailServiceOp) Delete(emailID string) (*Response, error) {
- path := fmt.Sprintf("%s/%s", emailBasePath, emailID)
-
- resp, err := s.client.DoRequest("DELETE", path, nil, nil)
- if err != nil {
- return resp, err
- }
-
- return resp, err
-}
-
-// Update email parameters
-func (s *EmailServiceOp) Update(emailID string, request *EmailRequest) (*Email, *Response, error) {
- email := new(Email)
- path := fmt.Sprintf("%s/%s", emailBasePath, emailID)
-
- resp, err := s.client.DoRequest("PUT", path, request, email)
- if err != nil {
- return nil, resp, err
- }
-
- return email, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/events.go b/vendor/github.com/packethost/packngo/events.go
deleted file mode 100644
index 78ec9b7f5..000000000
--- a/vendor/github.com/packethost/packngo/events.go
+++ /dev/null
@@ -1,104 +0,0 @@
-package packngo
-
-import "fmt"
-
-const eventBasePath = "/events"
-
-// Event struct
-type Event struct {
- ID string `json:"id,omitempty"`
- State string `json:"state,omitempty"`
- Type string `json:"type,omitempty"`
- Body string `json:"body,omitempty"`
- Relationships []Href `json:"relationships,omitempty"`
- Interpolated string `json:"interpolated,omitempty"`
- CreatedAt *Timestamp `json:"created_at,omitempty"`
- Href string `json:"href,omitempty"`
-}
-
-type eventsRoot struct {
- Events []Event `json:"events,omitempty"`
- Meta meta `json:"meta,omitempty"`
-}
-
-// EventService interface defines available event functions
-type EventService interface {
- List(*ListOptions) ([]Event, *Response, error)
- Get(string, *GetOptions) (*Event, *Response, error)
-}
-
-// EventServiceOp implements EventService
-type EventServiceOp struct {
- client *Client
-}
-
-// List returns all events
-func (s *EventServiceOp) List(listOpt *ListOptions) ([]Event, *Response, error) {
- return listEvents(s.client, eventBasePath, listOpt)
-}
-
-// Get returns an event by ID
-func (s *EventServiceOp) Get(eventID string, getOpt *GetOptions) (*Event, *Response, error) {
- path := fmt.Sprintf("%s/%s", eventBasePath, eventID)
- return get(s.client, path, getOpt)
-}
-
-// list helper function for all event functions
-func listEvents(client *Client, path string, listOpt *ListOptions) (events []Event, resp *Response, err error) {
- params := createListOptionsURL(listOpt)
- path = fmt.Sprintf("%s?%s", path, params)
-
- for {
- subset := new(eventsRoot)
-
- resp, err = client.DoRequest("GET", path, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- events = append(events, subset.Events...)
-
- if subset.Meta.Next != nil && (listOpt == nil || listOpt.Page == 0) {
- path = subset.Meta.Next.Href
- if params != "" {
- path = fmt.Sprintf("%s&%s", path, params)
- }
- continue
- }
-
- return
- }
-
-}
-
-// list helper function for all event functions
-/*
-func listEvents(client *Client, path string, listOpt *ListOptions) ([]Event, *Response, error) {
- params := createListOptionsURL(listOpt)
- root := new(eventsRoot)
-
- path = fmt.Sprintf("%s?%s", path, params)
-
- resp, err := client.DoRequest("GET", path, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.Events, resp, err
-}
-*/
-
-func get(client *Client, path string, getOpt *GetOptions) (*Event, *Response, error) {
- params := createGetOptionsURL(getOpt)
-
- event := new(Event)
-
- path = fmt.Sprintf("%s?%s", path, params)
-
- resp, err := client.DoRequest("GET", path, nil, event)
- if err != nil {
- return nil, resp, err
- }
-
- return event, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/facilities.go b/vendor/github.com/packethost/packngo/facilities.go
deleted file mode 100644
index fd4a7bf91..000000000
--- a/vendor/github.com/packethost/packngo/facilities.go
+++ /dev/null
@@ -1,56 +0,0 @@
-package packngo
-
-import "fmt"
-
-const facilityBasePath = "/facilities"
-
-// FacilityService interface defines available facility methods
-type FacilityService interface {
- List(*ListOptions) ([]Facility, *Response, error)
-}
-
-type facilityRoot struct {
- Facilities []Facility `json:"facilities"`
-}
-
-// Facility represents a Packet facility
-type Facility struct {
- ID string `json:"id"`
- Name string `json:"name,omitempty"`
- Code string `json:"code,omitempty"`
- Features []string `json:"features,omitempty"`
- Address *Address `json:"address,omitempty"`
- URL string `json:"href,omitempty"`
-}
-
-func (f Facility) String() string {
- return Stringify(f)
-}
-
-// Address - the physical address of the facility
-type Address struct {
- ID string `json:"id,omitempty"`
-}
-
-func (a Address) String() string {
- return Stringify(a)
-}
-
-// FacilityServiceOp implements FacilityService
-type FacilityServiceOp struct {
- client *Client
-}
-
-// List returns all facilities
-func (s *FacilityServiceOp) List(listOpt *ListOptions) ([]Facility, *Response, error) {
- root := new(facilityRoot)
- params := createListOptionsURL(listOpt)
- path := fmt.Sprintf("%s?%s", facilityBasePath, params)
-
- resp, err := s.client.DoRequest("GET", path, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.Facilities, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/hardware_reservations.go b/vendor/github.com/packethost/packngo/hardware_reservations.go
deleted file mode 100644
index efa3d6269..000000000
--- a/vendor/github.com/packethost/packngo/hardware_reservations.go
+++ /dev/null
@@ -1,94 +0,0 @@
-package packngo
-
-import "fmt"
-
-const hardwareReservationBasePath = "/hardware-reservations"
-
-// HardwareReservationService interface defines available hardware reservation functions
-type HardwareReservationService interface {
- Get(hardwareReservationID string, getOpt *GetOptions) (*HardwareReservation, *Response, error)
- List(projectID string, listOpt *ListOptions) ([]HardwareReservation, *Response, error)
- Move(string, string) (*HardwareReservation, *Response, error)
-}
-
-// HardwareReservationServiceOp implements HardwareReservationService
-type HardwareReservationServiceOp struct {
- client *Client
-}
-
-// HardwareReservation struct
-type HardwareReservation struct {
- ID string `json:"id,omitempty"`
- ShortID string `json:"short_id,omitempty"`
- Facility Facility `json:"facility,omitempty"`
- Plan Plan `json:"plan,omitempty"`
- Href string `json:"href,omitempty"`
- Project Project `json:"project,omitempty"`
- Device *Device `json:"device,omitempty"`
- CreatedAt Timestamp `json:"created_at,omitempty"`
-}
-
-type hardwareReservationRoot struct {
- HardwareReservations []HardwareReservation `json:"hardware_reservations"`
- Meta meta `json:"meta"`
-}
-
-// List returns all hardware reservations for a given project
-func (s *HardwareReservationServiceOp) List(projectID string, listOpt *ListOptions) (reservations []HardwareReservation, resp *Response, err error) {
- root := new(hardwareReservationRoot)
- params := createListOptionsURL(listOpt)
-
- path := fmt.Sprintf("%s/%s%s?%s", projectBasePath, projectID, hardwareReservationBasePath, params)
-
- for {
- subset := new(hardwareReservationRoot)
-
- resp, err = s.client.DoRequest("GET", path, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- reservations = append(reservations, root.HardwareReservations...)
-
- if subset.Meta.Next != nil && (listOpt == nil || listOpt.Page == 0) {
- path = subset.Meta.Next.Href
- if params != "" {
- path = fmt.Sprintf("%s&%s", path, params)
- }
- continue
- }
-
- return
- }
-}
-
-// Get returns a single hardware reservation
-func (s *HardwareReservationServiceOp) Get(hardwareReservationdID string, getOpt *GetOptions) (*HardwareReservation, *Response, error) {
- params := createGetOptionsURL(getOpt)
-
- hardwareReservation := new(HardwareReservation)
-
- path := fmt.Sprintf("%s/%s?%s", hardwareReservationBasePath, hardwareReservationdID, params)
-
- resp, err := s.client.DoRequest("GET", path, nil, hardwareReservation)
- if err != nil {
- return nil, resp, err
- }
-
- return hardwareReservation, resp, err
-}
-
-// Move a hardware reservation to another project
-func (s *HardwareReservationServiceOp) Move(hardwareReservationdID, projectID string) (*HardwareReservation, *Response, error) {
- hardwareReservation := new(HardwareReservation)
- path := fmt.Sprintf("%s/%s/%s", hardwareReservationBasePath, hardwareReservationdID, "move")
- body := map[string]string{}
- body["project_id"] = projectID
-
- resp, err := s.client.DoRequest("POST", path, body, hardwareReservation)
- if err != nil {
- return nil, resp, err
- }
-
- return hardwareReservation, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/ip.go b/vendor/github.com/packethost/packngo/ip.go
deleted file mode 100644
index 79501a426..000000000
--- a/vendor/github.com/packethost/packngo/ip.go
+++ /dev/null
@@ -1,196 +0,0 @@
-package packngo
-
-import (
- "fmt"
-)
-
-const ipBasePath = "/ips"
-
-// DeviceIPService handles assignment of addresses from reserved blocks to instances in a project.
-type DeviceIPService interface {
- Assign(deviceID string, assignRequest *AddressStruct) (*IPAddressAssignment, *Response, error)
- Unassign(assignmentID string) (*Response, error)
- Get(assignmentID string, getOpt *GetOptions) (*IPAddressAssignment, *Response, error)
-}
-
-// ProjectIPService handles reservation of IP address blocks for a project.
-type ProjectIPService interface {
- Get(reservationID string, getOpt *GetOptions) (*IPAddressReservation, *Response, error)
- List(projectID string) ([]IPAddressReservation, *Response, error)
- Request(projectID string, ipReservationReq *IPReservationRequest) (*IPAddressReservation, *Response, error)
- Remove(ipReservationID string) (*Response, error)
- AvailableAddresses(ipReservationID string, r *AvailableRequest) ([]string, *Response, error)
-}
-
-type ipAddressCommon struct {
- ID string `json:"id"`
- Address string `json:"address"`
- Gateway string `json:"gateway"`
- Network string `json:"network"`
- AddressFamily int `json:"address_family"`
- Netmask string `json:"netmask"`
- Public bool `json:"public"`
- CIDR int `json:"cidr"`
- Created string `json:"created_at,omitempty"`
- Updated string `json:"updated_at,omitempty"`
- Href string `json:"href"`
- Management bool `json:"management"`
- Manageable bool `json:"manageable"`
- Project Href `json:"project"`
-}
-
-// IPAddressReservation is created when user sends IP reservation request for a project (considering it's within quota).
-type IPAddressReservation struct {
- ipAddressCommon
- Assignments []Href `json:"assignments"`
- Facility Facility `json:"facility,omitempty"`
- Available string `json:"available"`
- Addon bool `json:"addon"`
- Bill bool `json:"bill"`
-}
-
-// AvailableResponse is a type for listing of available addresses from a reserved block.
-type AvailableResponse struct {
- Available []string `json:"available"`
-}
-
-// AvailableRequest is a type for listing available addresses from a reserved block.
-type AvailableRequest struct {
- CIDR int `json:"cidr"`
-}
-
-// IPAddressAssignment is created when an IP address from reservation block is assigned to a device.
-type IPAddressAssignment struct {
- ipAddressCommon
- AssignedTo Href `json:"assigned_to"`
-}
-
-// IPReservationRequest represents the body of a reservation request.
-type IPReservationRequest struct {
- Type string `json:"type"`
- Quantity int `json:"quantity"`
- Comments string `json:"comments"`
- Facility string `json:"facility"`
-}
-
-// AddressStruct is a helper type for request/response with dict like {"address": ... }
-type AddressStruct struct {
- Address string `json:"address"`
-}
-
-func deleteFromIP(client *Client, resourceID string) (*Response, error) {
- path := fmt.Sprintf("%s/%s", ipBasePath, resourceID)
-
- return client.DoRequest("DELETE", path, nil, nil)
-}
-
-func (i IPAddressReservation) String() string {
- return Stringify(i)
-}
-
-func (i IPAddressAssignment) String() string {
- return Stringify(i)
-}
-
-// DeviceIPServiceOp is interface for IP-address assignment methods.
-type DeviceIPServiceOp struct {
- client *Client
-}
-
-// Unassign unassigns an IP address from the device to which it is currently assigned.
-// This will remove the relationship between an IP and the device and will make the IP
-// address available to be assigned to another device.
-func (i *DeviceIPServiceOp) Unassign(assignmentID string) (*Response, error) {
- return deleteFromIP(i.client, assignmentID)
-}
-
-// Assign assigns an IP address to a device.
-// The IP address must be in one of the IP ranges assigned to the device’s project.
-func (i *DeviceIPServiceOp) Assign(deviceID string, assignRequest *AddressStruct) (*IPAddressAssignment, *Response, error) {
- path := fmt.Sprintf("%s/%s%s", deviceBasePath, deviceID, ipBasePath)
- ipa := new(IPAddressAssignment)
-
- resp, err := i.client.DoRequest("POST", path, assignRequest, ipa)
- if err != nil {
- return nil, resp, err
- }
-
- return ipa, resp, err
-}
-
-// Get returns assignment by ID.
-func (i *DeviceIPServiceOp) Get(assignmentID string, getOpt *GetOptions) (*IPAddressAssignment, *Response, error) {
- params := createGetOptionsURL(getOpt)
- path := fmt.Sprintf("%s/%s?%s", ipBasePath, assignmentID, params)
- ipa := new(IPAddressAssignment)
-
- resp, err := i.client.DoRequest("GET", path, nil, ipa)
- if err != nil {
- return nil, resp, err
- }
-
- return ipa, resp, err
-}
-
-// ProjectIPServiceOp is interface for IP assignment methods.
-type ProjectIPServiceOp struct {
- client *Client
-}
-
-// Get returns reservation by ID.
-func (i *ProjectIPServiceOp) Get(reservationID string, getOpt *GetOptions) (*IPAddressReservation, *Response, error) {
- params := createGetOptionsURL(getOpt)
- path := fmt.Sprintf("%s/%s?%s", ipBasePath, reservationID, params)
- ipr := new(IPAddressReservation)
-
- resp, err := i.client.DoRequest("GET", path, nil, ipr)
- if err != nil {
- return nil, resp, err
- }
-
- return ipr, resp, err
-}
-
-// List provides a list of IP resevations for a single project.
-func (i *ProjectIPServiceOp) List(projectID string) ([]IPAddressReservation, *Response, error) {
- path := fmt.Sprintf("%s/%s%s", projectBasePath, projectID, ipBasePath)
- reservations := new(struct {
- Reservations []IPAddressReservation `json:"ip_addresses"`
- })
-
- resp, err := i.client.DoRequest("GET", path, nil, reservations)
- if err != nil {
- return nil, resp, err
- }
- return reservations.Reservations, resp, nil
-}
-
-// Request requests more IP space for a project in order to have additional IP addresses to assign to devices.
-func (i *ProjectIPServiceOp) Request(projectID string, ipReservationReq *IPReservationRequest) (*IPAddressReservation, *Response, error) {
- path := fmt.Sprintf("%s/%s%s", projectBasePath, projectID, ipBasePath)
- ipr := new(IPAddressReservation)
-
- resp, err := i.client.DoRequest("POST", path, ipReservationReq, ipr)
- if err != nil {
- return nil, resp, err
- }
- return ipr, resp, err
-}
-
-// Remove removes an IP reservation from the project.
-func (i *ProjectIPServiceOp) Remove(ipReservationID string) (*Response, error) {
- return deleteFromIP(i.client, ipReservationID)
-}
-
-// AvailableAddresses lists addresses available from a reserved block
-func (i *ProjectIPServiceOp) AvailableAddresses(ipReservationID string, r *AvailableRequest) ([]string, *Response, error) {
- path := fmt.Sprintf("%s/%s/available?cidr=%d", ipBasePath, ipReservationID, r.CIDR)
- ar := new(AvailableResponse)
-
- resp, err := i.client.DoRequest("GET", path, r, ar)
- if err != nil {
- return nil, resp, err
- }
- return ar.Available, resp, nil
-
-}
diff --git a/vendor/github.com/packethost/packngo/notifications.go b/vendor/github.com/packethost/packngo/notifications.go
deleted file mode 100644
index 051ca56f9..000000000
--- a/vendor/github.com/packethost/packngo/notifications.go
+++ /dev/null
@@ -1,95 +0,0 @@
-package packngo
-
-import "fmt"
-
-const notificationBasePath = "/notifications"
-
-// Notification struct
-type Notification struct {
- ID string `json:"id,omitempty"`
- Type string `json:"type,omitempty"`
- Body string `json:"body,omitempty"`
- Severity string `json:"severity,omitempty"`
- Read bool `json:"read,omitempty"`
- Context string `json:"context,omitempty"`
- CreatedAt Timestamp `json:"created_at,omitempty"`
- UpdatedAt Timestamp `json:"updated_at,omitempty"`
- User Href `json:"user,omitempty"`
- Href string `json:"href,omitempty"`
-}
-
-type notificationsRoot struct {
- Notifications []Notification `json:"notifications,omitempty"`
- Meta meta `json:"meta,omitempty"`
-}
-
-// NotificationService interface defines available event functions
-type NotificationService interface {
- List(*ListOptions) ([]Notification, *Response, error)
- Get(string, *GetOptions) (*Notification, *Response, error)
- MarkAsRead(string) (*Notification, *Response, error)
-}
-
-// NotificationServiceOp implements NotificationService
-type NotificationServiceOp struct {
- client *Client
-}
-
-// List returns all notifications
-func (s *NotificationServiceOp) List(listOpt *ListOptions) ([]Notification, *Response, error) {
- return listNotifications(s.client, notificationBasePath, listOpt)
-}
-
-// Get returns a notification by ID
-func (s *NotificationServiceOp) Get(notificationID string, getOpt *GetOptions) (*Notification, *Response, error) {
- params := createGetOptionsURL(getOpt)
-
- path := fmt.Sprintf("%s/%s?%s", notificationBasePath, notificationID, params)
- return getNotifications(s.client, path)
-}
-
-// Marks notification as read by ID
-func (s *NotificationServiceOp) MarkAsRead(notificationID string) (*Notification, *Response, error) {
- path := fmt.Sprintf("%s/%s", notificationBasePath, notificationID)
- return markAsRead(s.client, path)
-}
-
-// list helper function for all notification functions
-func listNotifications(client *Client, path string, listOpt *ListOptions) ([]Notification, *Response, error) {
- params := createListOptionsURL(listOpt)
-
- root := new(notificationsRoot)
-
- path = fmt.Sprintf("%s?%s", path, params)
-
- resp, err := client.DoRequest("GET", path, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.Notifications, resp, err
-}
-
-func getNotifications(client *Client, path string) (*Notification, *Response, error) {
-
- notification := new(Notification)
-
- resp, err := client.DoRequest("GET", path, nil, notification)
- if err != nil {
- return nil, resp, err
- }
-
- return notification, resp, err
-}
-
-func markAsRead(client *Client, path string) (*Notification, *Response, error) {
-
- notification := new(Notification)
-
- resp, err := client.DoRequest("PUT", path, nil, notification)
- if err != nil {
- return nil, resp, err
- }
-
- return notification, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/operatingsystems.go b/vendor/github.com/packethost/packngo/operatingsystems.go
deleted file mode 100644
index 12aa1bb5b..000000000
--- a/vendor/github.com/packethost/packngo/operatingsystems.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package packngo
-
-const osBasePath = "/operating-systems"
-
-// OSService interface defines available operating_systems methods
-type OSService interface {
- List() ([]OS, *Response, error)
-}
-
-type osRoot struct {
- OperatingSystems []OS `json:"operating_systems"`
-}
-
-// OS represents a Packet operating system
-type OS struct {
- Name string `json:"name"`
- Slug string `json:"slug"`
- Distro string `json:"distro"`
- Version string `json:"version"`
- ProvisionableOn []string `json:"provisionable_on"`
-}
-
-func (o OS) String() string {
- return Stringify(o)
-}
-
-// OSServiceOp implements OSService
-type OSServiceOp struct {
- client *Client
-}
-
-// List returns all available operating systems
-func (s *OSServiceOp) List() ([]OS, *Response, error) {
- root := new(osRoot)
-
- resp, err := s.client.DoRequest("GET", osBasePath, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.OperatingSystems, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/organizations.go b/vendor/github.com/packethost/packngo/organizations.go
deleted file mode 100644
index 03b59c601..000000000
--- a/vendor/github.com/packethost/packngo/organizations.go
+++ /dev/null
@@ -1,171 +0,0 @@
-package packngo
-
-import "fmt"
-
-// API documentation https://www.packet.net/developers/api/organizations/
-const organizationBasePath = "/organizations"
-
-// OrganizationService interface defines available organization methods
-type OrganizationService interface {
- List(*ListOptions) ([]Organization, *Response, error)
- Get(string, *GetOptions) (*Organization, *Response, error)
- Create(*OrganizationCreateRequest) (*Organization, *Response, error)
- Update(string, *OrganizationUpdateRequest) (*Organization, *Response, error)
- Delete(string) (*Response, error)
- ListPaymentMethods(string) ([]PaymentMethod, *Response, error)
- ListEvents(string, *ListOptions) ([]Event, *Response, error)
-}
-
-type organizationsRoot struct {
- Organizations []Organization `json:"organizations"`
- Meta meta `json:"meta"`
-}
-
-// Organization represents a Packet organization
-type Organization struct {
- ID string `json:"id"`
- Name string `json:"name,omitempty"`
- Description string `json:"description,omitempty"`
- Website string `json:"website,omitempty"`
- Twitter string `json:"twitter,omitempty"`
- Created string `json:"created_at,omitempty"`
- Updated string `json:"updated_at,omitempty"`
- Address Address `json:"address,omitempty"`
- TaxID string `json:"tax_id,omitempty"`
- MainPhone string `json:"main_phone,omitempty"`
- BillingPhone string `json:"billing_phone,omitempty"`
- CreditAmount float64 `json:"credit_amount,omitempty"`
- Logo string `json:"logo,omitempty"`
- LogoThumb string `json:"logo_thumb,omitempty"`
- Projects []Project `json:"projects,omitempty"`
- URL string `json:"href,omitempty"`
- Users []User `json:"members,omitempty"`
- Owners []User `json:"owners,omitempty"`
-}
-
-func (o Organization) String() string {
- return Stringify(o)
-}
-
-// OrganizationCreateRequest type used to create a Packet organization
-type OrganizationCreateRequest struct {
- Name string `json:"name"`
- Description string `json:"description"`
- Website string `json:"website"`
- Twitter string `json:"twitter"`
- Logo string `json:"logo"`
-}
-
-func (o OrganizationCreateRequest) String() string {
- return Stringify(o)
-}
-
-// OrganizationUpdateRequest type used to update a Packet organization
-type OrganizationUpdateRequest struct {
- Name *string `json:"name,omitempty"`
- Description *string `json:"description,omitempty"`
- Website *string `json:"website,omitempty"`
- Twitter *string `json:"twitter,omitempty"`
- Logo *string `json:"logo,omitempty"`
-}
-
-func (o OrganizationUpdateRequest) String() string {
- return Stringify(o)
-}
-
-// OrganizationServiceOp implements OrganizationService
-type OrganizationServiceOp struct {
- client *Client
-}
-
-// List returns the user's organizations
-func (s *OrganizationServiceOp) List(listOpt *ListOptions) (orgs []Organization, resp *Response, err error) {
- params := createListOptionsURL(listOpt)
- root := new(organizationsRoot)
-
- path := fmt.Sprintf("%s?%s", organizationBasePath, params)
-
- for {
- resp, err = s.client.DoRequest("GET", path, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- orgs = append(orgs, root.Organizations...)
-
- if root.Meta.Next != nil && (listOpt == nil || listOpt.Page == 0) {
- path = root.Meta.Next.Href
- if params != "" {
- path = fmt.Sprintf("%s&%s", path, params)
- }
- continue
- }
- return
- }
-}
-
-// Get returns a organization by id
-func (s *OrganizationServiceOp) Get(organizationID string, getOpt *GetOptions) (*Organization, *Response, error) {
- params := createGetOptionsURL(getOpt)
- path := fmt.Sprintf("%s/%s?%s", organizationBasePath, organizationID, params)
- organization := new(Organization)
-
- resp, err := s.client.DoRequest("GET", path, nil, organization)
- if err != nil {
- return nil, resp, err
- }
-
- return organization, resp, err
-}
-
-// Create creates a new organization
-func (s *OrganizationServiceOp) Create(createRequest *OrganizationCreateRequest) (*Organization, *Response, error) {
- organization := new(Organization)
-
- resp, err := s.client.DoRequest("POST", organizationBasePath, createRequest, organization)
- if err != nil {
- return nil, resp, err
- }
-
- return organization, resp, err
-}
-
-// Update updates an organization
-func (s *OrganizationServiceOp) Update(id string, updateRequest *OrganizationUpdateRequest) (*Organization, *Response, error) {
- path := fmt.Sprintf("%s/%s", organizationBasePath, id)
- organization := new(Organization)
-
- resp, err := s.client.DoRequest("PATCH", path, updateRequest, organization)
- if err != nil {
- return nil, resp, err
- }
-
- return organization, resp, err
-}
-
-// Delete deletes an organizationID
-func (s *OrganizationServiceOp) Delete(organizationID string) (*Response, error) {
- path := fmt.Sprintf("%s/%s", organizationBasePath, organizationID)
-
- return s.client.DoRequest("DELETE", path, nil, nil)
-}
-
-// ListPaymentMethods returns PaymentMethods for an organization
-func (s *OrganizationServiceOp) ListPaymentMethods(organizationID string) ([]PaymentMethod, *Response, error) {
- url := fmt.Sprintf("%s/%s%s", organizationBasePath, organizationID, paymentMethodBasePath)
- root := new(paymentMethodsRoot)
-
- resp, err := s.client.DoRequest("GET", url, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.PaymentMethods, resp, err
-}
-
-// ListEvents returns list of organization events
-func (s *OrganizationServiceOp) ListEvents(organizationID string, listOpt *ListOptions) ([]Event, *Response, error) {
- path := fmt.Sprintf("%s/%s%s", organizationBasePath, organizationID, eventBasePath)
-
- return listEvents(s.client, path, listOpt)
-}
diff --git a/vendor/github.com/packethost/packngo/packngo.go b/vendor/github.com/packethost/packngo/packngo.go
deleted file mode 100644
index 01f77805c..000000000
--- a/vendor/github.com/packethost/packngo/packngo.go
+++ /dev/null
@@ -1,386 +0,0 @@
-package packngo
-
-import (
- "bytes"
- "encoding/json"
- "fmt"
- "io"
- "io/ioutil"
- "log"
- "net/http"
- "net/http/httputil"
- "net/url"
- "os"
- "strconv"
- "strings"
- "time"
-)
-
-const (
- packetTokenEnvVar = "PACKET_AUTH_TOKEN"
- libraryVersion = "0.1.0"
- baseURL = "https://api.packet.net/"
- userAgent = "packngo/" + libraryVersion
- mediaType = "application/json"
- debugEnvVar = "PACKNGO_DEBUG"
-
- headerRateLimit = "X-RateLimit-Limit"
- headerRateRemaining = "X-RateLimit-Remaining"
- headerRateReset = "X-RateLimit-Reset"
-)
-
-type GetOptions struct {
- Includes []string
- Excludes []string
-}
-
-// ListOptions specifies optional global API parameters
-type ListOptions struct {
- // for paginated result sets, page of results to retrieve
- Page int `url:"page,omitempty"`
- // for paginated result sets, the number of results to return per page
- PerPage int `url:"per_page,omitempty"`
- Includes []string
- Excludes []string
-}
-
-func makeSureGetOptionsInclude(g *GetOptions, s string) *GetOptions {
- if g == nil {
- return &GetOptions{Includes: []string{s}}
- }
- if !contains(g.Includes, s) {
- g.Includes = append(g.Includes, s)
- }
- return g
-}
-
-func makeSureListOptionsInclude(l *ListOptions, s string) *ListOptions {
- if l == nil {
- return &ListOptions{Includes: []string{s}}
- }
- if !contains(l.Includes, s) {
- l.Includes = append(l.Includes, s)
- }
- return l
-}
-
-func createGetOptionsURL(g *GetOptions) (url string) {
- if g == nil {
- return ""
- }
- if len(g.Includes) != 0 {
- url += fmt.Sprintf("include=%s", strings.Join(g.Includes, ","))
- }
- if len(g.Excludes) != 0 {
- url += fmt.Sprintf("exclude=%s", strings.Join(g.Excludes, ","))
- }
- return
-
-}
-
-func createListOptionsURL(l *ListOptions) (url string) {
- if l == nil {
- return ""
- }
- if len(l.Includes) != 0 {
- url += fmt.Sprintf("include=%s", strings.Join(l.Includes, ","))
- }
- if len(l.Excludes) != 0 {
- url += fmt.Sprintf("exclude=%s", strings.Join(l.Excludes, ","))
- }
- if l.Page != 0 {
- if url != "" {
- url += "&"
- }
- url += fmt.Sprintf("page=%d", l.Page)
- }
-
- if l.PerPage != 0 {
- if url != "" {
- url += "&"
- }
- url += fmt.Sprintf("per_page=%d", l.PerPage)
- }
-
- return
-}
-
-// meta contains pagination information
-type meta struct {
- Self *Href `json:"self"`
- First *Href `json:"first"`
- Last *Href `json:"last"`
- Previous *Href `json:"previous,omitempty"`
- Next *Href `json:"next,omitempty"`
- Total int `json:"total"`
- CurrentPageNum int `json:"current_page"`
- LastPageNum int `json:"last_page"`
-}
-
-// Response is the http response from api calls
-type Response struct {
- *http.Response
- Rate
-}
-
-// Href is an API link
-type Href struct {
- Href string `json:"href"`
-}
-
-func (r *Response) populateRate() {
- // parse the rate limit headers and populate Response.Rate
- if limit := r.Header.Get(headerRateLimit); limit != "" {
- r.Rate.RequestLimit, _ = strconv.Atoi(limit)
- }
- if remaining := r.Header.Get(headerRateRemaining); remaining != "" {
- r.Rate.RequestsRemaining, _ = strconv.Atoi(remaining)
- }
- if reset := r.Header.Get(headerRateReset); reset != "" {
- if v, _ := strconv.ParseInt(reset, 10, 64); v != 0 {
- r.Rate.Reset = Timestamp{time.Unix(v, 0)}
- }
- }
-}
-
-// ErrorResponse is the http response used on errors
-type ErrorResponse struct {
- Response *http.Response
- Errors []string `json:"errors"`
- SingleError string `json:"error"`
-}
-
-func (r *ErrorResponse) Error() string {
- return fmt.Sprintf("%v %v: %d %v %v",
- r.Response.Request.Method, r.Response.Request.URL, r.Response.StatusCode, strings.Join(r.Errors, ", "), r.SingleError)
-}
-
-// Client is the base API Client
-type Client struct {
- client *http.Client
- debug bool
-
- BaseURL *url.URL
-
- UserAgent string
- ConsumerToken string
- APIKey string
-
- RateLimit Rate
-
- // Packet Api Objects
- Plans PlanService
- Users UserService
- Emails EmailService
- SSHKeys SSHKeyService
- Devices DeviceService
- Projects ProjectService
- Facilities FacilityService
- OperatingSystems OSService
- DeviceIPs DeviceIPService
- DevicePorts DevicePortService
- ProjectIPs ProjectIPService
- ProjectVirtualNetworks ProjectVirtualNetworkService
- Volumes VolumeService
- VolumeAttachments VolumeAttachmentService
- SpotMarket SpotMarketService
- SpotMarketRequests SpotMarketRequestService
- Organizations OrganizationService
- BGPSessions BGPSessionService
- BGPConfig BGPConfigService
- CapacityService CapacityService
- Batches BatchService
- TwoFactorAuth TwoFactorAuthService
- VPN VPNService
- HardwareReservations HardwareReservationService
- Events EventService
- Notifications NotificationService
-}
-
-// NewRequest inits a new http request with the proper headers
-func (c *Client) NewRequest(method, path string, body interface{}) (*http.Request, error) {
- // relative path to append to the endpoint url, no leading slash please
- rel, err := url.Parse(path)
- if err != nil {
- return nil, err
- }
-
- u := c.BaseURL.ResolveReference(rel)
-
- // json encode the request body, if any
- buf := new(bytes.Buffer)
- if body != nil {
- err := json.NewEncoder(buf).Encode(body)
- if err != nil {
- return nil, err
- }
- }
-
- req, err := http.NewRequest(method, u.String(), buf)
- if err != nil {
- return nil, err
- }
-
- req.Close = true
-
- req.Header.Add("X-Auth-Token", c.APIKey)
- req.Header.Add("X-Consumer-Token", c.ConsumerToken)
-
- req.Header.Add("Content-Type", mediaType)
- req.Header.Add("Accept", mediaType)
- req.Header.Add("User-Agent", userAgent)
- return req, nil
-}
-
-// Do executes the http request
-func (c *Client) Do(req *http.Request, v interface{}) (*Response, error) {
- resp, err := c.client.Do(req)
- if err != nil {
- return nil, err
- }
-
- defer resp.Body.Close()
-
- response := Response{Response: resp}
- response.populateRate()
- if c.debug {
- o, _ := httputil.DumpResponse(response.Response, true)
- log.Printf("\n=======[RESPONSE]============\n%s\n\n", string(o))
- }
- c.RateLimit = response.Rate
-
- err = checkResponse(resp)
- // if the response is an error, return the ErrorResponse
- if err != nil {
- return &response, err
- }
-
- if v != nil {
- // if v implements the io.Writer interface, return the raw response
- if w, ok := v.(io.Writer); ok {
- io.Copy(w, resp.Body)
- } else {
- err = json.NewDecoder(resp.Body).Decode(v)
- if err != nil {
- return &response, err
- }
- }
- }
-
- return &response, err
-}
-
-// DoRequest is a convenience method, it calls NewRequest followed by Do
-// v is the interface to unmarshal the response JSON into
-func (c *Client) DoRequest(method, path string, body, v interface{}) (*Response, error) {
- req, err := c.NewRequest(method, path, body)
- if c.debug {
- o, _ := httputil.DumpRequestOut(req, true)
- log.Printf("\n=======[REQUEST]=============\n%s\n", string(o))
- }
- if err != nil {
- return nil, err
- }
- return c.Do(req, v)
-}
-
-// DoRequestWithHeader same as DoRequest
-func (c *Client) DoRequestWithHeader(method string, headers map[string]string, path string, body, v interface{}) (*Response, error) {
- req, err := c.NewRequest(method, path, body)
- for k, v := range headers {
- req.Header.Add(k, v)
- }
-
- if c.debug {
- o, _ := httputil.DumpRequestOut(req, true)
- log.Printf("\n=======[REQUEST]=============\n%s\n", string(o))
- }
- if err != nil {
- return nil, err
- }
- return c.Do(req, v)
-}
-
-// NewClient initializes and returns a Client
-func NewClient() (*Client, error) {
- apiToken := os.Getenv(packetTokenEnvVar)
- if apiToken == "" {
- return nil, fmt.Errorf("you must export %s", packetTokenEnvVar)
- }
- c := NewClientWithAuth("packngo lib", apiToken, nil)
- return c, nil
-
-}
-
-// NewClientWithAuth initializes and returns a Client, use this to get an API Client to operate on
-// N.B.: Packet's API certificate requires Go 1.5+ to successfully parse. If you are using
-// an older version of Go, pass in a custom http.Client with a custom TLS configuration
-// that sets "InsecureSkipVerify" to "true"
-func NewClientWithAuth(consumerToken string, apiKey string, httpClient *http.Client) *Client {
- client, _ := NewClientWithBaseURL(consumerToken, apiKey, httpClient, baseURL)
- return client
-}
-
-// NewClientWithBaseURL returns a Client pointing to nonstandard API URL, e.g.
-// for mocking the remote API
-func NewClientWithBaseURL(consumerToken string, apiKey string, httpClient *http.Client, apiBaseURL string) (*Client, error) {
- if httpClient == nil {
- // Don't fall back on http.DefaultClient as it's not nice to adjust state
- // implicitly. If the client wants to use http.DefaultClient, they can
- // pass it in explicitly.
- httpClient = &http.Client{}
- }
-
- u, err := url.Parse(apiBaseURL)
- if err != nil {
- return nil, err
- }
-
- c := &Client{client: httpClient, BaseURL: u, UserAgent: userAgent, ConsumerToken: consumerToken, APIKey: apiKey}
- c.debug = os.Getenv(debugEnvVar) != ""
- c.Plans = &PlanServiceOp{client: c}
- c.Organizations = &OrganizationServiceOp{client: c}
- c.Users = &UserServiceOp{client: c}
- c.Emails = &EmailServiceOp{client: c}
- c.SSHKeys = &SSHKeyServiceOp{client: c}
- c.Devices = &DeviceServiceOp{client: c}
- c.Projects = &ProjectServiceOp{client: c}
- c.Facilities = &FacilityServiceOp{client: c}
- c.OperatingSystems = &OSServiceOp{client: c}
- c.DeviceIPs = &DeviceIPServiceOp{client: c}
- c.DevicePorts = &DevicePortServiceOp{client: c}
- c.ProjectVirtualNetworks = &ProjectVirtualNetworkServiceOp{client: c}
- c.ProjectIPs = &ProjectIPServiceOp{client: c}
- c.Volumes = &VolumeServiceOp{client: c}
- c.VolumeAttachments = &VolumeAttachmentServiceOp{client: c}
- c.SpotMarket = &SpotMarketServiceOp{client: c}
- c.BGPSessions = &BGPSessionServiceOp{client: c}
- c.BGPConfig = &BGPConfigServiceOp{client: c}
- c.CapacityService = &CapacityServiceOp{client: c}
- c.Batches = &BatchServiceOp{client: c}
- c.TwoFactorAuth = &TwoFactorAuthServiceOp{client: c}
- c.VPN = &VPNServiceOp{client: c}
- c.HardwareReservations = &HardwareReservationServiceOp{client: c}
- c.SpotMarketRequests = &SpotMarketRequestServiceOp{client: c}
- c.Events = &EventServiceOp{client: c}
- c.Notifications = &NotificationServiceOp{client: c}
-
- return c, nil
-}
-
-func checkResponse(r *http.Response) error {
- // return if http status code is within 200 range
- if c := r.StatusCode; c >= 200 && c <= 299 {
- // response is good, return
- return nil
- }
-
- errorResponse := &ErrorResponse{Response: r}
- data, err := ioutil.ReadAll(r.Body)
- // if the response has a body, populate the message in errorResponse
- if err == nil && len(data) > 0 {
- json.Unmarshal(data, errorResponse)
- }
-
- return errorResponse
-}
diff --git a/vendor/github.com/packethost/packngo/payment_methods.go b/vendor/github.com/packethost/packngo/payment_methods.go
deleted file mode 100644
index 0dc98fa0c..000000000
--- a/vendor/github.com/packethost/packngo/payment_methods.go
+++ /dev/null
@@ -1,72 +0,0 @@
-package packngo
-
-// API documentation https://www.packet.net/developers/api/paymentmethods/
-const paymentMethodBasePath = "/payment-methods"
-
-// ProjectService interface defines available project methods
-type PaymentMethodService interface {
- List() ([]PaymentMethod, *Response, error)
- Get(string) (*PaymentMethod, *Response, error)
- Create(*PaymentMethodCreateRequest) (*PaymentMethod, *Response, error)
- Update(string, *PaymentMethodUpdateRequest) (*PaymentMethod, *Response, error)
- Delete(string) (*Response, error)
-}
-
-type paymentMethodsRoot struct {
- PaymentMethods []PaymentMethod `json:"payment_methods"`
-}
-
-// PaymentMethod represents a Packet payment method of an organization
-type PaymentMethod struct {
- ID string `json:"id"`
- Name string `json:"name,omitempty"`
- Created string `json:"created_at,omitempty"`
- Updated string `json:"updated_at,omitempty"`
- Nonce string `json:"nonce,omitempty"`
- Default bool `json:"default,omitempty"`
- Organization Organization `json:"organization,omitempty"`
- Projects []Project `json:"projects,omitempty"`
- Type string `json:"type,omitempty"`
- CardholderName string `json:"cardholder_name,omitempty"`
- ExpMonth string `json:"expiration_month,omitempty"`
- ExpYear string `json:"expiration_year,omitempty"`
- Last4 string `json:"last_4,omitempty"`
- BillingAddress BillingAddress `json:"billing_address,omitempty"`
- URL string `json:"href,omitempty"`
-}
-
-func (pm PaymentMethod) String() string {
- return Stringify(pm)
-}
-
-// PaymentMethodCreateRequest type used to create a Packet payment method of an organization
-type PaymentMethodCreateRequest struct {
- Name string `json:"name"`
- Nonce string `json:"nonce"`
- CardholderName string `json:"cardholder_name,omitempty"`
- ExpMonth string `json:"expiration_month,omitempty"`
- ExpYear string `json:"expiration_year,omitempty"`
- BillingAddress string `json:"billing_address,omitempty"`
-}
-
-func (pm PaymentMethodCreateRequest) String() string {
- return Stringify(pm)
-}
-
-// PaymentMethodUpdateRequest type used to update a Packet payment method of an organization
-type PaymentMethodUpdateRequest struct {
- Name *string `json:"name,omitempty"`
- CardholderName *string `json:"cardholder_name,omitempty"`
- ExpMonth *string `json:"expiration_month,omitempty"`
- ExpYear *string `json:"expiration_year,omitempty"`
- BillingAddress *string `json:"billing_address,omitempty"`
-}
-
-func (pm PaymentMethodUpdateRequest) String() string {
- return Stringify(pm)
-}
-
-// PaymentMethodServiceOp implements PaymentMethodService
-type PaymentMethodServiceOp struct {
- client *Client
-}
diff --git a/vendor/github.com/packethost/packngo/plans.go b/vendor/github.com/packethost/packngo/plans.go
deleted file mode 100644
index 36b0a2ff2..000000000
--- a/vendor/github.com/packethost/packngo/plans.go
+++ /dev/null
@@ -1,126 +0,0 @@
-package packngo
-
-import (
- "fmt"
-)
-
-const planBasePath = "/plans"
-
-// PlanService interface defines available plan methods
-type PlanService interface {
- List(*ListOptions) ([]Plan, *Response, error)
-}
-
-type planRoot struct {
- Plans []Plan `json:"plans"`
-}
-
-// Plan represents a Packet service plan
-type Plan struct {
- ID string `json:"id"`
- Slug string `json:"slug,omitempty"`
- Name string `json:"name,omitempty"`
- Description string `json:"description,omitempty"`
- Line string `json:"line,omitempty"`
- Specs *Specs `json:"specs,omitempty"`
- Pricing *Pricing `json:"pricing,omitempty"`
- DeploymentTypes []string `json:"deployment_types"`
- Class string `json:"class"`
- AvailableIn []Facility `json:"available_in"`
-}
-
-func (p Plan) String() string {
- return Stringify(p)
-}
-
-// Specs - the server specs for a plan
-type Specs struct {
- Cpus []*Cpus `json:"cpus,omitempty"`
- Memory *Memory `json:"memory,omitempty"`
- Drives []*Drives `json:"drives,omitempty"`
- Nics []*Nics `json:"nics,omitempty"`
- Features *Features `json:"features,omitempty"`
-}
-
-func (s Specs) String() string {
- return Stringify(s)
-}
-
-// Cpus - the CPU config details for specs on a plan
-type Cpus struct {
- Count int `json:"count,omitempty"`
- Type string `json:"type,omitempty"`
-}
-
-func (c Cpus) String() string {
- return Stringify(c)
-}
-
-// Memory - the RAM config details for specs on a plan
-type Memory struct {
- Total string `json:"total,omitempty"`
-}
-
-func (m Memory) String() string {
- return Stringify(m)
-}
-
-// Drives - the storage config details for specs on a plan
-type Drives struct {
- Count int `json:"count,omitempty"`
- Size string `json:"size,omitempty"`
- Type string `json:"type,omitempty"`
-}
-
-func (d Drives) String() string {
- return Stringify(d)
-}
-
-// Nics - the network hardware details for specs on a plan
-type Nics struct {
- Count int `json:"count,omitempty"`
- Type string `json:"type,omitempty"`
-}
-
-func (n Nics) String() string {
- return Stringify(n)
-}
-
-// Features - other features in the specs for a plan
-type Features struct {
- Raid bool `json:"raid,omitempty"`
- Txt bool `json:"txt,omitempty"`
-}
-
-func (f Features) String() string {
- return Stringify(f)
-}
-
-// Pricing - the pricing options on a plan
-type Pricing struct {
- Hour float32 `json:"hour,omitempty"`
- Month float32 `json:"month,omitempty"`
-}
-
-func (p Pricing) String() string {
- return Stringify(p)
-}
-
-// PlanServiceOp implements PlanService
-type PlanServiceOp struct {
- client *Client
-}
-
-// List method returns all available plans
-func (s *PlanServiceOp) List(listOpt *ListOptions) ([]Plan, *Response, error) {
- root := new(planRoot)
- params := createListOptionsURL(listOpt)
- path := fmt.Sprintf("%s?%s", planBasePath, params)
-
- resp, err := s.client.DoRequest("GET", path, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.Plans, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/ports.go b/vendor/github.com/packethost/packngo/ports.go
deleted file mode 100644
index a75c12fad..000000000
--- a/vendor/github.com/packethost/packngo/ports.go
+++ /dev/null
@@ -1,225 +0,0 @@
-package packngo
-
-import (
- "fmt"
-)
-
-const portBasePath = "/ports"
-
-type NetworkType int
-
-const (
- NetworkL3 NetworkType = iota
- NetworkHybrid
- NetworkL2Bonded
- NetworkL2Individual
- NetworkUnknown
-)
-
-// DevicePortService handles operations on a port which belongs to a particular device
-type DevicePortService interface {
- Assign(*PortAssignRequest) (*Port, *Response, error)
- Unassign(*PortAssignRequest) (*Port, *Response, error)
- Bond(*BondRequest) (*Port, *Response, error)
- Disbond(*DisbondRequest) (*Port, *Response, error)
- PortToLayerTwo(string) (*Port, *Response, error)
- PortToLayerThree(string) (*Port, *Response, error)
- DeviceToLayerTwo(string) (*Device, error)
- DeviceToLayerThree(string) (*Device, error)
- DeviceNetworkType(string) (NetworkType, error)
- GetBondPort(string) (*Port, error)
- GetPortByName(string, string) (*Port, error)
-}
-
-type PortData struct {
- MAC string `json:"mac"`
- Bonded bool `json:"bonded"`
-}
-
-type Port struct {
- ID string `json:"id"`
- Type string `json:"type"`
- Name string `json:"name"`
- Data PortData `json:"data"`
- AttachedVirtualNetworks []VirtualNetwork `json:"virtual_networks"`
-}
-
-type AddressRequest struct {
- AddressFamily int `json:"address_family"`
- Public bool `json:"public"`
-}
-
-type BackToL3Request struct {
- RequestIPs []AddressRequest `json:"request_ips"`
-}
-
-type DevicePortServiceOp struct {
- client *Client
-}
-
-type PortAssignRequest struct {
- PortID string `json:"id"`
- VirtualNetworkID string `json:"vnid"`
-}
-
-type BondRequest struct {
- PortID string `json:"id"`
- BulkEnable bool `json:"bulk_enable"`
-}
-
-type DisbondRequest struct {
- PortID string `json:"id"`
- BulkDisable bool `json:"bulk_disable"`
-}
-
-func (i *DevicePortServiceOp) GetBondPort(deviceID string) (*Port, error) {
- device, _, err := i.client.Devices.Get(deviceID, nil)
- if err != nil {
- return nil, err
- }
- for _, port := range device.NetworkPorts {
- if port.Type == "NetworkBondPort" {
- return &port, nil
- }
- }
-
- return nil, fmt.Errorf("No bonded port found in device %s", deviceID)
-}
-
-func (i *DevicePortServiceOp) GetPortByName(deviceID, name string) (*Port, error) {
- device, _, err := i.client.Devices.Get(deviceID, nil)
- if err != nil {
- return nil, err
- }
- for _, port := range device.NetworkPorts {
- if port.Name == name {
- return &port, nil
- }
- }
-
- return nil, fmt.Errorf("Port %s not found in device %s", name, deviceID)
-}
-
-func (i *DevicePortServiceOp) Assign(par *PortAssignRequest) (*Port, *Response, error) {
- path := fmt.Sprintf("%s/%s/assign", portBasePath, par.PortID)
- return i.portAction(path, par)
-}
-
-func (i *DevicePortServiceOp) Unassign(par *PortAssignRequest) (*Port, *Response, error) {
- path := fmt.Sprintf("%s/%s/unassign", portBasePath, par.PortID)
- return i.portAction(path, par)
-}
-
-func (i *DevicePortServiceOp) Bond(br *BondRequest) (*Port, *Response, error) {
- path := fmt.Sprintf("%s/%s/bond", portBasePath, br.PortID)
- return i.portAction(path, br)
-}
-
-func (i *DevicePortServiceOp) Disbond(dr *DisbondRequest) (*Port, *Response, error) {
- path := fmt.Sprintf("%s/%s/disbond", portBasePath, dr.PortID)
- return i.portAction(path, dr)
-}
-
-func (i *DevicePortServiceOp) portAction(path string, req interface{}) (*Port, *Response, error) {
- port := new(Port)
-
- resp, err := i.client.DoRequest("POST", path, req, port)
- if err != nil {
- return nil, resp, err
- }
-
- return port, resp, err
-}
-
-func (i *DevicePortServiceOp) PortToLayerTwo(portID string) (*Port, *Response, error) {
- path := fmt.Sprintf("%s/%s/convert/layer-2", portBasePath, portID)
- port := new(Port)
-
- resp, err := i.client.DoRequest("POST", path, nil, port)
- if err != nil {
- return nil, resp, err
- }
-
- return port, resp, err
-}
-
-func (i *DevicePortServiceOp) PortToLayerThree(portID string) (*Port, *Response, error) {
- path := fmt.Sprintf("%s/%s/convert/layer-3", portBasePath, portID)
- port := new(Port)
-
- req := BackToL3Request{
- RequestIPs: []AddressRequest{
- AddressRequest{AddressFamily: 4, Public: true},
- AddressRequest{AddressFamily: 4, Public: false},
- AddressRequest{AddressFamily: 6, Public: true},
- },
- }
-
- resp, err := i.client.DoRequest("POST", path, &req, port)
- if err != nil {
- return nil, resp, err
- }
-
- return port, resp, err
-}
-
-func (i *DevicePortServiceOp) DeviceNetworkType(deviceID string) (NetworkType, error) {
- d, _, err := i.client.Devices.Get(deviceID, nil)
- if err != nil {
- return NetworkUnknown, err
- }
- if d.Plan.Slug == "baremetal_0" || d.Plan.Slug == "baremetal_1" {
- return NetworkL3, nil
- }
- if d.Plan.Slug == "baremetal_1e" {
- return NetworkHybrid, nil
- }
- if len(d.NetworkPorts) < 1 {
- // really?
- return NetworkL2Individual, nil
- }
- if d.NetworkPorts[0].Data.Bonded {
- if d.NetworkPorts[2].Data.Bonded {
- for _, ip := range d.Network {
- if ip.Management {
- return NetworkL3, nil
- }
- }
- return NetworkL2Bonded, nil
- } else {
- return NetworkHybrid, nil
- }
- }
- return NetworkL2Individual, nil
-}
-
-func (i *DevicePortServiceOp) DeviceToLayerThree(deviceID string) (*Device, error) {
- // hopefull all the VLANs are unassigned at this point
- bond0, err := i.client.DevicePorts.GetBondPort(deviceID)
- if err != nil {
- return nil, err
- }
-
- bond0, _, err = i.client.DevicePorts.PortToLayerThree(bond0.ID)
- if err != nil {
- return nil, err
- }
- d, _, err := i.client.Devices.Get(deviceID, nil)
- return d, err
-}
-
-// DeviceToLayerTwo converts device to L2 networking. Use bond0 to attach VLAN.
-func (i *DevicePortServiceOp) DeviceToLayerTwo(deviceID string) (*Device, error) {
- bond0, err := i.client.DevicePorts.GetBondPort(deviceID)
- if err != nil {
- return nil, err
- }
-
- bond0, _, err = i.client.DevicePorts.PortToLayerTwo(bond0.ID)
- if err != nil {
- return nil, err
- }
- d, _, err := i.client.Devices.Get(deviceID, nil)
- return d, err
-
-}
diff --git a/vendor/github.com/packethost/packngo/projects.go b/vendor/github.com/packethost/packngo/projects.go
deleted file mode 100644
index 144e3fd98..000000000
--- a/vendor/github.com/packethost/packngo/projects.go
+++ /dev/null
@@ -1,172 +0,0 @@
-package packngo
-
-import (
- "fmt"
-)
-
-const projectBasePath = "/projects"
-
-// ProjectService interface defines available project methods
-type ProjectService interface {
- List(listOpt *ListOptions) ([]Project, *Response, error)
- Get(string, *GetOptions) (*Project, *Response, error)
- Create(*ProjectCreateRequest) (*Project, *Response, error)
- Update(string, *ProjectUpdateRequest) (*Project, *Response, error)
- Delete(string) (*Response, error)
- ListBGPSessions(projectID string, listOpt *ListOptions) ([]BGPSession, *Response, error)
- ListEvents(string, *ListOptions) ([]Event, *Response, error)
-}
-
-type projectsRoot struct {
- Projects []Project `json:"projects"`
- Meta meta `json:"meta"`
-}
-
-// Project represents a Packet project
-type Project struct {
- ID string `json:"id"`
- Name string `json:"name,omitempty"`
- Organization Organization `json:"organization,omitempty"`
- Created string `json:"created_at,omitempty"`
- Updated string `json:"updated_at,omitempty"`
- Users []User `json:"members,omitempty"`
- Devices []Device `json:"devices,omitempty"`
- SSHKeys []SSHKey `json:"ssh_keys,omitempty"`
- URL string `json:"href,omitempty"`
- PaymentMethod PaymentMethod `json:"payment_method,omitempty"`
-}
-
-func (p Project) String() string {
- return Stringify(p)
-}
-
-// ProjectCreateRequest type used to create a Packet project
-type ProjectCreateRequest struct {
- Name string `json:"name"`
- PaymentMethodID string `json:"payment_method_id,omitempty"`
- OrganizationID string `json:"organization_id,omitempty"`
-}
-
-func (p ProjectCreateRequest) String() string {
- return Stringify(p)
-}
-
-// ProjectUpdateRequest type used to update a Packet project
-type ProjectUpdateRequest struct {
- Name *string `json:"name,omitempty"`
- PaymentMethodID *string `json:"payment_method_id,omitempty"`
-}
-
-func (p ProjectUpdateRequest) String() string {
- return Stringify(p)
-}
-
-// ProjectServiceOp implements ProjectService
-type ProjectServiceOp struct {
- client *Client
-}
-
-// List returns the user's projects
-func (s *ProjectServiceOp) List(listOpt *ListOptions) (projects []Project, resp *Response, err error) {
- params := createListOptionsURL(listOpt)
- root := new(projectsRoot)
-
- path := fmt.Sprintf("%s?%s", projectBasePath, params)
-
- for {
- resp, err = s.client.DoRequest("GET", path, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- projects = append(projects, root.Projects...)
-
- if root.Meta.Next != nil && (listOpt == nil || listOpt.Page == 0) {
- path = root.Meta.Next.Href
- if params != "" {
- path = fmt.Sprintf("%s&%s", path, params)
- }
- continue
- }
-
- return
- }
-}
-
-// Get returns a project by id
-func (s *ProjectServiceOp) Get(projectID string, getOpt *GetOptions) (*Project, *Response, error) {
- params := createGetOptionsURL(getOpt)
- path := fmt.Sprintf("%s/%s?%s", projectBasePath, projectID, params)
- project := new(Project)
- resp, err := s.client.DoRequest("GET", path, nil, project)
- if err != nil {
- return nil, resp, err
- }
- return project, resp, err
-}
-
-// Create creates a new project
-func (s *ProjectServiceOp) Create(createRequest *ProjectCreateRequest) (*Project, *Response, error) {
- project := new(Project)
-
- resp, err := s.client.DoRequest("POST", projectBasePath, createRequest, project)
- if err != nil {
- return nil, resp, err
- }
-
- return project, resp, err
-}
-
-// Update updates a project
-func (s *ProjectServiceOp) Update(id string, updateRequest *ProjectUpdateRequest) (*Project, *Response, error) {
- path := fmt.Sprintf("%s/%s", projectBasePath, id)
- project := new(Project)
-
- resp, err := s.client.DoRequest("PATCH", path, updateRequest, project)
- if err != nil {
- return nil, resp, err
- }
-
- return project, resp, err
-}
-
-// Delete deletes a project
-func (s *ProjectServiceOp) Delete(projectID string) (*Response, error) {
- path := fmt.Sprintf("%s/%s", projectBasePath, projectID)
-
- return s.client.DoRequest("DELETE", path, nil, nil)
-}
-
-// ListBGPSessions returns all BGP Sessions associated with the project
-func (s *ProjectServiceOp) ListBGPSessions(projectID string, listOpt *ListOptions) (bgpSessions []BGPSession, resp *Response, err error) {
- params := createListOptionsURL(listOpt)
- path := fmt.Sprintf("%s/%s%s?%s", projectBasePath, projectID, bgpSessionBasePath, params)
-
- for {
- subset := new(bgpSessionsRoot)
-
- resp, err = s.client.DoRequest("GET", path, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- bgpSessions = append(bgpSessions, subset.Sessions...)
-
- if subset.Meta.Next != nil && (listOpt == nil || listOpt.Page == 0) {
- path = subset.Meta.Next.Href
- if params != "" {
- path = fmt.Sprintf("%s&%s", path, params)
- }
- continue
- }
-
- return
- }
-}
-
-// ListEvents returns list of project events
-func (s *ProjectServiceOp) ListEvents(projectID string, listOpt *ListOptions) ([]Event, *Response, error) {
- path := fmt.Sprintf("%s/%s%s", projectBasePath, projectID, eventBasePath)
-
- return listEvents(s.client, path, listOpt)
-}
diff --git a/vendor/github.com/packethost/packngo/rate.go b/vendor/github.com/packethost/packngo/rate.go
deleted file mode 100644
index 965967d45..000000000
--- a/vendor/github.com/packethost/packngo/rate.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package packngo
-
-// Rate provides the API request rate limit details
-type Rate struct {
- RequestLimit int `json:"request_limit"`
- RequestsRemaining int `json:"requests_remaining"`
- Reset Timestamp `json:"rate_reset"`
-}
-
-func (r Rate) String() string {
- return Stringify(r)
-}
diff --git a/vendor/github.com/packethost/packngo/spotmarket.go b/vendor/github.com/packethost/packngo/spotmarket.go
deleted file mode 100644
index 5dfb7d559..000000000
--- a/vendor/github.com/packethost/packngo/spotmarket.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package packngo
-
-const spotMarketBasePath = "/market/spot/prices"
-
-// SpotMarketService expooses Spot Market methods
-type SpotMarketService interface {
- Prices() (PriceMap, *Response, error)
-}
-
-// SpotMarketServiceOp implements SpotMarketService
-type SpotMarketServiceOp struct {
- client *Client
-}
-
-// PriceMap is a map of [facility][plan]-> float Price
-type PriceMap map[string]map[string]float64
-
-// Prices gets current PriceMap from the API
-func (s *SpotMarketServiceOp) Prices() (PriceMap, *Response, error) {
- root := new(struct {
- SMPs map[string]map[string]struct {
- Price float64 `json:"price"`
- } `json:"spot_market_prices"`
- })
-
- resp, err := s.client.DoRequest("GET", spotMarketBasePath, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- prices := make(PriceMap)
- for facility, planMap := range root.SMPs {
- prices[facility] = map[string]float64{}
- for plan, v := range planMap {
- prices[facility][plan] = v.Price
- }
- }
- return prices, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/spotmarketrequest.go b/vendor/github.com/packethost/packngo/spotmarketrequest.go
deleted file mode 100644
index 31755a8d4..000000000
--- a/vendor/github.com/packethost/packngo/spotmarketrequest.go
+++ /dev/null
@@ -1,109 +0,0 @@
-package packngo
-
-import (
- "fmt"
- "math"
-)
-
-const spotMarketRequestBasePath = "/spot-market-requests"
-
-type SpotMarketRequestService interface {
- List(string) ([]SpotMarketRequest, *Response, error)
- Create(*SpotMarketRequestCreateRequest, string) (*SpotMarketRequest, *Response, error)
- Delete(string, bool) (*Response, error)
- Get(string, *GetOptions) (*SpotMarketRequest, *Response, error)
-}
-
-type SpotMarketRequestCreateRequest struct {
- DevicesMax int `json:"devices_max"`
- DevicesMin int `json:"devices_min"`
- EndAt *Timestamp `json:"end_at,omitempty"`
- FacilityIDs []string `json:"facility_ids"`
- MaxBidPrice float64 `json:"max_bid_price"`
-
- Parameters SpotMarketRequestInstanceParameters `json:"instance_parameters"`
-}
-
-type SpotMarketRequest struct {
- SpotMarketRequestCreateRequest
- ID string `json:"id"`
- Devices []Device `json:"devices"`
- Facilities []Facility `json:"facilities"`
- Project Project `json:"project"`
- Href string `json:"href"`
-}
-
-type SpotMarketRequestInstanceParameters struct {
- AlwaysPXE bool `json:"always_pxe,omitempty"`
- BillingCycle string `json:"billing_cycle"`
- CustomData string `json:"customdata,omitempty"`
- Description string `json:"description,omitempty"`
- Features []string `json:"features,omitempty"`
- Hostname string `json:"hostname,omitempty"`
- Hostnames []string `json:"hostnames,omitempty"`
- Locked bool `json:"locked,omitempty"`
- OperatingSystem string `json:"operating_system"`
- Plan string `json:"plan"`
- ProjectSSHKeys []string `json:"project_ssh_keys,omitempty"`
- Tags []string `json:"tags"`
- TerminationTime *Timestamp `json:"termination_time,omitempty"`
- UserSSHKeys []string `json:"user_ssh_keys,omitempty"`
- UserData string `json:"userdata"`
-}
-
-type SpotMarketRequestServiceOp struct {
- client *Client
-}
-
-func roundPlus(f float64, places int) float64 {
- shift := math.Pow(10, float64(places))
- return math.Floor(f*shift+.5) / shift
-}
-
-func (s *SpotMarketRequestServiceOp) Create(cr *SpotMarketRequestCreateRequest, pID string) (*SpotMarketRequest, *Response, error) {
- path := fmt.Sprintf("%s/%s%s?include=devices,project", projectBasePath, pID, spotMarketRequestBasePath)
- cr.MaxBidPrice = roundPlus(cr.MaxBidPrice, 2)
- smr := new(SpotMarketRequest)
-
- resp, err := s.client.DoRequest("POST", path, cr, smr)
- if err != nil {
- return nil, resp, err
- }
-
- return smr, resp, err
-}
-
-func (s *SpotMarketRequestServiceOp) List(pID string) ([]SpotMarketRequest, *Response, error) {
- smrRoot := struct {
- SMRs []SpotMarketRequest `json:"spot_market_requests"`
- }{}
-
- path := fmt.Sprintf("%s/%s%s?include=devices,project", projectBasePath, pID, spotMarketRequestBasePath)
- resp, err := s.client.DoRequest("GET", path, nil, &smrRoot)
- if err != nil {
- return nil, resp, err
- }
- return smrRoot.SMRs, resp, nil
-}
-
-func (s *SpotMarketRequestServiceOp) Get(id string, getOpt *GetOptions) (*SpotMarketRequest, *Response, error) {
- params := createGetOptionsURL(getOpt)
- path := fmt.Sprintf("%s/%s?%s", spotMarketRequestBasePath, id, params)
- smr := new(SpotMarketRequest)
-
- resp, err := s.client.DoRequest("GET", path, nil, &smr)
- if err != nil {
- return nil, resp, err
- }
-
- return smr, resp, err
-}
-
-func (s *SpotMarketRequestServiceOp) Delete(id string, forceDelete bool) (*Response, error) {
- path := fmt.Sprintf("%s/%s", spotMarketRequestBasePath, id)
- var params *map[string]bool
- if forceDelete {
- params = &map[string]bool{"force_termination": true}
- }
- return s.client.DoRequest("DELETE", path, params, nil)
-}
diff --git a/vendor/github.com/packethost/packngo/sshkeys.go b/vendor/github.com/packethost/packngo/sshkeys.go
deleted file mode 100644
index 4b198f571..000000000
--- a/vendor/github.com/packethost/packngo/sshkeys.go
+++ /dev/null
@@ -1,139 +0,0 @@
-package packngo
-
-import "fmt"
-
-const (
- sshKeyBasePath = "/ssh-keys"
-)
-
-// SSHKeyService interface defines available device methods
-type SSHKeyService interface {
- List() ([]SSHKey, *Response, error)
- ProjectList(string) ([]SSHKey, *Response, error)
- Get(string, *GetOptions) (*SSHKey, *Response, error)
- Create(*SSHKeyCreateRequest) (*SSHKey, *Response, error)
- Update(string, *SSHKeyUpdateRequest) (*SSHKey, *Response, error)
- Delete(string) (*Response, error)
-}
-
-type sshKeyRoot struct {
- SSHKeys []SSHKey `json:"ssh_keys"`
-}
-
-// SSHKey represents a user's ssh key
-type SSHKey struct {
- ID string `json:"id"`
- Label string `json:"label"`
- Key string `json:"key"`
- FingerPrint string `json:"fingerprint"`
- Created string `json:"created_at"`
- Updated string `json:"updated_at"`
- User User `json:"user,omitempty"`
- URL string `json:"href,omitempty"`
-}
-
-func (s SSHKey) String() string {
- return Stringify(s)
-}
-
-// SSHKeyCreateRequest type used to create an ssh key
-type SSHKeyCreateRequest struct {
- Label string `json:"label"`
- Key string `json:"key"`
- ProjectID string `json:"-"`
-}
-
-func (s SSHKeyCreateRequest) String() string {
- return Stringify(s)
-}
-
-// SSHKeyUpdateRequest type used to update an ssh key
-type SSHKeyUpdateRequest struct {
- Label *string `json:"label,omitempty"`
- Key *string `json:"key,omitempty"`
-}
-
-func (s SSHKeyUpdateRequest) String() string {
- return Stringify(s)
-}
-
-// SSHKeyServiceOp implements SSHKeyService
-type SSHKeyServiceOp struct {
- client *Client
-}
-
-func (s *SSHKeyServiceOp) list(url string) ([]SSHKey, *Response, error) {
- root := new(sshKeyRoot)
-
- resp, err := s.client.DoRequest("GET", url, nil, root)
- if err != nil {
- return nil, resp, err
- }
-
- return root.SSHKeys, resp, err
-}
-
-// ProjectList lists ssh keys of a project
-func (s *SSHKeyServiceOp) ProjectList(projectID string) ([]SSHKey, *Response, error) {
- return s.list(fmt.Sprintf("%s/%s%s", projectBasePath, projectID, sshKeyBasePath))
-
-}
-
-// List returns a user's ssh keys
-func (s *SSHKeyServiceOp) List() ([]SSHKey, *Response, error) {
- return s.list(sshKeyBasePath)
-}
-
-// Get returns an ssh key by id
-func (s *SSHKeyServiceOp) Get(sshKeyID string, getOpt *GetOptions) (*SSHKey, *Response, error) {
- params := createGetOptionsURL(getOpt)
- path := fmt.Sprintf("%s/%s?%s", sshKeyBasePath, sshKeyID, params)
- sshKey := new(SSHKey)
-
- resp, err := s.client.DoRequest("GET", path, nil, sshKey)
- if err != nil {
- return nil, resp, err
- }
-
- return sshKey, resp, err
-}
-
-// Create creates a new ssh key
-func (s *SSHKeyServiceOp) Create(createRequest *SSHKeyCreateRequest) (*SSHKey, *Response, error) {
- path := sshKeyBasePath
- if createRequest.ProjectID != "" {
- path = fmt.Sprintf("%s/%s%s", projectBasePath, createRequest.ProjectID, sshKeyBasePath)
- }
- sshKey := new(SSHKey)
-
- resp, err := s.client.DoRequest("POST", path, createRequest, sshKey)
- if err != nil {
- return nil, resp, err
- }
-
- return sshKey, resp, err
-}
-
-// Update updates an ssh key
-func (s *SSHKeyServiceOp) Update(id string, updateRequest *SSHKeyUpdateRequest) (*SSHKey, *Response, error) {
- if updateRequest.Label == nil && updateRequest.Key == nil {
- return nil, nil, fmt.Errorf("You must set either Label or Key string for SSH Key update")
- }
- path := fmt.Sprintf("%s/%s", sshKeyBasePath, id)
-
- sshKey := new(SSHKey)
-
- resp, err := s.client.DoRequest("PATCH", path, updateRequest, sshKey)
- if err != nil {
- return nil, resp, err
- }
-
- return sshKey, resp, err
-}
-
-// Delete deletes an ssh key
-func (s *SSHKeyServiceOp) Delete(sshKeyID string) (*Response, error) {
- path := fmt.Sprintf("%s/%s", sshKeyBasePath, sshKeyID)
-
- return s.client.DoRequest("DELETE", path, nil, nil)
-}
diff --git a/vendor/github.com/packethost/packngo/timestamp.go b/vendor/github.com/packethost/packngo/timestamp.go
deleted file mode 100644
index c3320ed62..000000000
--- a/vendor/github.com/packethost/packngo/timestamp.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package packngo
-
-import (
- "strconv"
- "time"
-)
-
-// Timestamp represents a time that can be unmarshalled from a JSON string
-// formatted as either an RFC3339 or Unix timestamp. All
-// exported methods of time.Time can be called on Timestamp.
-type Timestamp struct {
- time.Time
-}
-
-func (t Timestamp) String() string {
- return t.Time.String()
-}
-
-// UnmarshalJSON implements the json.Unmarshaler interface.
-// Time is expected in RFC3339 or Unix format.
-func (t *Timestamp) UnmarshalJSON(data []byte) (err error) {
- str := string(data)
- i, err := strconv.ParseInt(str, 10, 64)
- if err == nil {
- t.Time = time.Unix(i, 0)
- } else {
- t.Time, err = time.Parse(`"`+time.RFC3339+`"`, str)
- }
- return
-}
-
-// Equal reports whether t and u are equal based on time.Equal
-func (t Timestamp) Equal(u Timestamp) bool {
- return t.Time.Equal(u.Time)
-}
diff --git a/vendor/github.com/packethost/packngo/two_factor_auth.go b/vendor/github.com/packethost/packngo/two_factor_auth.go
deleted file mode 100644
index 5064b09fe..000000000
--- a/vendor/github.com/packethost/packngo/two_factor_auth.go
+++ /dev/null
@@ -1,56 +0,0 @@
-package packngo
-
-const twoFactorAuthAppPath = "/user/otp/app"
-const twoFactorAuthSmsPath = "/user/otp/sms"
-
-// TwoFactorAuthService interface defines available two factor authentication functions
-type TwoFactorAuthService interface {
- EnableApp(string) (*Response, error)
- DisableApp(string) (*Response, error)
- EnableSms(string) (*Response, error)
- DisableSms(string) (*Response, error)
- ReceiveSms() (*Response, error)
- SeedApp() (string, *Response, error)
-}
-
-// TwoFactorAuthServiceOp implements TwoFactorAuthService
-type TwoFactorAuthServiceOp struct {
- client *Client
-}
-
-// EnableApp function enables two factor auth using authenticatior app
-func (s *TwoFactorAuthServiceOp) EnableApp(token string) (resp *Response, err error) {
- headers := map[string]string{"x-otp-token": token}
- return s.client.DoRequestWithHeader("POST", headers, twoFactorAuthAppPath, nil, nil)
-}
-
-// EnableSms function enables two factor auth using sms
-func (s *TwoFactorAuthServiceOp) EnableSms(token string) (resp *Response, err error) {
- headers := map[string]string{"x-otp-token": token}
- return s.client.DoRequestWithHeader("POST", headers, twoFactorAuthSmsPath, nil, nil)
-}
-
-// ReceiveSms orders the auth service to issue an SMS token
-func (s *TwoFactorAuthServiceOp) ReceiveSms() (resp *Response, err error) {
- return s.client.DoRequest("POST", twoFactorAuthSmsPath+"/receive", nil, nil)
-}
-
-// DisableApp function disables two factor auth using
-func (s *TwoFactorAuthServiceOp) DisableApp(token string) (resp *Response, err error) {
- headers := map[string]string{"x-otp-token": token}
- return s.client.DoRequestWithHeader("DELETE", headers, twoFactorAuthAppPath, nil, nil)
-}
-
-// DisableSms function disables two factor auth using
-func (s *TwoFactorAuthServiceOp) DisableSms(token string) (resp *Response, err error) {
- headers := map[string]string{"x-otp-token": token}
- return s.client.DoRequestWithHeader("DELETE", headers, twoFactorAuthSmsPath, nil, nil)
-}
-
-// SeedApp orders the auth service to issue a token via google authenticator
-func (s *TwoFactorAuthServiceOp) SeedApp() (otpURI string, resp *Response, err error) {
- ret := &map[string]string{}
- resp, err = s.client.DoRequest("POST", twoFactorAuthAppPath+"/receive", nil, ret)
-
- return (*ret)["otp_uri"], resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/user.go b/vendor/github.com/packethost/packngo/user.go
deleted file mode 100644
index ef4b25bb6..000000000
--- a/vendor/github.com/packethost/packngo/user.go
+++ /dev/null
@@ -1,100 +0,0 @@
-package packngo
-
-import "fmt"
-
-const usersBasePath = "/users"
-const userBasePath = "/user"
-
-// UserService interface defines available user methods
-type UserService interface {
- List(*ListOptions) ([]User, *Response, error)
- Get(string, *GetOptions) (*User, *Response, error)
- Current() (*User, *Response, error)
-}
-
-type usersRoot struct {
- Users []User `json:"users"`
- Meta meta `json:"meta"`
-}
-
-// User represents a Packet user
-type User struct {
- ID string `json:"id"`
- FirstName string `json:"first_name,omitempty"`
- LastName string `json:"last_name,omitempty"`
- FullName string `json:"full_name,omitempty"`
- Email string `json:"email,omitempty"`
- TwoFactor string `json:"two_factor_auth,omitempty"`
- DefaultOrganizationID string `json:"default_organization_id,omitempty"`
- AvatarURL string `json:"avatar_url,omitempty"`
- Facebook string `json:"twitter,omitempty"`
- Twitter string `json:"facebook,omitempty"`
- LinkedIn string `json:"linkedin,omitempty"`
- Created string `json:"created_at,omitempty"`
- Updated string `json:"updated_at,omitempty"`
- TimeZone string `json:"timezone,omitempty"`
- Emails []Email `json:"emails,omitempty"`
- PhoneNumber string `json:"phone_number,omitempty"`
- URL string `json:"href,omitempty"`
- VPN bool `json:"vpn"`
-}
-
-func (u User) String() string {
- return Stringify(u)
-}
-
-// UserServiceOp implements UserService
-type UserServiceOp struct {
- client *Client
-}
-
-// Get method gets a user by userID
-func (s *UserServiceOp) List(listOpt *ListOptions) (users []User, resp *Response, err error) {
- params := createListOptionsURL(listOpt)
- path := fmt.Sprintf("%s?%s", usersBasePath, params)
-
- for {
- subset := new(usersRoot)
-
- resp, err = s.client.DoRequest("GET", path, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- users = append(users, subset.Users...)
-
- if subset.Meta.Next != nil && (listOpt == nil || listOpt.Page == 0) {
- path = subset.Meta.Next.Href
- if params != "" {
- path = fmt.Sprintf("%s&%s", path, params)
- }
- continue
- }
- return
- }
-}
-
-// Returns the user object for the currently logged-in user.
-func (s *UserServiceOp) Current() (*User, *Response, error) {
- user := new(User)
-
- resp, err := s.client.DoRequest("GET", userBasePath, nil, user)
- if err != nil {
- return nil, resp, err
- }
-
- return user, resp, err
-}
-
-func (s *UserServiceOp) Get(userID string, getOpt *GetOptions) (*User, *Response, error) {
- params := createGetOptionsURL(getOpt)
- path := fmt.Sprintf("%s/%s?%s", usersBasePath, userID, params)
- user := new(User)
-
- resp, err := s.client.DoRequest("GET", path, nil, user)
- if err != nil {
- return nil, resp, err
- }
-
- return user, resp, err
-}
diff --git a/vendor/github.com/packethost/packngo/utils.go b/vendor/github.com/packethost/packngo/utils.go
deleted file mode 100644
index eb997c809..000000000
--- a/vendor/github.com/packethost/packngo/utils.go
+++ /dev/null
@@ -1,115 +0,0 @@
-package packngo
-
-import (
- "bytes"
- "fmt"
- "io"
- "reflect"
-)
-
-var (
- timestampType = reflect.TypeOf(Timestamp{})
- Facilities = []string{
- "yyz1", "nrt1", "atl1", "mrs1", "hkg1", "ams1",
- "ewr1", "sin1", "dfw1", "lax1", "syd1", "sjc1",
- "ord1", "iad1", "fra1", "sea1"}
- FacilityFeatures = []string{
- "baremetal", "layer_2", "backend_transfer", "storage", "global_ipv4"}
- UtilizationLevels = []string{"unavailable", "critical", "limited", "normal"}
- DevicePlans = []string{"c2.medium.x86", "g2.large.x86",
- "m2.xlarge.x86", "x2.xlarge.x86", "baremetal_2a", "baremetal_2a2",
- "baremetal_1", "baremetal_3", "baremetal_2", "baremetal_s",
- "baremetal_0", "baremetal_1e",
- }
-)
-
-// Stringify creates a string representation of the provided message
-func Stringify(message interface{}) string {
- var buf bytes.Buffer
- v := reflect.ValueOf(message)
- stringifyValue(&buf, v)
- return buf.String()
-}
-
-// StreamToString converts a reader to a string
-func StreamToString(stream io.Reader) string {
- buf := new(bytes.Buffer)
- buf.ReadFrom(stream)
- return buf.String()
-}
-
-// contains tells whether a contains x.
-func contains(a []string, x string) bool {
- for _, n := range a {
- if x == n {
- return true
- }
- }
- return false
-}
-
-// stringifyValue was graciously cargoculted from the goprotubuf library
-func stringifyValue(w io.Writer, val reflect.Value) {
- if val.Kind() == reflect.Ptr && val.IsNil() {
- w.Write([]byte(""))
- return
- }
-
- v := reflect.Indirect(val)
-
- switch v.Kind() {
- case reflect.String:
- fmt.Fprintf(w, `"%s"`, v)
- case reflect.Slice:
- w.Write([]byte{'['})
- for i := 0; i < v.Len(); i++ {
- if i > 0 {
- w.Write([]byte{' '})
- }
-
- stringifyValue(w, v.Index(i))
- }
-
- w.Write([]byte{']'})
- return
- case reflect.Struct:
- if v.Type().Name() != "" {
- w.Write([]byte(v.Type().String()))
- }
-
- // special handling of Timestamp values
- if v.Type() == timestampType {
- fmt.Fprintf(w, "{%s}", v.Interface())
- return
- }
-
- w.Write([]byte{'{'})
-
- var sep bool
- for i := 0; i < v.NumField(); i++ {
- fv := v.Field(i)
- if fv.Kind() == reflect.Ptr && fv.IsNil() {
- continue
- }
- if fv.Kind() == reflect.Slice && fv.IsNil() {
- continue
- }
-
- if sep {
- w.Write([]byte(", "))
- } else {
- sep = true
- }
-
- w.Write([]byte(v.Type().Field(i).Name))
- w.Write([]byte{':'})
- stringifyValue(w, fv)
- }
-
- w.Write([]byte{'}'})
- default:
- if v.CanInterface() {
- fmt.Fprint(w, v.Interface())
- }
- }
-}
diff --git a/vendor/github.com/packethost/packngo/virtualnetworks.go b/vendor/github.com/packethost/packngo/virtualnetworks.go
deleted file mode 100644
index 5f0f9d0f0..000000000
--- a/vendor/github.com/packethost/packngo/virtualnetworks.go
+++ /dev/null
@@ -1,92 +0,0 @@
-package packngo
-
-import (
- "fmt"
-)
-
-const virtualNetworkBasePath = "/virtual-networks"
-
-// DevicePortService handles operations on a port which belongs to a particular device
-type ProjectVirtualNetworkService interface {
- List(projectID string, listOpt *ListOptions) (*VirtualNetworkListResponse, *Response, error)
- Create(*VirtualNetworkCreateRequest) (*VirtualNetwork, *Response, error)
- Get(string, *GetOptions) (*VirtualNetwork, *Response, error)
- Delete(virtualNetworkID string) (*Response, error)
-}
-
-type VirtualNetwork struct {
- ID string `json:"id"`
- Description string `json:"description,omitempty"`
- VXLAN int `json:"vxlan,omitempty"`
- FacilityCode string `json:"facility_code,omitempty"`
- CreatedAt string `json:"created_at,omitempty"`
- Href string `json:"href"`
- Project Project `json:"assigned_to"`
-}
-
-type ProjectVirtualNetworkServiceOp struct {
- client *Client
-}
-
-type VirtualNetworkListResponse struct {
- VirtualNetworks []VirtualNetwork `json:"virtual_networks"`
-}
-
-func (i *ProjectVirtualNetworkServiceOp) List(projectID string, listOpt *ListOptions) (*VirtualNetworkListResponse, *Response, error) {
-
- params := createListOptionsURL(listOpt)
- path := fmt.Sprintf("%s/%s%s?%s", projectBasePath, projectID, virtualNetworkBasePath, params)
- output := new(VirtualNetworkListResponse)
-
- resp, err := i.client.DoRequest("GET", path, nil, output)
- if err != nil {
- return nil, nil, err
- }
-
- return output, resp, nil
-}
-
-type VirtualNetworkCreateRequest struct {
- ProjectID string `json:"project_id"`
- Description string `json:"description"`
- Facility string `json:"facility"`
-}
-
-func (i *ProjectVirtualNetworkServiceOp) Get(vlanID string, getOpt *GetOptions) (*VirtualNetwork, *Response, error) {
- params := createGetOptionsURL(getOpt)
- path := fmt.Sprintf("%s/%s?%s", virtualNetworkBasePath, vlanID, params)
- vlan := new(VirtualNetwork)
-
- resp, err := i.client.DoRequest("GET", path, nil, vlan)
- if err != nil {
- return nil, resp, err
- }
-
- return vlan, resp, err
-}
-
-func (i *ProjectVirtualNetworkServiceOp) Create(input *VirtualNetworkCreateRequest) (*VirtualNetwork, *Response, error) {
- // TODO: May need to add timestamp to output from 'post' request
- // for the 'created_at' attribute of VirtualNetwork struct since
- // API response doesn't include it
- path := fmt.Sprintf("%s/%s%s", projectBasePath, input.ProjectID, virtualNetworkBasePath)
- output := new(VirtualNetwork)
-
- resp, err := i.client.DoRequest("POST", path, input, output)
- if err != nil {
- return nil, nil, err
- }
-
- return output, resp, nil
-}
-
-func (i *ProjectVirtualNetworkServiceOp) Delete(virtualNetworkID string) (*Response, error) {
- path := fmt.Sprintf("%s/%s", virtualNetworkBasePath, virtualNetworkID)
-
- resp, err := i.client.DoRequest("DELETE", path, nil, nil)
- if err != nil {
- return nil, err
- }
-
- return resp, nil
-}
diff --git a/vendor/github.com/packethost/packngo/volumes.go b/vendor/github.com/packethost/packngo/volumes.go
deleted file mode 100644
index ebaaddf1c..000000000
--- a/vendor/github.com/packethost/packngo/volumes.go
+++ /dev/null
@@ -1,238 +0,0 @@
-package packngo
-
-import (
- "fmt"
-)
-
-const (
- volumeBasePath = "/storage"
- attachmentsBasePath = "/attachments"
-)
-
-// VolumeService interface defines available Volume methods
-type VolumeService interface {
- List(string, *ListOptions) ([]Volume, *Response, error)
- Get(string, *GetOptions) (*Volume, *Response, error)
- Update(string, *VolumeUpdateRequest) (*Volume, *Response, error)
- Delete(string) (*Response, error)
- Create(*VolumeCreateRequest, string) (*Volume, *Response, error)
- Lock(string) (*Response, error)
- Unlock(string) (*Response, error)
-}
-
-// VolumeAttachmentService defines attachment methdods
-type VolumeAttachmentService interface {
- Get(string, *GetOptions) (*VolumeAttachment, *Response, error)
- Create(string, string) (*VolumeAttachment, *Response, error)
- Delete(string) (*Response, error)
-}
-
-type volumesRoot struct {
- Volumes []Volume `json:"volumes"`
- Meta meta `json:"meta"`
-}
-
-// Volume represents a volume
-type Volume struct {
- Attachments []*VolumeAttachment `json:"attachments,omitempty"`
- BillingCycle string `json:"billing_cycle,omitempty"`
- Created string `json:"created_at,omitempty"`
- Description string `json:"description,omitempty"`
- Facility *Facility `json:"facility,omitempty"`
- Href string `json:"href,omitempty"`
- ID string `json:"id"`
- Locked bool `json:"locked,omitempty"`
- Name string `json:"name,omitempty"`
- Plan *Plan `json:"plan,omitempty"`
- Project *Project `json:"project,omitempty"`
- Size int `json:"size,omitempty"`
- SnapshotPolicies []*SnapshotPolicy `json:"snapshot_policies,omitempty"`
- State string `json:"state,omitempty"`
- Updated string `json:"updated_at,omitempty"`
-}
-
-// SnapshotPolicy used to execute actions on volume
-type SnapshotPolicy struct {
- ID string `json:"id"`
- Href string `json:"href"`
- SnapshotFrequency string `json:"snapshot_frequency,omitempty"`
- SnapshotCount int `json:"snapshot_count,omitempty"`
-}
-
-func (v Volume) String() string {
- return Stringify(v)
-}
-
-// VolumeCreateRequest type used to create a Packet volume
-type VolumeCreateRequest struct {
- BillingCycle string `json:"billing_cycle"`
- Description string `json:"description,omitempty"`
- Locked bool `json:"locked,omitempty"`
- Size int `json:"size"`
- PlanID string `json:"plan_id"`
- FacilityID string `json:"facility_id"`
- SnapshotPolicies []*SnapshotPolicy `json:"snapshot_policies,omitempty"`
-}
-
-func (v VolumeCreateRequest) String() string {
- return Stringify(v)
-}
-
-// VolumeUpdateRequest type used to update a Packet volume
-type VolumeUpdateRequest struct {
- Description *string `json:"description,omitempty"`
- PlanID *string `json:"plan_id,omitempty"`
- Size *int `json:"size,omitempty"`
- BillingCycle *string `json:"billing_cycle,omitempty"`
-}
-
-// VolumeAttachment is a type from Packet API
-type VolumeAttachment struct {
- Href string `json:"href"`
- ID string `json:"id"`
- Volume Volume `json:"volume"`
- Device Device `json:"device"`
-}
-
-func (v VolumeUpdateRequest) String() string {
- return Stringify(v)
-}
-
-// VolumeAttachmentServiceOp implements VolumeService
-type VolumeAttachmentServiceOp struct {
- client *Client
-}
-
-// VolumeServiceOp implements VolumeService
-type VolumeServiceOp struct {
- client *Client
-}
-
-// List returns the volumes for a project
-func (v *VolumeServiceOp) List(projectID string, listOpt *ListOptions) (volumes []Volume, resp *Response, err error) {
- params := createListOptionsURL(listOpt)
- path := fmt.Sprintf("%s/%s%s?%s", projectBasePath, projectID, volumeBasePath, params)
-
- for {
- subset := new(volumesRoot)
-
- resp, err = v.client.DoRequest("GET", path, nil, subset)
- if err != nil {
- return nil, resp, err
- }
-
- volumes = append(volumes, subset.Volumes...)
-
- if subset.Meta.Next != nil && (listOpt == nil || listOpt.Page == 0) {
- path = subset.Meta.Next.Href
- if params != "" {
- path = fmt.Sprintf("%s&%s", path, params)
- }
- continue
- }
-
- return
- }
-}
-
-// Get returns a volume by id
-func (v *VolumeServiceOp) Get(volumeID string, getOpt *GetOptions) (*Volume, *Response, error) {
- params := createGetOptionsURL(getOpt)
- path := fmt.Sprintf("%s/%s?%s", volumeBasePath, volumeID, params)
- volume := new(Volume)
-
- resp, err := v.client.DoRequest("GET", path, nil, volume)
- if err != nil {
- return nil, resp, err
- }
-
- return volume, resp, err
-}
-
-// Update updates a volume
-func (v *VolumeServiceOp) Update(id string, updateRequest *VolumeUpdateRequest) (*Volume, *Response, error) {
- path := fmt.Sprintf("%s/%s", volumeBasePath, id)
- volume := new(Volume)
-
- resp, err := v.client.DoRequest("PATCH", path, updateRequest, volume)
- if err != nil {
- return nil, resp, err
- }
-
- return volume, resp, err
-}
-
-// Delete deletes a volume
-func (v *VolumeServiceOp) Delete(volumeID string) (*Response, error) {
- path := fmt.Sprintf("%s/%s", volumeBasePath, volumeID)
-
- return v.client.DoRequest("DELETE", path, nil, nil)
-}
-
-// Create creates a new volume for a project
-func (v *VolumeServiceOp) Create(createRequest *VolumeCreateRequest, projectID string) (*Volume, *Response, error) {
- url := fmt.Sprintf("%s/%s%s", projectBasePath, projectID, volumeBasePath)
- volume := new(Volume)
-
- resp, err := v.client.DoRequest("POST", url, createRequest, volume)
- if err != nil {
- return nil, resp, err
- }
-
- return volume, resp, err
-}
-
-// Attachments
-
-// Create Attachment, i.e. attach volume to a device
-func (v *VolumeAttachmentServiceOp) Create(volumeID, deviceID string) (*VolumeAttachment, *Response, error) {
- url := fmt.Sprintf("%s/%s%s", volumeBasePath, volumeID, attachmentsBasePath)
- volAttachParam := map[string]string{
- "device_id": deviceID,
- }
- volumeAttachment := new(VolumeAttachment)
-
- resp, err := v.client.DoRequest("POST", url, volAttachParam, volumeAttachment)
- if err != nil {
- return nil, resp, err
- }
- return volumeAttachment, resp, nil
-}
-
-// Get gets attachment by id
-func (v *VolumeAttachmentServiceOp) Get(attachmentID string, getOpt *GetOptions) (*VolumeAttachment, *Response, error) {
- params := createGetOptionsURL(getOpt)
-
- path := fmt.Sprintf("%s%s/%s?%s", volumeBasePath, attachmentsBasePath, attachmentID, params)
- volumeAttachment := new(VolumeAttachment)
-
- resp, err := v.client.DoRequest("GET", path, nil, volumeAttachment)
- if err != nil {
- return nil, resp, err
- }
-
- return volumeAttachment, resp, nil
-}
-
-// Delete deletes attachment by id
-func (v *VolumeAttachmentServiceOp) Delete(attachmentID string) (*Response, error) {
- path := fmt.Sprintf("%s%s/%s", volumeBasePath, attachmentsBasePath, attachmentID)
-
- return v.client.DoRequest("DELETE", path, nil, nil)
-}
-
-// Lock sets a volume to "locked"
-func (s *VolumeServiceOp) Lock(id string) (*Response, error) {
- path := fmt.Sprintf("%s/%s", volumeBasePath, id)
- action := lockType{Locked: true}
-
- return s.client.DoRequest("PATCH", path, action, nil)
-}
-
-// Unlock sets a volume to "unlocked"
-func (s *VolumeServiceOp) Unlock(id string) (*Response, error) {
- path := fmt.Sprintf("%s/%s", volumeBasePath, id)
- action := lockType{Locked: false}
-
- return s.client.DoRequest("PATCH", path, action, nil)
-}
diff --git a/vendor/github.com/packethost/packngo/vpn.go b/vendor/github.com/packethost/packngo/vpn.go
deleted file mode 100644
index f228f7d43..000000000
--- a/vendor/github.com/packethost/packngo/vpn.go
+++ /dev/null
@@ -1,50 +0,0 @@
-package packngo
-
-import "fmt"
-
-const vpnBasePath = "/user/vpn"
-
-// VPNConfig struct
-type VPNConfig struct {
- Config string `json:"config,omitempty"`
-}
-
-// VPNService interface defines available VPN functions
-type VPNService interface {
- Enable() (*Response, error)
- Disable() (*Response, error)
- Get(code string, getOpt *GetOptions) (*VPNConfig, *Response, error)
-}
-
-// VPNServiceOp implements VPNService
-type VPNServiceOp struct {
- client *Client
-}
-
-// Enable VPN for current user
-func (s *VPNServiceOp) Enable() (resp *Response, err error) {
- return s.client.DoRequest("POST", vpnBasePath, nil, nil)
-}
-
-// Disable VPN for current user
-func (s *VPNServiceOp) Disable() (resp *Response, err error) {
- return s.client.DoRequest("DELETE", vpnBasePath, nil, nil)
-
-}
-
-// Get returns the client vpn config for the currently logged-in user.
-func (s *VPNServiceOp) Get(code string, getOpt *GetOptions) (config *VPNConfig, resp *Response, err error) {
- params := createGetOptionsURL(getOpt)
- config = &VPNConfig{}
- path := fmt.Sprintf("%s?code=%s", vpnBasePath, code)
- if params != "" {
- path += params
- }
-
- resp, err = s.client.DoRequest("GET", path, nil, config)
- if err != nil {
- return nil, resp, err
- }
-
- return config, resp, err
-}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index aae463a94..fa1f695b5 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -439,8 +439,6 @@ github.com/onsi/gomega/matchers/support/goraph/edge
github.com/onsi/gomega/matchers/support/goraph/node
github.com/onsi/gomega/matchers/support/goraph/util
github.com/onsi/gomega/types
-# github.com/packethost/packngo v0.0.0-20181217122008-b3b45f1b4979
-github.com/packethost/packngo
# github.com/pelletier/go-toml v1.2.0
github.com/pelletier/go-toml
# github.com/pierrec/lz4 v2.3.0+incompatible