Skip to content

Commit 1a42db0

Browse files
committed
feat: move from apiVersion v1alpha1 to v1beta1
1 parent 6f90f89 commit 1a42db0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+96
-97
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ generate-code:
5252
$(info Compiling deepcopy-gen...)
5353
go build -o ${BIN_DIR}/deepcopy-gen ./cmd/deepcopy-gen/
5454
$(info Generating deepcopy...)
55-
${BIN_DIR}/deepcopy-gen -i ./pkg/apis/controller/v1alpha1/ -O zz_generated.deepcopy
55+
${BIN_DIR}/deepcopy-gen -i ./pkg/apis/controller/v1beta1/ -O zz_generated.deepcopy
5656

5757
images: verify-tag-name
5858
$(info List executable directory)

config/crd/bases/mcad.ibm.com_appwrappers.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
singular: appwrapper
1717
scope: Namespaced
1818
versions:
19-
- name: v1alpha1
19+
- name: v1beta1
2020
schema:
2121
openAPIV3Schema:
2222
description: Definition of AppWrapper class

config/crd/bases/mcad.ibm.com_queuejobs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
singular: queuejob
1717
scope: Namespaced
1818
versions:
19-
- name: v1alpha1
19+
- name: v1beta1
2020
schema:
2121
openAPIV3Schema:
2222
properties:

config/crd/bases/mcad.ibm.com_schedulingspecs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
singular: schedulingspec
1717
scope: Namespaced
1818
versions:
19-
- name: v1alpha1
19+
- name: v1beta1
2020
schema:
2121
openAPIV3Schema:
2222
properties:

deployment/mcad-controller/templates/deployment.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ spec:
116116
singular: schedulingspec
117117
scope: Namespaced
118118
versions:
119-
- name: v1alpha1
119+
- name: v1beta1
120120
schema:
121121
openAPIV3Schema:
122122
properties:
@@ -163,7 +163,7 @@ spec:
163163
singular: queuejob
164164
scope: Namespaced
165165
versions:
166-
- name: v1alpha1
166+
- name: v1beta1
167167
schema:
168168
openAPIV3Schema:
169169
properties:
@@ -6983,7 +6983,7 @@ spec:
69836983
singular: appwrapper
69846984
scope: Namespaced
69856985
versions:
6986-
- name: v1alpha1
6986+
- name: v1beta1
69876987
schema:
69886988
openAPIV3Schema:
69896989
description: Definition of AppWrapper class

deployment/mcad-operator/helm-charts/mcad-controller/templates/deployment.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ spec:
9898
singular: schedulingspec
9999
scope: Namespaced
100100
versions:
101-
- name: v1alpha1
101+
- name: v1beta1
102102
schema:
103103
openAPIV3Schema:
104104
properties:
@@ -145,7 +145,7 @@ spec:
145145
singular: queuejob
146146
scope: Namespaced
147147
versions:
148-
- name: v1alpha1
148+
- name: v1beta1
149149
schema:
150150
openAPIV3Schema:
151151
properties:
@@ -6965,7 +6965,7 @@ spec:
69656965
singular: appwrapper
69666966
scope: Namespaced
69676967
versions:
6968-
- name: v1alpha1
6968+
- name: v1beta1
69696969
schema:
69706970
openAPIV3Schema:
69716971
description: Definition of AppWrapper class

doc/build/build.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ $ ./build.sh
4545
Compiling deepcopy-gen
4646
Generating deepcopy
4747
go build -o _output/bin/deepcopy-gen ./cmd/deepcopy-gen/
48-
_output/bin/deepcopy-gen -i ./pkg/apis/controller/v1alpha1/ -O zz_generated.deepcopy
48+
_output/bin/deepcopy-gen -i ./pkg/apis/controller/v1beta1/ -O zz_generated.deepcopy
4949
+ make kar-controller
5050
mkdir -p _output/bin
5151
CGO_ENABLED=0 GOARCH=amd64 go build -o _output/bin/kar-controllers ./cmd/kar-controllers/

doc/usage/examples/aw-1-k8s-job1.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: mcad.ibm.com/v1alpha1
1+
apiVersion: mcad.ibm.com/v1beta1
22
kind: AppWrapper
33
metadata:
44
name: aw-generic-statefulset-2

doc/usage/examples/aw-1-k8s-job2.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: mcad.ibm.com/v1alpha1
1+
apiVersion: mcad.ibm.com/v1beta1
22
kind: AppWrapper
33
metadata:
44
name: aw-generic-statefulset-2

doc/usage/examples/aw-1-k8s-job3.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: mcad.ibm.com/v1alpha1
1+
apiVersion: mcad.ibm.com/v1beta1
22
kind: AppWrapper
33
metadata:
44
name: aw-generic-statefulset-2

doc/usage/tutorial.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Refer to [deployment instructions](../deploy/deployment.md) on how to deploy the
1818
After successfully deploying the __Multi-Cluster Application Dispatcher__ Controller, create an AppWrapper custom resource in a file named `aw-01.yaml` with the following content:
1919

2020
```
21-
apiVersion: mcad.ibm.com/v1alpha1
21+
apiVersion: mcad.ibm.com/v1beta1
2222
kind: AppWrapper
2323
metadata:
2424
name: stateful-set-2-replicas
@@ -81,7 +81,7 @@ Name: stateful-set-2-replicas
8181
Namespace: default
8282
Labels: <none>
8383
Annotations: <none>
84-
API Version: mcad.ibm.com/v1alpha1
84+
API Version: mcad.ibm.com/v1beta1
8585
Kind: AppWrapper
8686
. . .
8787
Status:
@@ -188,7 +188,7 @@ The next step is to create a second `AppWrapper` job that has resource demands t
188188
Create an `AppWrapper` job in a file named `aw-02.yaml` with the following content:
189189

190190
```
191-
apiVersion: mcad.ibm.com/v1alpha1
191+
apiVersion: mcad.ibm.com/v1beta1
192192
kind: AppWrapper
193193
metadata:
194194
name: deployment-2-replicas
@@ -250,7 +250,7 @@ Name: deployment-2-replicas
250250
Namespace: default
251251
Labels: <none>
252252
Annotations: <none>
253-
API Version: mcad.ibm.com/v1alpha1
253+
API Version: mcad.ibm.com/v1beta1
254254
Kind: AppWrapper
255255
. . .
256256
Status:

hack/run-e2e-kind.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ debug_function() {
133133
kubectl create namespace test
134134

135135
cat <<EOF > aw-ss.0.yaml
136-
apiVersion: mcad.ibm.com/v1alpha1
136+
apiVersion: mcad.ibm.com/v1beta1
137137
kind: AppWrapper
138138
metadata:
139139
name: hellodiana-2-test-0

pkg/apis/controller/v1alpha1/appwrapper.go renamed to pkg/apis/controller/v1beta1/appwrapper.go

+26-27
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 v1alpha1
17+
package v1beta1
1818

1919
import (
2020
"k8s.io/api/core/v1"
@@ -57,12 +57,13 @@ type AppWrapperSpec struct {
5757
// SchedSpec specifies the parameters for scheduling.
5858
SchedSpec SchedulingSpecTemplate `json:"schedulingSpec,omitempty" protobuf:"bytes,2,opt,name=schedulingSpec"`
5959
}
60+
6061
// a collection of AppWrapperResource
6162
type AppWrapperResourceList struct {
6263
metav1.TypeMeta `json:",inline"`
6364
metav1.ListMeta `json:"metadata"`
6465
Items []AppWrapperResource
65-
GenericItems []AppWrapperGenericResource
66+
GenericItems []AppWrapperGenericResource
6667
}
6768

6869
// AppWrapperService is App Wrapper service definition
@@ -96,7 +97,6 @@ type AppWrapperResource struct {
9697
//The template for the resource; it is now a raw text because we don't know for what resource
9798
//it should be instantiated
9899
Template runtime.RawExtension `json:"template"`
99-
100100
}
101101

102102
// AppWrapperResource is App Wrapper aggregation resource
@@ -128,7 +128,7 @@ type AppWrapperGenericResource struct {
128128
}
129129

130130
type CustomPodResourceTemplate struct {
131-
Replicas int `json:"replicas"`
131+
Replicas int `json:"replicas"`
132132
//todo: replace with
133133
//Containers []Container Contain v1.ResourceRequirements
134134
Requests v1.ResourceList `json:"requests"`
@@ -139,17 +139,17 @@ type CustomPodResourceTemplate struct {
139139
type ResourceType string
140140

141141
const (
142-
ResourceTypePod ResourceType = "Pod"
143-
ResourceTypeService ResourceType = "Service"
144-
ResourceTypeSecret ResourceType = "Secret"
145-
ResourceTypeStatefulSet ResourceType = "StatefulSet"
146-
ResourceTypeDeployment ResourceType = "Deployment"
147-
ResourceTypeReplicaSet ResourceType = "ReplicaSet"
148-
ResourceTypePersistentVolume ResourceType = "PersistentVolume"
149-
ResourceTypePersistentVolumeClaim ResourceType = "PersistentVolumeClaim"
150-
ResourceTypeNamespace ResourceType = "Namespace"
151-
ResourceTypeConfigMap ResourceType = "ConfigMap"
152-
ResourceTypeNetworkPolicy ResourceType = "NetworkPolicy"
142+
ResourceTypePod ResourceType = "Pod"
143+
ResourceTypeService ResourceType = "Service"
144+
ResourceTypeSecret ResourceType = "Secret"
145+
ResourceTypeStatefulSet ResourceType = "StatefulSet"
146+
ResourceTypeDeployment ResourceType = "Deployment"
147+
ResourceTypeReplicaSet ResourceType = "ReplicaSet"
148+
ResourceTypePersistentVolume ResourceType = "PersistentVolume"
149+
ResourceTypePersistentVolumeClaim ResourceType = "PersistentVolumeClaim"
150+
ResourceTypeNamespace ResourceType = "Namespace"
151+
ResourceTypeConfigMap ResourceType = "ConfigMap"
152+
ResourceTypeNetworkPolicy ResourceType = "NetworkPolicy"
153153
)
154154

155155
// AppWrapperStatus represents the current state of a AppWrapper
@@ -172,7 +172,7 @@ type AppWrapperStatus struct {
172172
// The minimal available resources to run for this AppWrapper (is this different from the MinAvailable from JobStatus)
173173
// +optional
174174
MinAvailable int32 `json:"template,omitempty" protobuf:"bytes,4,opt,name=template"`
175-
175+
176176
//Can run?
177177
CanRun bool `json:"canrun,omitempty" protobuf:"bytes,1,opt,name=canrun"`
178178

@@ -204,7 +204,6 @@ type AppWrapperStatus struct {
204204

205205
// Represents the latest available observations of a appwrapper's current condition.
206206
Conditions []AppWrapperCondition `json:"conditions,omitempty"`
207-
208207
}
209208

210209
type AppWrapperState string
@@ -220,16 +219,16 @@ const (
220219
type AppWrapperConditionType string
221220

222221
const (
223-
AppWrapperCondInit AppWrapperConditionType = "Init"
224-
AppWrapperCondQueueing AppWrapperConditionType = "Queueing"
225-
AppWrapperCondHeadOfLine AppWrapperConditionType = "HeadOfLine"
226-
AppWrapperCondBackoff AppWrapperConditionType = "Backoff"
227-
AppWrapperCondDispatched AppWrapperConditionType = "Dispatched"
228-
AppWrapperCondRunning AppWrapperConditionType = "Running"
229-
AppWrapperCondPreemptCandidate AppWrapperConditionType = "PreemptCandidate"
230-
AppWrapperCondPreempted AppWrapperConditionType = "Preempted"
231-
AppWrapperCondDeleted AppWrapperConditionType = "Deleted"
232-
AppWrapperCondFailed AppWrapperConditionType = "Failed"
222+
AppWrapperCondInit AppWrapperConditionType = "Init"
223+
AppWrapperCondQueueing AppWrapperConditionType = "Queueing"
224+
AppWrapperCondHeadOfLine AppWrapperConditionType = "HeadOfLine"
225+
AppWrapperCondBackoff AppWrapperConditionType = "Backoff"
226+
AppWrapperCondDispatched AppWrapperConditionType = "Dispatched"
227+
AppWrapperCondRunning AppWrapperConditionType = "Running"
228+
AppWrapperCondPreemptCandidate AppWrapperConditionType = "PreemptCandidate"
229+
AppWrapperCondPreempted AppWrapperConditionType = "Preempted"
230+
AppWrapperCondDeleted AppWrapperConditionType = "Deleted"
231+
AppWrapperCondFailed AppWrapperConditionType = "Failed"
233232
)
234233

235234
// DeploymentCondition describes the state of a deployment at a certain point.

pkg/apis/controller/v1alpha1/doc.go renamed to pkg/apis/controller/v1beta1/doc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ limitations under the License.
1515
*/
1616

1717
// +k8s:deepcopy-gen=package
18-
package v1alpha1
18+
package v1beta1

pkg/apis/controller/v1alpha1/queuejob.go renamed to pkg/apis/controller/v1beta1/queuejob.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package v1alpha1
18-
17+
package v1beta1
1918

2019
import (
2120
"k8s.io/api/core/v1"

pkg/apis/controller/v1alpha1/register.go renamed to pkg/apis/controller/v1beta1/register.go

+6-5
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 v1alpha1
17+
package v1beta1
1818

1919
import (
2020
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
@@ -32,15 +32,16 @@ var (
3232
const GroupName = "mcad.ibm.com"
3333

3434
// SchemeGroupVersion is the group version used to register these objects.
35-
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
35+
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"}
3636

37-
var Versions = []apiextensionsv1.CustomResourceDefinitionVersion {
37+
var Versions = []apiextensionsv1.CustomResourceDefinitionVersion{
3838
{
39-
Name: SchemeGroupVersion.Version,
40-
Served: true,
39+
Name: SchemeGroupVersion.Version,
40+
Served: true,
4141
Storage: true,
4242
},
4343
}
44+
4445
// Resource takes an unqualified resource and returns a Group-qualified GroupResource.
4546
func Resource(resource string) schema.GroupResource {
4647
return SchemeGroupVersion.WithResource(resource).GroupResource()

pkg/apis/controller/v1alpha1/schedulingspec.go renamed to pkg/apis/controller/v1beta1/schedulingspec.go

+1-1
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 v1alpha1
17+
package v1beta1
1818

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

pkg/apis/controller/v1alpha1/zz_generated.deepcopy.go renamed to pkg/apis/controller/v1beta1/zz_generated.deepcopy.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/clientset/controller-versioned/clients/appwrapper.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"os"
2323
"time"
2424

25-
arbv1 "github.com/IBM/multi-cluster-app-dispatcher/pkg/apis/controller/v1alpha1"
25+
arbv1 "github.com/IBM/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1"
2626

2727
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
2828
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"

pkg/client/clientset/controller-versioned/clients/factory.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"k8s.io/apimachinery/pkg/runtime/serializer"
2222
"k8s.io/client-go/rest"
2323

24-
arbv1 "github.com/IBM/multi-cluster-app-dispatcher/pkg/apis/controller/v1alpha1"
24+
arbv1 "github.com/IBM/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1"
2525
)
2626

2727
func NewClient(cfg *rest.Config) (*rest.RESTClient, *runtime.Scheme, error) {

pkg/client/clientset/controller-versioned/clients/queuejob.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"os"
2323
"time"
2424

25-
arbv1 "github.com/IBM/multi-cluster-app-dispatcher/pkg/apis/controller/v1alpha1"
25+
arbv1 "github.com/IBM/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1"
2626

2727
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
2828
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"

pkg/client/clientset/controller-versioned/clients/schedulingspec.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"os"
2323
"time"
2424

25-
arbv1 "github.com/IBM/multi-cluster-app-dispatcher/pkg/apis/controller/v1alpha1"
25+
arbv1 "github.com/IBM/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1"
2626

2727
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
2828
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"

pkg/client/clientset/controller-versioned/scheme/register.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
package scheme
1818

1919
import (
20-
arbv1 "github.com/IBM/multi-cluster-app-dispatcher/pkg/apis/controller/v1alpha1"
20+
arbv1 "github.com/IBM/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1"
2121

2222
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2323
runtime "k8s.io/apimachinery/pkg/runtime"

pkg/client/clientset/controller-versioned/typed/v1/appwrapper.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package v1
1919
import (
2020
"context"
2121

22-
v1 "github.com/IBM/multi-cluster-app-dispatcher/pkg/apis/controller/v1alpha1"
22+
v1 "github.com/IBM/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1"
2323
"github.com/IBM/multi-cluster-app-dispatcher/pkg/client/clientset/controller-versioned/scheme"
2424

2525
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

0 commit comments

Comments
 (0)