-
Notifications
You must be signed in to change notification settings - Fork 257
deps: copy keda #1016
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
Merged
deps: copy keda #1016
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 hidden or 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
This file contains hidden or 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
This file contains hidden or 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,105 @@ | ||
/* | ||
Copyright 2021 The KEDA 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 v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// ConditionType specifies the available conditions for the resource | ||
type ConditionType string | ||
|
||
const ( | ||
// ConditionReady specifies that the resource is ready. | ||
// For long-running resources. | ||
ConditionReady ConditionType = "Ready" | ||
// ConditionActive specifies that the resource has finished. | ||
// For resource which run to completion. | ||
ConditionActive ConditionType = "Active" | ||
// ConditionFallback specifies that the resource has a fallback active. | ||
ConditionFallback ConditionType = "Fallback" | ||
// ConditionPaused specifies that the resource is paused. | ||
ConditionPaused ConditionType = "Paused" | ||
) | ||
|
||
const ( | ||
// ScaledObjectConditionReadySuccessReason defines the default Reason for correct ScaledObject | ||
ScaledObjectConditionReadySuccessReason = "ScaledObjectReady" | ||
// ScaledObjectConditionReadySuccessMessage defines the default Message for correct ScaledObject | ||
ScaledObjectConditionReadySuccessMessage = "ScaledObject is defined correctly and is ready for scaling" | ||
// ScaledObjectConditionPausedReason defines the default Reason for paused ScaledObject | ||
ScaledObjectConditionPausedReason = "ScaledObjectPaused" | ||
// ScaledObjectConditionPausedMessage defines the default Message for paused ScaledObject | ||
ScaledObjectConditionPausedMessage = "ScaledObject is paused" | ||
) | ||
|
||
const ( | ||
// ScaledJobConditionPausedReason defines the default Reason for paused ScaledJob | ||
ScaledJobConditionPausedReason = "ScaledJobPaused" | ||
// ScaledJobConditionPausedReason defines the default Reason for paused ScaledJob | ||
ScaledJobConditionUnpausedReason = "ScaledJobUnpaused" | ||
// ScaledJobConditionPausedMessage defines the default Message for paused ScaledJob | ||
ScaledJobConditionPausedMessage = "ScaledJob is paused" | ||
// ScaledJobConditionPausedMessage defines the default Message for paused ScaledJob | ||
ScaledJobConditionUnpausedMessage = "ScaledJob is unpaused" | ||
) | ||
|
||
// Condition to store the condition state | ||
type Condition struct { | ||
// Type of condition | ||
// +required | ||
Type ConditionType `json:"type" description:"type of status condition"` | ||
|
||
// Status of the condition, one of True, False, Unknown. | ||
// +required | ||
Status metav1.ConditionStatus `json:"status" description:"status of the condition, one of True, False, Unknown"` | ||
|
||
// The reason for the condition's last transition. | ||
// +optional | ||
Reason string `json:"reason,omitempty" description:"one-word CamelCase reason for the condition's last transition"` | ||
|
||
// A human readable message indicating details about the transition. | ||
// +optional | ||
Message string `json:"message,omitempty" description:"human-readable message indicating details about last transition"` | ||
} | ||
|
||
// Conditions an array representation to store multiple Conditions | ||
type Conditions []Condition | ||
|
||
// IsTrue is true if the condition is True | ||
func (c *Condition) IsTrue() bool { | ||
if c == nil { | ||
return false | ||
} | ||
return c.Status == metav1.ConditionTrue | ||
} | ||
|
||
// IsFalse is true if the condition is False | ||
func (c *Condition) IsFalse() bool { | ||
if c == nil { | ||
return false | ||
} | ||
return c.Status == metav1.ConditionFalse | ||
} | ||
|
||
// IsUnknown is true if the condition is Unknown | ||
func (c *Condition) IsUnknown() bool { | ||
if c == nil { | ||
return true | ||
} | ||
return c.Status == metav1.ConditionUnknown | ||
} |
This file contains hidden or 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,68 @@ | ||
/* | ||
Copyright 2021 The KEDA 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 v1alpha1 contains API Schema definitions for the keda v1alpha1 API group | ||
// +kubebuilder:object:generate=true | ||
// +groupName=keda.sh | ||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/runtime" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
) | ||
|
||
var ( | ||
// GroupVersion is group version used to register these objects | ||
GroupVersion = schema.GroupVersion{Group: "keda.sh", Version: "v1alpha1"} | ||
|
||
// SchemeGroupVersion is group version used to register these objects | ||
// added for generated clientset | ||
SchemeGroupVersion = GroupVersion | ||
|
||
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. | ||
SchemeBuilder runtime.SchemeBuilder | ||
localSchemeBuilder = &SchemeBuilder | ||
AddToScheme = localSchemeBuilder.AddToScheme | ||
) | ||
|
||
func init() { | ||
// We only register manually written functions here. The registration of the | ||
// generated functions takes place in the generated files. The separation | ||
// makes the code compile even when the generated files are missing. | ||
localSchemeBuilder.Register(addKnownTypes) | ||
} | ||
|
||
// Adds the list of known types to api.Scheme. | ||
func addKnownTypes(scheme *runtime.Scheme) error { | ||
scheme.AddKnownTypes(SchemeGroupVersion, | ||
&ScaledObject{}, | ||
janisz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) | ||
metav1.AddToGroupVersion(scheme, SchemeGroupVersion) | ||
return nil | ||
} | ||
|
||
// Kind takes an unqualified kind and returns back a Group qualified GroupKind | ||
// added for generated clientset | ||
func Kind(kind string) schema.GroupKind { | ||
return GroupVersion.WithKind(kind).GroupKind() | ||
} | ||
|
||
// Resource takes an unqualified resource and returns a Group qualified GroupResource | ||
// added for generated clientset | ||
func Resource(resource string) schema.GroupResource { | ||
return GroupVersion.WithResource(resource).GroupResource() | ||
} |
This file contains hidden or 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,25 @@ | ||
/* | ||
Copyright 2021 The KEDA 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 v1alpha1 | ||
|
||
// GroupVersionKindResource provides unified structure for schema.GroupVersionKind and Resource | ||
type GroupVersionKindResource struct { | ||
Group string `json:"group"` | ||
Version string `json:"version"` | ||
Kind string `json:"kind"` | ||
Resource string `json:"resource"` | ||
} |
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.
no idea why new pacakges appeard as indirect while we mostly remove pacakges