-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from arangodb/resources
Moved low level resource (pod,pvc,secret,service) creation & inspection to resources sub-package.
- Loading branch information
Showing
23 changed files
with
423 additions
and
234 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
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,65 @@ | ||
// | ||
// DISCLAIMER | ||
// | ||
// Copyright 2018 ArangoDB GmbH, Cologne, Germany | ||
// | ||
// 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. | ||
// | ||
// Copyright holder is ArangoDB GmbH, Cologne, Germany | ||
// | ||
// Author Ewout Prangsma | ||
// | ||
|
||
package resources | ||
|
||
import ( | ||
api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1alpha" | ||
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil" | ||
"k8s.io/api/core/v1" | ||
"k8s.io/client-go/kubernetes" | ||
) | ||
|
||
// ServerGroupIterator provides a helper to callback on every server | ||
// group of the deployment. | ||
type ServerGroupIterator interface { | ||
// ForeachServerGroup calls the given callback for all server groups. | ||
// If the callback returns an error, this error is returned and no other server | ||
// groups are processed. | ||
// Groups are processed in this order: agents, single, dbservers, coordinators, syncmasters, syncworkers | ||
ForeachServerGroup(cb func(group api.ServerGroup, spec api.ServerGroupSpec, status *api.MemberStatusList) error, status *api.DeploymentStatus) error | ||
} | ||
|
||
// Context provides all functions needed by the Resources service | ||
// to perform its service. | ||
type Context interface { | ||
// GetAPIObject returns the deployment as k8s object. | ||
GetAPIObject() k8sutil.APIObject | ||
// GetServerGroupIterator returns the deployment as ServerGroupIterator. | ||
GetServerGroupIterator() ServerGroupIterator | ||
// GetSpec returns the current specification of the deployment | ||
GetSpec() api.DeploymentSpec | ||
// GetStatus returns the current status of the deployment | ||
GetStatus() api.DeploymentStatus | ||
// UpdateStatus replaces the status of the deployment with the given status and | ||
// updates the resources in k8s. | ||
UpdateStatus(status api.DeploymentStatus, force ...bool) error | ||
// GetKubeCli returns the kubernetes client | ||
GetKubeCli() kubernetes.Interface | ||
// GetNamespace returns the namespace that contains the deployment | ||
GetNamespace() string | ||
// createEvent creates a given event. | ||
// On error, the error is logged. | ||
CreateEvent(evt *v1.Event) | ||
// GetOwnedPods returns a list of all pods owned by the deployment. | ||
GetOwnedPods() ([]v1.Pod, error) | ||
} |
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,29 @@ | ||
// | ||
// DISCLAIMER | ||
// | ||
// Copyright 2018 ArangoDB GmbH, Cologne, Germany | ||
// | ||
// 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. | ||
// | ||
// Copyright holder is ArangoDB GmbH, Cologne, Germany | ||
// | ||
// Author Ewout Prangsma | ||
// | ||
|
||
package resources | ||
|
||
import "github.com/pkg/errors" | ||
|
||
var ( | ||
maskAny = errors.WithStack | ||
) |
Oops, something went wrong.