Skip to content

Commit

Permalink
Changes: align with pr #116
Browse files Browse the repository at this point in the history
Signed-off-by: jhu02 <[email protected]>
  • Loading branch information
jhu02 authored and jhu02 committed Feb 27, 2022
1 parent dbc6104 commit 3e2f1cf
Show file tree
Hide file tree
Showing 31 changed files with 63 additions and 327 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ const (
CnabPkg PackageType = "cnab"
// CompositePkg is a package type representing a composite package structure, just yamls
CompositePkg PackageType = "composite"
// Error used to indicate system error
Error ApplicationAssemblyPhase = "error"
)

// CmdType represents a function that can be performed with arguments
Expand Down Expand Up @@ -151,8 +153,6 @@ const (
Deleting ApplicationAssemblyPhase = "Deleting"
// DeleteFailed Used to indicate that delete failed.
DeleteFailed ApplicationAssemblyPhase = "Delete Failed"
// Error used to indicate system error
Error ApplicationAssemblyPhase = "error"
)

// DeploymentPhase represents the status of observed resources
Expand Down Expand Up @@ -283,8 +283,8 @@ type AddonStatus struct {
StartTime int64 `json:"starttime"`
}

// AddonList contains a list of Addon
// +kubebuilder:object:root=true

// Addon is the Schema for the addons API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
Expand All @@ -306,6 +306,7 @@ type Addon struct {

// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// AddonList contains a list of Addon
type AddonList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Expand Down Expand Up @@ -383,22 +384,6 @@ func (a *Addon) GetInstallStatus() ApplicationAssemblyPhase {
return a.Status.Lifecycle.Installed
}

// GetInstallStatus returns the install phase for addon
func (a *Addon) GetPrereqStatus() ApplicationAssemblyPhase {
return a.Status.Lifecycle.Prereqs
}

// NotTriggered indicate the workflow not triggered
// Pending,Running are triggered
func (p ApplicationAssemblyPhase) NotTriggered() bool {
switch p {
case Succeeded, Failed, Error, "":
return true
default:
return false
}
}

func (p ApplicationAssemblyPhase) Succeeded() bool {
switch p {
case Succeeded:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
/*
* 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"
"k8s.io/apimachinery/pkg/runtime"
runtime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)

Expand Down

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

3 changes: 2 additions & 1 deletion controllers/addonController.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/sirupsen/logrus"

addonapiv1 "github.com/keikoproj/addon-manager/pkg/apis/addon"
addonapiv1 "github.com/keikoproj/addon-manager/api/addon"
addonv1versioned "github.com/keikoproj/addon-manager/pkg/client/clientset/versioned"
"github.com/keikoproj/addon-manager/pkg/utils"

Expand Down Expand Up @@ -96,6 +96,7 @@ func Start(namespace string) {
} else {
kubeClient = utils.GetClient()
}

dynCli, err := dynamic.NewForConfig(cfg)
if err != nil {
panic(err)
Expand Down
4 changes: 2 additions & 2 deletions controllers/addonHandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"fmt"
"strings"

addonv1 "github.com/keikoproj/addon-manager/pkg/apis/addon/v1alpha1"
addonv1 "github.com/keikoproj/addon-manager/api/addon/v1alpha1"
"github.com/keikoproj/addon-manager/pkg/common"
"github.com/keikoproj/addon-manager/pkg/workflows"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

addonapiv1 "github.com/keikoproj/addon-manager/api/addon"
addoninternal "github.com/keikoproj/addon-manager/pkg/addon"
addonapiv1 "github.com/keikoproj/addon-manager/pkg/apis/addon"
)

func (c *Controller) handleAddonCreation(ctx context.Context, addon *addonv1.Addon) error {
Expand Down
2 changes: 1 addition & 1 deletion controllers/addonUpdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"

wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
addonv1 "github.com/keikoproj/addon-manager/pkg/apis/addon/v1alpha1"
addonv1 "github.com/keikoproj/addon-manager/api/addon/v1alpha1"
"github.com/keikoproj/addon-manager/pkg/common"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion controllers/addon_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

addonmgrv1alpha1 "github.com/keikoproj/addon-manager/pkg/apis/addon/v1alpha1"
addonmgrv1alpha1 "github.com/keikoproj/addon-manager/api/addon/v1alpha1"
fakeAddonCli "github.com/keikoproj/addon-manager/pkg/client/clientset/versioned/fake"
"golang.org/x/net/context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
4 changes: 2 additions & 2 deletions controllers/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
informers "github.com/argoproj/argo-workflows/v3/pkg/client/informers/externalversions"
v1alpha1 "github.com/argoproj/argo-workflows/v3/pkg/client/informers/externalversions/workflow/v1alpha1"

"github.com/keikoproj/addon-manager/pkg/apis/addon"
addonv1 "github.com/keikoproj/addon-manager/pkg/apis/addon/v1alpha1"
"github.com/keikoproj/addon-manager/api/addon"
addonv1 "github.com/keikoproj/addon-manager/api/addon/v1alpha1"
addonv1versioned "github.com/keikoproj/addon-manager/pkg/client/clientset/versioned"
"github.com/keikoproj/addon-manager/pkg/client/clientset/versioned/scheme"
addonv1informers "github.com/keikoproj/addon-manager/pkg/client/informers/externalversions"
Expand Down
2 changes: 1 addition & 1 deletion controllers/objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

addonmgrv1alpha1 "github.com/keikoproj/addon-manager/pkg/apis/addon/v1alpha1"
addonmgrv1alpha1 "github.com/keikoproj/addon-manager/api/addon/v1alpha1"
"sigs.k8s.io/controller-runtime/pkg/client"

appsv1 "k8s.io/api/apps/v1"
Expand Down
4 changes: 2 additions & 2 deletions controllers/resourceHandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"

addonapiv1 "github.com/keikoproj/addon-manager/pkg/apis/addon"
addonv1 "github.com/keikoproj/addon-manager/pkg/apis/addon/v1alpha1"
addonapiv1 "github.com/keikoproj/addon-manager/api/addon"
addonv1 "github.com/keikoproj/addon-manager/api/addon/v1alpha1"
appsv1 "k8s.io/api/apps/v1"
batch_v1 "k8s.io/api/batch/v1"
v1 "k8s.io/api/core/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/addon/addon_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"

addonmgrv1alpha1 "github.com/keikoproj/addon-manager/pkg/apis/addon/v1alpha1"
addonmgrv1alpha1 "github.com/keikoproj/addon-manager/api/addon/v1alpha1"
"github.com/keikoproj/addon-manager/pkg/common"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/addon/addon_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/dynamic/fake"

addonmgrv1alpha1 "github.com/keikoproj/addon-manager/pkg/apis/addon/v1alpha1"
addonmgrv1alpha1 "github.com/keikoproj/addon-manager/api/addon/v1alpha1"
)

var dynClient = fake.NewSimpleDynamicClient(runtime.NewScheme())
Expand Down
2 changes: 1 addition & 1 deletion pkg/addon/addon_version_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"sync"

"github.com/Masterminds/semver/v3"
addonmgrv1alpha1 "github.com/keikoproj/addon-manager/pkg/apis/addon/v1alpha1"
addonmgrv1alpha1 "github.com/keikoproj/addon-manager/api/addon/v1alpha1"
)

// VersionCacheClient interface clients must implement for addon version cache.
Expand Down
2 changes: 1 addition & 1 deletion pkg/addon/addon_version_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"reflect"
"testing"

addonmgrv1alpha1 "github.com/keikoproj/addon-manager/pkg/apis/addon/v1alpha1"
addonmgrv1alpha1 "github.com/keikoproj/addon-manager/api/addon/v1alpha1"
)

func TestNewCachedClient(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/addonctl/addonctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

addonmgrv1alpha1 "github.com/keikoproj/addon-manager/pkg/apis/addon/v1alpha1"
addonmgrv1alpha1 "github.com/keikoproj/addon-manager/api/addon/v1alpha1"
"github.com/keikoproj/addon-manager/pkg/common"
"github.com/keikoproj/addon-manager/pkg/version"
"github.com/keikoproj/addon-manager/pkg/workflows"
Expand Down
Loading

0 comments on commit 3e2f1cf

Please sign in to comment.