Skip to content

Commit

Permalink
chore: dump v2alpha2 to v2beta1
Browse files Browse the repository at this point in the history
Signed-off-by: Rory Z <[email protected]>
  • Loading branch information
Rory-Z committed Jul 28, 2023
1 parent 0fd840f commit ef24ef1
Show file tree
Hide file tree
Showing 101 changed files with 741 additions and 741 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ jobs:
- [EmqxBroker, emqx, "config/samples/emqx/v1beta4/emqxbroker-full.yaml"]
- [EmqxEnterprise, emqx-ee, "config/samples/emqx/v1beta4/emqxenterprise-slim.yaml"]
- [EmqxEnterprise, emqx-ee, "config/samples/emqx/v1beta4/emqxenterprise-full.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2alpha2/emqx-slim.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2alpha2/emqx-full.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2beta1/emqx-slim.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2beta1/emqx-full.yaml"]

steps:
- if: matrix.kubernetes-env == 'k3s'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
- [EMQX, emqx, "config/samples/emqx/v2alpha1/emqx-slim.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2alpha1/emqx-full.yaml"]

- [EMQX, emqx, "config/samples/emqx/v2alpha2/emqx-slim.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2alpha2/emqx-full.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2beta1/emqx-slim.yaml"]
- [EMQX, emqx, "config/samples/emqx/v2beta1/emqx-full.yaml"]

steps:
- run: minikube start
Expand Down
8 changes: 4 additions & 4 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ resources:
domain: emqx.io
group: apps
kind: EMQX
path: github.com/emqx/emqx-operator/apis/apps/v2alpha2
version: v2alpha2
path: github.com/emqx/emqx-operator/apis/apps/v2beta1
version: v2beta1
webhooks:
conversion: true
defaulting: true
Expand All @@ -136,8 +136,8 @@ resources:
domain: emqx.io
group: apps
kind: Rebalance
path: github.com/emqx/emqx-operator/apis/apps/v2alpha2
version: v2alpha2
path: github.com/emqx/emqx-operator/apis/apps/v2beta1
version: v2beta1
webhooks:
conversion: true
defaulting: true
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The EMQX Operator includes, but is not limited to, the following features:
| 4.4.8 (included) ~ 4.4.14 | 1.2.6, 1.2.7, 1.2.8, 2.0.0, 2.0.1, 2.0.2, 2.0.3 | [apps.emqx.io/v1beta3](./docs/en_US/reference/v1beta3-reference.md) | EmqxEnterprise |
| 4.4.14 (included) or higher 4.4.x | 2.1.0, 2.1.1 | [apps.emqx.io/v1beta4](./docs/en_US/reference/v1beta4-reference.md) | EmqxEnterprise |
| 5.0.0 (included) ~ 5.0.23 | 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.1.0, 2.1.1 | [apps.emqx.io/v2alpha1](./docs/en_US/reference/v2alpha1-reference.md) | EMQX |
| 5.1.1 or higher | 2.2.0 | [apps.emqx.io/v2alpha2](./docs/en_US/reference/v2alpha2-reference.md) | EMQX |
| 5.1.1 or higher | 2.2.0 | [apps.emqx.io/v2beta1](./docs/en_US/reference/v2beta1-reference.md) | EMQX |

### EMQX Open Source

Expand All @@ -43,7 +43,7 @@ The EMQX Operator includes, but is not limited to, the following features:
| 5.0.6 (included) ~ 5.0.8 | 2.0.0, 2.0.1, 2.0.3 | [apps.emqx.io/v2alpha1](./docs/en_US/reference/v2alpha1-reference.md) | EMQX |
| 5.0.8 (included) ~ 5.0.14 | 2.0.2 | [apps.emqx.io/v2alpha1](./docs/en_US/reference/v2alpha1-reference.md) | EMQX |
| 5.0.14 (included) ~ 5.0.23 | 2.1.0, 2.1.1 | [apps.emqx.io/v2alpha1](./docs/en_US/reference/v2alpha1-reference.md) | EMQX |
| 5.1.1 or higher | 2.2.0 | [apps.emqx.io/v2alpha2](./docs/en_US/reference/v2alpha2-reference.md) | EMQX |
| 5.1.1 or higher | 2.2.0 | [apps.emqx.io/v2beta1](./docs/en_US/reference/v2beta1-reference.md) | EMQX |

## How to selector Kubernetes version

Expand Down
6 changes: 3 additions & 3 deletions apis/apps/v1beta4/rebalance_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ package v1beta4
import (
"encoding/json"

"github.com/emqx/emqx-operator/apis/apps/v2alpha2"
"github.com/emqx/emqx-operator/apis/apps/v2beta1"
"sigs.k8s.io/controller-runtime/pkg/conversion"
)

// ConvertTo converts this version to the Hub version (v1).
func (src *Rebalance) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*v2alpha2.Rebalance)
dst := dstRaw.(*v2beta1.Rebalance)

b, err := json.Marshal(src)
if err != nil {
Expand All @@ -44,7 +44,7 @@ func (src *Rebalance) ConvertTo(dstRaw conversion.Hub) error {

// ConvertFrom converts from the Hub version (v1) to this version.
func (dst *Rebalance) ConvertFrom(srcRaw conversion.Hub) error {
src := srcRaw.(*v2alpha2.Rebalance)
src := srcRaw.(*v2beta1.Rebalance)

b, err := json.Marshal(src)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions apis/apps/v1beta4/rebalance_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ package v1beta4
import (
"testing"

"github.com/emqx/emqx-operator/apis/apps/v2alpha2"
"github.com/emqx/emqx-operator/apis/apps/v2beta1"
"github.com/stretchr/testify/assert"
)

func TestConvertTo(t *testing.T) {
dst := &v2alpha2.Rebalance{}
dst := &v2beta1.Rebalance{}
src := &Rebalance{}

assert.Nil(t, src.ConvertTo(dst))
}

func TestConvertFrom(t *testing.T) {
dst := &Rebalance{}
src := &v2alpha2.Rebalance{}
src := &v2beta1.Rebalance{}

assert.Nil(t, dst.ConvertFrom(src))
}
8 changes: 4 additions & 4 deletions apis/apps/v2alpha1/emqx_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ package v2alpha1
import (
"encoding/json"

"github.com/emqx/emqx-operator/apis/apps/v2alpha2"
"github.com/emqx/emqx-operator/apis/apps/v2beta1"
"sigs.k8s.io/controller-runtime/pkg/conversion"
)

// ConvertTo converts this version to the Hub version (v1).
func (src *EMQX) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*v2alpha2.EMQX)
dst := dstRaw.(*v2beta1.EMQX)

b, err := json.Marshal(src)
if err != nil {
Expand All @@ -35,7 +35,7 @@ func (src *EMQX) ConvertTo(dstRaw conversion.Hub) error {
if err := json.Unmarshal(b, dst); err != nil {
return err
}
dst.SetGroupVersionKind(v2alpha2.GroupVersion.WithKind("EMQX"))
dst.SetGroupVersionKind(v2beta1.GroupVersion.WithKind("EMQX"))
dst.Spec.ClusterDomain = "cluster.local"
dst.Spec.Config.Data = src.Spec.BootstrapConfig

Expand All @@ -45,7 +45,7 @@ func (src *EMQX) ConvertTo(dstRaw conversion.Hub) error {

// ConvertFrom converts from the Hub version (v1) to this version.
func (dst *EMQX) ConvertFrom(srcRaw conversion.Hub) error {
src := srcRaw.(*v2alpha2.EMQX)
src := srcRaw.(*v2beta1.EMQX)

b, err := json.Marshal(src)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions apis/apps/v2alpha1/emqx_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ package v2alpha1
import (
"testing"

"github.com/emqx/emqx-operator/apis/apps/v2alpha2"
"github.com/emqx/emqx-operator/apis/apps/v2beta1"
"github.com/stretchr/testify/assert"
)

func TestConvertTo(t *testing.T) {
dst := &v2alpha2.EMQX{}
dst := &v2beta1.EMQX{}
src := &EMQX{}

assert.Nil(t, src.ConvertTo(dst))
assert.Equal(t, v2alpha2.GroupVersion.String(), dst.GroupVersionKind().GroupVersion().String())
assert.Equal(t, v2beta1.GroupVersion.String(), dst.GroupVersionKind().GroupVersion().String())
}

func TestConvertFrom(t *testing.T) {
dst := &EMQX{}
src := &v2alpha2.EMQX{}
src := &v2beta1.EMQX{}

assert.Nil(t, dst.ConvertFrom(src))
assert.Equal(t, GroupVersion.String(), dst.GroupVersionKind().GroupVersion().String())
Expand Down
2 changes: 1 addition & 1 deletion apis/apps/v2alpha2/const.go → apis/apps/v2beta1/const.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v2alpha2
package v2beta1

import corev1 "k8s.io/api/core/v1"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha2
package v2beta1

func (*EMQX) Hub() {}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha2
package v2beta1

import (
corev1 "k8s.io/api/core/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha2
package v2beta1

import (
"reflect"
Expand All @@ -41,7 +41,7 @@ func (r *EMQX) SetupWebhookWithManager(mgr ctrl.Manager) error {
Complete()
}

//+kubebuilder:webhook:path=/mutate-apps-emqx-io-v2alpha2-emqx,mutating=true,failurePolicy=fail,sideEffects=None,groups=apps.emqx.io,resources=emqxes,verbs=create;update,versions=v2alpha2,name=mutating.apps.emqx.io,admissionReviewVersions={v1,v1beta1}
//+kubebuilder:webhook:path=/mutate-apps-emqx-io-v2beta1-emqx,mutating=true,failurePolicy=fail,sideEffects=None,groups=apps.emqx.io,resources=emqxes,verbs=create;update,versions=v2beta1,name=mutating.apps.emqx.io,admissionReviewVersions={v1,v1beta1}

var _ webhook.Defaulter = &EMQX{}

Expand All @@ -59,7 +59,7 @@ func (r *EMQX) Default() {
}

// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
//+kubebuilder:webhook:path=/validate-apps-emqx-io-v2alpha2-emqx,mutating=false,failurePolicy=fail,sideEffects=None,groups=apps.emqx.io,resources=emqxes,verbs=create;update,versions=v2alpha2,name=validator.apps.emqx.io,admissionReviewVersions={v1,v1beta1}
//+kubebuilder:webhook:path=/validate-apps-emqx-io-v2beta1-emqx,mutating=false,failurePolicy=fail,sideEffects=None,groups=apps.emqx.io,resources=emqxes,verbs=create;update,versions=v2beta1,name=validator.apps.emqx.io,admissionReviewVersions={v1,v1beta1}

var _ webhook.Validator = &EMQX{}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha2
package v2beta1

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v2alpha2 contains API Schema definitions for the apps v2alpha2 API group
// Package v2beta1 contains API Schema definitions for the apps v2beta1 API group
// +kubebuilder:object:generate=true
// +groupName=apps.emqx.io
package v2alpha2
package v2beta1

import (
"k8s.io/apimachinery/pkg/runtime/schema"
Expand All @@ -26,7 +26,7 @@ import (

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "apps.emqx.io", Version: "v2alpha2"}
GroupVersion = schema.GroupVersion{Group: "apps.emqx.io", Version: "v2beta1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand Down
2 changes: 1 addition & 1 deletion apis/apps/v2alpha2/names.go → apis/apps/v2beta1/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha2
package v2beta1

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha2
package v2beta1

func (*Rebalance) Hub() {}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha2
package v2beta1

import (
"fmt"
Expand All @@ -27,7 +27,7 @@ import (
// RebalanceSpec defines the desired state of Rebalance
type RebalanceSpec struct {
// InstanceKind is used to distinguish between EMQX and EMQXEnterprise.
// When it is set to "EMQX", it means that the EMQX CR is v2alpha2,
// When it is set to "EMQX", it means that the EMQX CR is v2beta1,
// and when it is set to "EmqxEnterprise", it means that the EmqxEnterprise CR is v1beta4.
//+kubebuilder:default:="EMQX"
InstanceKind string `json:"instanceKind"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha2
package v2beta1

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha2
package v2beta1

import (
"errors"
Expand All @@ -37,7 +37,7 @@ func (r *Rebalance) SetupWebhookWithManager(mgr ctrl.Manager) error {
}

// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
//+kubebuilder:webhook:path=/validate-apps-emqx-io-v2alpha2-rebalance,mutating=false,failurePolicy=fail,sideEffects=None,groups=apps.emqx.io,resources=rebalances,verbs=create;update,versions=v2alpha2,name=validator.rebalance.emqx.io,admissionReviewVersions={v1,v1beta1}
//+kubebuilder:webhook:path=/validate-apps-emqx-io-v2beta1-rebalance,mutating=false,failurePolicy=fail,sideEffects=None,groups=apps.emqx.io,resources=rebalances,verbs=create;update,versions=v2beta1,name=validator.rebalance.emqx.io,admissionReviewVersions={v1,v1beta1}

var _ webhook.Validator = &Rebalance{}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha2
package v2beta1

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha2
package v2beta1

import (
"sort"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha2
package v2beta1

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion apis/apps/v2alpha2/util.go → apis/apps/v2beta1/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha2
package v2beta1

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha2
package v2beta1

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v2alpha2
package v2beta1

import (
"context"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/crd/bases/apps.emqx.io_emqxes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6470,7 +6470,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v2alpha2
name: v2beta1
schema:
openAPIV3Schema:
properties:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/apps.emqx.io_rebalances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v2alpha2
name: v2beta1
schema:
openAPIV3Schema:
properties:
Expand Down
Loading

0 comments on commit ef24ef1

Please sign in to comment.