-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change RunOnce duration plugin to act as a limit instead of override
- Loading branch information
Showing
10 changed files
with
165 additions
and
59 deletions.
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
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
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
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,25 @@ | ||
package v1 | ||
|
||
import ( | ||
"k8s.io/kubernetes/pkg/conversion" | ||
"k8s.io/kubernetes/pkg/runtime" | ||
|
||
internal "github.com/openshift/origin/pkg/quota/admission/runonceduration/api" | ||
) | ||
|
||
func addConversionFuncs(scheme *runtime.Scheme) { | ||
err := scheme.AddConversionFuncs( | ||
func(in *RunOnceDurationConfig, out *internal.RunOnceDurationConfig, s conversion.Scope) error { | ||
out.ActiveDeadlineSecondsLimit = in.ActiveDeadlineSecondsOverride | ||
return nil | ||
}, | ||
func(in *internal.RunOnceDurationConfig, out *RunOnceDurationConfig, s conversion.Scope) error { | ||
out.ActiveDeadlineSecondsOverride = in.ActiveDeadlineSecondsLimit | ||
return nil | ||
}, | ||
) | ||
if err != nil { | ||
// If one of the conversion functions is malformed, detect it immediately. | ||
panic(err) | ||
} | ||
} |
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
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
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
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
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
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