Skip to content

Commit

Permalink
Merge pull request operator-framework#403 from ecordell/1.11-updates
Browse files Browse the repository at this point in the history
1.11 updates
  • Loading branch information
ecordell authored Aug 5, 2018
2 parents afc2752 + 3ab0cb4 commit 4350f4d
Show file tree
Hide file tree
Showing 17 changed files with 191 additions and 191 deletions.
2 changes: 1 addition & 1 deletion deploy/chart/templates/12-alm-operator.deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: alm-operator
Expand Down
2 changes: 1 addition & 1 deletion deploy/chart/templates/13-catalog-operator.deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: catalog-operator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ if .Values.servicebroker }}
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: alm-service-broker
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions pkg/api/client/deployment_install_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorclient"
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/ownerutil"
"github.com/pkg/errors"
appsv1beta2 "k8s.io/api/apps/v1beta2"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
v1beta1rbac "k8s.io/api/rbac/v1beta1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -18,11 +18,11 @@ type InstallStrategyDeploymentInterface interface {
CreateRole(role *v1beta1rbac.Role) (*v1beta1rbac.Role, error)
CreateRoleBinding(roleBinding *v1beta1rbac.RoleBinding) (*v1beta1rbac.RoleBinding, error)
EnsureServiceAccount(serviceAccount *corev1.ServiceAccount, owner ownerutil.Owner) (*corev1.ServiceAccount, error)
CreateDeployment(deployment *appsv1beta2.Deployment) (*appsv1beta2.Deployment, error)
CreateOrUpdateDeployment(deployment *appsv1beta2.Deployment) (*appsv1beta2.Deployment, error)
CreateDeployment(deployment *appsv1.Deployment) (*appsv1.Deployment, error)
CreateOrUpdateDeployment(deployment *appsv1.Deployment) (*appsv1.Deployment, error)
DeleteDeployment(name string) error
GetServiceAccountByName(serviceAccountName string) (*corev1.ServiceAccount, error)
FindAnyDeploymentsMatchingNames(depNames []string) ([]*appsv1beta2.Deployment, error)
FindAnyDeploymentsMatchingNames(depNames []string) ([]*appsv1.Deployment, error)
}

type InstallStrategyDeploymentClientForNamespace struct {
Expand Down Expand Up @@ -79,7 +79,7 @@ func (c *InstallStrategyDeploymentClientForNamespace) EnsureServiceAccount(servi
return c.opClient.UpdateServiceAccount(foundAccount)
}

func (c *InstallStrategyDeploymentClientForNamespace) CreateDeployment(deployment *appsv1beta2.Deployment) (*appsv1beta2.Deployment, error) {
func (c *InstallStrategyDeploymentClientForNamespace) CreateDeployment(deployment *appsv1.Deployment) (*appsv1.Deployment, error) {
return c.opClient.CreateDeployment(deployment)
}

Expand All @@ -90,7 +90,7 @@ func (c *InstallStrategyDeploymentClientForNamespace) DeleteDeployment(name stri
return c.opClient.DeleteDeployment(c.Namespace, name, immediateForegroundDelete)
}

func (c *InstallStrategyDeploymentClientForNamespace) CreateOrUpdateDeployment(deployment *appsv1beta2.Deployment) (*appsv1beta2.Deployment, error) {
func (c *InstallStrategyDeploymentClientForNamespace) CreateOrUpdateDeployment(deployment *appsv1.Deployment) (*appsv1.Deployment, error) {
d, _, err := c.opClient.CreateOrRollingUpdateDeployment(deployment)
return d, err
}
Expand All @@ -99,8 +99,8 @@ func (c *InstallStrategyDeploymentClientForNamespace) GetServiceAccountByName(se
return c.opClient.KubernetesInterface().CoreV1().ServiceAccounts(c.Namespace).Get(serviceAccountName, metav1.GetOptions{})
}

func (c *InstallStrategyDeploymentClientForNamespace) FindAnyDeploymentsMatchingNames(depNames []string) ([]*appsv1beta2.Deployment, error) {
var deployments []*appsv1beta2.Deployment
func (c *InstallStrategyDeploymentClientForNamespace) FindAnyDeploymentsMatchingNames(depNames []string) ([]*appsv1.Deployment, error) {
var deployments []*appsv1.Deployment
for _, depName := range depNames {
fetchedDep, err := c.opClient.GetDeployment(c.Namespace, depName)

Expand Down
10 changes: 5 additions & 5 deletions pkg/controller/install/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

log "github.com/sirupsen/logrus"
"k8s.io/api/apps/v1beta2"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
rbac "k8s.io/api/rbac/v1beta1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -25,8 +25,8 @@ type StrategyDeploymentPermissions struct {

// StrategyDeploymentSpec contains the name and spec for the deployment ALM should create
type StrategyDeploymentSpec struct {
Name string `json:"name"`
Spec v1beta2.DeploymentSpec `json:"spec"`
Name string `json:"name"`
Spec appsv1.DeploymentSpec `json:"spec"`
}

// StrategyDetailsDeployment represents the parsed details of a Deployment
Expand Down Expand Up @@ -104,7 +104,7 @@ func (i *StrategyDeploymentInstaller) installPermissions(perms []StrategyDeploym
func (i *StrategyDeploymentInstaller) installDeployments(deps []StrategyDeploymentSpec) error {
for _, d := range deps {
// Create or Update Deployment
dep := &v1beta2.Deployment{Spec: d.Spec}
dep := &appsv1.Deployment{Spec: d.Spec}
dep.SetName(d.Name)
dep.SetNamespace(i.owner.GetNamespace())
ownerutil.AddNonBlockingOwner(dep, i.owner)
Expand Down Expand Up @@ -209,7 +209,7 @@ func (i *StrategyDeploymentInstaller) checkForDeployments(deploymentSpecs []Stra
}

// compare deployments to see if any need to be created/updated
existingMap := map[string]*v1beta2.Deployment{}
existingMap := map[string]*appsv1.Deployment{}
for _, d := range existingDeployments {
existingMap[d.GetName()] = d
}
Expand Down
Loading

0 comments on commit 4350f4d

Please sign in to comment.