我正在尝试升级舵图,
我得到未定义的错误函数“pod”,这是有道理的,因为我真的没有这样的函数。
“pod”来自一个 json 文件,我将其转换为 configmap 并且 helm 将此值作为函数读取,而不是作为 json 文件一部分的直接字符串读取。
这是我的配置图的片段:
# Generated from 'pods' from https://raw.githubusercontent.com/coreos/prometheus-operator/master/contrib/kube-prometheus/manifests/grafana-dashboardDefinitions.yaml
# Do not change in-place! In order to change this file first read following link:
# https://github.com/helm/charts/tree/master/stable/prometheus-operator/hack
{{- if and .Values.grafana.enabled .Values.grafana.defaultDashboardsEnabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ printf "%s-%s" (include "prometheus-operator.fullname" $) "services-health" | trunc 63 | trimSuffix "-" }}
labels:
{{- if $.Values.grafana.sidecar.dashboards.label }}
{{ $.Values.grafana.sidecar.dashboards.label }}: "1"
{{- end }}
app: {{ template "prometheus-operator.name" $ }}-grafana
{{ …Run Code Online (Sandbox Code Playgroud) 我正在尝试在Linux上安装Nsis,我找到了一个很好的安装指南:http://www.xdevsoftware.com/blog/post/How-to-Install-the-Nullsoft-Installer---NSIS- on-Linux-.aspx 问题是它在最后一步失败:scons SKIPSTUBS =所有SKIPPLUGINS =所有SKIPUTILS =所有SKIPMISC =所有NSIS_CONFIG_CONST_DATA =否PREFIX =/usr/local/nsis/nsis-2.46 install-compiler
这是我得到的输出:
Source/script.cpp:6460:1: required from here
Source/util.h:145:1: error: 'close' was not declared in this scope,
and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
Run Code Online (Sandbox Code Playgroud)
错误是:'close'未在此范围内声明.... 我尝试运行它几次,并在互联网上查找解决方案,但我认为这是一个64位的机器而不是32的问题.
任何的想法?
我创建了一个pom.xml来编译我的项目并将其打包为jar,实际上它是comiples并创建了jar - 问题是我有一个包含类和java内部的jar,我只想要里面的类.
我如何丢失java文件?我不需要它们.
这是我创建的pom.xml:
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<filtering>true</filtering>
</resource>
</resources>
<finalName>api-interfaces</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>make-a-jar</id>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<excludes>
<exclude>*.properties</exclude>
<exclude>*.xml</exclude>
<exclude>sql/**</exclude>
<exclude>META-INF/**</exclude>
<exclude>*.jar</exclude>
<exclude>*.java</exclude>
<exclude>default-configs/**</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)

当我尝试删除以 tmp 开头的所有目录时,我使用了以下命令:
find -type d -name tmp* -exec rmdir {} \;
Run Code Online (Sandbox Code Playgroud)
它确实成功了,但该命令正在退出并显示错误代码:
find: `./tmp09098': No such file or directory
Run Code Online (Sandbox Code Playgroud)
是什么导致我的构建失败。
谁能告诉我如何删除这些文件夹而不出现错误?
在尝试了@anubhava的建议并引用了“temp*”之后,
find -type d -name 'tmp*' -exec rmdir {} \;
Run Code Online (Sandbox Code Playgroud)
我仍然遇到同样的错误:
find: `./tmp0909565g': No such file or directory
find: `./tmp09095': No such file or directory
Run Code Online (Sandbox Code Playgroud)
运行时:
find -type d -name 'tmp*' -exec ls -ld '{}' \;
Run Code Online (Sandbox Code Playgroud)
这是结果:
drwxr-xr-x 2 root root 4096 Jun 16 10:08 ./tmp0909565g
drwxr-xr-x 2 root root 4096 Jun 16 10:07 ./tmp09095
drwxr-xr-x 2 root …Run Code Online (Sandbox Code Playgroud) 我有一个脚本正在向我的 XML 文件添加一个子节点,并且它工作正常。
问题是我运行这个脚本很多时间,我只想添加我的子节点一次,所以我需要的是检查它是否存在,如果它不存在,我想创建它,如果它不执行任何操作。(在我的示例中创建名为 66.66.66 的子节点)
#!/bin/bash
LOCK_BRANCH="66.66.66"
#Adding a new subnode to certain nodes
xmlstarlet ed -L --subnode "/configurations/rules" --type elem -n rule config.xml
#Adding text to the new node
xmlstarlet ed -L --subnode "/configurations/rules/rule[last()]" --type elem -n name -v "$LOCK_BRANCH" config.xml
xmlstarlet ed -L --subnode "/configurations/rules/rule[last()]" --type elem -n repo -v "mqm" config.xml
xmlstarlet ed -L --subnode "/configurations/rules/rule[last()]" --type elem -n branch -v "refs/heads/12.55.99" config.xml
xmlstarlet ed -L --subnode "/configurations/rules/rule[last()]" --type elem -n emailTo -v "imichael@gmail.com" config.xml
xmlstarlet …Run Code Online (Sandbox Code Playgroud) 我想获取变量的第一个整数之前的第一个元素,例如,我有这个变量:
FILE=normalize-component-0.0.3-SNAPSHOT-jar-with-dependencies-package-58.jar
Run Code Online (Sandbox Code Playgroud)
我想获取应用程序名称,即名称“标准化组件”,在这种情况下,它总是出现在整数之前。
请记住,应用程序名称始终可以更改,但结构始终是:
{application_name}-{digit}-{*}-jar-with-dependencies-package-{digit}.jar
Run Code Online (Sandbox Code Playgroud)
期望的输出:
APP_NAME=规范化组件