This repository has been archived by the owner on Dec 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Working prototype * Added kubeless-config yaml * Cleanup * Working after cleanup * Modify the client to read the configmap - The configmap needs to be read by the client * Made changes based on comments - The langruntimes is now part of the controller data structure so that it can be passed on to k8sutils.go - The langruntimes reads the configmap on the start of the controller. - Currently monitoring of the configmap is missing. So if the configmap is changed the controller needs to be restarted. - The kubeless binary has been updated to read the configmap everytime the kubeless binary is used to deploy/update the function - Updated the unit tests * Dont repeat configmap initialization for every test. * Updated the documentation for adding custom runtimes. * Update the jsonnet to pass the runtime information as configmaps Also remove kubeless-config.yaml Add a new get-server-config flag to print the server configuration Remove checks from unittest without RBAC. Since controller fails to read the config file. * Changes based on PR comments - Removed the debug messages from libtest - Added unit tests for imagesecrets - Moved the common code into langruntimetestutils.go - Updated the Readme with information on new switch kubeless function. * Made changes based on feed from PR * Resolving merge conflicts * Rebased to latest master - Resolved the merge conflicts - Reworked langruntimes * Update the documentation to reflect new behaviour * Made changes based on PR Comments - Made get-server-config a command/ - Fixed Readme to reflect changes.
- Loading branch information
1 parent
439725f
commit 7503f8b
Showing
16 changed files
with
623 additions
and
194 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
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,43 @@ | ||
package getServerConfig | ||
|
||
import ( | ||
"os" | ||
"strings" | ||
|
||
"github.com/kubeless/kubeless/pkg/langruntime" | ||
"github.com/kubeless/kubeless/pkg/utils" | ||
"github.com/sirupsen/logrus" | ||
"github.com/spf13/cobra" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
//GetServerConfigCmd contains first-class command for displaying the current server config | ||
var GetServerConfigCmd = &cobra.Command{ | ||
Use: "get-server-config", | ||
Short: "Print the current configuration of the controller", | ||
Long: ``, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
cli := utils.GetClientOutOfCluster() | ||
controllerNamespace := os.Getenv("KUBELESS_NAMESPACE") | ||
kubelessConfig := os.Getenv("KUBELESS_CONFIG") | ||
|
||
if len(controllerNamespace) == 0 { | ||
controllerNamespace = "kubeless" | ||
} | ||
|
||
if len(kubelessConfig) == 0 { | ||
kubelessConfig = "kubeless-config" | ||
} | ||
config, err := cli.CoreV1().ConfigMaps(controllerNamespace).Get(kubelessConfig, metav1.GetOptions{}) | ||
if err != nil { | ||
logrus.Fatalf("Unable to read the configmap: %v", err) | ||
} | ||
|
||
var lr = langruntime.New(config) | ||
lr.ReadConfigMap() | ||
|
||
logrus.Info("Current Server Config:") | ||
logrus.Infof("Supported Runtimes are: %s", | ||
strings.Join(lr.GetRuntimes(), ", ")) | ||
}, | ||
} |
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
Oops, something went wrong.