github.com/oam-dev/kubevela@v1.9.11/pkg/appfile/helm/flux2apis/apis.go (about)

     1  /*
     2  Copyright 2021 The KubeVela Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  // Package apis contains typed structs from fluxcd/helm-controller and fluxcd/source-controller.
    18  // Because we cannot solve dependency inconsistencies between KubeVela and fluxcd/gotk,
    19  // so we pick up those APIs used in KubeVela to install helm resources.
    20  package apis
    21  
    22  import (
    23  	"k8s.io/apimachinery/pkg/runtime/schema"
    24  )
    25  
    26  const (
    27  	// HelmRepositoryKind is the kind name of fluxcd/helmrepository
    28  	HelmRepositoryKind = "HelmRepository"
    29  )
    30  
    31  // HelmSpec includes information to install a Helm chart
    32  type HelmSpec struct {
    33  	HelmReleaseSpec    `json:"release"`
    34  	HelmRepositorySpec `json:"repository"`
    35  }
    36  
    37  var (
    38  	// HelmReleaseGVK refers to GVK of fluxcd/helmrelease
    39  	HelmReleaseGVK = schema.GroupVersionKind{
    40  		Group:   "helm.toolkit.fluxcd.io",
    41  		Version: "v2beta1",
    42  		Kind:    "HelmRelease",
    43  	}
    44  
    45  	// HelmRepositoryGVK refers to GVK of fluxcd/helmrepository
    46  	HelmRepositoryGVK = schema.GroupVersionKind{
    47  		Group:   "source.toolkit.fluxcd.io",
    48  		Version: "v1beta1",
    49  		Kind:    "HelmRepository",
    50  	}
    51  
    52  	// HelmChartNamePath indicates the field to path in HelmRelease to get the chart name
    53  	HelmChartNamePath = []string{"spec", "chart", "spec", "chart"}
    54  )