github.com/sealerio/sealer@v0.11.1-0.20240507115618-f4f89c5853ae/build/kubefile/command/command.go (about)

     1  // Copyright © 2022 Alibaba Group Holding Ltd.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package command
    16  
    17  import (
    18  	"fmt"
    19  )
    20  
    21  const (
    22  
    23  	// the following commands are kubefile-spec commands
    24  	// we recommender users to use these commands to pack their
    25  	// demands for applications.
    26  	App         = "app"
    27  	AppCmds     = "appcmds"
    28  	Launch      = "launch"
    29  	Cmds        = "cmds"
    30  	CNI         = "cni"
    31  	CSI         = "csi"
    32  	KUBEVERSION = "kubeversion"
    33  
    34  	Label      = "label"
    35  	Maintainer = "maintainer"
    36  
    37  	Env    = "env"
    38  	AppEnv = "appenv"
    39  
    40  	// Deprecated
    41  	Cmd = "cmd"
    42  
    43  	// the following commands are the intenal implementations for kube commands
    44  	Add  = "add"
    45  	Arg  = "arg"
    46  	Copy = "copy"
    47  	From = "from"
    48  	Run  = "run"
    49  )
    50  
    51  const (
    52  	LabelSupportedKubeVersionAlpha = "app.alpha.sealer.io/supported-kube-version"
    53  	LabelSupportedKubeCNIAlpha     = "cluster.alpha.sealer.io/kube-cni"
    54  	LabelSupportedKubeCSIAlpha     = "cluster.alpha.sealer.io/kube-csi"
    55  )
    56  
    57  var (
    58  	LabelKubeCNIPrefix = fmt.Sprintf("%s-", LabelSupportedKubeCNIAlpha)
    59  	LabelKubeCSIPrefix = fmt.Sprintf("%s-", LabelSupportedKubeCSIAlpha)
    60  )
    61  
    62  // SupportedCommands is list of all Kubefile commands
    63  var SupportedCommands = map[string]struct{}{
    64  	Add:         {},
    65  	Arg:         {},
    66  	Copy:        {},
    67  	From:        {},
    68  	Label:       {},
    69  	Maintainer:  {},
    70  	Run:         {},
    71  	App:         {},
    72  	AppCmds:     {},
    73  	Launch:      {},
    74  	Cmds:        {},
    75  	Cmd:         {},
    76  	CNI:         {},
    77  	CSI:         {},
    78  	KUBEVERSION: {},
    79  	Env:         {},
    80  	AppEnv:      {},
    81  }