diff --git a/Gopkg.lock b/Gopkg.lock index 9d80f0df..86d5d1da 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -376,7 +376,7 @@ [[projects]] branch = "openshift-4.2-cluster-api-0.1.0" - digest = "1:39b28a2133488606e41fd0f6f13ec4239169424432fb0eb0dadb9d6f8ee4bf91" + digest = "1:e4cc8b4a309af144c12f7e010efe4de2a3068cbb141a856bc2e662608683d3f3" name = "github.com/openshift/cluster-api" packages = [ "pkg/apis", @@ -396,7 +396,7 @@ "pkg/util", ] pruneopts = "T" - revision = "e911af77e9a33cfb45f82ba9778876d715cdb4ea" + revision = "f8de78af80fcecf1fd69e35005b591dc9e1df61a" [[projects]] branch = "master" diff --git a/vendor/github.com/openshift/cluster-api/Gopkg.lock b/vendor/github.com/openshift/cluster-api/Gopkg.lock index 9c4dee36..15544ae7 100644 --- a/vendor/github.com/openshift/cluster-api/Gopkg.lock +++ b/vendor/github.com/openshift/cluster-api/Gopkg.lock @@ -350,11 +350,11 @@ [[projects]] branch = "master" - digest = "1:f7646c654e93258958dba300641f8f674d5a9ed015c11119793ba1156e2acbe9" + digest = "1:b79de44700bc7fc32b4f898e283754fa027616f87074be1cf65a7be5a961cc85" name = "github.com/openshift/kubernetes-drain" packages = ["."] pruneopts = "UT" - revision = "c2e51be1758efa30d71a4d30dc4e2db86b70a4df" + revision = "4b061affbd00bfc62036a5cd3a57493db6c94151" [[projects]] digest = "1:e5d0bd87abc2781d14e274807a470acd180f0499f8bf5bb18606e9ec22ad9de9" @@ -1086,7 +1086,8 @@ revision = "324c5df7d3f0fafd8ab337871d9f2c86afd1fe64" [[projects]] - digest = "1:5bfbcd19f444fc4bf9ae6cc938a8e9bc0a98050c8357e8b038ec03c3482c974c" + branch = "release-0.2" + digest = "1:2212c932307779541b20f07c46728a2ff0caca9ada465a1072d4d83187174566" name = "sigs.k8s.io/controller-runtime" packages = [ "pkg/cache", @@ -1126,7 +1127,7 @@ "pkg/webhook/internal/metrics", ] pruneopts = "UT" - revision = "96b67f231945a8e8550dbdd8bfbd550a0c68097b" + revision = "f60c87ec713cb8da81257228530605457ebf7220" [[projects]] digest = "1:77a19ea61ca4e01817ad2bc3e91689c5097b4b439668127d1fb5d8b95c3aca03" diff --git a/vendor/github.com/openshift/cluster-api/Gopkg.toml b/vendor/github.com/openshift/cluster-api/Gopkg.toml index d132d1d6..b3c4116e 100644 --- a/vendor/github.com/openshift/cluster-api/Gopkg.toml +++ b/vendor/github.com/openshift/cluster-api/Gopkg.toml @@ -43,8 +43,9 @@ required = [ # STANZAS BELOW ARE GENERATED AND MAY BE WRITTEN - DO NOT MODIFY BELOW THIS LINE. [[constraint]] - name="sigs.k8s.io/controller-runtime" - revision="96b67f231945a8e8550dbdd8bfbd550a0c68097b" + name = "sigs.k8s.io/controller-runtime" + # release-0.2 since it imports kubernetes 1.14 + branch="release-0.2" [[constraint]] name="sigs.k8s.io/controller-tools" diff --git a/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machine.yaml b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machine.yaml index 35dd1f4a..b5cc2a47 100644 --- a/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machine.yaml +++ b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machine.yaml @@ -6,6 +6,37 @@ metadata: controller-tools.k8s.io: "1.0" name: machines.machine.openshift.io spec: + additionalPrinterColumns: + - JSONPath: .metadata.annotations['machine\.openshift\.io/instance-state'] + description: State of instance + name: State + type: string + - JSONPath: .metadata.labels['machine\.openshift\.io/instance-type'] + description: Type of instance + name: Type + type: string + - JSONPath: .metadata.labels['machine\.openshift\.io/region'] + description: Region associated with machine + name: Region + type: string + - JSONPath: .metadata.labels['machine\.openshift\.io/zone'] + description: Zone associated with machine + name: Zone + type: string + - JSONPath: .metadata.creationTimestamp + description: Machine age + name: Age + type: date + - JSONPath: .status.nodeRef.name + description: Node associated with machine + name: Node + priority: 1 + type: string + - JSONPath: .spec.providerID + description: Provider ID of machine created in cloud provider + name: ProviderID + priority: 1 + type: string group: machine.openshift.io names: kind: Machine diff --git a/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machineset.yaml b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machineset.yaml index 4e88e2b6..0cbdf333 100644 --- a/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machineset.yaml +++ b/vendor/github.com/openshift/cluster-api/config/crds/machine_v1beta1_machineset.yaml @@ -6,6 +6,27 @@ metadata: controller-tools.k8s.io: "1.0" name: machinesets.machine.openshift.io spec: + additionalPrinterColumns: + - JSONPath: .spec.replicas + description: Desired Replicas + name: Desired + type: integer + - JSONPath: .status.replicas + description: Current Replicas + name: Current + type: integer + - JSONPath: .status.readyReplicas + description: Ready Replicas + name: Ready + type: integer + - JSONPath: .status.availableReplicas + description: Observed number of available replicas + name: Available + type: string + - JSONPath: .metadata.creationTimestamp + description: Machineset age + name: Age + type: date group: machine.openshift.io names: kind: MachineSet diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machine_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machine_types.go index 62ec3933..0bbc48f5 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machine_types.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machine_types.go @@ -46,6 +46,13 @@ const ( // Machine is the Schema for the machines API // +k8s:openapi-gen=true // +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".metadata.annotations['machine\.openshift\.io/instance-state']",description="State of instance" +// +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".metadata.labels['machine\.openshift\.io/instance-type']",description="Type of instance" +// +kubebuilder:printcolumn:name="Region",type="string",JSONPath=".metadata.labels['machine\.openshift\.io/region']",description="Region associated with machine" +// +kubebuilder:printcolumn:name="Zone",type="string",JSONPath=".metadata.labels['machine\.openshift\.io/zone']",description="Zone associated with machine" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Machine age" +// +kubebuilder:printcolumn:name="Node",type="string",JSONPath=".status.nodeRef.name",description="Node associated with machine",priority=1 +// +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="Provider ID of machine created in cloud provider",priority=1 type Machine struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machineset_types.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machineset_types.go index b4edb7a3..413f598f 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machineset_types.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/v1beta1/machineset_types.go @@ -35,6 +35,11 @@ import ( // +k8s:openapi-gen=true // +kubebuilder:subresource:status // +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector +// +kubebuilder:printcolumn:name="Desired",type="integer",JSONPath=".spec.replicas",description="Desired Replicas" +// +kubebuilder:printcolumn:name="Current",type="integer",JSONPath=".status.replicas",description="Current Replicas" +// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="Ready Replicas" +// +kubebuilder:printcolumn:name="Available",type="string",JSONPath=".status.availableReplicas",description="Observed number of available replicas" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Machineset age" type MachineSet struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/add_node.go b/vendor/github.com/openshift/cluster-api/pkg/controller/add_node.go deleted file mode 100644 index 34c00cf7..00000000 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/add_node.go +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -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 controller - -import ( - "github.com/openshift/cluster-api/pkg/controller/node" -) - -func init() { - // AddToManagerFuncs is a list of functions to create controllers and add them to a manager. - AddToManagerFuncs = append(AddToManagerFuncs, node.Add) -} diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go index f2f17119..3d5f1e41 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go @@ -49,6 +49,18 @@ const ( // ExcludeNodeDrainingAnnotation annotation explicitly skips node draining if set ExcludeNodeDrainingAnnotation = "machine.openshift.io/exclude-node-draining" + + // MachineRegionLabelName as annotation name for a machine region + MachineRegionLabelName = "machine.openshift.io/region" + + // MachineAZLabelName as annotation name for a machine AZ + MachineAZLabelName = "machine.openshift.io/zone" + + // MachineInstanceStateAnnotationName as annotation name for a machine instance state + MachineInstanceStateAnnotationName = "machine.openshift.io/instance-state" + + // MachineInstanceTypeLabelName as annotation name for a machine instance type + MachineInstanceTypeLabelName = "machine.openshift.io/instance-type" ) var DefaultActuator Actuator diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/controller.go index e47bd3e8..a77e7a62 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/controller.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/controller.go @@ -173,6 +173,13 @@ func (r *ReconcileMachineDeployment) Reconcile(request reconcile.Request) (recon // Error reading the object - requeue the request. return reconcile.Result{}, err } + + // Ignore deleted MachineDeployments, this can happen when foregroundDeletion + // is enabled + if d.DeletionTimestamp != nil { + return reconcile.Result{}, nil + } + result, err := r.reconcile(ctx, d) if err != nil { klog.Errorf("Failed to reconcile MachineDeployment %q: %v", request.NamespacedName, err) diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/sync.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/sync.go index 497167f8..40bca896 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/sync.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machinedeployment/sync.go @@ -31,6 +31,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" apirand "k8s.io/apimachinery/pkg/util/rand" + "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/util/retry" "k8s.io/klog" "sigs.k8s.io/controller-runtime/pkg/client" @@ -154,6 +155,11 @@ func (r *ReconcileMachineDeployment) getNewMachineSet(d *machinev1beta1.MachineD }, } + // Add foregroundDeletion finalizer to MachineSet if the MachineDeployment has it + if sets.NewString(d.Finalizers...).Has(metav1.FinalizerDeleteDependents) { + newMS.Finalizers = []string{metav1.FinalizerDeleteDependents} + } + allMSs := append(oldMSs, &newMS) newReplicasCount, err := dutil.NewMSNewReplicas(d, allMSs, &newMS) if err != nil { diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/controller.go index db2678c5..17c44f76 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/controller.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machineset/controller.go @@ -158,6 +158,12 @@ func (r *ReconcileMachineSet) Reconcile(request reconcile.Request) (reconcile.Re return reconcile.Result{}, err } + // Ignore deleted MachineSets, this can happen when foregroundDeletion + // is enabled + if machineSet.DeletionTimestamp != nil { + return reconcile.Result{}, nil + } + result, err := r.reconcile(ctx, machineSet) if err != nil { klog.Errorf("Failed to reconcile MachineSet %q: %v", request.NamespacedName, err)