Skip to content

Commit 66c8134

Browse files
authored
Merge pull request #1869 from chuckha/dockertypes
✨ Update capd types to be v1a3 compliant
2 parents a2592b6 + 567ba2a commit 66c8134

16 files changed

+45
-53
lines changed

test/infrastructure/docker/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ generate-go: $(CONTROLLER_GEN) $(CONVERSION_GEN) ## Runs Go related generate tar
116116
object:headerFile=$(ROOT)/hack/boilerplate/boilerplate.generatego.txt \
117117
paths=./api/...
118118
$(CONVERSION_GEN) \
119-
--input-dirs=./api/v1alpha2 \
119+
--input-dirs=./api/v1alpha3 \
120120
--output-file-base=zz_generated.conversion \
121121
--go-header-file=$(ROOT)/hack/boilerplate/boilerplate.generatego.txt
122122

test/infrastructure/docker/PROJECT

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ domain: cluster.x-k8s.io
33
repo: sigs.k8s.io/cluster-api/test/infrastructure/docker
44
resources:
55
- group: infrastructure
6-
version: v1alpha2
6+
version: v1alpha3
77
kind: DockerCluster
88
- group: infrastructure
9-
version: v1alpha2
9+
version: v1alpha3
1010
kind: DockerMachine

test/infrastructure/docker/api/v1alpha2/dockercluster_types.go renamed to test/infrastructure/docker/api/v1alpha3/dockercluster_types.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package v1alpha2
17+
package v1alpha3
1818

1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -30,16 +30,16 @@ const (
3030
type DockerClusterSpec struct {
3131
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
3232
// Important: Run "make" to regenerate code after modifying this file
33+
34+
// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
35+
// +optional
36+
ControlPlaneEndpoint APIEndpoint `json:"controlPlaneEndpoint"`
3337
}
3438

3539
// DockerClusterStatus defines the observed state of DockerCluster.
3640
type DockerClusterStatus struct {
3741
// Ready denotes that the docker cluster (infrastructure) is ready.
3842
Ready bool `json:"ready"`
39-
40-
// APIEndpoints represents the endpoints to communicate with the control plane.
41-
// +optional
42-
APIEndpoints []APIEndpoint `json:"apiEndpoints,omitempty"`
4343
}
4444

4545
// APIEndpoint represents a reachable Kubernetes API endpoint.

test/infrastructure/docker/api/v1alpha2/dockermachine_types.go renamed to test/infrastructure/docker/api/v1alpha3/dockermachine_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package v1alpha2
17+
package v1alpha3
1818

1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

test/infrastructure/docker/api/v1alpha2/dockermachinetemplate_types.go renamed to test/infrastructure/docker/api/v1alpha3/dockermachinetemplate_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package v1alpha2
17+
package v1alpha3
1818

1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

test/infrastructure/docker/api/v1alpha2/groupversion_info.go renamed to test/infrastructure/docker/api/v1alpha3/groupversion_info.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
// Package v1alpha2 contains API Schema definitions for the infrastructure v1alpha2 API group
1818
// +kubebuilder:object:generate=true
1919
// +groupName=infrastructure.cluster.x-k8s.io
20-
package v1alpha2
20+
package v1alpha3
2121

2222
import (
2323
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -26,7 +26,7 @@ import (
2626

2727
var (
2828
// GroupVersion is group version used to register these objects
29-
GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha2"}
29+
GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha3"}
3030

3131
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
3232
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

test/infrastructure/docker/api/v1alpha2/zz_generated.deepcopy.go renamed to test/infrastructure/docker/api/v1alpha3/zz_generated.deepcopy.go

Lines changed: 3 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclusters.yaml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,25 @@ spec:
3838
type: object
3939
spec:
4040
description: DockerClusterSpec defines the desired state of DockerCluster.
41+
properties:
42+
controlPlaneEndpoint:
43+
description: ControlPlaneEndpoint represents the endpoint used to communicate
44+
with the control plane.
45+
properties:
46+
host:
47+
description: Host is the hostname on which the API server is serving.
48+
type: string
49+
port:
50+
description: Port is the port on which the API server is serving.
51+
type: integer
52+
required:
53+
- host
54+
- port
55+
type: object
4156
type: object
4257
status:
4358
description: DockerClusterStatus defines the observed state of DockerCluster.
4459
properties:
45-
apiEndpoints:
46-
description: APIEndpoints represents the endpoints to communicate with
47-
the control plane.
48-
items:
49-
description: APIEndpoint represents a reachable Kubernetes API endpoint.
50-
properties:
51-
host:
52-
description: Host is the hostname on which the API server is serving.
53-
type: string
54-
port:
55-
description: Port is the port on which the API server is serving.
56-
type: integer
57-
required:
58-
- host
59-
- port
60-
type: object
61-
type: array
6260
ready:
6361
description: Ready denotes that the docker cluster (infrastructure)
6462
is ready.
@@ -67,9 +65,9 @@ spec:
6765
- ready
6866
type: object
6967
type: object
70-
version: v1alpha2
68+
version: v1alpha3
7169
versions:
72-
- name: v1alpha2
70+
- name: v1alpha3
7371
served: true
7472
storage: true
7573
status:

test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachines.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ spec:
5858
- ready
5959
type: object
6060
type: object
61-
version: v1alpha2
61+
version: v1alpha3
6262
versions:
63-
- name: v1alpha2
63+
- name: v1alpha3
6464
served: true
6565
storage: true
6666
status:

test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinetemplates.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ spec:
6262
- template
6363
type: object
6464
type: object
65-
version: v1alpha2
65+
version: v1alpha3
6666
versions:
67-
- name: v1alpha2
67+
- name: v1alpha3
6868
served: true
6969
storage: true
7070
status:

test/infrastructure/docker/controllers/dockercluster_controller.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/pkg/errors"
2424
apierrors "k8s.io/apimachinery/pkg/api/errors"
2525
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
26-
infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha2"
26+
infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha3"
2727
"sigs.k8s.io/cluster-api/test/infrastructure/docker/docker"
2828
"sigs.k8s.io/cluster-api/test/infrastructure/docker/third_party/forked/loadbalancer"
2929
"sigs.k8s.io/cluster-api/util"
@@ -122,11 +122,9 @@ func reconcileNormal(dockerCluster *infrav1.DockerCluster, externalLoadBalancer
122122
return ctrl.Result{}, errors.Wrap(err, "failed to get ip for the load balancer")
123123
}
124124

125-
dockerCluster.Status.APIEndpoints = []infrav1.APIEndpoint{
126-
{
127-
Host: lbip4,
128-
Port: loadbalancer.ControlPlanePort,
129-
},
125+
dockerCluster.Spec.ControlPlaneEndpoint = infrav1.APIEndpoint{
126+
Host: lbip4,
127+
Port: loadbalancer.ControlPlanePort,
130128
}
131129

132130
// Mark the dockerCluster ready

test/infrastructure/docker/controllers/dockermachine_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
apierrors "k8s.io/apimachinery/pkg/api/errors"
2626
"k8s.io/apimachinery/pkg/types"
2727
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
28-
infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha2"
28+
infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha3"
2929
"sigs.k8s.io/cluster-api/test/infrastructure/docker/docker"
3030
"sigs.k8s.io/cluster-api/util"
3131
"sigs.k8s.io/cluster-api/util/patch"

test/infrastructure/docker/controllers/dockermachine_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"k8s.io/klog"
2626
"k8s.io/klog/klogr"
2727
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
28-
infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha2"
28+
infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha3"
2929
"sigs.k8s.io/controller-runtime/pkg/client/fake"
3030
"sigs.k8s.io/controller-runtime/pkg/handler"
3131
)

test/infrastructure/docker/e2e/docker_suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232

3333
capiv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
3434
bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha3"
35-
infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha2"
35+
infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha3"
3636
)
3737

3838
func TestDocker(t *testing.T) {

test/infrastructure/docker/e2e/docker_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131

3232
capiv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
3333
bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha3"
34-
infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha2"
34+
infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha3"
3535
)
3636

3737
var _ = Describe("Docker", func() {

test/infrastructure/docker/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"k8s.io/klog"
2828
"k8s.io/klog/klogr"
2929
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
30-
infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha2"
30+
infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha3"
3131
"sigs.k8s.io/cluster-api/test/infrastructure/docker/controllers"
3232
ctrl "sigs.k8s.io/controller-runtime"
3333
// +kubebuilder:scaffold:imports

0 commit comments

Comments
 (0)