generated from crossplane-contrib/provider-jet-template
-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix provider definition #59
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
43b8b8e
fix provider definition
displague 88ac730
feat: update providerconfig to v1beta1
displague 0071808
rename NoFork to TerraformPluginSDK
displague 9095a6a
fix: equinix providerconfig needs int for retry timeout, page_size, a…
displague 78637d8
fix: define terraform.Setup with working workspace, scheduler, and TF…
displague 21e0d7d
debug: remove hardcoded TF setup values
displague 54dcb33
chore: regenerate providerconfigusages yaml
displague File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
Copyright 2024 The Crossplane Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// Package v1beta1 contains the core resources of the template upjet provider. | ||
// +kubebuilder:object:generate=true | ||
// +groupName=equinix.jet.crossplane.io | ||
// +versionName=v1beta1 | ||
package v1beta1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
Copyright 2024 The Crossplane Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1beta1 | ||
|
||
import ( | ||
"reflect" | ||
|
||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/controller-runtime/pkg/scheme" | ||
) | ||
|
||
// Package type metadata. | ||
const ( | ||
Group = "equinix.jet.crossplane.io" | ||
Version = "v1beta1" | ||
) | ||
|
||
var ( | ||
// SchemeGroupVersion is group version used to register these objects | ||
SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version} | ||
|
||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme | ||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} | ||
) | ||
|
||
// ProviderConfig type metadata. | ||
var ( | ||
ProviderConfigKind = reflect.TypeOf(ProviderConfig{}).Name() | ||
ProviderConfigGroupKind = schema.GroupKind{Group: Group, Kind: ProviderConfigKind}.String() | ||
ProviderConfigKindAPIVersion = ProviderConfigKind + "." + SchemeGroupVersion.String() | ||
ProviderConfigGroupVersionKind = SchemeGroupVersion.WithKind(ProviderConfigKind) | ||
) | ||
|
||
// ProviderConfigUsage type metadata. | ||
var ( | ||
ProviderConfigUsageKind = reflect.TypeOf(ProviderConfigUsage{}).Name() | ||
ProviderConfigUsageGroupKind = schema.GroupKind{Group: Group, Kind: ProviderConfigUsageKind}.String() | ||
ProviderConfigUsageKindAPIVersion = ProviderConfigUsageKind + "." + SchemeGroupVersion.String() | ||
ProviderConfigUsageGroupVersionKind = SchemeGroupVersion.WithKind(ProviderConfigUsageKind) | ||
|
||
ProviderConfigUsageListKind = reflect.TypeOf(ProviderConfigUsageList{}).Name() | ||
ProviderConfigUsageListGroupKind = schema.GroupKind{Group: Group, Kind: ProviderConfigUsageListKind}.String() | ||
ProviderConfigUsageListKindAPIVersion = ProviderConfigUsageListKind + "." + SchemeGroupVersion.String() | ||
ProviderConfigUsageListGroupVersionKind = SchemeGroupVersion.WithKind(ProviderConfigUsageListKind) | ||
) | ||
|
||
func init() { | ||
SchemeBuilder.Register(&ProviderConfig{}, &ProviderConfigList{}) | ||
SchemeBuilder.Register(&ProviderConfigUsage{}, &ProviderConfigUsageList{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
/* | ||
Copyright 2024 The Crossplane Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1beta1 | ||
|
||
import ( | ||
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// A ProviderConfigSpec defines the desired state of a ProviderConfig. | ||
type ProviderConfigSpec struct { | ||
// Credentials required to authenticate to this provider. | ||
Credentials ProviderCredentials `json:"credentials"` | ||
|
||
// +kubebuilder:validation:Optional | ||
Configuration ProviderConfiguration `json:"config"` | ||
} | ||
|
||
// ProviderConfiguration for configuring the terraform provider | ||
// see https://registry.terraform.io/providers/equinix/equinix/latest/docs#configuration-reference | ||
type ProviderConfiguration struct { | ||
// The Equinix API base URL to point out desired environment. This argument can also be specified with the EQUINIX_API_ENDPOINT shell environment variable. (Defaults to https://api.equinix.com) | ||
// +kubebuilder:validation:Optional | ||
Endpoint string `json:"endpoint"` | ||
|
||
// Maximum number of retries in case of network failure. | ||
// +kubebuilder:validation:Optional | ||
MaxRetries bool `json:"max_retries"` | ||
|
||
// Maximum number of seconds to wait before retrying a request. | ||
// +kubebuilder:validation:Optional | ||
MaxRetryWaitSeconds bool `json:"max_retry_wait_seconds"` | ||
|
||
// The duration of time, in seconds, that the Equinix Platform API Client should wait before canceling an API request. Canceled requests may still result in provisioned resources. (Defaults to 30) | ||
// +kubebuilder:validation:Optional | ||
RequestTimeout bool `json:"request_timeout"` | ||
|
||
// The maximum number of records in a single response for REST queries that produce paginated responses. (Default is client specific) | ||
// +kubebuilder:validation:Optional | ||
ResponseMaxPageSize bool `json:"response_max_page_size"` | ||
} | ||
|
||
// ProviderCredentials required to authenticate. | ||
type ProviderCredentials struct { | ||
// Source of the provider credentials. | ||
// +kubebuilder:validation:Enum=None;Secret;InjectedIdentity;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"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// A ProviderConfig configures a Linode provider. | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" | ||
// +kubebuilder:printcolumn:name="SECRET-NAME",type="string",JSONPath=".spec.credentials.secretRef.name",priority=1 | ||
// +kubebuilder:resource:scope=Cluster | ||
// +kubebuilder:resource:scope=Cluster,categories={crossplane,providerconfig,equinix} | ||
// +kubebuilder:storageversion | ||
type ProviderConfig struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ProviderConfigSpec `json:"spec"` | ||
Status ProviderConfigStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// ProviderConfigList contains a list of ProviderConfig. | ||
type ProviderConfigList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []ProviderConfig `json:"items"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// A ProviderConfigUsage indicates that a resource is using a ProviderConfig. | ||
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" | ||
// +kubebuilder:printcolumn:name="CONFIG-NAME",type="string",JSONPath=".providerConfigRef.name" | ||
// +kubebuilder:printcolumn:name="RESOURCE-KIND",type="string",JSONPath=".resourceRef.kind" | ||
// +kubebuilder:printcolumn:name="RESOURCE-NAME",type="string",JSONPath=".resourceRef.name" | ||
// +kubebuilder:resource:scope=Cluster,categories={crossplane,providerconfig,equinix} | ||
// +kubebuilder:storageversion | ||
type ProviderConfigUsage struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
xpv1.ProviderConfigUsage `json:",inline"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// ProviderConfigUsageList contains a list of ProviderConfigUsage | ||
type ProviderConfigUsageList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []ProviderConfigUsage `json:"items"` | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a
v1beta1
for ProviderConfig lets us remove the BasePackage overrides.https://github.com/crossplane-contrib/provider-jet-equinix/pull/59/files#diff-483ebdb1139323e5256859b870054a99a208f4a1d60a0f5e51583c22d8600240L95-L104
I don't know of any other benefits to introducing this.