Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit 5d354ff

Browse files
authored
feat: Include CABPK APIs (nutanix-cloud-native#445)
1 parent 7c88a80 commit 5d354ff

File tree

14 files changed

+2877
-2
lines changed

14 files changed

+2877
-2
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
Copyright 2021 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1beta1
18+
19+
import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
20+
21+
// Conditions and condition Reasons for the KubeadmConfig object.
22+
23+
const (
24+
// DataSecretAvailableCondition documents the status of the bootstrap secret generation process.
25+
//
26+
// NOTE: When the DataSecret generation starts the process completes immediately and within the
27+
// same reconciliation, so the user will always see a transition from Wait to Generated without having
28+
// evidence that BootstrapSecret generation is started/in progress.
29+
DataSecretAvailableCondition clusterv1.ConditionType = "DataSecretAvailable"
30+
31+
// WaitingForClusterInfrastructureReason (Severity=Info) document a bootstrap secret generation process
32+
// waiting for the cluster infrastructure to be ready.
33+
//
34+
// NOTE: Having the cluster infrastructure ready is a pre-condition for starting to create machines;
35+
// the KubeadmConfig controller ensure this pre-condition is satisfied.
36+
WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure"
37+
38+
// DataSecretGenerationFailedReason (Severity=Warning) documents a KubeadmConfig controller detecting
39+
// an error while generating a data secret; those kind of errors are usually due to misconfigurations
40+
// and user intervention is required to get them fixed.
41+
DataSecretGenerationFailedReason = "DataSecretGenerationFailed"
42+
)
43+
44+
const (
45+
// CertificatesAvailableCondition documents that cluster certificates are available.
46+
//
47+
// NOTE: Cluster certificates are generated only for the KubeadmConfig object linked to the initial control plane
48+
// machine, if the cluster is not using a control plane ref object, if the certificates are not provided
49+
// by the users.
50+
// IMPORTANT: This condition won't be re-created after clusterctl move.
51+
CertificatesAvailableCondition clusterv1.ConditionType = "CertificatesAvailable"
52+
53+
// CertificatesGenerationFailedReason (Severity=Warning) documents a KubeadmConfig controller detecting
54+
// an error while generating certificates; those kind of errors are usually temporary and the controller
55+
// automatically recover from them.
56+
CertificatesGenerationFailedReason = "CertificatesGenerationFailed"
57+
58+
// CertificatesCorruptedReason (Severity=Error) documents a KubeadmConfig controller detecting
59+
// an error while retrieving certificates for a joining node.
60+
CertificatesCorruptedReason = "CertificatesCorrupted"
61+
)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
Copyright 2021 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1beta1
18+
19+
func (*KubeadmConfig) Hub() {}
20+
func (*KubeadmConfigList) Hub() {}
21+
func (*KubeadmConfigTemplate) Hub() {}
22+
func (*KubeadmConfigTemplateList) Hub() {}
23+
24+
func (*ClusterConfiguration) Hub() {}
25+
func (*ClusterStatus) Hub() {}
26+
func (*InitConfiguration) Hub() {}
27+
func (*JoinConfiguration) Hub() {}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
Copyright 2021 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1beta1
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
Copyright 2021 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package v1beta1 contains API Schema definitions for the kubeadm v1beta1 API group
18+
// +kubebuilder:object:generate=true
19+
// +groupName=bootstrap.cluster.x-k8s.io
20+
package v1beta1
21+
22+
import (
23+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24+
"k8s.io/apimachinery/pkg/runtime"
25+
"k8s.io/apimachinery/pkg/runtime/schema"
26+
)
27+
28+
var (
29+
// GroupVersion is group version used to register these objects.
30+
GroupVersion = schema.GroupVersion{Group: "bootstrap.cluster.x-k8s.io", Version: "v1beta1"}
31+
32+
// schemeBuilder is used to add go types to the GroupVersionKind scheme.
33+
schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
34+
35+
// AddToScheme adds the types in this group-version to the given scheme.
36+
AddToScheme = schemeBuilder.AddToScheme
37+
38+
objectTypes = []runtime.Object{}
39+
)
40+
41+
func addKnownTypes(scheme *runtime.Scheme) error {
42+
scheme.AddKnownTypes(GroupVersion, objectTypes...)
43+
metav1.AddToGroupVersion(scheme, GroupVersion)
44+
return nil
45+
}

0 commit comments

Comments
 (0)