Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump crossplane runtime version to v0.13.0 #64

Merged
merged 20 commits into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,8 @@ demo:
docker build . -t ${IMG} -f ./hack/demo/Dockerfile
kind load docker-image $(IMG) || { echo >&2 "kind not installed or error loading image: $(IMG)"; exit 1; }
kubectl apply -f ./package/crds
cat ./examples/provider.yaml | sed \
-e "s|((ACCESS_KEY_ID))|"${ACCESS_KEY_ID}"|g" \
-e "s|((ACCESS_KEY_SECRET))|"${ACCESS_KEY_SECRET}"|g" \
| kubectl apply -f -
./hack/demo/prepare-alibaba-credentials.sh
kubectl apply -f ./examples/provider.yaml
./hack/demo/helm_install_crossplane_master.sh
kubectl apply -f ./examples/database/rds.yaml
kubectl apply -f ./hack/demo/deploy/
4 changes: 2 additions & 2 deletions apis/alibaba.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import (
redisv1alpha1 "github.com/crossplane/provider-alibaba/apis/redis/v1alpha1"
slbv1alpha1 "github.com/crossplane/provider-alibaba/apis/slb/v1alpha1"
slsv1alpha1 "github.com/crossplane/provider-alibaba/apis/sls/v1alpha1"
"github.com/crossplane/provider-alibaba/apis/v1alpha1"
"github.com/crossplane/provider-alibaba/apis/v1beta1"
)

func init() {
// Register the types with the Scheme so the components can map objects to GroupVersionKinds and back
AddToSchemes = append(AddToSchemes,
v1alpha1.SchemeBuilder.AddToScheme,
v1beta1.SchemeBuilder.AddToScheme,
databasev1alpha1.SchemeBuilder.AddToScheme,
slsv1alpha1.AddToScheme,
ossv1alpha1.SchemeBuilder.AddToScheme,
Expand Down
6 changes: 3 additions & 3 deletions apis/v1alpha1/doc.go → apis/v1beta1/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha1 contains the core resources of the Alibaba Cloud.
// Package v1beta1 contains the core resources of the Alibaba Cloud.
// +kubebuilder:object:generate=true
// +groupName=alibaba.crossplane.io
// +versionName=v1alpha1
package v1alpha1
// +versionName=v1beta1
package v1beta1
12 changes: 2 additions & 10 deletions apis/v1alpha1/register.go → apis/v1beta1/register.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 v1alpha1
package v1beta1

import (
"reflect"
Expand All @@ -26,7 +26,7 @@ import (
// Package type metadata.
const (
Group = "alibaba.crossplane.io"
Version = "v1alpha1"
Version = "v1beta1"
)

var (
Expand All @@ -37,14 +37,6 @@ var (
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
)

// Provider type metadata.
var (
ProviderKind = reflect.TypeOf(Provider{}).Name()
ProviderGroupKind = schema.GroupKind{Group: Group, Kind: ProviderKind}.String()
ProviderKindAPIVersion = ProviderKind + "." + SchemeGroupVersion.String()
ProviderGroupVersionKind = SchemeGroupVersion.WithKind(ProviderKind)
)

// ProviderConfig type metadata.
var (
ProviderConfigKind = reflect.TypeOf(ProviderConfig{}).Name()
Expand Down
49 changes: 13 additions & 36 deletions apis/v1alpha1/types.go → apis/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,32 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1
package v1beta1

import (
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// A ProviderSpec defines the desired state of a Provider.
type ProviderSpec struct {
xpv1.ProviderSpec `json:",inline"`

// Region for managed resources created using this Alibaba Cloud provider,
// e.g. "cn-hangzhou".
Region string `json:"region"`
}

// +kubebuilder:object:root=true

// A Provider configures an Alibaba Cloud 'provider', i.e. a connection to a
// particular cloud account.
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:printcolumn:name="SECRET-NAME",type="string",JSONPath=".spec.credentialsSecretRef.name",priority=1
// +kubebuilder:resource:scope=Cluster,categories={crossplane,provider,alibaba}
type Provider struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ProviderSpec `json:"spec"`
}

// +kubebuilder:object:root=true

// ProviderList contains a list of Provider
type ProviderList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Provider `json:"items"`
}

// A ProviderConfigSpec defines the desired state of a ProviderConfig.
type ProviderConfigSpec struct {
xpv1.ProviderConfigSpec `json:",inline"`
// Credentials required to authenticate to this provider.
Credentials ProviderCredentials `json:"credentials"`

// Region for managed resources created using this Alibaba Cloud provider,
// e.g. "cn-hangzhou".
Region string `json:"region"`
}

// A ProviderConfigStatus represents the status of a ProviderConfig.
// ProviderCredentials required to authenticate.
type ProviderCredentials struct {
// Source of the provider credentials.
// +kubebuilder:validation:Enum=None;Secret;Environment;Filesystem
Source xpv1.CredentialsSource `json:"source"`
xpv1.CommonCredentialSelectors `json:",inline"`
}

// A ProviderConfigStatus reflects the observed state of a ProviderConfig.
type ProviderConfigStatus struct {
xpv1.ProviderConfigStatus `json:",inline"`
}
Expand All @@ -72,7 +49,7 @@ type ProviderConfigStatus struct {
// A ProviderConfig configures an Alibaba Cloud 'provider', i.e. a connection to
// a particular cloud account.
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:printcolumn:name="SECRET-NAME",type="string",JSONPath=".spec.credentialsSecretRef.name",priority=1
// +kubebuilder:printcolumn:name="SECRET-NAME",type="string",JSONPath=".spec.credentials.secretRef.name",priority=1
// +kubebuilder:resource:scope=Cluster,categories={crossplane,provider,alibaba}
// +kubebuilder:subresource:status
type ProviderConfig struct {
Expand Down

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

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

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

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

8 changes: 4 additions & 4 deletions examples/database/rds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ metadata:
name: example
labels:
example: "true"
engine: postgresql
engine: mysql
spec:
forProvider:
engine: postgresql
engineVersion: "10.0"
dbInstanceClass: rds.pg.s1.small
engine: mysql
engineVersion: "8.0"
dbInstanceClass: "rds.mysql.c1.large"
dbInstanceStorageInGB: 20
securityIPList: "0.0.0.0/0"
masterUsername: "test123"
Expand Down
13 changes: 1 addition & 12 deletions examples/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: crossplane-system

---
apiVersion: alibaba.crossplane.io/v1alpha1
apiVersion: alibaba.crossplane.io/v1beta1
kind: ProviderConfig
metadata:
name: default
Expand All @@ -17,14 +17,3 @@ spec:
name: alibaba-account-creds
key: credentials
region: cn-beijing

zzxwill marked this conversation as resolved.
Show resolved Hide resolved
---
apiVersion: v1
kind: Secret
metadata:
name: alibaba-account-creds
namespace: crossplane-system
type: Opaque
stringData:
accessKeyId: ((ACCESS_KEY_ID))
accessKeySecret: ((ACCESS_KEY_SECRET))
14 changes: 8 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ require (
github.com/aliyun/aliyun-log-go-sdk v0.1.19
github.com/aliyun/aliyun-oss-go-sdk v2.1.6+incompatible
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect
github.com/crossplane/crossplane-runtime v0.12.0
github.com/crossplane/crossplane-tools v0.0.0-20201201125637-9ddc70edfd0d
github.com/crossplane/crossplane-runtime v0.13.0
github.com/crossplane/crossplane-tools v0.0.0-20201007233256-88b291e145bb
github.com/google/go-cmp v0.5.2
github.com/pkg/errors v0.9.1
github.com/satori/go.uuid v1.2.0 // indirect
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b
gopkg.in/alecthomas/kingpin.v2 v2.2.6
k8s.io/api v0.18.6
k8s.io/apimachinery v0.18.6
k8s.io/utils v0.0.0-20200603063816-c1c6865ac451
sigs.k8s.io/controller-runtime v0.6.2
gopkg.in/yaml.v2 v2.3.0
k8s.io/api v0.20.1
k8s.io/apimachinery v0.20.1
k8s.io/utils v0.0.0-20201110183641-67b214c5f920
sigs.k8s.io/controller-runtime v0.8.0
sigs.k8s.io/controller-tools v0.3.0
)
Loading